You are here

function performance_cron_apc_prune in Devel 5

1 call to performance_cron_apc_prune()
performance_cron in performance/performance.module

File

performance/performance.module, line 457

Code

function performance_cron_apc_prune($timestamp = 0) {
  if (!function_exists('apc_cache_info')) {

    // APC not enabled, nothing to do ...
    return;
  }

  // Get all entries in APC's user cache
  $list = performance_apc_list_all();
  if (!count($list)) {

    // Nothing stored yet
    return;
  }
  foreach ($list as $key) {
    if ($data = apc_fetch($key)) {
      if ($data['last_access'] <= $timestamp) {
        apc_delete($key);
      }
    }
  }
}