Exemplo n.º 1
0
 /**
  * Changes a substring of a larger string.
  *
  * @param string $key
  * @param int $offset
  * @param string $value
  *
  * @return string the length of the string after it was modified.
  * @link http://redis.io/commands/setrange
  * @example
  * <pre>
  * $redis->set('key', 'Hello world');
  * $redis->setRange('key', 6, "redis"); // returns 11
  * $redis->get('key'); // "Hello redis"
  * </pre>
  */
 public function setRange($key, $offset, $value)
 {
     try {
         return $this->client->setRange($key, $offset, $value);
     } catch (Exception $e) {
         return $this->handleException($e, __FUNCTION__, func_get_args());
     }
 }
Exemplo n.º 2
0
 /**
  * Changes a substring of a larger string.
  *
  * @param string $key
  * @param int $offset
  * @param string $value
  *
  * @return string the length of the string after it was modified.
  * @link http://redis.io/commands/setrange
  * @example
  * <pre>
  * $redis->set('key', 'Hello world');
  * $redis->setRange('key', 6, "redis"); // returns 11
  * $redis->get('key'); // "Hello redis"
  * </pre>
  */
 public function setRange($key, $offset, $value)
 {
     $this->appendToLog('SETRANGE ' . $key . ' ' . $offset . ' ' . $value);
     return $this->client->setRange($key, $offset, $value);
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function setRange($key, $offset, $value)
 {
     unset($this->cache[$key]);
     return $this->redis->setRange($key, $offset, $value);
 }