Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add cas operation for apc adapter #4844

wants to merge 3 commits into from

4 participants


No description provided.


Please add a unit test, if possible.


How to do that without concurrent threads?


@prolic Good point. :) Merging!


Merged to develop for release with 2.3.0, as it's a feature addition.


This breaks the test. apc_cas allows only integer values but we allow all values :(
@Ocramius It's a bit late to revert - should I open a new issue? I'm currently not sure how to solve it.


@marc-mabe you could open a pull request with a failing test case...


The test's are currently failing. Currently APC no enabled on travis - I'm working on a solution to enable more tests for travis.
WIP -> This one is using APCu as APC is not available by default on travis since PHP-5.5


@marc-mabe would throwing an exception if ! is_int() be a good idea here?


@Ocramius I don't think so because other adapter accept it and it's not possible to check before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 17, 2013
  1. @prolic
  2. @prolic


    prolic authored
  3. @prolic

    remove unused phpdoc line

    prolic authored
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 0 deletions.
  1. +15 −0 library/Zend/Cache/Storage/Adapter/Apc.php
15 library/Zend/Cache/Storage/Adapter/Apc.php
@@ -734,4 +734,19 @@ protected function normalizeMetadata(array & $metadata)
+ /**
+ * Internal method to set an item only if token matches
+ *
+ * @param mixed $token
+ * @param string $normalizedKey
+ * @param mixed $value
+ * @return bool
+ * @see getItem()
+ * @see setItem()
+ */
+ protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value)
+ {
+ return apc_cas($normalizedKey, $token, $value);
+ }
Something went wrong with that request. Please try again.