public function add($key, $value = 1, $ttl = 600) { $result = 0; if (is_numeric($value)) { $result = $value > 0 ? xcache_inc($key, $value, $ttl) : xcache_dec($key, abs($value), $ttl); } return $result; }
public function modifyInteger($key, $offset, &$success = null) { $success = false; if ($offset > 0) { $newValue = xcache_inc($key, $offset); } else { $newValue = xcache_dec($key, abs($offset)); } if (is_int($newValue)) { $success = true; } return $newValue; }
/** * Decrements the value of an integer cached key. * If the cache key is not an integer it will be treated as 0 * * @param string $key Identifier for the data * @param int $offset How much to subtract * @return New decremented value, false otherwise */ public function decrement($key, $offset = 1) { return xcache_dec($key, $offset); }
/** * Decrements the value of an integer cached key. * If the cache key is not an integer it will be treated as 0 * * @param string $key Identifier for the data * @param int $offset How much to subtract * @return bool|int New decremented value, false otherwise */ public function decrement($key, $offset = 1) { $key = $this->_key($key); return xcache_dec($key, $offset); }
/** * Performs an atomic decrement 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. * It is possible to decrement a value into the negative integers. * * @param string $key Key of numeric cache item to decrement. * @param integer $offset Offset to decrement - defaults to `1`. * @return integer|boolean The item's new value on successful decrement, else `false`. */ public function decrement($key, $offset = 1) { return xcache_dec($this->_config['scope'] ? "{$this->_config['scope']}:{$key}" : $key, $offset); }
/** * Performs an atomic decrement 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. * It is possible to decrement a value into the negative integers. * * @param string $key Key of numeric cache item to decrement * @param integer $offset Offset to decrement - defaults to 1. * @return mixed Item's new value on successful decrement, false otherwise */ public function decrement($key, $offset = 1) { return function ($self, $params, $chain) use($offset) { extract($params); return xcache_dec($key, $offset); }; }
public function dec($key, $step = 1) { $this->type = $type; return xcache_dec($this->_key($key), $step); }
/** * {@inheritdoc} */ public function decrement($name, $delta = 1) { return xcache_dec($this->options['prefix'] . $name, $delta); }
/** * @see Temporary_cache_driver::dec() */ public function dec($id, $realm = COT_DEFAULT_REALM, $value = 1) { return xcache_dec($realm . '/' . $id, $value); }
public function decrement($key, $step = 1) { return \xcache_dec($key, $step); }
/** * Decreases the value in the variable store * @param string $key The key of the variable * @param integer $value The value to decrease with * @param integer $timeToLive Set to a number of seconds to make the variable expire in that amount of time * @return mixed The new value of the variable */ public function decrease($key, $value = null, $timeToLive = null) { return xcache_dec($key, $value, $timeToLive); }
static function intdec($key, $value, $ttl) { return xcache_dec($key, $value, $ttl); }
public function decr($id, $val = 1, $group = Cache::DEFAULT_GROUP, $ttl = Cache::DEFAULT_TTL) { return xcache_dec($this->getPrefix($group) . $id, $val, $ttl); }
/** * Decrements numeric cache item's value. * * {@inheritDoc} * * @see \app\src\Cache\etsis_Abstract_Cache::dec() * * @since 6.2.0 * @param int|string $key * The cache key to decrement. * @param int $offset * Optional. The amount by which to decrement the item's value. Default: 1. * @param string $namespace * Optional. The namespace the key is in. Default: 'default'. * @return false|int False on failure, the item's new value on success. */ public function dec($key, $offset = 1, $namespace = 'default') { $unique_key = $this->uniqueKey($key, $namespace); return xcache_dec($unique_key, (int) $offset); }
public function decr($id, $value = 1, $ttl = Cache::DEFAULT_TTL) { return xcache_dec($this->prefix . $id, $value, $ttl); }
public function delete($key) { xcache_dec('__known_xcache_size', strlen($this->load($key))); return xcache_unset($key); }
/** * Decrease the value of a key by $amount. * * If the key does not exist, this method assumes that the current value is zero. * This method returns the new value. * * @param string $key * @param int $amount * @return int */ public function decr($key, $amount) { return xcache_dec($key, $amount); }
/** * Increment the value of an item in the cache. * * @param string $key * @param mixed $value * @return int */ public function decrement($key, $value = 1) { return xcache_dec($this->getPrefixWithLocale() . $key, $value); }
/** * Increment the value of an item in the cache. * * @param string $key * @param mixed $value * @return void */ public function decrement($key, $value = 1) { return xcache_dec($this->prefix . $key, $value); }
/** * Emulates `Memcache::decrement`. */ public function decrement($key, $value = 1) { return xcache_dec(self::$key_prefix . $key, $value); }
/** * Decrease a stored number * * @param string $key * @param int $step * @return int | bool */ public function dec($key, $step = 1) { return xcache_dec($this->getPrefix() . $key, $step); }
/** * {@inheritdoc} */ public function dec($name, $delta = 1) { return xcache_dec($this->prefix . $name, $delta); }
/** * Internal method to decrement an item. * * @param string $normalizedKey * @param int $value * @return int|bool The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalDecrementItem(&$normalizedKey, &$value) { $options = $this->getOptions(); $namespace = $options->getNamespace(); $prefix = $namespace === '' ? '' : $namespace . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $ttl = $options->getTtl(); $value = (int) $value; return xcache_dec($internalKey, $value, $ttl); }
function decrement($key, $by = 1) { $formatted = \Cachet\Helper::formatKey([$this->prefix, 'counter', $key]); $value = xcache_dec($formatted, $by, $this->counterTTL); return $value; }
public function decr($key, $value = 1) { return xcache_dec($key, $value); }
/** * Performs an atomic decrement 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. * It is possible to decrement a value into the negative integers. * * @param string $key Key of numeric cache item to decrement * @param integer $offset Offset to decrement - defaults to 1. * @return closure Function returning item's new value on successful decrement, else `false` */ public function decrement($key, $offset = 1) { return function ($self, $params) use($offset) { return xcache_dec($params['key'], $offset); }; }
public function dec($key, $step = 1) { return xcache_dec($key, $step); }
} private static function xcache_increment($name, $step = 1) { $orgi = $name; $name = self::getMemoryName($name); $ret = xcache_inc($name, $step); if ($ret === false) { self::xcache_set($orgi, $step, 3600); return $step; } else { return $ret; }
public function dec($key, $interval = 1) { return xcache_dec($this->_p($key), $interval); }
/** * {@inheritdoc} */ protected function decrementValue($key, $value) { if (is_int($dec = xcache_dec($key, (int) $value))) { return $dec; } return false; }