예제 #1
0
파일: Redis.php 프로젝트: Top-Tech/Top-tech
 /**
  * Decrease the cache item.
  *
  * @see http://redis.io/commands/decr
  * @see http://redis.io/commands/decrby
  *
  * @param string $key The cache key
  * @param int $decrement decrement value
  *
  * @return mixed
  */
 public function decrease($key, $decrement = 1)
 {
     $decrement = abs((int) $decrement);
     if ($decrement <= 1) {
         $this->client->decr($key);
     } else {
         $this->client->decrby($key, $decrement);
     }
     return $this;
 }
예제 #2
0
파일: RedisAdapter.php 프로젝트: orno/cache
 /**
  * {@inheritdoc}
  *
  * @return \Orno\Cache\Adapter\RedisAdapter
  */
 public function decrement($key, $offset = 1)
 {
     $this->redis->decrby($key, $offset);
     return $this;
 }
 /**
  * Decrements an item in the cache.
  *
  * @param string $key
  * @param int $amount
  *
  * @return mixed
  */
 public function decrement(string $key, int $amount = 1)
 {
     $this->predis->decrby($this->prefix . $key, $amount);
 }
예제 #4
0
파일: Client.php 프로젝트: Antevenio/redis
 public function decrementKey($key, $increment)
 {
     return $this->_client->decrby($key, $increment);
 }