You are here

function memcache_admin_init in Memcache API and Integration 6

Same name and namespace in other branches
  1. 5 memcache_admin/memcache_admin.module \memcache_admin_init()
  2. 7 memcache_admin/memcache_admin.module \memcache_admin_init()

For the collection of memcache stats. This small .js file makes sure that the HTML displaying the stats is inside of the <body> part of the HTML document.

File

memcache_admin/memcache_admin.module, line 8

Code

function memcache_admin_init() {
  global $user;
  if ($user->uid == 0 || strstr($_SERVER['PHP_SELF'], 'update.php') || isset($_GET['q']) && (in_array($_GET['q'], array(
    'upload/js',
    'admin/content/node-settings/rebuild',
  )) || substr($_GET['q'], 0, strlen('system/files')) == 'system/files' || substr($_GET['q'], 0, strlen('batch')) == 'batch' || strstr($_GET['q'], 'autocomplete'))) {

    // update.php relies on standard error handler
  }
  else {
    if ($user->uid) {
      drupal_add_js(drupal_get_path('module', 'memcache_admin') . '/memcache.js');
    }
    register_shutdown_function('memcache_admin_shutdown');
  }
}