Commit b3ed35e8 authored by robertDouglass's avatar robertDouglass

#154996 by lyricnz; smarter inclusion of .js file (for memcache stats) and...

#154996 by lyricnz; smarter inclusion of .js file (for memcache stats) and registering of shutdown function.
parent f240aaac
......@@ -6,7 +6,10 @@ function memcache_init() {
// update.php relies on standard error handler
}
else {
register_shutdown_function('memcache_shutdown');
if (user_access('access memcache statistics')) {
drupal_add_js(drupal_get_path('module', 'memcache'). '/memcache.js');
register_shutdown_function('memcache_shutdown');
}
}
}
......@@ -21,8 +24,6 @@ function memcache_perm() {
function memcache_shutdown() {
global $user, $_memcache_statistics;
$output = '';
// Try not to break non html pages.
if (function_exists('drupal_get_headers')) {
$headers = drupal_get_headers();
......@@ -32,7 +33,6 @@ function memcache_shutdown() {
}
if (user_access('access memcache statistics')) {
drupal_add_js(drupal_get_path('module', 'memcache'). '/memcache.js');
$stats = array();
foreach ($_memcache_statistics as $stat => $val) {
$stats[] = "<strong>$stat:</strong> ". theme('item_list', $val);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment