Skip to content

Commit 7ad2f27

Browse files
committed
Add SCAN command
1 parent 21ab190 commit 7ad2f27

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Redis.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,6 +2961,25 @@ public function migrate( $host, $port, $key, $db, $timeout ) {}
29612961
* </pre>
29622962
*/
29632963
public function time() {}
2964+
2965+
/**
2966+
* Scan the keyspace for keys.
2967+
* @param int $iterator Iterator, initialized to NULL.
2968+
* @param string $pattern Pattern to match.
2969+
* @param int $count Count of keys per iteration (only a suggestion to Redis).
2970+
* @return array This function will return an array of keys or FALSE if there are no more keys.
2971+
* @link http://redis.io/commands/scan
2972+
* @example
2973+
* <pre>
2974+
* $iterator = null;
2975+
* while($keys = $redis->scan($iterator)) {
2976+
* foreach($keys as $key) {
2977+
* echo $key . PHP_EOL;
2978+
* }
2979+
* }
2980+
* </pre>
2981+
*/
2982+
public function scan( &$iterator, $pattern = null, $count = 0 ) {}
29642983
}
29652984

29662985
class RedisException extends Exception {}

0 commit comments

Comments
 (0)