Skip to content

Commit

Permalink
add cas operation for apc adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jul 17, 2013
1 parent 5595004 commit 82001f3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions library/Zend/Cache/Storage/Adapter/Apc.php
Expand Up @@ -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);
}
}

0 comments on commit 82001f3

Please sign in to comment.