diff --git a/library/Zend/Cache/Storage/Adapter/Apc.php b/library/Zend/Cache/Storage/Adapter/Apc.php index 2196ff5f43e..7483d3fc3aa 100644 --- a/library/Zend/Cache/Storage/Adapter/Apc.php +++ b/library/Zend/Cache/Storage/Adapter/Apc.php @@ -734,4 +734,24 @@ protected function normalizeMetadata(array & $metadata) $metadata['num_hits'] ); } + + /** + * Internal method to set an item only if token matches + * + * @param mixed $token + * @param string $normalizedKey + * @param mixed $value + * @return bool + * @throws Exception\ExceptionInterface + * @see getItem() + * @see setItem() + */ + protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value) + { + if (!$this->internalHasItem($normalizedKey)) { + return false; + } + + return apc_cas($normalizedKey, $token, $value); + } }