lithium\storage\cache\adapter\XCache::increment()

public method

Performs an atomic increment operation on specified numeric cache item.

Note that, as per the XCache specification: If the item's value is not numeric, it is treated as if the value were 0.

Parameters

  • string $key

    Key of numeric cache item to increment.

  • integer $offset

    Offset to increment - defaults to 1.

Returns

integer|boolean

The item's new value on successful increment, else false.

Source

	public function increment($key, $offset = 1) {
		return xcache_inc(
			$this->_config['scope'] ? "{$this->_config['scope']}:{$key}" : $key, $offset
		);
	}