You are here

function apc_handle_get in APC - Alternative PHP Cache 6

Same name and namespace in other branches
  1. 5 apc.inc \apc_handle_get()

Return data from the apc cache.

Parameters

$key: The key of the data to retrieve.

$bin: The bin/silo to look in.

1 call to apc_handle_get()
cache_get in ./apc.inc
Return data from the persistent cache.

File

./apc.inc, line 91

Code

function apc_handle_get($key, $bin = 'cache') {
  global $apc_page_stats;
  $apc_page_stats['get']++;
  $full_key = apc_handle_key($key, $bin);
  if (isset($full_key)) {
    $return = apc_fetch($full_key);
    if ($return === FALSE) {
      watchdog('apc', 'Failed to get key: ' . $full_key, WATCHDOG_ERROR);
      $return = FALSE;
    }
    else {
      $apc_page_stats['hit']++;
    }
  }
  else {
    $apc_page_stats['miss']++;
    $return = FALSE;
  }
  return $return;
}