本文整理匯總了PHP中Predis\Client::incrby方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::incrby方法的具體用法?PHP Client::incrby怎麽用?PHP Client::incrby使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Predis\Client
的用法示例。
在下文中一共展示了Client::incrby方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addAccumulativeEntry
/**
* Add accumulative metric.
*
* @param EntryInterface $entry Entry
* @param string $entryKey Key entry
*
* @return $this Self Object
*/
private function addAccumulativeEntry(EntryInterface $entry, $entryKey)
{
$this->doRedisQuery(function () use($entry, $entryKey) {
$this->redis->incrby($entryKey . '_accum', (int) $entry->getValue());
});
return $this;
}
示例2: increase
/**
* Increase the cache item.
*
* @see http://redis.io/commands/incr
* @see http://redis.io/commands/incrby
*
* @param string $key The cache key
* @param int $increment Increment value
*
* @return mixed
*/
public function increase($key, $increment = 1)
{
$increment = abs((int) $increment);
if ($increment <= 1) {
$this->client->incr($key);
} else {
$this->client->incrby($key, $increment);
}
return $this;
}
示例3: increment
/**
* {@inheritdoc}
*
* @return \Orno\Cache\Adapter\RedisAdapter
*/
public function increment($key, $offset = 1)
{
$this->redis->incrby($key, $offset);
return $this;
}
示例4: increment
/**
* Increments an item in the cache.
*
* @param string $key
* @param int $amount
*
* @return mixed
*/
public function increment(string $key, int $amount = 1)
{
$this->predis->incrby($this->prefix . $key, $amount);
}
示例5: incrementKey
public function incrementKey($key, $increment)
{
return $this->_client->incrby($key, $increment);
}