Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function increment($key, $offset = 1, $initial = 0, $expire = 0)
 {
     if ($offset <= 0 || $initial < 0) {
         return false;
     }
     // INCRBY initializes (at 0) & immediately increments, whereas we
     // only do initialization if the value does not yet exist
     if ($initial + $offset === 0 && $expire === 0) {
         return $this->client->incrBy($key, $offset);
     }
     return $this->doIncrement($key, $offset, $initial, $expire);
 }