function apc_init

cis7 apc.module apc_init()
cle7 apc.module apc_init()
elmsmedia7 apc.module apc_init()
icor7 apc.module apc_init()
meedjum_blog7 apc.module apc_init()
mooc7 apc.module apc_init()

Implementation of hook_init().

Used for displaying the APC stats for debug purposes.

File

sites/all/modules/ulmus/apc/apc.module, line 8
This integrates the drupal APC cache module.

Code

function apc_init() {
  global $user;

  // Clear out any caches that an external actor (i.e drush) would like cleared.
  // Someday this queue could be popuplated externally to support propagating
  // Cache clearing events across multiple web heads.
  if (!function_exists('drush_main')) {
    $queue = DrupalQueue::get('apc_cache_queue');

    while ($item = $queue->claimItem()) {
      cache_clear_all($item->data['cid'], $item->data['bin'], $item->data['wildcard']);
      $queue->deleteItem($item);
    }
  }

  if (($user->uid == 0) || !variable_get('apc_show_debug', FALSE) || !user_access('access apc statistics') || strstr($_SERVER['PHP_SELF'], 'update.php') || strstr($_GET['q'], 'autocomplete')) {
    return;
  }

  register_shutdown_function('apc_shutdown');
}