summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Douglass2007-06-28 12:02:18 (GMT)
committerRobert Douglass2007-06-28 12:02:18 (GMT)
commitb3ed35e8bb75a713e4cef5ea2311868171a918c9 (patch)
treed40d67aa2700615f36907a53269b75af55eb3373
parentf240aaac42a2455a29f89e1b6a0920d9f83b9168 (diff)
#154996 by lyricnz; smarter inclusion of .js file (for memcache stats) and registering of shutdown function.
-rw-r--r--memcache.module8
1 files changed, 4 insertions, 4 deletions
diff --git a/memcache.module b/memcache.module
index 2c9a40e..ba0f5aa 100644
--- a/memcache.module
+++ b/memcache.module
@@ -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);