php-memcached-dev/php-memcached — pull request #92 by poison (2013-11-07 22:02:43+00:00)
Title: Added user-defined flags to the connector

Flags are currently used by the connector to identify the type of the payload, the compression and the serialization. While memcached support at least 16 bits for the flags, only 8 bits are used by the connector. So this leaves us 8 bits to user-land to play with.

The only big incompatible change is $cas_token in get and getMulti; the code used to check if the $cas_token argument is added to the get and getMulti. If so, it enables CAS and does returns the $cas_token. But when I added the $udf_flags parameter as a last argument, you can't omit $cas_tokens. In order to solve this, if you set $cas_token = null and pass this to the get or getMulti function, it will treat it as it was absent. Any other value (eg.: $cas_token = 0) will enable cas.

Please let me know what you think of it. We're using it to enable versioning of keys and we have some other use cases as well.