Extends
lithium\core\Object
Performs an atomic increment operation on specified numeric cache item.
Note that, as per the APC specification:
If the item's value is not numeric, the increment operation has no effect
on the key - it retains it's original non-integer value.
Parameters
- string $key Key of numeric cache item to increment
- integer $offset Offset to increment - defaults to 1.
Returns
closure Function returning item's new value on successful increment, else `false`Source
public function increment($key, $offset = 1) {
return function($self, $params) use ($offset) {
return apc_inc($params['key'], $offset);
};
}