You are here

function memcache_admin_init in Memcache API and Integration 7

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

Implements hook_init().

File

memcache_admin/memcache_admin.module, line 14
For the collection and display of memcache stats.

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');
  }
}