コード例 #1
0
ファイル: TryCatchWrapper.php プロジェクト: plista/core-redis
 /**
  * Increment the number stored at key by one. If the second argument is filled, it will be used as the integer
  * value of the increment.
  *
  * @param string $key key
  * @param int $value value that will be added to key (only for incrBy)
  *
  * @return int the new value
  * @link http://redis.io/commands/incrby
  * @example
  * <pre>
  * $redis->incr('key1'); // key1 didn't exists, set to 0 before the increment and now has the value 1
  * $redis->incr('key1'); // 2
  * $redis->incr('key1'); // 3
  * $redis->incr('key1'); // 4
  * $redis->incrBy('key1', 10); // 14
  * </pre>
  */
 public function incrBy($key, $value)
 {
     try {
         return $this->client->incrBy($key, $value);
     } catch (Exception $e) {
         return $this->handleException($e, __FUNCTION__, func_get_args());
     }
 }
コード例 #2
0
 /**
  * Increment the number stored at key by one. If the second argument is filled, it will be used as the integer
  * value of the increment.
  *
  * @param string $key key
  * @param int $value value that will be added to key (only for incrBy)
  *
  * @return int the new value
  * @link http://redis.io/commands/incrby
  * @example
  * <pre>
  * $redis->incr('key1'); // key1 didn't exists, set to 0 before the increment and now has the value 1
  * $redis->incr('key1'); // 2
  * $redis->incr('key1'); // 3
  * $redis->incr('key1'); // 4
  * $redis->incrBy('key1', 10); // 14
  * </pre>
  */
 public function incrBy($key, $value)
 {
     $this->appendToLog('INCRBY ' . $key . ' ' . $value);
     return $this->client->incrBy($key, $value);
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function incrBy($key, $value)
 {
     unset($this->cache[$key]);
     return $this->redis->incrBy($key, $value);
 }