lithium\storage\cache\adapter\Redis::increment()
Implements
lithium\storage\cache\Adapter::increment()
Performs an atomic increment operation on specified numeric cache item.
Note that if the value of the specified key is not an integer, the increment operation will have no effect whatsoever. Redis chooses to not typecast values to integers when performing an atomic increment operation.
Parameters
-
string
$key
Key of numeric cache item to increment.
-
integer
$offset
Offset to increment - defaults to
1
.
Returns
integer|booleanThe item's new value on successful increment, else false
.
Source
public function increment($key, $offset = 1) {
return $this->connection->incr($key, $offset);
}