本文整理汇总了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);
}