You are here

function DrupalAPCCache::get in APC - Alternative PHP Cache 7

Returns data from the persistent cache.

Data may be stored as either plain text or as serialized data. cache_get() will automatically return unserialized objects and arrays.

Parameters

$cid: The cache ID of the data to retrieve.

Return value

The cache or FALSE on failure.

Overrides DrupalCacheInterface::get

File

./drupal_apc_cache.inc, line 136
This integrates the drupal APC cache backend.

Class

DrupalAPCCache
APC cache implementation.

Code

function get($cid) {

  // Add a get to our statistics.
  $GLOBALS['apc_statistics'][] = array(
    'get',
    $this->bin,
    array(
      $cid,
    ),
  );

  // Fetch the data.
  $cache = apc_fetch($this
    ->key($cid));
  return $this
    ->prepareItem($cache);
}