Пример #1
0
 /**
  * Increment the float value of a key by the given amount
  *
  * @param string $key
  * @param float $increment
  *
  * @return float
  * @link http://redis.io/commands/incrbyfloat
  * @example
  * <pre>
  * $redis = new Redis();
  * $redis->connect('127.0.0.1');
  * $redis->set('x', 3);
  * var_dump( $redis->incrByFloat('x', 1.5) ); // float(4.5)
  * // ! SIC
  * var_dump( $redis->get('x') ); // string(3) "4.5"
  * </pre>
  */
 public function incrByFloat($key, $increment)
 {
     try {
         return $this->client->incrByFloat($key, $increment);
     } catch (Exception $e) {
         return $this->handleException($e, __FUNCTION__, func_get_args());
     }
 }
Пример #2
0
 /**
  * Increment the float value of a key by the given amount
  *
  * @param string $key
  * @param float $increment
  *
  * @return float
  * @link http://redis.io/commands/incrbyfloat
  * @example
  * <pre>
  * $redis = new Redis();
  * $redis->connect('127.0.0.1');
  * $redis->set('x', 3);
  * var_dump( $redis->incrByFloat('x', 1.5) ); // float(4.5)
  * // ! SIC
  * var_dump( $redis->get('x') ); // string(3) "4.5"
  * </pre>
  */
 public function incrByFloat($key, $increment)
 {
     $this->appendToLog('INCRYBYFLOAT ' . $key . ' ' . $increment);
     return $this->client->incrByFloat($key, $increment);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function incrByFloat($key, $increment)
 {
     unset($this->cache[$key]);
     return $this->redis->incrByFloat($key, $increment);
 }