From 531177d42d3b34230fe4941b4c310e92e938bdc4 Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Wed, 9 Nov 2022 15:33:56 -0800 Subject: Documentation: Render docs --- docs/Redis.html | 697 +++++++++++++++++++++++++------------------------ docs/renderer.index | 2 +- redis_arginfo.h | 2 +- redis_legacy_arginfo.h | 2 +- 4 files changed, 356 insertions(+), 347 deletions(-) diff --git a/docs/Redis.html b/docs/Redis.html index cfc5a250..0c811371 100644 --- a/docs/Redis.html +++ b/docs/Redis.html @@ -3824,7 +3824,7 @@ to Redis >= 6.0.0 to send a floating point timeout.

- + Redis|array|false bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) @@ -3835,7 +3835,18 @@ to Redis >= 6.0.0 to send a floating point timeout.

POP the maximum scoring element off of one or more sorted sets, blocking up to a specified -timeout if no elements are available.

+timeout if no elements are available.

Following are examples of the two main ways to call this method.

+
<?php
+// Method 1 - Variadic, with the last argument being our timeout
+$redis->bzPopMax('key1', 'key2', 'key3', 1.5);
+
+// Method 2 - A single array of keys, followed by the timeout
+$redis->bzPopMax(['key1', 'key2', 'key3'], 1.5);
+<?php>
+
+NOTE:  We reccomend calling this function with an array and a timeout as the other strategy
+       may be deprecated in future versions of PhpRedis
+?>

Parameters

@@ -3857,20 +3868,7 @@ another key.

mixed ...$extra_args

Can consist of additional keys, until the last argument -which needs to be a timeout.

-

Following are examples of the two main ways to call this method.

-

-<?php
-// Method 1 - Variadic, with the last argument being our timeout
-$redis->bzPopMax('key1', 'key2', 'key3', 1.5);
-
-// Method 2 - A single array of keys, followed by the timeout
-$redis->bzPopMax(['key1', 'key2', 'key3'], 1.5);
-<?php>
-
-NOTE:  We reccomend calling this function with an array and a timeout as the other strategy
-       may be deprecated in future versions of PhpRedis
-?>
+which needs to be a timeout.

@@ -3880,7 +3878,7 @@ NOTE: We reccomend calling this function with an array and a timeout as the oth - +
Redis|array|false

The popped elements.

@@ -3904,7 +3902,7 @@ NOTE: We reccomend calling this function with an array and a timeout as the oth

- + Redis|array|false bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) @@ -3975,7 +3973,7 @@ Redis::bzPopMax

- + Redis|array|null|false bzmpop(float $timeout, array $keys, string $from, int $count = 1) @@ -4038,7 +4036,7 @@ instead return NULL when Redis doesn't pop any elements.

- + Redis|array|null|false zmpop(array $keys, string $from, int $count = 1) @@ -4102,7 +4100,7 @@ pop the lowest or highest scoring elements.

- + Redis|array|null|false blmpop(float $timeout, array $keys, string $from, int $count = 1) @@ -4173,7 +4171,7 @@ were empty.

- + Redis|array|null|false lmpop(array $keys, string $from, int $count = 1) @@ -4238,7 +4236,7 @@ were empty.

- + bool clearLastError() @@ -4284,7 +4282,7 @@ var_dump($redis->getLastError());

- + mixed client(string $opt, mixed ...$args) @@ -4332,7 +4330,7 @@ var_dump($redis->getLastError());

- + bool close() @@ -4365,7 +4363,7 @@ var_dump($redis->getLastError());

- + mixed command(string $opt = null, string|array $arg) @@ -4413,7 +4411,7 @@ var_dump($redis->getLastError());

- + mixed config(string $operation, array|string|null $key_or_settings = NULL, string|null $value = NULL) @@ -4491,7 +4489,7 @@ $redis->config('SET', ['timeout' => 30, 'loglevel' => 'warning']);

- + bool connect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array $context = null) @@ -4564,7 +4562,7 @@ $redis->config('SET', ['timeout' => 30, 'loglevel' => 'warning']);

- + Redis|bool copy(string $src, string $dst, array $options = null) @@ -4661,7 +4659,7 @@ var_dump($redis->copy('source1', 'exists', ['REPLACE' => true]));

- + Redis|int|false dbSize() @@ -4720,7 +4718,7 @@ var_dump($redis->dbsize());

- + Redis|string debug(string $key) @@ -4763,7 +4761,7 @@ var_dump($redis->dbsize());

- + Redis|int|false decr(string $key, int $by = 1) @@ -4842,7 +4840,7 @@ var_dump($redis->decr('counter', 2));

- + Redis|int|false decrBy(string $key, int $value) @@ -4911,7 +4909,7 @@ var_dump($redis->decrby('counter', 2));

- + Redis|int|false del(array|string $key, string ...$other_keys) @@ -4986,7 +4984,7 @@ var_dump($redis->del(['key:2', 'key:3', 'key:4']));

- + Redis|int|false delete(array|string $key, string ...$other_keys) deprecated @@ -5041,7 +5039,7 @@ var_dump($redis->del(['key:2', 'key:3', 'key:4']));

- + Redis|bool discard() @@ -5088,7 +5086,7 @@ $redis->getMode();

- + Redis|string dump(string $key) @@ -5162,7 +5160,7 @@ $redis->zRange('new-zset', 0, -1, true);

- + Redis|string|false echo(string $str) @@ -5224,7 +5222,7 @@ var_dump($redis->echo('Hello, World'));

- + mixed eval(string $script, array $args = [], int $num_keys = 0) @@ -5290,7 +5288,7 @@ strings, arrays, nested arrays, etc.

- + mixed eval_ro(string $script_sha, array $args = [], int $num_keys = 0) @@ -5355,7 +5353,7 @@ Redis::eval

- + mixed evalsha(string $sha1, array $args = [], int $num_keys = 0) @@ -5426,7 +5424,7 @@ Redis::eval

- + mixed evalsha_ro(string $sha1, array $args = [], int $num_keys = 0) @@ -5491,7 +5489,7 @@ Redis::evalsha

- + Redis|array|false exec() @@ -5577,7 +5575,7 @@ Redis::multi

- + Redis|int|bool exists(mixed $key, mixed ...$other_keys) @@ -5653,7 +5651,7 @@ var_dump($redis->exists('k4', 'k5', 'notakey'));

- + Redis|bool expire(string $key, int $timeout, string|null $mode = NULL) @@ -5723,7 +5721,7 @@ GT - Set expiry only when new expiry is > current expiry

- + Redis|bool expireAt(string $key, int $timestamp, string|null $mode = NULL) @@ -5792,7 +5790,7 @@ Redis::expire

- + Redis|bool failover(array|null $to = null, bool $abort = false, int $timeout = 0) @@ -5845,7 +5843,7 @@ Redis::expire

- + Redis|int|false expiretime(string $key) @@ -5913,7 +5911,7 @@ var_dump($redis->expiretime('expiry-key'));

- + Redis|int|false pexpiretime(string $key) @@ -5974,7 +5972,7 @@ Redis::expiretime

- + Redis|bool flushAll(bool|null $sync = null) @@ -6020,7 +6018,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + Redis|bool flushDB(bool|null $sync = null) @@ -6066,7 +6064,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + Redis|int|false geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options) @@ -6129,7 +6127,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + Redis|float|false geodist(string $key, string $src, string $dst, string|null $unit = null) @@ -6187,7 +6185,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + Redis|array|false geohash(string $key, string $member, string ...$other_members) @@ -6240,7 +6238,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + Redis|array|false geopos(string $key, string $member, string ...$other_members) @@ -6293,7 +6291,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + mixed georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) @@ -6361,7 +6359,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + mixed georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) @@ -6429,7 +6427,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + mixed georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []) @@ -6492,7 +6490,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + mixed georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []) @@ -6555,7 +6553,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + array geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []) @@ -6618,7 +6616,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + Redis|array|int|false geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []) @@ -6686,7 +6684,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + mixed get(string $key) @@ -6729,7 +6727,7 @@ on Redis' lazyfree-lazy-user-flush config setting.

- + mixed getAuth() @@ -6773,7 +6771,7 @@ Redis::auth

- + Redis|int|false getBit(string $key, int $idx) @@ -6821,7 +6819,7 @@ Redis::auth

- + Redis|string|bool getEx(string $key, array $options = []) @@ -6869,7 +6867,7 @@ Redis::auth

- + int getDBNum() @@ -6902,7 +6900,7 @@ Redis::auth

- + Redis|string|bool getDel(string $key) @@ -6945,7 +6943,7 @@ Redis::auth

- + string getHost() @@ -6977,7 +6975,7 @@ Redis::auth

- + string|null getLastError() @@ -7009,7 +7007,7 @@ Redis::auth

- + int getMode() @@ -7041,7 +7039,7 @@ Redis::auth

- + mixed getOption(int $option) @@ -7095,7 +7093,7 @@ Redis::setOption

- + string|null getPersistentID() @@ -7127,7 +7125,7 @@ Redis::setOption

- + int getPort() @@ -7159,7 +7157,7 @@ Redis::setOption

- + Redis|string|false getRange(string $key, int $start, int $end) @@ -7224,7 +7222,7 @@ var_dump($redis->getRange('silly-word', -7, -1));

- + Redis|string|array|int|false lcs(string $key1, string $key2, array|null $options = NULL) @@ -7299,7 +7297,7 @@ var_dump($redis->lcs('seq1', 'seq2'));

- + float getReadTimeout() @@ -7331,7 +7329,7 @@ var_dump($redis->lcs('seq1', 'seq2'));

- + Redis|string|false getset(string $key, mixed $value) @@ -7389,7 +7387,7 @@ var_dump($redis->getset('captain', 'Kirk'));

- + float|false getTimeout() @@ -7421,7 +7419,7 @@ var_dump($redis->getset('captain', 'Kirk'));

- + int|false getTransferredBytes() @@ -7454,7 +7452,7 @@ var_dump($redis->getset('captain', 'Kirk'));

- + Redis|int|false hDel(string $key, string $field, string ...$other_fields) @@ -7527,7 +7525,7 @@ $redis->hDel('comms', 'Mallory', 'Archibald');

- + Redis|bool hExists(string $key, string $field) @@ -7598,7 +7596,7 @@ $redis->hExists('captains', 'Picard');

- + mixed hGet(string $key, string $member) @@ -7646,7 +7644,7 @@ $redis->hExists('captains', 'Picard');

- + Redis|array|false hGetAll(string $key) @@ -7716,7 +7714,7 @@ $redis->hGetAll('comms');

- + Redis|int|false hIncrBy(string $key, string $field, int $value) @@ -7792,7 +7790,7 @@ $redis->hIncrBy('player', 'level', 3);

- + Redis|float|false hIncrByFloat(string $key, string $field, float $value) @@ -7865,7 +7863,7 @@ $redis->hIncrByFloat('trig-numbers', 'tau', 2 * $pi);

- + Redis|array|false hKeys(string $key) @@ -7935,7 +7933,7 @@ $redis->hKeys('ships');

- + Redis|int|false hLen(string $key) @@ -7988,7 +7986,7 @@ $redis->hKeys('ships');

- + Redis|array|false hMget(string $key, array $fields) @@ -8061,7 +8059,7 @@ $redis->hmget('player:1', ['name', 'score']);

- + Redis|bool hMset(string $key, array $fieldvals) @@ -8124,7 +8122,7 @@ $redis->hmset('updates', ['status' => 'starting', 'elapsed' => 0]);

- + Redis|string|array hRandField(string $key, array $options = null) @@ -8197,7 +8195,7 @@ $redis->hrandfield('settings', ['count' => 2, 'withvalues' => true]);

- + Redis|int|false hSet(string $key, string $member, mixed $value) @@ -8250,7 +8248,7 @@ $redis->hrandfield('settings', ['count' => 2, 'withvalues' => true]);

- + Redis|bool hSetNx(string $key, string $field, string $value) @@ -8324,7 +8322,7 @@ var_dump($redis->hsetnx('player:1', 'lock', 'enabled'));

- + Redis|int|false hStrLen(string $key, string $field) @@ -8391,7 +8389,7 @@ $redis->hstrlen('hash', '50bytes');

- + Redis|array|false hVals(string $key) @@ -8459,7 +8457,7 @@ $redis->hgetall('player');

- + Redis|array|bool hscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) @@ -8569,7 +8567,7 @@ do {

- + Redis|int|false incr(string $key, int $by = 1) @@ -8644,7 +8642,7 @@ $redis->incr('counter', 2);

- + Redis|int|false incrBy(string $key, int $value) @@ -8720,7 +8718,7 @@ $redis->incrby('primes', 4);

- + Redis|float|false incrByFloat(string $key, float $value) @@ -8778,7 +8776,7 @@ var_dump($redis->incrByFloat('tau', 3.1415926));

- + Redis|array|false info(string ...$sections) @@ -8834,7 +8832,7 @@ to that section.

If connected to Redis server >=

- + bool isConnected() @@ -8866,7 +8864,7 @@ to that section.

If connected to Redis server >=

- + Redis|array|false keys(string $pattern) @@ -8909,7 +8907,7 @@ to that section.

If connected to Redis server >=

- + Redis|int|false lInsert(string $key, string $pos, mixed $pivot, mixed $value) @@ -8967,7 +8965,7 @@ to that section.

If connected to Redis server >=

- + Redis|int|false lLen(string $key) @@ -9010,7 +9008,7 @@ to that section.

If connected to Redis server >=

- + Redis|string|false lMove(string $src, string $dst, string $wherefrom, string $whereto) @@ -9068,7 +9066,7 @@ to that section.

If connected to Redis server >=

- + Redis|bool|string|array lPop(string $key, int $count = 0) @@ -9116,7 +9114,7 @@ to that section.

If connected to Redis server >=

- + Redis|null|bool|int|array lPos(string $key, mixed $value, array $options = null) @@ -9169,7 +9167,7 @@ to that section.

If connected to Redis server >=

- + int|Redis lPush(string $key, mixed ...$elements) @@ -9217,7 +9215,7 @@ to that section.

If connected to Redis server >=

- + Redis|int|false rPush(string $key, mixed ...$elements) @@ -9265,7 +9263,7 @@ to that section.

If connected to Redis server >=

- + Redis|int|false lPushx(string $key, mixed $value) @@ -9313,7 +9311,7 @@ to that section.

If connected to Redis server >=

- + Redis|int|false rPushx(string $key, mixed $value) @@ -9361,7 +9359,7 @@ to that section.

If connected to Redis server >=

- + Redis|bool lSet(string $key, int $index, mixed $value) @@ -9414,7 +9412,7 @@ to that section.

If connected to Redis server >=

- + int lastSave() @@ -9447,7 +9445,7 @@ to that section.

If connected to Redis server >=

- + mixed lindex(string $key, int $index) @@ -9495,7 +9493,7 @@ to that section.

If connected to Redis server >=

- + Redis|array|false lrange(string $key, int $start, int $end) @@ -9548,7 +9546,7 @@ to that section.

If connected to Redis server >=

- + int|Redis|false lrem(string $key, mixed $value, int $count = 0) @@ -9601,7 +9599,7 @@ to that section.

If connected to Redis server >=

- + Redis|bool ltrim(string $key, int $start, int $end) @@ -9654,7 +9652,7 @@ to that section.

If connected to Redis server >=

- + array|Redis mget(array $keys) @@ -9697,7 +9695,7 @@ to that section.

If connected to Redis server >=

- + Redis|bool migrate(string $host, int $port, string|array $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, mixed $credentials = NULL) @@ -9775,7 +9773,7 @@ to that section.

If connected to Redis server >=

- + bool move(string $key, int $index) @@ -9823,7 +9821,7 @@ to that section.

If connected to Redis server >=

- + Redis|bool mset(array $key_values) @@ -9866,7 +9864,7 @@ to that section.

If connected to Redis server >=

- + Redis|bool msetnx(array $key_values) @@ -9909,7 +9907,7 @@ to that section.

If connected to Redis server >=

- + bool|Redis multi(int $value = Redis::MULTI) @@ -9952,7 +9950,7 @@ to that section.

If connected to Redis server >=

- + Redis|int|string|false object(string $subcommand, string $key) @@ -10000,7 +9998,7 @@ to that section.

If connected to Redis server >=

- + bool open(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL) deprecated @@ -10080,7 +10078,7 @@ to that section.

If connected to Redis server >=

- + bool pconnect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL) @@ -10153,7 +10151,7 @@ to that section.

If connected to Redis server >=

- + bool persist(string $key) @@ -10196,7 +10194,7 @@ to that section.

If connected to Redis server >=

- + bool pexpire(string $key, int $timeout, string|null $mode = NULL) @@ -10252,7 +10250,7 @@ command works.

- + Redis|bool pexpireAt(string $key, int $timestamp, string|null $mode = NULL) @@ -10323,7 +10321,7 @@ Redis::expire

- + Redis|int pfadd(string $key, array $elements) @@ -10381,7 +10379,7 @@ Redis::expire

- + Redis|int pfcount(string $key) @@ -10434,7 +10432,7 @@ Redis::expire

- + Redis|bool pfmerge(string $dst, array $srckeys) @@ -10492,7 +10490,7 @@ Redis::expire

- + Redis|string|bool ping(string $message = NULL) @@ -10555,7 +10553,7 @@ $redis->ping('beep boop');

- + bool|Redis pipeline() @@ -10607,7 +10605,7 @@ $redis->pipeline()

- + bool popen(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL) deprecated @@ -10687,7 +10685,7 @@ $redis->pipeline()

- + bool|Redis psetex(string $key, int $expire, mixed $value) @@ -10740,7 +10738,7 @@ $redis->pipeline()

- + bool psubscribe(array $patterns, callable $cb) @@ -10799,7 +10797,7 @@ $redis->pipeline()

- + Redis|int|false pttl(string $key) @@ -10862,7 +10860,7 @@ var_dump($redis->pttl('ttl-key'));

- + Redis|int|false publish(string $channel, string $message) @@ -10920,7 +10918,7 @@ var_dump($redis->pttl('ttl-key'));

- + mixed pubsub(string $command, mixed $arg = null) @@ -10968,7 +10966,7 @@ var_dump($redis->pttl('ttl-key'));

- + Redis|array|bool punsubscribe(array $patterns) @@ -11034,7 +11032,7 @@ Redis::subscribe

- + Redis|array|string|bool rPop(string $key, int $count = 0) @@ -11109,7 +11107,7 @@ $redis->rPop('mylist');

- + Redis|string|false randomKey() @@ -11152,7 +11150,7 @@ $redis->rPop('mylist');

- + mixed rawcommand(string $command, mixed ...$args) @@ -11220,7 +11218,7 @@ $redis->rawCommand('lrange', 'mylist', 0, -1);

- + Redis|bool rename(string $old_name, string $new_name) @@ -11278,7 +11276,7 @@ $redis->rawCommand('lrange', 'mylist', 0, -1);

- + Redis|bool renameNx(string $key_src, string $key_dst) @@ -11350,7 +11348,7 @@ $redis->renamenx('dst', 'existing-dst');

- + Redis|bool reset() @@ -11382,7 +11380,7 @@ $redis->renamenx('dst', 'existing-dst');

- + Redis|bool restore(string $key, int $ttl, string $value, array|null $options = NULL) @@ -11502,7 +11500,7 @@ Redis::dump

- + mixed role() @@ -11535,7 +11533,7 @@ an error.

- + Redis|string|false rpoplpush(string $srckey, string $dstkey) @@ -11618,7 +11616,7 @@ var_dump($redis->lrange('list1', 0, -1));

- + Redis|int|false sAdd(string $key, mixed $value, mixed ...$other_values) @@ -11693,7 +11691,7 @@ var_dump($redis->sadd('myset', 'foo', 'new'));

- + int sAddArray(string $key, array $values) @@ -11770,7 +11768,7 @@ var_dump($redis->sAddArray('myset', ['foo', 'new']));

- + Redis|array|false sDiff(string $key, string ...$other_keys) @@ -11852,7 +11850,7 @@ array(2) {

- + Redis|int|false sDiffStore(string $dst, string $key, string ...$other_keys) @@ -11922,7 +11920,7 @@ values in a specified destination key.

- + Redis|array|false sInter(array|string $key, string ...$other_keys) @@ -12001,7 +11999,7 @@ var_dump($redis->sinter('alice_likes', 'bob_likes', 'bill_likes'));

- + Redis|int|false sintercard(array $keys, int $limit = -1) @@ -12072,7 +12070,7 @@ var_dump($redis->sInterCard(['set1', 'set2', 'set3']));

- + Redis|int|false sInterStore(array|string $key, string ...$other_keys) @@ -12147,7 +12145,7 @@ $redis->sInterStore('dst', 'src1', 'src'2', 'src3');

- + Redis|array|false sMembers(string $key) @@ -12218,7 +12216,7 @@ $redis->sMembers('tng-crew');

- + Redis|array|false sMisMember(string $key, string $member, string ...$other_members) @@ -12315,7 +12313,7 @@ var_dump(array_combine($names, $members));

- + Redis|bool sMove(string $src, string $dst, mixed $value) @@ -12408,7 +12406,7 @@ var_dump($redis->sMembers('evens'));

- + Redis|string|array|false sPop(string $key, int $count = 0) @@ -12499,7 +12497,7 @@ var_dump($redis->sMembers('evens'));

- + Redis|string|array|false sRandMember(string $key, int $count = 0) @@ -12567,7 +12565,7 @@ $rng3 = $redis->sRandMember('elder-gods', -9999);

- + Redis|array|false sUnion(string $key, string ...$other_keys) @@ -12650,7 +12648,7 @@ var_dump($redis->sunion('set1', 'set2', 'set3'));

- + Redis|int|false sUnionStore(string $dst, string $key, string ...$other_keys) @@ -12720,7 +12718,7 @@ false on failure.

- + Redis|bool save() @@ -12770,7 +12768,7 @@ completed. For a nonblocking alternative, see Redis::bgsave().

- + array|false scan(int|null $iterator, string|null $pattern = null, int $count = 0, string $type = NULL) @@ -12780,7 +12778,38 @@ completed. For a nonblocking alternative, see Redis::bgsave().

-

Incrementally scan the Redis keyspace, with optional pattern and type matching.

+

Incrementally scan the Redis keyspace, with optional pattern and type matching.

A note about Redis::SCAN_NORETRY and Redis::SCAN_RETRY.

+

For convenience, PhpRedis can retry SCAN commands itself when Redis returns an empty array of +keys with a nonzero iterator. This can happen when matching against a pattern that very few +keys match inside a key space with a great many keys. The following example demonstrates how +to use Redis::scan() with the option disabled and enabled.

+
<?php
+
+$redis = new Redis(['host' => 'localhost']);
+
+$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_NORETRY);
+
+$it = NULL;
+
+do {
+    $keys = $redis->scan($it, '*zorg*');
+    foreach ($keys as $key) {
+        echo "KEY: $key\n";
+    }
+} while ($it != 0);
+
+$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
+
+$it = NULL;
+
+// When Redis::SCAN_RETRY is enabled, we can use simpler logic, as we will never receive an
+// empty array of keys when the iterator is nonzero.
+while ($keys = $redis->scan($it, '*zorg*')) {
+    foreach ($keys as $key) {
+        echo "KEY: $key\n";
+    }
+}
+?>

Parameters

@@ -12826,39 +12855,7 @@ clients while iterating the key space.

invocation of scan. Note that it is possible for Redis to return zero keys before having scanned the entire key space, so the caller should instead continue to SCAN until the iterator reference is -returned to zero.

-

A note about Redis::SCAN_NORETRY and Redis::SCAN_RETRY.

-

For convenience, PhpRedis can retry SCAN commands itself when Redis returns an empty array of -keys with a nonzero iterator. This can happen when matching against a pattern that very few -keys match inside a key space with a great many keys. The following example demonstrates how -to use Redis::scan() with the option disabled and enabled.

-
<?php
-
-$redis = new Redis(['host' => 'localhost']);
-
-$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_NORETRY);
-
-$it = NULL;
-
-do {
-    $keys = $redis->scan($it, '*zorg*');
-    foreach ($keys as $key) {
-        echo "KEY: $key\n";
-    }
-} while ($it != 0);
-
-$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
-
-$it = NULL;
-
-// When Redis::SCAN_RETRY is enabled, we can use simpler logic, as we will never receive an
-// empty array of keys when the iterator is nonzero.
-while ($keys = $redis->scan($it, '*zorg*')) {
-    foreach ($keys as $key) {
-        echo "KEY: $key\n";
-    }
-}
-?>
+returned to zero.

@@ -12889,7 +12886,7 @@ Redis::setOption

- + Redis|int|false scard(string $key) @@ -12952,7 +12949,7 @@ $redis->scard('set');

- + mixed script(string $command, mixed ...$args) @@ -13029,7 +13026,7 @@ var_dump($redis->script('exists', sha1($lua)));

- + Redis|bool select(int $db) @@ -13087,7 +13084,7 @@ var_dump($redis->exists('this_is_db_1'));

- + Redis|string|bool set(string $key, mixed $value, mixed $options = NULL) @@ -13181,7 +13178,7 @@ $redis->set('key', 'options_set', ['XX']);

- + Redis|int|false setBit(string $key, int $idx, bool $value) @@ -13255,7 +13252,7 @@ $redis->get('foo');

- + Redis|int|false setRange(string $key, int $index, string $value) @@ -13326,7 +13323,7 @@ $redis->setRange('message', 6, 'Redis');

- + bool setOption(int $option, mixed $value) @@ -13336,7 +13333,83 @@ $redis->setRange('message', 6, 'Redis');
-

Set a configurable option on the Redis object.

+

Set a configurable option on the Redis object.

Following are a list of options you can set:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OPTIONTYPEDESCRIPTION
OPT_MAX_RETRIESintThe maximum number of times Redis will attempt to reconnect if it gets disconnected, before throwing an exception.
OPT_SCANenumRedis::OPT_SCAN_RETRY, or Redis::OPT_SCAN_NORETRY. Whether PhpRedis should automatically SCAN again when zero keys but a nonzero iterator are returned.
OPT_SERIALIZERenumSet the automatic data serializer.
Redis::SERIALIZER_NONE
Redis::SERIALIZER_PHP
Redis::SERIALIZER_IGBINARY
Redis::SERIALIZER_MSGPACK, Redis::SERIALIZER_JSON
OPT_PREFIXstringA string PhpRedis will use to prefix every key we read or write.
OPT_READ_TIMEOUTfloatHow long PhpRedis will block for a response from Redis before throwing a 'read error on connection' exception.
OPT_TCP_KEEPALIVEboolSet or disable TCP_KEEPALIVE on the connection.
OPT_COMPRESSIONenumSet the compression algorithm
Redis::COMPRESSION_NONE
Redis::COMPRESSION_LZF
Redis::COMPRESSION_LZ4
Redis::COMPRESSION_ZSTD
OPT_REPLY_LITERALboolIf set to true, PhpRedis will return the literal string Redis returns for LINE replies (e.g. '+OK'), rather than true.
OPT_COMPRESSION_LEVELintSet a specific compression level if Redis is compressing data.
OPT_NULL_MULTIBULK_AS_NULLboolCauses PhpRedis to return NULL rather than false for NULL MULTIBULK replies
OPT_BACKOFF_ALGORITHMenumThe exponential backoff strategy to use.
OPT_BACKOFF_BASEintThe minimum delay between retries when backing off.
OPT_BACKOFF_CAPintThe maximum delay between replies when backing off.

Parameters

@@ -13360,7 +13433,7 @@ $redis->setRange('message', 6, 'Redis'); - +
bool

True if the setting was updated, false if not.

true if the setting was updated, false if not.

@@ -13374,71 +13447,7 @@ $redis->setRange('message', 6, 'Redis'); Redis::getOption - Following are a list of options you can set: - -OPTION TYPE DESCRIPTION -OPT_MAX_RETRIES int The maximum number of times Redis will attempt to reconnect - if it gets disconnected, before throwing an exception. - -OPT_SCAN enum Redis::OPT_SCAN_RETRY, or Redis::OPT_SCAN_NORETRY - - Redis::SCAN_NORETRY (default) - -------------------------------------------------------- - PhpRedis will only call `SCAN` once for every time the - user calls Redis::scan(). This means it is possible for - an empty array of keys to be returned while there are - still more keys to be processed. - - Redis::SCAN_RETRY - -------------------------------------------------------- - PhpRedis may make multiple calls to `SCAN` for every - time the user calls Redis::scan(), and will never return - an empty array of keys unless Redis returns the iterator - to zero (meaning the `SCAN` is complete). - - -OPT_SERIALIZER int One of the installed serializers, which can vary depending - on how PhpRedis was compiled. All of the supported serializers - are as follows: - - Redis::SERIALIZER_NONE - Redis::SERIALIZER_PHP - Redis::SERIALIZER_IGBINARY - Redis::SERIALIZER_MSGPACK - Redis::SERIALIZER_JSON - - Note: The PHP and JSON serializers are always available. - -OPT_PREFIX string A string PhpRedis will use to prefix every key we read or write. - To disable the prefix, you may pass an empty string or NULL. - -OPT_READ_TIMEOUT double How long PhpRedis will block for a response from Redis before - throwing a 'read error on connection' exception. - -OPT_TCP_KEEPALIVE bool Set or disable TCP_KEEPALIVE on the connection. - -OPT_COMPRESSION enum Set an automatic compression algorithm to use when reading/writing - data to Redis. All of the supported compressors are as follows: - - Redis::COMPRESSION_NONE - Redis::COMPRESSION_LZF - Redis::COMPRESSION_LZ4 - Redis::COMPRESSION_ZSTD - - Note: Some of these may not be available depending on how Redis - was compiled. - -OPT_REPLY_LITERAL bool If set to true, PhpRedis will return the literal string Redis returns - for LINE replies (e.g. '+OK'), rather than `true`. - -OPT_COMPRESSION_LEVEL int Set a specific compression level if Redis is compressing data. - -OPT_NULL_MULTIBULK_AS_NULL bool Causes PhpRedis to return `NULL` rather than `false` for NULL MULTIBULK - RESP replies (i.e. `*-1`). - -OPT_BACKOFF_ALGORITHM enum The exponential backoff strategy to use. -OPT_BACKOFF_BASE int The minimum delay between retries when backing off. -OPT_BACKOFF_CAP int The maximum delay between replies when backing off. + @@ -13456,7 +13465,7 @@ Redis::__construct

- + Redis|bool setex(string $key, int $expire, mixed $value) @@ -13515,7 +13524,7 @@ $redis->set('some_key', 60, 'some_value');

- + Redis|bool setnx(string $key, mixed $value) @@ -13585,7 +13594,7 @@ $redis->setnx('existing-key', 'new-value');

- + Redis|bool sismember(string $key, mixed $value) @@ -13646,7 +13655,7 @@ $redis->sismember('myset', 'not-in-set');

- + Redis|bool slaveof(string $host = NULL, int $port = 6379) deprecated @@ -13729,7 +13738,7 @@ Redis::slaveof

- + Redis|bool replicaof(string $host = NULL, int $port = 6379) @@ -13812,7 +13821,7 @@ Redis::slaveof

- + Redis|int|false touch(array|string $key_or_array, string ...$more_keys) @@ -13871,7 +13880,7 @@ had their last modified time reset

- + mixed slowlog(string $operation, int $length = 0) @@ -13943,7 +13952,7 @@ entries, which is configurable.

- + mixed sort(string $key, array|null $options = null) @@ -14018,7 +14027,7 @@ $options = [

- + mixed sort_ro(string $key, array|null $options = null) @@ -14077,7 +14086,7 @@ Redis::sort

- + array sortAsc(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated @@ -14152,7 +14161,7 @@ Redis::sort

- + array sortAscAlpha(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated @@ -14227,7 +14236,7 @@ Redis::sort

- + array sortDesc(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated @@ -14302,7 +14311,7 @@ Redis::sort

- + array sortDescAlpha(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated @@ -14377,7 +14386,7 @@ Redis::sort

- + Redis|int|false srem(string $key, mixed $value, mixed ...$other_values) @@ -14452,7 +14461,7 @@ var_dump($redis->sRem('set1', 'foo', 'bar', 'not-in-the-set'));

- + array|false sscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) @@ -14578,7 +14587,7 @@ Redis::setOption

- + Redis|int|false strlen(string $key) @@ -14637,7 +14646,7 @@ $redis->strlen('string');

- + bool subscribe(array $channels, callable $cb) @@ -14703,7 +14712,7 @@ echo "Subscribe loop ended\n";

- + Redis|bool swapdb(int $src, int $dst) @@ -14807,7 +14816,7 @@ Redis::del

- + Redis|array time() @@ -14861,7 +14870,7 @@ print_r($redis->time());

- + Redis|int|false ttl(string $key) @@ -14924,7 +14933,7 @@ $redis->ttl('not_a_key');

- + Redis|int|false type(string $key) @@ -14985,7 +14994,7 @@ Redis::REDIS_STREAM

- + Redis|array|bool unsubscribe(array $channels) @@ -15128,7 +15137,7 @@ Redis::subscribe

- + Redis|bool unwatch() @@ -15184,7 +15193,7 @@ Redis::watch

- + bool|Redis watch(array|string $key, string ...$other_keys) @@ -15232,7 +15241,7 @@ Redis::watch

- + int|false wait(int $numreplicas, int $timeout) @@ -15291,7 +15300,7 @@ recieving them.

- + int|false xack(string $key, string $group, array $ids) @@ -15344,7 +15353,7 @@ recieving them.

- + Redis|string|false xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false, bool $nomkstream = false) @@ -15456,7 +15465,7 @@ $redis->xRange('ds9-season-1', '1-1', '1-2');

- + Redis|bool|array xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) @@ -15529,7 +15538,7 @@ $redis->xRange('ds9-season-1', '1-1', '1-2');

- + Redis|bool|array xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options) @@ -15597,7 +15606,7 @@ $redis->xRange('ds9-season-1', '1-1', '1-2');

- + Redis|int|false xdel(string $key, array $ids) @@ -15677,7 +15686,7 @@ $redis->xRange('stream', '-', '+');

- + mixed xgroup(string $operation, string $key = null, string $group = null, string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2) @@ -15772,7 +15781,7 @@ cause Redis to also create the STREAM if it doesn't currently exist.

- + mixed xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1) @@ -15847,7 +15856,7 @@ $redis->xInfo('STREAM', 'stream');

- + Redis|int|false xlen(string $key) @@ -15910,7 +15919,7 @@ $redis->xLen('stream');

- + Redis|array|false xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null) @@ -15995,7 +16004,7 @@ acknowledged with XACK.

- + Redis|array|bool xrange(string $key, string $start, string $end, int $count = -1) @@ -16093,7 +16102,7 @@ $redis->xRange('stream', '-', '+');

- + Redis|array|bool xread(array $streams, int $count = -1, int $block = -1) @@ -16196,7 +16205,7 @@ print_r($redis->xRead(['s03' => '3-2', 's04' => '4-1']));<

- + Redis|array|bool xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1) @@ -16298,7 +16307,7 @@ var_dump($msgs);

- + Redis|array|bool xrevrange(string $key, string $end, string $start, int $count = -1) @@ -16402,7 +16411,7 @@ $redis->xRevRange('stream', '+', '-');

- + Redis|int|false xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1) @@ -16529,7 +16538,7 @@ print_r($redis->xRange('stream', '-', '+'));

- + Redis|int|false zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems) @@ -16635,7 +16644,7 @@ print_r($redis->zRange('zs', 0, -1, true));

- + Redis|int|false zCard(string $key) @@ -16697,7 +16706,7 @@ $redis->zCard('zs');

- + Redis|int|false zCount(string $key, string $start, string $end) @@ -16760,7 +16769,7 @@ $redis->zCard('zs');

- + Redis|float|false zIncrBy(string $key, float $value, mixed $member) @@ -16835,7 +16844,7 @@ print_r($redis->zIncrBy('zs', 2.0, 'eggplants'));

- + Redis|int|false zLexCount(string $key, string $min, string $max) @@ -16911,7 +16920,7 @@ $redis->zRangeByLex('captains', '[A', '[S', 2, 2);

- + Redis|array|false zMscore(string $key, mixed $member, mixed ...$other_members) @@ -16997,7 +17006,7 @@ $redis->zMScore('zs', 'one', 'not-a-member');

- + Redis|array|false zPopMax(string $key, int $count = null) @@ -17074,7 +17083,7 @@ print_r($redis->zPopMax('zs', 2));

- + Redis|array|false zPopMin(string $key, int $count = null) @@ -17151,7 +17160,7 @@ $redis->zPopMin('zs', 2);

- + Redis|array|false zRange(string $key, mixed $start, mixed $end, array|bool|null $options = null) @@ -17233,7 +17242,7 @@ $options = [

- + Redis|array|false zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) @@ -17328,7 +17337,7 @@ $redis->zRangeByLex('captains', '[A', '[S', 2, 2);

- + Redis|array|false zRangeByScore(string $key, string $start, string $end, array $options = []) @@ -17444,7 +17453,7 @@ $redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true, 'LIMIT' => [

- + Redis|int|false zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = NULL) @@ -17525,7 +17534,7 @@ it will store them in a destination key provided by the user

- + Redis|string|array zRandMember(string $key, array $options = null) @@ -17596,7 +17605,7 @@ $redis->zRandMember('zs', ['COUNT' => 2, 'WITHSCORES' => true]);

- + Redis|int|false zRank(string $key, mixed $member) @@ -17654,7 +17663,7 @@ $redis->zRandMember('zs', ['COUNT' => 2, 'WITHSCORES' => true]);

- + Redis|int|false zRem(mixed $key, mixed $member, mixed ...$other_members) @@ -17738,7 +17747,7 @@ $redis->zRange('zs', 0, -1);

- + Redis|int|false zRemRangeByLex(string $key, string $min, string $max) @@ -17836,7 +17845,7 @@ print_r($redis->zRange('zs', 0, -1));

- + Redis|int|false zRemRangeByRank(string $key, int $start, int $end) @@ -17914,7 +17923,7 @@ $redis->zRange('zs', 0, -1);

- + Redis|int|false zRemRangeByScore(string $key, string $start, string $end) @@ -17994,7 +18003,7 @@ $redis->zRange('zs', 0, -1);

- + Redis|array|false zRevRange(string $key, int $start, int $end, mixed $scores = null) @@ -18075,7 +18084,7 @@ $redis->zRevRange('zs', 0, -1, ['withscores' => true]);

- + Redis|array|false zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1) @@ -18176,7 +18185,7 @@ $redis->zRevRangeByLex('captains', '[Q', '[J', 1, 2);

- + Redis|array|false zRevRangeByScore(string $key, string $max, string $min, array|bool $options = []) @@ -18272,7 +18281,7 @@ $redis->zRevRangeByScore('oldest-people', '117.5', '-inf', ['LIMIT' => [0,

- + Redis|int|false zRevRank(string $key, mixed $member) @@ -18344,7 +18353,7 @@ $redis->zrevrank('ds9-characters', 'Garak');

- + Redis|float|false zScore(string $key, mixed $member) @@ -18416,7 +18425,7 @@ foreach ($redis->zRange('telescopes', 0, -1) as $name) {

- + Redis|array|false zdiff(array $keys, array $options = null) @@ -18492,7 +18501,7 @@ print_r($redis->zDiff(['primes', 'evens', 'mod3']));

- + Redis|int|false zdiffstore(string $dst, array $keys) @@ -18559,7 +18568,7 @@ Redis::zdiff

- + Redis|array|false zinter(array $keys, array|null $weights = null, array|null $options = null) @@ -18652,7 +18661,7 @@ $redis->zInter(['TNG', 'DS9'], NULL, ['withscores' => true, 'aggregate' =&

- + Redis|int|false zintercard(array $keys, int $limit = -1) @@ -18737,7 +18746,7 @@ Redis::zinter

- + Redis|int|false zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null) @@ -18840,7 +18849,7 @@ print_r($redis->zRange('fruit-max', 0, -1, true));

- + Redis|array|false zscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) @@ -18927,7 +18936,7 @@ Redis::scan

- + Redis|array|false zunion(array $keys, array|null $weights = null, array|null $options = null) @@ -19026,7 +19035,7 @@ $redis->zUnion(['store1', 'store3'], [2, .5], ['withscores' => true, 'aggr

- + Redis|int|false zunionstore(string $dst, array $keys, array|null $weights = NULL, string|null $aggregate = NULL) diff --git a/docs/renderer.index b/docs/renderer.index index e1826a63..97fb749e 100644 --- a/docs/renderer.index +++ b/docs/renderer.index @@ -1 +1 @@ -O:21:"Doctum\Renderer\Index":3:{i:0;a:6:{s:5:"Redis";s:40:"65ebe68ff54586b8953ba135c8c8d5c1208cf563";s:10:"RedisArray";s:40:"fb17c785beccf1dbeedaa48afb4aa7d48fd8b655";s:12:"RedisCluster";s:40:"1783d14c476f95598062edb44dab7284b9b2680d";s:21:"RedisClusterException";s:40:"1783d14c476f95598062edb44dab7284b9b2680d";s:14:"RedisException";s:40:"65ebe68ff54586b8953ba135c8c8d5c1208cf563";s:13:"RedisSentinel";s:40:"4055ace9f1cf20bef89bdb5d3219470b4c8915e6";}i:1;a:1:{i:0;s:7:"develop";}i:2;a:1:{i:0;s:0:"";}} \ No newline at end of file +O:21:"Doctum\Renderer\Index":3:{i:0;a:6:{s:5:"Redis";s:40:"d303f5f87803a7ca760f478c154e5ca8082f29ee";s:10:"RedisArray";s:40:"fb17c785beccf1dbeedaa48afb4aa7d48fd8b655";s:12:"RedisCluster";s:40:"1783d14c476f95598062edb44dab7284b9b2680d";s:21:"RedisClusterException";s:40:"1783d14c476f95598062edb44dab7284b9b2680d";s:14:"RedisException";s:40:"d303f5f87803a7ca760f478c154e5ca8082f29ee";s:13:"RedisSentinel";s:40:"4055ace9f1cf20bef89bdb5d3219470b4c8915e6";}i:1;a:1:{i:0;s:7:"develop";}i:2;a:1:{i:0;s:0:"";}} \ No newline at end of file diff --git a/redis_arginfo.h b/redis_arginfo.h index d11cd333..bb95ce36 100644 --- a/redis_arginfo.h +++ b/redis_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c95a6704d3c51686748694926d6f4b0f55a2f3df */ + * Stub hash: d303f5f87803a7ca760f478c154e5ca8082f29ee */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null") diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index cde9a871..156ed4a9 100644 --- a/redis_legacy_arginfo.h +++ b/redis_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c95a6704d3c51686748694926d6f4b0f55a2f3df */ + * Stub hash: d303f5f87803a7ca760f478c154e5ca8082f29ee */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) -- cgit v1.2.3