Beispiel #1
0
 /**
  * Returns the elements of the sorted set stored at the specified key in the range [start, end]
  * in reverse order. start and stop are interpretated as zero-based indices:
  * 0 the first element,
  * 1 the second ...
  * -1 the last element,
  * -2 the penultimate ...
  *
  * @param string $key
  * @param int $start
  * @param int $end
  * @param bool $withscores optional
  *
  * @return array Array containing the values in specified range.
  * @link http://redis.io/commands/zrevrange
  * @example
  * <pre>
  * $redis->zAdd('key', 0, 'val0');
  * $redis->zAdd('key', 2, 'val2');
  * $redis->zAdd('key', 10, 'val10');
  * $redis->zRevRange('key', 0, -1); // array('val10', 'val2', 'val0')
  * // with scores
  * $redis->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0)
  * </pre>
  */
 public function zRevRange($key, $start, $end, $withscores = false)
 {
     try {
         return $this->client->zRevRange($key, $start, $end, $withscores);
     } catch (Exception $e) {
         return $this->handleException($e, __FUNCTION__, func_get_args());
     }
 }
 /**
  * Returns the elements of the sorted set stored at the specified key in the range [start, end]
  * in reverse order. start and stop are interpretated as zero-based indices:
  * 0 the first element,
  * 1 the second ...
  * -1 the last element,
  * -2 the penultimate ...
  *
  * @param string $key
  * @param int $start
  * @param int $end
  * @param bool $withscores optional
  *
  * @return array Array containing the values in specified range.
  * @link http://redis.io/commands/zrevrange
  * @example
  * <pre>
  * $redis->zAdd('key', 0, 'val0');
  * $redis->zAdd('key', 2, 'val2');
  * $redis->zAdd('key', 10, 'val10');
  * $redis->zRevRange('key', 0, -1); // array('val10', 'val2', 'val0')
  * // with scores
  * $redis->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0)
  * </pre>
  */
 public function zRevRange($key, $start, $end, $withscores = false)
 {
     $this->appendToLog('ZREVRANGE ' . $key . ' ' . $start . ' ' . $end . ($withscores ? ' WITHSCORES' : null));
     return $this->client->zRevRange($key, $start, $end, $withscores);
 }