Skip to content

Commit b9636c0

Browse files
committed
Add ZSCAN command
1 parent 1d089d0 commit b9636c0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Redis.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,6 +2534,26 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc
25342534
*/
25352535
public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {}
25362536

2537+
/**
2538+
* Scan a sorted set for members, with optional pattern and count.
2539+
* @param string $key String, the set to scan.
2540+
* @param int $iterator Long (reference), initialized to NULL.
2541+
* @param string $pattern String (optional), the pattern to match.
2542+
* @param int $count How many keys to return per iteration (Redis might return a different number).
2543+
* @return array PHPRedis will return matching keys from Redis, or FALSE when iteration is complete.
2544+
* @link http://redis.io/commands/zscan
2545+
* @example
2546+
* <pre>
2547+
* $iterator = null;
2548+
* while ($members = $redis-zscan('zset', $iterator)) {
2549+
* foreach ($members as $member => $score) {
2550+
* echo $member . ' => ' . $score . PHP_EOL;
2551+
* }
2552+
* }
2553+
* </pre>
2554+
*/
2555+
public function zScan( $key, &$iterator, $pattern = null, $count = 0 ) {}
2556+
25372557
/**
25382558
* Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned.
25392559
*

0 commit comments

Comments
 (0)