Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#7068 from marc-mabe/be…
Browse files Browse the repository at this point in the history
…tterCampatibilityWithApcu_master

Cache: better compatibility with APCu
  • Loading branch information
Ocramius committed Dec 31, 2014
2 parents 8b9a054 + 35a3d62 commit 2f967c1
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/Storage/Adapter/Apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,20 +717,16 @@ protected function internalGetCapabilities()
*/
protected function normalizeMetadata(array & $metadata)
{
$metadata['internal_key'] = $metadata['key'];
$metadata['ctime'] = $metadata['creation_time'];
$metadata['atime'] = $metadata['access_time'];
$metadata['rtime'] = $metadata['deletion_time'];
$metadata['size'] = $metadata['mem_size'];
$metadata['hits'] = $metadata['num_hits'];

unset(
$metadata['key'],
$metadata['creation_time'],
$metadata['access_time'],
$metadata['deletion_time'],
$metadata['mem_size'],
$metadata['num_hits']
$apcMetadata = $metadata;
$metadata = array(
'internal_key' => isset($metadata['key']) ? $metadata['key'] : $metadata['info'],
'atime' => isset($metadata['access_time']) ? $metadata['access_time'] : $metadata['atime'],
'ctime' => isset($metadata['creation_time']) ? $metadata['creation_time'] : $metadata['ctime'],
'mtime' => isset($metadata['modified_time']) ? $metadata['modified_time'] : $metadata['mtime'],
'rtime' => isset($metadata['deletion_time']) ? $metadata['deletion_time'] : $metadata['dtime'],
'size' => $metadata['mem_size'],
'hits' => isset($metadata['nhits']) ? $metadata['nhits'] : $metadata['num_hits'],
'ttl' => $metadata['ttl'],
);
}

Expand Down

0 comments on commit 2f967c1

Please sign in to comment.