diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14e8018e3d..3288d59d63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,13 +186,25 @@ jobs: - name: Wait for ${{ matrix.server }} instances run: | + WAIT_TIMEOUT_SECONDS=30 + for PORT in {6379..6382} {7000..7005} {32767..32768} {26379..26380}; do + START_TIME=$SECONDS until echo PING | ${{ matrix.server }}-cli -p "$PORT" 2>&1 | grep -qE 'PONG|NOAUTH'; do + if (( SECONDS - START_TIME >= WAIT_TIMEOUT_SECONDS )); then + echo "Timed out waiting for ${{ matrix.server }} on port $PORT after ${WAIT_TIMEOUT_SECONDS}s" + exit 1 + fi echo "Still waiting for ${{ matrix.server }} on port $PORT" sleep .5 done done + START_TIME=$SECONDS until echo PING | ${{ matrix.server }}-cli -s /tmp/redis.sock 2>&1 | grep -qE 'PONG|NOAUTH'; do + if (( SECONDS - START_TIME >= WAIT_TIMEOUT_SECONDS )); then + echo "Timed out waiting for ${{ matrix.server }} at /tmp/redis.sock after ${WAIT_TIMEOUT_SECONDS}s" + exit 1 + fi echo "Still waiting for ${{ matrix.server }} at /tmp/redis.sock" sleep .5 done @@ -231,7 +243,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout uses: actions/checkout@v4 @@ -253,49 +265,29 @@ jobs: phpize ./configure --enable-redis-lzf --enable-redis-zstd --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lz4 --with-liblz4 sudo make install + sudo mkdir -p "$(php-config --ini-dir)" echo 'extension = redis.so' | sudo tee -a "$(php-config --ini-dir)/90-redis.ini" windows: - runs-on: windows-latest + runs-on: windows-2022 continue-on-error: false strategy: fail-fast: false matrix: - php: ['8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] ts: [nts, ts] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: true - - name: Install PHP ${{ matrix.php }} - uses: php/setup-php-sdk@v0.10 - id: setup-php-sdk - with: - version: ${{ matrix.php }} - arch: x64 - ts: ${{matrix.ts}} - cache: true - - name: Install dependencies - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - toolset: ${{steps.setup-php-sdk.outputs.toolset}} - name: Build phpredis - run: | - phpize - ./configure --enable-redis --with-prefix=${{steps.setup-php-sdk.outputs.prefix}} - nmake - - name: package - run: | - md binaries - copy LICENSE binaries - Get-ChildItem -Recurse -Filter "php_redis.dll" | ForEach-Object {Copy-Item -Path $_.FullName -Destination "binaries"} - - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: php/php-windows-builder/extension@v1 with: - name: redis-${{matrix.php}}-x64-${{matrix.ts}} - path: binaries + arch: x64 + php-version: ${{ matrix.php }} + ts: ${{ matrix.ts }} + run-tests: false pecl: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index f09ec40423..fa1d633688 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,13 @@ /.idea /.vscode +.cache /docs/.cache .cquery +*.dep *.deps *.libs *.o +*.la *.lo Makefile* configure* @@ -21,3 +24,4 @@ tags compile_commands.json doctum.phar run-tests.php +vendor/ diff --git a/CHANGELOG.md b/CHANGELOG.md index c07b485e06..1815dd32b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All changes to phpredis will be documented in this file. We're basing this format on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and PhpRedis adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# [6.3.0RC1] - 2025-10-15 +# [6.3.0RC1] - 2025-10-15 ([GitHub](https://github.com/phpredis/phpredis/releases/tag/6.3.0RC1), [PECL](https://pecl.php.net/package/redis/6.3.0RC1)) This release introduces support for dozens of new commands, including hash field expiration, Valkey’s DELIFEQ, and Redis vector set operations. It also delivers numerous bug fixes and performance improvements. diff --git a/README.md b/README.md index 944d36ae89..b56b7f539a 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ The best way to support the project is through [GitHub Sponsors](https://github. * [Pub/sub](#pubsub) * [Transactions](#transactions) * [Scripting](#scripting) + * [Local Helper Methods](#local-helper-methods) * [Introspection](#introspection) ## Installing/Configuring @@ -74,7 +75,8 @@ phpredis can be used to store PHP sessions. To do this, configure `session.save_ * weight (integer): the weight of a host is used in comparison with the others to customize the session distribution on several hosts. If host A has twice the weight of host B, it will get twice the amount of sessions. In the example, *host1* stores 20% of all the sessions (1/(1+2+2)) while *host2* and *host3* each store 40% (2/(1+2+2)). The target host is determined once and for all at the start of the session, and doesn't change. The default weight is 1. * timeout (float): the connection timeout to a redis host, expressed in seconds. If the host is unreachable in that amount of time, the session storage will be unavailable for the client. The default timeout is very high (86400 seconds). -* persistent (integer, should be 1 or 0): defines if a persistent connection should be used. +* read_timeout (float): the timeout for read operations on an established connection, expressed in seconds. If a Redis response is not received within this time, the session operation fails. The default is `0` (no timeout), meaning PHP can hang indefinitely if Redis becomes unresponsive or a connection goes stale. Setting this to a low value (e.g. `2.5`) is strongly recommended in production environments. +* persistent (integer, should be 1 or 0): defines if a persistent connection should be used. The default value is `0` (persistent connection is not used). * prefix (string, defaults to "PHPREDIS_SESSION:"): used as a prefix to the Redis key in which the session is stored. The key is composed of the prefix followed by the session ID. * auth (string, or an array with one or two elements): used to authenticate with the server prior to sending commands. * database (integer): selects a different database. @@ -161,7 +163,7 @@ php tests/TestRedis.php --class Redis --test echo ## API Documentation -The [API Documentation](https://phpredis.github.io/phpredis) are a work in progress, but will eventually replace our **ONE README TO RULE THEM ALL** docs. +The [API Documentation](https://phpredis.github.io/phpredis) are a work in progress, but will eventually replace our **ONE README TO RULE THEM ALL** docs. ## Classes and methods @@ -204,15 +206,15 @@ $redis = new Redis([ ###### *Parameters* (optional) -*host*: string, the hostname/FQDN/IP address or the path to a unix domain socket; since v5.0.0 it is possible to specify schema -*port*: int, actual port (e.g. `6379`) or `-1` (or `0`) for unix domain socket; setting to < `0` with non-UDS will assume default of `6379` -*connectTimeout*: float, value in seconds (default is 0 meaning unlimited) -*retryInterval*: int, value in milliseconds (optional) -*readTimeout*: float, value in seconds (default is 0 meaning unlimited) +*host*: string, the hostname/FQDN/IP address or the path to a unix domain socket; since v5.0.0 it is possible to specify schema +*port*: int, actual port (e.g. `6379`) or `-1` (or `0`) for unix domain socket; setting to < `0` with non-UDS will assume default of `6379` +*connectTimeout*: float, value in seconds (default is 0 meaning unlimited) +*retryInterval*: int, value in milliseconds (optional) +*readTimeout*: float, value in seconds (default is 0 meaning unlimited) *persistent*: mixed, If the value is a string it is used as a persistent ID. Non-strings are cast to boolean. *auth*: mixed, authentication information *database*: int, database number -*ssl*: array, SSL context options +*ssl*: array, SSL context options #### Class RedisException ----- @@ -231,11 +233,11 @@ Redis::REDIS_SET - Set Redis::REDIS_LIST - List Redis::REDIS_ZSET - Sorted set Redis::REDIS_HASH - Hash +Redis::REDIS_STREAM - Stream +Redis::REDIS_VECTORSET - Vector set Redis::REDIS_NOT_FOUND - Not found / other ~~~ -@TODO: OPT_SERIALIZER, AFTER, BEFORE,... - ### Connection 1. [connect, open](#connect-open) - Connect to a server @@ -251,21 +253,21 @@ Redis::REDIS_NOT_FOUND - Not found / other #### connect, open ----- -_**Description**_: Connects to a Redis instance. +_**Description**_: Connects to a Redis instance. If phpredis cannot reach the server it will usually throw a [`RedisException`](#class-redisexception); only rarely will `FALSE` be returned without an exception. ###### *Parameters* -*host*: string, *host*: string, the hostname/FQDN/IP address or the path to a unix domain socket; since v5.0.0 it is possible to specify schema -*port*: int, actual port (e.g. `6379`) or `-1` (or `0`) for unix domain socket; setting to < `0` with non-UDS will assume default of `6379`, optional -*timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) -*reserved*: should be '' if retry_interval is specified -*retry_interval*: int, value in milliseconds, optional -*read_timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) -*others*: array, with PhpRedis >= 5.3.0, it allows setting _auth_ and [_stream_](https://www.php.net/manual/en/context.ssl.php) configuration. +*host*: string, *host*: string, the hostname/FQDN/IP address or the path to a unix domain socket; since v5.0.0 it is possible to specify schema +*port*: int, actual port (e.g. `6379`) or `-1` (or `0`) for unix domain socket; setting to < `0` with non-UDS will assume default of `6379`, optional +*timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) +*reserved*: should be '' if retry_interval is specified +*retry_interval*: int, value in milliseconds, optional +*read_timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) +*others*: array, with PhpRedis >= 5.3.0, it allows setting _auth_ and [_stream_](https://www.php.net/manual/en/context.ssl.php) configuration. ###### *Return value* -*BOOL*: `TRUE` on success, `FALSE` on error. +*BOOL*: `TRUE` on success. Failures typically raise a `RedisException`, though in some edge cases `FALSE` may be returned instead. ###### *Example* @@ -281,8 +283,43 @@ $redis->connect('/tmp/redis.sock', 0, 1.5, NULL, 0, 1.5); // Unix socket with 1. /* With PhpRedis >= 5.3.0 you can specify authentication and stream information on connect */ $redis->connect('127.0.0.1', 6379, 1, '', 0, 0, ['auth' => ['phpredis', 'phpredis']]); + +/* TLS connections can customise the underlying PHP stream context */ +$redis->connect('tls://redis.example.com', 6380, 1.5, null, 0, 0, [ + 'auth' => ['app-user', 'strong-password'], + 'stream' => [ + 'verify_peer' => true, // validate the server certificate against cafile/capath + 'verify_peer_name' => true, // require the certificate common/SAN name to match peer_name + 'peer_name' => 'redis.example.com', // expected hostname presented by the server certificate + 'cafile' => '/etc/ssl/redis-ca.pem', // CA or bundle used to trust the server certificate + 'capath' => '/etc/ssl/certs', // directory alternative to cafile + 'allow_self_signed' => false, // set to true if you rely on a self-signed certificate + 'local_cert' => '/etc/ssl/client.crt', // client certificate for mutual TLS (optional) + 'local_pk' => '/etc/ssl/client.key', // private key that matches local_cert (optional) + 'passphrase' => 'secret', // passphrase for local_pk if it is encrypted (optional) + 'ciphers' => 'HIGH:!aNULL:!MD5', // TLS cipher list provided to OpenSSL (optional) + ], +]); + +try { + $redis->connect('redis.invalid', 6379); +} catch (RedisException $ex) { + echo "Connection failed: {$ex->getMessage()}"; +} ~~~ +When you pass a `stream` key PhpRedis forwards the options to [`stream_socket_client`](https://www.php.net/manual/en/context.ssl.php). +Commonly used options include: + +- `verify_peer`, `verify_peer_name`, `peer_name`: control server certificate validation behaviour. +- `cafile`/`capath`: provide the trusted certificate authority bundle when the default store is insufficient. +- `allow_self_signed`: permits self-signed certificates when set to `true`. +- `local_cert`, `local_pk`, `passphrase`: configure client-side certificates for mutual TLS. +- `ciphers`: restrict the negotiated TLS cipher suites. +- Any other SSL context option supported by PHP (e.g. `SNI_enabled`, `disable_compression`) can also be supplied. + +The same array format can be used with `pconnect`/`popen`. + **Note:** `open` is an alias for `connect` and will be removed in future versions of phpredis. #### pconnect, popen @@ -303,12 +340,12 @@ persistent equivalents. ###### *Parameters* -*host*: string, *host*: string, the hostname/FQDN/IP address or the path to a unix domain socket; since v5.0.0 it is possible to specify schema -*port*: int, actual port (e.g. `6379`) or `-1` (or `0`) for unix domain socket; setting to < `0` with non-UDS will assume default of `6379`, optional -*timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) -*persistent_id*: string. identity for the requested persistent connection -*retry_interval*: int, value in milliseconds (optional) -*read_timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) +*host*: string, *host*: string, the hostname/FQDN/IP address or the path to a unix domain socket; since v5.0.0 it is possible to specify schema +*port*: int, actual port (e.g. `6379`) or `-1` (or `0`) for unix domain socket; setting to < `0` with non-UDS will assume default of `6379`, optional +*timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) +*persistent_id*: string. identity for the requested persistent connection +*retry_interval*: int, value in milliseconds (optional) +*read_timeout*: float, value in seconds (optional, default is 0 meaning it will use default_socket_timeout) ###### *Return value* @@ -371,18 +408,18 @@ See method for example: [move](#move) #### swapdb ----- -_**Description**_: Swap one Redis database with another atomically +_**Description**_: Swap one Redis database with another atomically -###### *Parameters* -*INTEGER*: db1 -*INTEGER*: db2 +###### *Parameters* +*INTEGER*: db1 +*INTEGER*: db2 -###### *Return value* +###### *Return value* `TRUE` on success and `FALSE` on failure. *Note*: Requires Redis >= 4.0.0 -###### *Example* +###### *Example* ~~~php $redis->swapdb(0, 1); /* Swaps DB 0 with DB 1 atomically */ ~~~ @@ -404,7 +441,7 @@ None. _**Description**_: Set client option. ###### *Parameters* -*parameter name* +*parameter name* *parameter value* ###### *Return value* @@ -448,7 +485,7 @@ Parameter value. ###### *Example* ~~~php -// return Redis::SERIALIZER_NONE, Redis::SERIALIZER_PHP, +// return Redis::SERIALIZER_NONE, Redis::SERIALIZER_PHP, // Redis::SERIALIZER_IGBINARY, Redis::SERIALIZER_MSGPACK or Redis::SERIALIZER_JSON $redis->getOption(Redis::OPT_SERIALIZER); ~~~ @@ -536,6 +573,8 @@ $redis->setOption(Redis::OPT_BACKOFF_CAP, 750); // backoff time capped at 750ms 1. [info](#info) - Get information and statistics about the server 1. [lastSave](#lastsave) - Get the timestamp of the last disk save 1. [save](#save) - Synchronously save the dataset to disk (wait to complete) +1. [wait](#wait) - Block until write acknowledgements from replicas +1. [waitaof](#waitaof) - Wait for local AOF fsync and replica acknowledgements 1. [slaveOf](#slaveof) - Make the server a slave of another instance, or promote it to master 1. [time](#time) - Return the current server time 1. [slowLog](#slowlog) - Access the Redis slowLog entries @@ -597,7 +636,7 @@ $redis->config(string $operation, string|array|null $key = NULL, ?string $value ~~~ ###### *Return value* -*Associative array* for `GET`, key(s) -> value(s) +*Associative array* for `GET`, key(s) -> value(s) *bool* for `SET`, `RESETSTAT`, and `REWRITE` ###### *Examples* @@ -721,6 +760,48 @@ None. $redis->save(); ~~~ +#### wait +----- +_**Description**_: Block the client until a specified number of replicas acknowledge the most recent write or until the timeout elapses. + +###### *Parameters* +*numreplicas* (int): The number of replicas that must confirm the write. +*timeout* (int): Maximum time to wait in milliseconds (`0` to wait indefinitely). + +###### *Return value* +*INT*: The number of replicas that acknowledged the write before timing out, or `FALSE` on error. + +###### *Example* +~~~php +$redis->set('user:1', 'marco'); +$confirmed = $redis->wait(1, 500); + +if ($confirmed < 1) { + // Handle the case where the write was not replicated in time. +} +~~~ + +#### waitaof +----- +_**Description**_: Block until Redis has durably written recent changes to the local AOF file the requested number of times and received acknowledgements from the requested number of replicas (Redis >= 7.2). + +###### *Parameters* +*numlocal* (int): Minimum number of local AOF fsync operations to wait for. +*numreplicas* (int): Number of replicas that must acknowledge the write. +*timeout* (int): Maximum time to wait in milliseconds (`0` to wait indefinitely). + +###### *Return value* +*ARRAY*: Two integers, where element `0` is the number of local fsync operations performed and element `1` is the number of replica acknowledgements, or `FALSE` on error. + +###### *Example* +~~~php +[$local, $replicas] = $redis->waitaof(1, 1, 1000); + +if ($local < 1 || $replicas < 1) { + // The write was not persisted or replicated as requested. +} +~~~ + #### slaveOf ----- _**Description**_: Changes the slave status @@ -759,7 +840,7 @@ $redis->time(); _**Description**_: Access the Redis slowLog ###### *Parameters* -*Operation* (string): This can be either `GET`, `LEN`, or `RESET` +*Operation* (string): This can be either `GET`, `LEN`, or `RESET` *Length* (integer), optional: If executing a `SLOWLOG GET` command, you can pass an optional length. ##### @@ -854,7 +935,7 @@ $redis->get('key'); _**Description**_: Get the value related to the specified key and set its expiration ###### *Parameters* -*key* +*key* *options array* (optional) with the following keys: * `EX` - expire time in seconds * `PX` - expire time in milliseconds @@ -876,9 +957,9 @@ $redis->getEx('key', ['EX' => 10]); // get key and set its expiration to 10 seco _**Description**_: Set the string value in argument as value of the key. If you're using Redis >= 2.6.12, you can pass extended options as explained below ###### *Parameters* -*Key* -*Value* -*Timeout or Options Array* (optional). If you pass an integer, phpredis will redirect to SETEX, and will try to use Redis >= 2.6.12 extended options if you pass an array with valid values +*Key* +*Value* +*Timeout or Options Array* (optional). If you pass an integer, phpredis will redirect to SETEX, and will try to use Redis >= 2.6.12 extended options if you pass an array with valid values ###### *Return value* *Bool* `TRUE` if the command is successful. @@ -904,9 +985,9 @@ $redis->set('key', 'value', ['xx', 'px'=>1000]); _**Description**_: Set the string value in argument as value of the key, with a time to live. PSETEX uses a TTL in milliseconds. ###### *Parameters* -*Key* -*TTL* -*Value* +*Key* +*TTL* +*Value* ###### *Return value* *Bool* `TRUE` if the command is successful, `FALSE` in case of failure. @@ -923,8 +1004,8 @@ $redis->pSetEx('key', 100, 'value'); // sets key → value, with 0.1 sec TTL. _**Description**_: Set the string value in argument as value of the key if the key doesn't already exist in the database. ###### *Parameters* -*Key* -*Value* +*Key* +*Value* ###### *Return value* *Bool* `TRUE` if the command is successful, `FALSE` in case of failure. @@ -992,7 +1073,7 @@ $redis->exists('foo', 'bar', 'baz'); /* 3 */ _**Description**_: Increment the number stored at key by one. If the second argument is filled, it will be used as the integer value of the increment. ###### *Parameters* -*key* +*key* *value*: value that will be added to key (only for incrBy) ###### *Return value* @@ -1018,7 +1099,7 @@ $redis->incrBy('key1', 10); /* 24 */ _**Description**_: Increment the key with floating point precision. ###### *Parameters* -*key* +*key* *value*: (float) value that will be added to the key ###### *Return value* @@ -1039,7 +1120,7 @@ $redis->incrByFloat('key1', 2.5); /* 4 */ _**Description**_: Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer value of the decrement. ###### *Parameters* -*key* +*key* *value*: value that will be subtracted to key (only for decrBy) ###### *Return value* @@ -1286,12 +1367,12 @@ _**Description**_: Returns the type of data pointed by a given key. ###### *Return value* -Depending on the type of the data pointed by the key, this method will return the following value: -string: Redis::REDIS_STRING -set: Redis::REDIS_SET -list: Redis::REDIS_LIST -zset: Redis::REDIS_ZSET -hash: Redis::REDIS_HASH +Depending on the type of the data pointed by the key, this method will return the following value: +string: Redis::REDIS_STRING +set: Redis::REDIS_SET +list: Redis::REDIS_LIST +zset: Redis::REDIS_ZSET +hash: Redis::REDIS_HASH other: Redis::REDIS_NOT_FOUND ###### *Example* @@ -1322,8 +1403,8 @@ $redis->get('key'); /* 'value1value2' */ _**Description**_: Return a substring of a larger string ###### *Parameters* -*key* -*start* +*key* +*start* *end* ###### *Return value* @@ -1376,7 +1457,7 @@ $redis->strlen('key'); /* 5 */ _**Description**_: Return a single bit out of a larger string ###### *Parameters* -*key* +*key* *offset* ###### *Return value* @@ -1394,8 +1475,8 @@ $redis->getBit('key', 1); /* 1 */ _**Description**_: Changes a single bit of a string. ###### *Parameters* -*key* -*offset* +*key* +*offset* *value*: bool or int (1 or 0) ###### *Return value* @@ -1414,9 +1495,9 @@ $redis->get('key'); /* chr(0x2f) = "/" = b("0010 1111") */ _**Description**_: Bitwise operation on multiple keys. ###### *Parameters* -*operation*: either "AND", "OR", "NOT", "XOR" -*ret_key*: return key -*key1* +*operation*: either "AND", "OR", "NOT", "XOR" +*ret_key*: return key +*key1* *key2...* ###### *Return value* @@ -1541,8 +1622,8 @@ $val = $redis->dump('foo'); // $val will be the Redis encoded key value ----- _**Description**_: Restore a key from the result of a DUMP operation. ###### *Parameters* -*key* string. The key name -*ttl* integer. How long the key should live (if zero, no expire will be set on the key) +*key* string. The key name +*ttl* integer. How long the key should live (if zero, no expire will be set on the key) *value* string (binary). The Redis encoded key value (from DUMP) ###### *Examples* ~~~php @@ -1559,13 +1640,13 @@ _**Description**_: Migrates a key to a different Redis instance. that version to call `migrate` with an array of keys. ###### *Parameters* -*host* string. The destination host -*port* integer. The TCP port to connect to. -*key(s)* string or array. -*destination-db* integer. The target DB. -*timeout* integer. The maximum amount of time given to this transfer. -*copy* boolean, optional. Should we send the COPY flag to redis. -*replace* boolean, optional. Should we send the REPLACE flag to redis +*host* string. The destination host +*port* integer. The TCP port to connect to. +*key(s)* string or array. +*destination-db* integer. The target DB. +*timeout* integer. The maximum amount of time given to this transfer. +*copy* boolean, optional. Should we send the COPY flag to redis. +*replace* boolean, optional. Should we send the REPLACE flag to redis ###### *Examples* ~~~php $redis->migrate('backup', 6379, 'foo', 0, 3600); @@ -1600,8 +1681,8 @@ $redis->migrate('backup', 6379, ['key1', 'key2', 'key3'], 0, 3600); ----- _**Description**_: Adds a value to the hash stored at key. ###### *Parameters* -*key* -*hashKey* +*key* +*hashKey* *value* ###### *Return value* @@ -1635,11 +1716,11 @@ $redis->hSetNx('h', 'key1', 'world'); /* FALSE, 'key1' => 'hello' in the hash at ----- _**Description**_: Gets a value from the hash stored at key. If the hash table doesn't exist, or the key doesn't exist, `FALSE` is returned. ###### *Parameters* -*key* +*key* *hashKey* ###### *Return value* -*STRING* The value, if the command executed successfully +*STRING* The value, if the command executed successfully *BOOL* `FALSE` in case of failure @@ -1663,9 +1744,9 @@ $redis->hLen('h'); /* returns 2 */ ----- _**Description**_: Removes a value from the hash stored at key. If the hash table doesn't exist, or the key doesn't exist, `FALSE` is returned. ###### *Parameters* -*key* -*hashKey1* -*hashKey2* +*key* +*hashKey1* +*hashKey2* ... ###### *Return value* @@ -1781,7 +1862,7 @@ The order is random and corresponds to redis' own internal representation of the ----- _**Description**_: Verify if the specified member exists in a key. ###### *Parameters* -*key* +*key* *memberKey* ###### *Return value* *BOOL*: If the member exists in the hash table, return `TRUE`, otherwise return `FALSE`. @@ -1796,8 +1877,8 @@ $redis->hExists('h', 'NonExistingKey'); /* FALSE */ ----- _**Description**_: Increments the value of a member from a hash by a given amount. ###### *Parameters* -*key* -*member* +*key* +*member* *value*: (integer) value that will be added to the member's value ###### *Return value* *LONG* the new value @@ -1812,8 +1893,8 @@ $redis->hIncrBy('h', 'x', 1); /* h[x] ← 2 + 1. Returns 3 */ ----- _**Description**_: Increments the value of a hash member by the provided float value ###### *Parameters* -*key* -*member* +*key* +*member* *value*: (float) value that will be added to the member's value ###### *Return value* *FLOAT* the new value @@ -1829,7 +1910,7 @@ $redis->hIncrByFloat('h', 'x', -3.0); /* returns 0.0: h[x] = 0.0 now */ ----- _**Description**_: Fills in a whole hash. Non-string values are converted to string, using the standard `(string)` cast. NULL values are stored as empty strings. ###### *Parameters* -*key* +*key* *members*: key → value array ###### *Return value* *BOOL* @@ -1844,7 +1925,7 @@ $redis->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now. ----- _**Description**_: Retrieve the values associated to the specified fields in the hash. ###### *Parameters* -*key* +*key* *memberKeys* Array ###### *Return value* *Array* An array of elements, the values of the specified fields in the hash, with the hash keys as array keys. @@ -1860,9 +1941,9 @@ $redis->hMGet('h', ['field1', 'field2']); /* returns ['field1' => 'value1', 'fie ----- _**Description**_: Scan a HASH value for members, with an optional pattern and count ###### *Parameters* -*key*: String -*iterator*: Long (reference) -*pattern*: Optional pattern to match against +*key*: String +*iterator*: Long (reference) +*pattern*: Optional pattern to match against *count*: How many keys to return in a go (only a suggestion to Redis) ###### *Return value* *Array* An array of members that match our pattern @@ -1883,7 +1964,7 @@ while($arr_keys = $redis->hScan('hash', $it)) { ----- _**Description**_: Get the string length of the value associated with field in the hash stored at key. ###### *Parameters* -*key*: String +*key*: String *field*: String ###### *Return value* *LONG* the string length of the value associated with field, or zero when field is not present in the hash or key does not exist at all. @@ -1913,14 +1994,14 @@ _**Description**_: Is a blocking lPop(rPop) primitive. If at least one of the li If all the list identified by the keys passed in arguments are empty, blPop will block during the specified timeout until an element is pushed to one of those lists. This element will be popped. ###### *Parameters* -*ARRAY* Array containing the keys of the lists -*INTEGER* Timeout -Or -*STRING* Key1 -*STRING* Key2 -*STRING* Key3 -... -*STRING* Keyn +*ARRAY* Array containing the keys of the lists +*INTEGER* Timeout +Or +*STRING* Key1 +*STRING* Key2 +*STRING* Key3 +... +*STRING* Keyn *INTEGER* Timeout ###### *Return value* @@ -1959,8 +2040,8 @@ $redis->lPush('key1', 'A'); _**Description**_: A blocking version of `rPopLPush`, with an integral timeout in the third parameter. ###### *Parameters* -*Key*: srckey -*Key*: dstkey +*Key*: srckey +*Key*: dstkey *Long*: timeout ###### *Return value* @@ -1970,17 +2051,17 @@ _**Description**_: A blocking version of `rPopLPush`, with an integral timeout i ----- _**Description**_: Return the specified element of the list stored at the specified key. -0 the first element, 1 the second ... +0 the first element, 1 the second ... -1 the last element, -2 the penultimate ... Return `FALSE` in case of a bad index or a key that doesn't point to a list. ###### *Parameters* -*key* +*key* *index* ###### *Return value* -*String* the element at this index +*String* the element at this index *Bool* `FALSE` if the key identifies a non-string data type, or no value corresponds to this index in the list `Key`. ###### *Example* @@ -2001,9 +2082,9 @@ The parameter options specify the position of the insert (before or after). If the list didn't exists, or the pivot didn't exists, the value is not inserted. ###### *Parameters* -*key* -*position* Redis::BEFORE | Redis::AFTER -*pivot* +*key* +*position* Redis::BEFORE | Redis::AFTER +*pivot* *value* ###### *Return value* @@ -2035,7 +2116,7 @@ _**Description**_: Return and remove the first element of the list. *key* ###### *Return value* -*STRING* if command executed successfully +*STRING* if command executed successfully *BOOL* `FALSE` in case of failure (empty list) ###### *Example* @@ -2075,7 +2156,7 @@ $redis->lPush('key1', 'C', 'B', 'A'); // Returns 6 _**Description**_: Adds the string value to the head (left) of the list if the list exists. ###### *Parameters* -*key* +*key* *value* String, value to push in key ###### *Return value* @@ -2093,13 +2174,13 @@ $redis->lPushx('key1', 'C'); // returns 3 #### lRange ----- -_**Description**_: Returns the specified elements of the list stored at the specified key in the range [start, end]. start and stop are interpreted as indices: -0 the first element, 1 the second ... +_**Description**_: Returns the specified elements of the list stored at the specified key in the range [start, end]. start and stop are interpreted as indices: +0 the first element, 1 the second ... -1 the last element, -2 the penultimate ... ###### *Parameters* -*key* -*start* +*key* +*start* *end* ###### *Return value* @@ -2120,12 +2201,12 @@ _**Description**_: Removes the first `count` occurrences of the value element fr **Note**: The argument order is not the same as in the Redis documentation. This difference is kept for compatibility reasons. ###### *Parameters* -*key* -*value* +*key* +*value* *count* ###### *Return value* -*LONG* the number of elements to remove +*LONG* the number of elements to remove *BOOL* `FALSE` if the value identified by key is not a list. ###### *Example* @@ -2146,8 +2227,8 @@ $redis->lRange('key1', 0, -1); /* ['C', 'B', 'A'] */ _**Description**_: Set the list at index with the new value. ###### *Parameters* -*key* -*index* +*key* +*index* *value* ###### *Return value* @@ -2168,12 +2249,12 @@ $redis->lindex('key1', 0); /* 'X' */ _**Description**_: Trims an existing list so that it will contain only a specified range of elements. ###### *Parameters* -*key* -*start* +*key* +*start* *stop* ###### *Return value* -*Array* +*Array* *Bool* return `FALSE` if the key identify a non-list value. ###### *Example* @@ -2194,7 +2275,7 @@ _**Description**_: Returns and removes the last element of the list. *key* ###### *Return value* -*STRING* if command executed successfully +*STRING* if command executed successfully *BOOL* `FALSE` in case of failure (empty list) ###### *Example* @@ -2210,7 +2291,7 @@ $redis->rPop('key1'); /* key1 => [ 'A', 'B' ] */ _**Description**_: Pops a value from the tail of a list, and pushes it to the front of another list. Also return this value. (redis >= 1.1) ###### *Parameters* -*Key*: srckey +*Key*: srckey *Key*: dstkey ###### *Return value* @@ -2275,7 +2356,7 @@ $redis->rPush('key1', 'D', 'E', 'F'); // returns 6 _**Description**_: Adds the string value to the tail (right) of the list if the list exists. `FALSE` in case of Failure. ###### *Parameters* -*key* +*key* *value* String, value to push in key ###### *Return value* @@ -2301,7 +2382,7 @@ If the list didn't exist or is empty, the command returns 0. If the data type id *Key* ###### *Return value* -*LONG* The size of the list identified by Key exists. +*LONG* The size of the list identified by Key exists. *BOOL* `FALSE` if the data type identified by Key is not list ###### *Example* @@ -2337,7 +2418,7 @@ $redis->lLen('key1');/* 2 */ ----- _**Description**_: Adds a value to the set value stored at key. ###### *Parameters* -*key* +*key* *value* ###### *Return value* @@ -2522,7 +2603,7 @@ array(2) { ----- _**Description**_: Checks if `value` is a member of the set stored at the key `key`. ###### *Parameters* -*key* +*key* *value* ###### *Return value* @@ -2574,8 +2655,8 @@ The order is random and corresponds to redis' own internal representation of the ----- _**Description**_: Moves the specified member from the set at srcKey to the set at dstKey. ###### *Parameters* -*srcKey* -*dstKey* +*srcKey* +*dstKey* *member* ###### *Return value* *BOOL* If the operation is successful, return `TRUE`. If the srcKey and/or dstKey didn't exist, and/or the member didn't exist in srcKey, `FALSE` is returned. @@ -2595,13 +2676,13 @@ $redis->sMove('key1', 'key2', 'member13'); /* 'key1' => {'member11', 'member12' ----- _**Description**_: Removes and returns a random element from the set value at Key. ###### *Parameters* -*key* +*key* *count*: Integer, optional ###### *Return value (without count argument)* -*String* "popped" value +*String* "popped" value *Bool* `FALSE` if set identified by key is empty or doesn't exist. ###### *Return value (with count argument)* -*Array*: Member(s) returned or an empty array if the set doesn't exist +*Array*: Member(s) returned or an empty array if the set doesn't exist *Bool*: `FALSE` on error if the key is not a set ###### *Example* ~~~php @@ -2620,7 +2701,7 @@ $redis->sPop('key2', 3); /* Will return all members but in no particular order * ----- _**Description**_: Returns a random element from the set value at Key, without removing it. ###### *Parameters* -*key* +*key* *count* (Integer, optional) ###### *Return value* If no count is provided, a random *String* value from the set will be returned. If a count @@ -2649,7 +2730,7 @@ $redis->sRandMember('not-a-set', 100); // Will return FALSE ----- _**Description**_: Removes the specified member from the set value stored at key. ###### *Parameters* -*key* +*key* *member* ###### *Return value* *LONG* The number of elements removed from the set. @@ -2751,9 +2832,9 @@ array(4) { _**Description**_: Scan a set for members ###### *Parameters* -*Key*: The set to search -*iterator*: LONG (reference) to the iterator as we go -*pattern*: String, optional pattern to match against +*Key*: The set to search +*iterator*: LONG (reference) to the iterator as we go +*pattern*: String, optional pattern to match against *count*: How many members to return at a time (Redis might return a different amount) ###### *Return value* @@ -2850,7 +2931,7 @@ $redis->zAdd($key, [ $options ,] $score, $value [, $score1, $value1, ...]); ###### *Parameters* *key*: string *options*: array (optional) -*score*: double +*score*: double *value*: string *score1*: double *value1*: string @@ -2892,8 +2973,8 @@ $redis->zCard('key'); /* 3 */ _**Description**_: Returns the *number* of elements of the sorted set stored at the specified key which have scores in the range [start,end]. Adding a parenthesis before `start` or `end` excludes it from the range. +inf and -inf are also valid limits. ###### *Parameters* -*key* -*start*: string +*key* +*start*: string *end*: string ###### *Return value* @@ -2914,7 +2995,7 @@ _**Description**_: Computes the difference between the first and all successive The second argument is a set of options. It can define `WITHSCORES` so that the scores are returned as well. ###### *Parameters* -*arrayZSetKeys* +*arrayZSetKeys* *arrayOptions* One option is available: `withscores => TRUE`. ###### *Return value* @@ -2948,8 +3029,8 @@ $redis->zDiff(['k3', 'k2', 'k1']); /* ['val4'] */ _**Description**_: Computes the difference between the first and all successive input sorted sets in the second argument. The result of the difference will be stored in the sorted set defined by the first argument. ###### *Parameters* -*keyOutput* -*arrayZSetKeys* +*keyOutput* +*arrayZSetKeys* ###### *Return value* *LONG* The number of values in the new sorted set. @@ -2981,8 +3062,8 @@ $redis->zdiffstore('ko4', ['k3', 'k2', 'k1']); /* 1, 'k04' => ['val4'] */ _**Description**_: Increments the score of a member from a sorted set by a given amount. ###### *Parameters* -*key* -*value*: (double) value that will be added to the member's score +*key* +*value*: (double) value that will be added to the member's score *member* ###### *Return value* @@ -3004,8 +3085,8 @@ The second optional argument defines `weights` to apply to the sorted sets in in The third argument is a set of options. It can define the `AGGREGATE` option which specify how the results of the intersection are aggregated. It can also define `WITHSCORES` so that the scores are returned as well. ###### *Parameters* -*arrayZSetKeys* -*arrayWeights* +*arrayZSetKeys* +*arrayWeights* *arrayOptions* Two options are available: `withscores => TRUE`, and `aggregate => $behaviour`. Either "SUM", "MIN", or "MAX" defines the behaviour to use on duplicate entries during the zinter. ###### *Return value* @@ -3040,9 +3121,9 @@ The third optional argument defines `weights` to apply to the sorted sets in inp The forth argument defines the `AGGREGATE` option which specify how the results of the intersection are aggregated. ###### *Parameters* -*keyOutput* -*arrayZSetKeys* -*arrayWeights* +*keyOutput* +*arrayZSetKeys* +*arrayWeights* *aggregateFunction* Either "SUM", "MIN", or "MAX": defines the behaviour to use on duplicate entries during the zinterstore. ###### *Return value* @@ -3079,7 +3160,7 @@ $redis->zinterstore('ko4', ['k1', 'k2'], [1, 5], 'max'); /* 2, 'ko4' => ['val3', _**Description**_: Returns the scores of the given members in the specified sorted set. ###### *Parameters* -*key* +*key* *members*: member1, member2, ... , memberN: Any number of members in the specified sorted set. ###### *Return value* @@ -3122,14 +3203,14 @@ $redis->zPopMax('zs1', 5); ----- _**Description**_: Returns a range of elements from the ordered set stored at the specified key, with values in the range [start, end]. -Start and stop are interpreted as zero-based indices: -`0` the first element, `1` the second ... -`-1` the last element, `-2` the penultimate ... +Start and stop are interpreted as zero-based indices: +`0` the first element, `1` the second ... +`-1` the last element, `-2` the penultimate ... ###### *Parameters* *key* -*start*: long -*end*: long +*start*: long +*end*: long *withscores*: bool = false ###### *Return value* @@ -3151,9 +3232,9 @@ $redis->zRange('key1', 0, -1, true); /* ['val0' => 0, 'val2' => 2, 'val10' => 10 _**Description**_: Returns the elements of the sorted set stored at the specified key which have scores in the range [start,end]. Adding a parenthesis before `start` or `end` excludes it from the range. +inf and -inf are also valid limits. zRevRangeByScore returns the same items in reverse order, when the `start` and `end` parameters are swapped. ###### *Parameters* -*key* -*start*: string -*end*: string +*key* +*start*: string +*end*: string *options*: array Two options are available: `withscores => TRUE`, and `limit => [$offset, $count]` @@ -3178,10 +3259,10 @@ $redis->zRangeByScore('key', '-inf', '+inf', ['withscores' => TRUE]); /* ['val0' _**Description**_: Returns a lexicographical range of members in a sorted set, assuming the members have the same score. The min and max values are required to start with '(' (exclusive), '[' (inclusive), or be exactly the values '-' (negative inf) or '+' (positive inf). The command must be called with either three *or* five arguments or will return FALSE. ###### *Parameters* -*key*: The ZSET you wish to run against -*min*: The minimum alphanumeric value you wish to get -*max*: The maximum alphanumeric value you wish to get -*offset*: Optional argument if you wish to start somewhere other than the first element. +*key*: The ZSET you wish to run against +*min*: The minimum alphanumeric value you wish to get +*max*: The maximum alphanumeric value you wish to get +*offset*: Optional argument if you wish to start somewhere other than the first element. *limit*: Optional argument if you wish to limit the number of elements returned. ###### *Return value* @@ -3202,7 +3283,7 @@ $redis->zRangeByLex('key','-','[c',1,2) /* ['b','c'] */ _**Description**_: Returns the rank of a given member in the specified sorted set, starting at 0 for the item with the smallest score. zRevRank starts at 0 for the item with the *largest* score. ###### *Parameters* -*key* +*key* *member* ###### *Return value* @@ -3242,8 +3323,8 @@ $redis->zRem('key', 'val0', 'val1', 'val2'); // Returns: 3 _**Description**_: Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. ###### *Parameters* -*key* -*start*: LONG +*key* +*start*: LONG *end*: LONG ###### *Return value* @@ -3263,8 +3344,8 @@ $redis->zRange('key', 0, -1, ['withscores' => TRUE]); /* ['three' => 3] */ _**Description**_: Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end]. ###### *Parameters* -*key* -*start*: double or "+inf" or "-inf" string +*key* +*start*: double or "+inf" or "-inf" string *end*: double or "+inf" or "-inf" string ###### *Return value* @@ -3280,14 +3361,14 @@ $redis->zRemRangeByScore('key', 0, 3); /* 2 */ #### zRevRange ----- -_**Description**_: Returns the elements of the sorted set stored at the specified key in the range [start, end] in reverse order. start and stop are interpreted as zero-based indices: -`0` the first element, `1` the second ... +_**Description**_: Returns the elements of the sorted set stored at the specified key in the range [start, end] in reverse order. start and stop are interpreted as zero-based indices: +`0` the first element, `1` the second ... `-1` the last element, `-2` the penultimate ... ###### *Parameters* -*key* -*start*: long -*end*: long +*key* +*start*: long +*end*: long *withscores*: bool = false ###### *Return value* @@ -3309,7 +3390,7 @@ $redis->zRevRange('key', 0, -1, true); /* ['val10' => 10, 'val2' => 2, 'val0' => _**Description**_: Returns the score of a given member in the specified sorted set. ###### *Parameters* -*key* +*key* *member* ###### *Return value* @@ -3329,8 +3410,8 @@ The second optional argument defines `weights` to apply to the sorted sets in in The third argument is a set of options. It can define the `AGGREGATE` option which specify how the results of the intersection are aggregated. It can also define `WITHSCORES` so that the scores are returned as well. ###### *Parameters* -*arrayZSetKeys* -*arrayWeights* +*arrayZSetKeys* +*arrayWeights* *arrayOptions* Two options are available: `withscores => TRUE`, and `aggregate => $behaviour`. Either "SUM", "MIN", or "MAX" defines the behaviour to use on duplicate entries during the zunion. ###### *Return value* @@ -3363,9 +3444,9 @@ The third optional argument defines `weights` to apply to the sorted sets in inp The forth argument defines the `AGGREGATE` option which specify how the results of the union are aggregated. ###### *Parameters* -*keyOutput* -*arrayZSetKeys* -*arrayWeights* +*keyOutput* +*arrayZSetKeys* +*arrayWeights* *aggregateFunction* Either "SUM", "MIN", or "MAX": defines the behaviour to use on duplicate entries during the zunionstore. ###### *Return value* @@ -3398,9 +3479,9 @@ $redis->zunionstore('ko3', ['k1', 'k2'], [5, 1]); /* 4, 'ko3' => ['val0', 'val2' _**Description**_: Scan a sorted set for members, with optional pattern and count ###### *Parameters* -*key*: String, the set to scan -*iterator*: Long (reference), initialized to NULL -*pattern*: String (optional), the pattern to match +*key*: String, the set to scan +*iterator*: Long (reference), initialized to NULL +*pattern*: String (optional), the pattern to match *count*: How many keys to return per iteration (Redis might return a different number) ###### *Return value* @@ -3424,14 +3505,14 @@ while($arr_matches = $redis->zScan('zset', $it, '*pattern*')) { _**Description**_: Adds the specified elements to the specified HyperLogLog. -###### *Prototype* +###### *Prototype* ~~~php $redis->pfAdd($key, Array $elements); ~~~ ###### *Parameters* -_Key_ -_Array of values_ +_Key_ +_Array of values_ ###### *Return value* *Integer*: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise. @@ -3447,14 +3528,14 @@ $redis->pfAdd('hll', ['a', 'b']); // (int) 0 _**Description**_: Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). -###### *Prototype* +###### *Prototype* ~~~php $redis->pfCount($key); $redis->pfCount(Array $keys); ~~~ ###### *Parameters* -_Key_ or _Array of keys_ +_Key_ or _Array of keys_ ###### *Return value* *Integer*: The approximated number of unique elements observed via [pfAdd](#pfAdd). @@ -3475,14 +3556,14 @@ $redis->pfCount(['hll1', 'hll2']); // (int) 5 _**Description**_: Merge N different HyperLogLogs into a single one. -###### *Prototype* +###### *Prototype* ~~~php $redis->pfMerge($destkey, Array $sourceKeys); ~~~ ###### *Parameters* -_Destination Key_ -_Array of Source Keys_ +_Destination Key_ +_Array of Source Keys_ ###### *Return value* *BOOL*: `TRUE` on success, `FALSE` on error. @@ -3502,7 +3583,7 @@ $redis->pfCount('hll3'); // (int) 5 #### geoAdd ----- -###### *Prototype* +###### *Prototype* ~~~php $redis->geoAdd($key, $longitude, $latitude, $member [, $longitude, $latitude, $member, ...]); ~~~ @@ -3522,7 +3603,7 @@ $result = $redis->geoAdd( -122.431, 37.773, "San Francisco", -157.858, 21.315, "Honolulu" ); -~~~ +~~~ #### geoHash ----- @@ -3532,19 +3613,19 @@ $result = $redis->geoAdd( $redis->geoHash($key, $member [, $member, $member, ...]); ~~~ -_**Description**_: Retrieve Geohash strings for one or more elements of a geospatial index. +_**Description**_: Retrieve Geohash strings for one or more elements of a geospatial index. -###### *Return value* -*Array*: One or more Redis Geohash encoded strings. +###### *Return value* +*Array*: One or more Redis Geohash encoded strings. -###### *Example* +###### *Example* ~~~php $redis->geoAdd("hawaii", -157.858, 21.306, "Honolulu", -156.331, 20.798, "Maui"); $hashes = $redis->geoHash("hawaii", "Honolulu", "Maui"); var_dump($hashes); ~~~ -###### *Output* +###### *Output* ~~~ array(2) { [0]=> @@ -3557,24 +3638,24 @@ array(2) { #### geoPos ----- -###### *Prototype* +###### *Prototype* ~~~php $redis->geoPos($key, $member [, $member, $member, ...]); ~~~ _**Description**_: Return longitude, latitude positions for each requested member. -###### *Return value* +###### *Return value* *Array*: One or more longitude/latitude positions -###### *Example* +###### *Example* ~~~php $redis->geoAdd("hawaii", -157.858, 21.306, "Honolulu", -156.331, 20.798, "Maui"); $positions = $redis->geoPos("hawaii", "Honolulu", "Maui"); var_dump($positions); ~~~ -###### *Output* +###### *Output* ~~~ array(2) { [0]=> @@ -3594,10 +3675,10 @@ array(2) { } ~~~ -#### GeoDist +#### GeoDist ----- -###### *Prototype* +###### *Prototype* ~~~php $redis->geoDist($key, $member1, $member2 [, $unit]); ~~~ @@ -3611,7 +3692,7 @@ _**Description**_: Return the distance between two members in a geospatial set. * 'ft' => Feet ###### *Return value* -*Double*: The distance between the two passed members in the units requested (meters by default). +*Double*: The distance between the two passed members in the units requested (meters by default). ###### *Example* ~~~php @@ -3632,9 +3713,9 @@ echo " feet : $feet\n"; $inches = $redis->geoDist("hawaii", "Honolulu", "Maui", 'in'); echo "Invalid unit returned:\n"; var_dump($inches); -~~~ +~~~ -###### *Output* +###### *Output* ~~~ Distance between Honolulu and Maui: meters : 168275.204 @@ -3653,10 +3734,10 @@ bool(false) $redis->geoRadius($key, $longitude, $latitude, $radius, $unit [, Array $options]); ~~~ -_**Description**_: Return members of a set with geospatial information that are within the radius specified by the caller. +_**Description**_: Return members of a set with geospatial information that are within the radius specified by the caller. ###### *Options Array* -The georadius command can be called with various options that control how Redis returns results. The following table describes the options phpredis supports. All options are case insensitive. +The georadius command can be called with various options that control how Redis returns results. The following table describes the options phpredis supports. All options are case insensitive. | Key | Value | Description | :--- | :--- | :---- | @@ -3669,12 +3750,12 @@ The georadius command can be called with various options that control how Redis | STORE | _key_ | Store results in _key_ | STOREDIST | _key_ | Store the results as distances in _key_ - *Note*: It doesn't make sense to pass both `ASC` and `DESC` options but if both are passed the last one passed will be used. + *Note*: It doesn't make sense to pass both `ASC` and `DESC` options but if both are passed the last one passed will be used. *Note*: When using `STORE[DIST]` in Redis Cluster, the store key must has to the same slot as the query key or you will get a `CROSSLOT` error. ###### *Return value* *Mixed*: When no `STORE` option is passed, this function returns an array of results. If it is passed this function returns the number of stored entries. - + ###### *Example* ~~~php /* Add some cities */ @@ -3760,7 +3841,7 @@ _**Description**_: This method is identical to [geoRadius](#georadius) except th See [geoRadius](#georadius) command for options array. ###### *Return value* -*Array*: The zero or more entries that are close enough to the member given the distance and radius specified. +*Array*: The zero or more entries that are close enough to the member given the distance and radius specified. ###### *Example* ~~~php @@ -4125,68 +4206,106 @@ $obj_redis->xTrim('mystream', 100, true); ### Pub/sub +* [subscribe](#subscribe) - Subscribe to channels +* [unsubscribe](#unsubscribe) - Stop listening to channels * [pSubscribe](#psubscribe) - Subscribe to channels by pattern +* [punsubscribe](#punsubscribe) - Stop listening to pattern subscriptions * [publish](#publish) - Post a message to a channel -* [subscribe](#subscribe) - Subscribe to channels * [pubSub](#pubsub) - Introspection into the pub/sub subsystem -#### pSubscribe +#### subscribe ----- -_**Description**_: Subscribe to channels by pattern +_**Description**_: Subscribe to channels. Warning: this function will probably change in the future. ###### *Parameters* -*patterns*: An array of patterns to match -*callback*: Either a string or an array with an object and method. The callback will get four arguments ($redis, $pattern, $channel, $message) -*return value*: Mixed. Any non-null return value in the callback will be returned to the caller. +*channels*: an array of channels to subscribe to +*callback*: either a string or [$instance, 'method_name']. The callback function receives 3 parameters: the redis instance, the channel name, and the message. +*return value*: Mixed. Any non-null return value in the callback will be returned to the caller. + +Calling `$redis->unsubscribe()` inside the callback removes the provided channels. Once all channel subscriptions have been removed (for example by omitting the parameter so every channel is removed) PhpRedis leaves pub/sub mode and returns control to your script, which is the safest way to exit a `subscribe()` loop from within the callback. + ###### *Example* ~~~php -function pSubscribe($redis, $pattern, $chan, $msg) { - echo "Pattern: $pattern\n"; - echo "Channel: $chan\n"; - echo "Payload: $msg\n"; -} +$r = new Redis; +$r->connect('localhost', 6379); + +$r->subscribe(['channel'], function ($redis, $chan, $message) { + echo "Received {$chan}: {$message}\n"; + $redis->unsubscribe(['channel']); +}); + +echo "Done\n"; ~~~ -#### publish +#### unsubscribe ----- -_**Description**_: Publish messages to channels. Warning: this function will probably change in the future. +_**Description**_: Remove one or more channel subscriptions. When all active channel subscriptions are removed PhpRedis exits pub/sub mode. ###### *Parameters* -*channel*: a channel to publish to -*message*: string +*channels*: an array of channels to unsubscribe from. Passing an empty array, or omitting the parameter while inside an active subscription loop, unsubscribes from every channel. + +###### *Return value* +*Redis|array|bool*: Outside of a subscription loop the method returns `true` on success. When invoked from within a subscription callback the method returns the server response array (`['unsubscribe', $channel, $remaining]`) until all subscriptions have been removed. ###### *Example* ~~~php -$redis->publish('chan-1', 'hello, world!'); // send message. +$redis->unsubscribe(['first', 'second']); ~~~ -#### subscribe +#### pSubscribe ----- -_**Description**_: Subscribe to channels. Warning: this function will probably change in the future. +_**Description**_: Subscribe to channels by pattern. Warning: this function will probably change in the future. ###### *Parameters* -*channels*: an array of channels to subscribe to -*callback*: either a string or [$instance, 'method_name']. The callback function receives 3 parameters: the redis instance, the channel name, and the message. -*return value*: Mixed. Any non-null return value in the callback will be returned to the caller. +*patterns*: An array of patterns to match +*callback*: Either a string or an array with an object and method. The callback will get four arguments ($redis, $pattern, $channel, $message) +*return value*: Mixed. Any non-null return value in the callback will be returned to the caller. + +When you no longer need a pattern subscription call `$redis->punsubscribe()` from inside the callback. PhpRedis tracks the exact patterns you subscribed to and exits pub/sub mode once no patterns remain (including when the parameter is omitted to remove every pattern). + ###### *Example* ~~~php -function f($redis, $chan, $msg) { - switch($chan) { - case 'chan-1': - ... - break; +$r = new Redis; +$r->connect('localhost', 6379); - case 'chan-2': - ... - break; +$r->psubscribe(['*foo*', '*bar*'], function ($redis, $pattern, $channel, $message) { + echo "Pattern {$pattern} matched {$channel}: {$message}\n"; + $redis->punsubscribe(['*foo*', '*bar*']); +}); - case 'chan-2': - ... - break; - } -} +echo "Done\n"; +~~~ + +#### punsubscribe +----- +_**Description**_: Remove one or more pattern subscriptions that were registered with `pSubscribe()`. -$redis->subscribe(['chan-1', 'chan-2', 'chan-3'], 'f'); // subscribe to 3 chans +###### *Parameters* +*patterns*: An array of patterns to unsubscribe from. + +###### *Return value* +*Redis|array|bool*: The channels that were removed. + +###### *Example* +~~~php +$redis->punsubscribe(['orders.*']); +$redis->punsubscribe(['foo', 'bar']); +$redis->punsubscribe(['*']); +~~~ + +_**Note**_: PhpRedis does not interpret glob-style requests that differ from the patterns you originally supplied to `pSubscribe()`. For example, subscribing with `['foo']` and later calling `$redis->punsubscribe(['*'])` will send the command to Redis, but PhpRedis will still think `foo` is active and will keep invoking the callback. Always pass the same concrete patterns that were used to subscribe. + +#### publish +----- +_**Description**_: Publish messages to channels. Warning: this function will probably change in the future. + +###### *Parameters* +*channel*: a channel to publish to +*message*: string + +###### *Example* +~~~php +$redis->publish('chan-1', 'hello, world!'); // send message. ~~~ #### pubSub @@ -4194,12 +4313,12 @@ $redis->subscribe(['chan-1', 'chan-2', 'chan-3'], 'f'); // subscribe to 3 chans _**Description**_: A command allowing you to get information on the Redis pub/sub system. ###### *Parameters* -*keyword*: String, which can be: "channels", "numsub", or "numpat" +*keyword*: String, which can be: "channels", "numsub", or "numpat" *argument*: Optional, variant. For the "channels" subcommand, you can pass a string pattern. For "numsub" an array of channel names. ###### *Return value* -*CHANNELS*: Returns an array where the members are the matching channels. -*NUMSUB*: Returns a key/value array where the keys are channel names and values are their counts. +*CHANNELS*: Returns an array where the members are the matching channels. +*NUMSUB*: Returns a key/value array where the keys are channel names and values are their counts. *NUMPAT*: Integer return containing the number active pattern subscriptions ###### *Example* @@ -4299,17 +4418,14 @@ $ret = FALSE if x has been modified between the call to WATCH and the call to EX * [script](#script) - Execute the Redis SCRIPT command to perform various operations on the scripting subsystem * [getLastError](#getlasterror) - The last error message (if any) * [clearLastError](#clearlasterror) - Clear the last error message -* [_prefix](#_prefix) - A utility method to prefix the value with the prefix setting for phpredis -* [_unserialize](#_unserialize) - A utility method to unserialize data with whatever serializer is set up -* [_serialize](#_serialize) - A utility method to serialize data with whatever serializer is set up #### eval ----- _**Description**_: Evaluate a LUA script serverside ###### *Parameters* -*script* string. -*args* array, optional. +*script* string. +*args* array, optional. *num_keys* int, optional. ###### *Return value* @@ -4337,8 +4453,8 @@ In order to run this command Redis will have to have already loaded the script, either by running it or via the SCRIPT LOAD command. ###### *Parameters* -*script_sha* string. The sha1 encoded hash of the script you want to run. -*args* array, optional. Arguments to pass to the LUA script. +*script_sha* string. The sha1 encoded hash of the script you want to run. +*args* array, optional. Arguments to pass to the LUA script. *num_keys* int, optional. The number of arguments that should go into the KEYS array, vs. the ARGV array when Redis spins the script ###### *Return value* @@ -4435,33 +4551,64 @@ $err = $redis->getLastError(); // NULL ~~~ -#### _prefix +### Local Helper Methods + +These helpers expose the exact logic PhpRedis uses locally for serialization, compression, and prefixing. + +* [_compress](#_compress) - Compress a string with the configured compression option +* [_uncompress](#_uncompress) - Uncompress a string with the configured compression option +* [_serialize](#_serialize) - Serialize a value with the configured serializer +* [_unserialize](#_unserialize) - Unserialize a string with the configured serializer +* [_pack](#_pack) - Serialize and compress a value exactly as PhpRedis would before sending it to Redis +* [_unpack](#_unpack) - Reverse `_pack` to retrieve the original PHP value +* [_prefix](#_prefix) - Apply the configured key prefix locally +* [_digest](#_digest) - Compute the XXH3 digest of a packed value just like Redis' DIGEST command + +#### _compress ----- -_**Description**_: A utility method to prefix the value with the prefix setting for phpredis. +_**Description**_: Compress a string using whatever `Redis::OPT_COMPRESSION` is currently set to. This is useful when you need to mimic PhpRedis' compression logic without sending data to Redis. ###### *Parameters* -*value* string. The value you wish to prefix +*value* string. The string to compress. ###### *Return value* -If a prefix is set up, the value now prefixed. If there is no prefix, the value will be returned unchanged. +*string* Returns the compressed string, or the original value if compression is disabled. ###### *Examples* ~~~php -$redis->setOption(Redis::OPT_PREFIX, 'my-prefix:'); -$redis->_prefix('my-value'); // Will return 'my-prefix:my-value' +$redis->setOption(Redis::OPT_COMPRESSION, Redis::COMPRESSION_LZF); +$payload = $redis->_compress('large-payload'); +~~~ + +#### _uncompress +----- +_**Description**_: Reverse `_compress` by uncompressing a string with the compression option currently in use. + +###### *Parameters* +*value* string. The raw compressed value to uncompress. + +###### *Return value* +*string* Returns the uncompressed value. Throws an exception if the payload is invalid for the configured compressor. + +###### *Examples* +~~~php +$redis->setOption(Redis::OPT_COMPRESSION, Redis::COMPRESSION_LZ4); +$original = $redis->_uncompress($compressedPayload); ~~~ #### _serialize ----- -_**Description**_: A utility method to serialize values manually. +_**Description**_: Serialize a value manually using whatever serializer is configured. -This method allows you to serialize a value with whatever serializer is configured, manually. This can be useful for serialization/unserialization of data going in and out of EVAL commands -as phpredis can't automatically do this itself. Note that if no serializer is set, phpredis +as phpredis can't automatically do this itself. Note that if no serializer is set, phpredis will change Array values to 'Array', and Objects to 'Object'. ###### *Parameters* -*value*: Mixed. The value to be serialized +*value* mixed. The value to be serialized. + +###### *Return value* +*string* The serialized representation of the value. ###### *Examples* ~~~php @@ -4476,14 +4623,16 @@ $redis->_serialize("foo"); // Returns 's:3:"foo";' #### _unserialize ----- -_**Description**_: A utility method to unserialize data with whatever serializer is set up. +_**Description**_: Unserialize a string using whatever serializer is configured. -If there is no serializer set, the value will be returned unchanged. If there is a serializer set up, -and the data passed in is malformed, an exception will be thrown. This can be useful if phpredis is -serializing values, and you return something from redis in a LUA script that is serialized. +If there is no serializer set, the value will be returned unchanged. If there is a serializer set up, +and the data passed in is malformed, an exception will be thrown. ###### *Parameters* -*value* string. The value to be unserialized +*value* string. The value to be unserialized. + +###### *Return value* +*mixed* The PHP value represented by the serialized string. ###### *Examples* ~~~php @@ -4491,7 +4640,68 @@ $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); $redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return [1,2,3] ~~~ +#### _pack +----- +_**Description**_: Pack a value the same way PhpRedis does internally by first serializing (if configured) and then compressing (if configured). This mirrors the exact bytes Redis receives. + +###### *Parameters* +*value* mixed. The PHP value to pack. + +###### *Return value* +*string* The packed payload that would be sent to Redis. + +###### *Examples* +~~~php +$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); +$redis->setOption(Redis::OPT_COMPRESSION, Redis::COMPRESSION_LZF); +$payload = $redis->_pack(['a' => 1]); +~~~ + +#### _unpack +----- +_**Description**_: Reverse `_pack` by uncompressing and then unserializing a payload using the current PhpRedis options. + +###### *Parameters* +*value* string. The packed payload to unpack. + +###### *Return value* +*mixed* The unpacked PHP value. + +###### *Examples* +~~~php +$value = $redis->_unpack($payload); +~~~ + +#### _prefix +----- +_**Description**_: A utility method to prefix the value with the prefix setting for PhpRedis. + +###### *Parameters* +*value* string. The value you wish to prefix. +###### *Return value* +*string* Returns the prefixed value when a prefix is configured, or the original string otherwise. + +###### *Examples* +~~~php +$redis->setOption(Redis::OPT_PREFIX, 'my-prefix:'); +$redis->_prefix('my-value'); // Will return 'my-prefix:my-value' +~~~ + +#### _digest +----- +_**Description**_: Compute the XXH3 digest of a PHP value after it has been `_pack`ed. This produces the same output as Redis' `DIGEST` command, making it easy to verify values locally. + +###### *Parameters* +*value* mixed. The PHP value to digest. + +###### *Return value* +*string* A 16 character hex string containing the XXH3 digest. + +###### *Examples* +~~~php +$digest = $redis->_digest(['foo' => 'bar']); +~~~ ### Introspection diff --git a/cluster_library.c b/cluster_library.c index 96def05cd2..b342bfe3e8 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -656,8 +656,7 @@ cluster_node_create(redisCluster *c, char *host, size_t host_len, c->flags->timeout, c->flags->read_timeout, c->flags->persistent, NULL, 0); - /* Stream context */ - node->sock->stream_ctx = c->flags->stream_ctx; + redis_sock_set_context(node->sock, c->flags->context); redis_sock_set_auth(node->sock, c->flags->user, c->flags->pass); @@ -872,6 +871,8 @@ cluster_free(redisCluster *c, int free_ctx) if (c->flags->prefix) zend_string_release(c->flags->prefix); redis_sock_free_auth(c->flags); + redis_sock_free_context(c->flags); + efree(c->flags); /* Call hash table destructors */ @@ -1019,7 +1020,7 @@ void cluster_init_cache(redisCluster *c, redisCachedCluster *cc) { NULL, 0); /* Stream context */ - sock->stream_ctx = c->flags->stream_ctx; + redis_sock_set_context(sock, c->flags->context); /* Add to seed nodes */ zend_hash_str_update_ptr(c->seeds, key, keylen, sock); @@ -1074,11 +1075,9 @@ cluster_init_seeds(redisCluster *c, zend_string **seeds, uint32_t nseeds) c->flags->timeout, c->flags->read_timeout, c->flags->persistent, NULL, 0); - /* Stream context */ - sock->stream_ctx = c->flags->stream_ctx; - - /* Credentials */ + /* Credentials and context */ redis_sock_set_auth(sock, c->flags->user, c->flags->pass); + redis_sock_set_context(sock, c->flags->context); // Index this seed by host/port key_len = snprintf(key, sizeof(key), "%s:%u", ZSTR_VAL(sock->host), @@ -1589,6 +1588,7 @@ PHP_REDIS_API short cluster_send_command(redisCluster *c, short slot, const char * node until we find one that is available. */ if (cluster_sock_write(c, cmd, cmd_len, 0) == -1) { /* We have to abort, as no nodes are reachable */ + cluster_cache_clear(c); CLUSTER_THROW_EXCEPTION("Can't communicate with any node in the cluster", 0); return -1; } @@ -2010,12 +2010,12 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster * if ((z_tmp = zend_hash_index_find(Z_ARRVAL(z_tab), 0)) == NULL || strcasecmp(Z_STRVAL_P(z_tmp), sctx->kw) != 0 ) { - zval_dtor(&z_tab); + zval_ptr_dtor_nogc(&z_tab); efree(sctx); RETURN_FALSE; } - zval_dtor(&z_tab); + zval_ptr_dtor_nogc(&z_tab); pull = 1; } @@ -2046,7 +2046,7 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster * { is_pmsg = *Z_STRVAL_P(z_type) == 'p'; } else { - zval_dtor(&z_tab); + zval_ptr_dtor_nogc(&z_tab); continue; } @@ -2085,14 +2085,14 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster * // If we have a return value, free it zval_ptr_dtor(&z_ret); - zval_dtor(&z_tab); + zval_ptr_dtor_nogc(&z_tab); } // We're no longer subscribing, due to an error c->subscribed_slot = -1; // Cleanup - zval_dtor(&z_tab); + zval_ptr_dtor_nogc(&z_tab); efree(sctx); // Failure @@ -2116,8 +2116,8 @@ PHP_REDIS_API void cluster_unsub_resp(INTERNAL_FUNCTION_PARAMETERS, if (!cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, pull, mbulk_resp_loop_raw, &z_tab) || (z_chan = zend_hash_index_find(Z_ARRVAL(z_tab), 1)) == NULL ) { - zval_dtor(&z_tab); - zval_dtor(return_value); + zval_ptr_dtor_nogc(&z_tab); + zval_ptr_dtor_nogc(return_value); RETURN_FALSE; } @@ -2125,8 +2125,8 @@ PHP_REDIS_API void cluster_unsub_resp(INTERNAL_FUNCTION_PARAMETERS, if ((z_flag = zend_hash_index_find(Z_ARRVAL(z_tab), 2)) == NULL || Z_STRLEN_P(z_flag) != 2 ) { - zval_dtor(&z_tab); - zval_dtor(return_value); + zval_ptr_dtor_nogc(&z_tab); + zval_ptr_dtor_nogc(return_value); RETURN_FALSE; } @@ -2136,7 +2136,7 @@ PHP_REDIS_API void cluster_unsub_resp(INTERNAL_FUNCTION_PARAMETERS, // Add result add_assoc_bool(return_value, Z_STRVAL_P(z_chan), flag[1] == '1'); - zval_dtor(&z_tab); + zval_ptr_dtor_nogc(&z_tab); pull = 1; } } @@ -2331,7 +2331,7 @@ cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, /* Call our specified callback */ if (cb(c->cmd_sock, &z_result, c->reply_len, ctx) == FAILURE) { - zval_dtor(&z_result); + zval_ptr_dtor_nogc(&z_result); CLUSTER_RETURN_FALSE(c); } } @@ -2461,7 +2461,7 @@ cluster_xrange_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) { c->cmd_sock->compression = c->flags->compression; if (redis_read_stream_messages(c->cmd_sock, c->reply_len, &z_messages) < 0) { - zval_dtor(&z_messages); + zval_ptr_dtor_nogc(&z_messages); CLUSTER_RETURN_FALSE(c); } @@ -2485,7 +2485,7 @@ cluster_xread_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) { } else { array_init(&z_streams); if (redis_read_stream_messages_multi(c->cmd_sock, c->reply_len, &z_streams) < 0) { - zval_dtor(&z_streams); + zval_ptr_dtor_nogc(&z_streams); CLUSTER_RETURN_FALSE(c); } } @@ -2507,7 +2507,7 @@ cluster_xclaim_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) { ZEND_ASSERT(ctx == NULL || ctx == PHPREDIS_CTX_PTR); if (redis_read_xclaim_reply(c->cmd_sock, c->reply_len, ctx == PHPREDIS_CTX_PTR, &z_msg) < 0) { - zval_dtor(&z_msg); + zval_ptr_dtor_nogc(&z_msg); CLUSTER_RETURN_FALSE(c); } @@ -2542,7 +2542,7 @@ cluster_vemb_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) { return; fail: - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); CLUSTER_RETURN_FALSE(c); } @@ -2556,7 +2556,7 @@ cluster_vinfo_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) { array_init_size(&z_ret, c->reply_len / 2); if (redis_read_vinfo_response(c->cmd_sock, &z_ret, c->reply_len) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); CLUSTER_RETURN_FALSE(c); } @@ -2623,7 +2623,7 @@ cluster_xinfo_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) array_init(&z_ret); if (redis_read_xinfo_response(c->cmd_sock, &z_ret, c->reply_len) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); CLUSTER_RETURN_FALSE(c); } @@ -2658,7 +2658,7 @@ cluster_acl_custom_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx array_init(&z_ret); if (cb(c->cmd_sock, &z_ret, c->reply_len) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); CLUSTER_RETURN_FALSE(c); } @@ -2701,7 +2701,7 @@ PHP_REDIS_API zval *cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, // Call our callback if (cb(c->cmd_sock, z_ret, c->reply_len, NULL) == FAILURE) { - zval_dtor(z_ret); + zval_ptr_dtor_nogc(z_ret); return NULL; } @@ -2727,7 +2727,7 @@ PHP_REDIS_API void cluster_multi_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, c->cmd_sock = SLOT_SOCK(c, fi->slot); if (cluster_check_response(c, &c->reply_type) < 0) { - zval_dtor(multi_resp); + zval_ptr_dtor_nogc(multi_resp); RETURN_FALSE; } @@ -2742,7 +2742,7 @@ PHP_REDIS_API void cluster_multi_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, } // Set our return array - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); RETVAL_ZVAL(multi_resp, 0, 1); } @@ -2858,7 +2858,7 @@ PHP_REDIS_API void cluster_mset_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster if (c->reply_type != TYPE_LINE) { php_error_docref(0, E_ERROR, "Invalid reply type returned for MSET command"); - zval_dtor(mctx->z_multi); + zval_ptr_dtor_nogc(mctx->z_multi); efree(mctx->z_multi); efree(mctx); RETURN_FALSE; @@ -2867,9 +2867,9 @@ PHP_REDIS_API void cluster_mset_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster // Set our return if it's the last call if (mctx->last) { if (CLUSTER_IS_ATOMIC(c)) { - ZVAL_BOOL(return_value, zval_is_true(mctx->z_multi)); + ZVAL_BOOL(return_value, zend_is_true(mctx->z_multi)); } else { - add_next_index_bool(&c->multi_resp, zval_is_true(mctx->z_multi)); + add_next_index_bool(&c->multi_resp, zend_is_true(mctx->z_multi)); } efree(mctx->z_multi); } @@ -3061,7 +3061,7 @@ static int mbulk_resp_loop_zipdbl(RedisSock *redis_sock, zval *z_result, zend_string *tmp, *zstr = zval_get_tmp_string(z, &tmp); add_assoc_double_ex(z_result, ZSTR_VAL(zstr), ZSTR_LEN(zstr), atof(line)); zend_tmp_string_release(tmp); - zval_dtor(z); + zval_ptr_dtor_nogc(z); /* Free our key and line */ efree(key); @@ -3260,7 +3260,7 @@ PHP_REDIS_API redisCachedCluster *cluster_cache_load(zend_string *hash) { PHP_REDIS_API void cluster_cache_store(zend_string *hash, HashTable *nodes) { redisCachedCluster *cc = cluster_cache_create(hash, nodes); - redis_register_persistent_resource(cc->hash, cc, le_cluster_slot_cache); + zend_register_persistent_resource_ex(cc->hash, cc, le_cluster_slot_cache); } void cluster_cache_clear(redisCluster *c) diff --git a/common.h b/common.h index 8936c8e080..27e79d600d 100644 --- a/common.h +++ b/common.h @@ -46,9 +46,11 @@ #endif #ifndef REDIS_MSVC -# if defined(__has_c_attribute) -# if __has_c_attribute(nodiscard) -# define REDIS_NODISCARD [[nodiscard]] +# ifndef REDIS_NODISCARD +# if defined(__has_c_attribute) +# if __has_c_attribute(nodiscard) +# define REDIS_NODISCARD [[nodiscard]] +# endif # endif # endif # ifndef REDIS_NODISCARD @@ -58,11 +60,11 @@ # endif # elif defined(__GNUC__) || defined(__clang__) # define REDIS_NODISCARD __attribute__((warn_unused_result)) -# else -# define REDIS_NODISCARD # endif # endif -#else +#endif /* ifndef REDIS_MSVC */ + +#ifndef REDIS_NODISCARD # define REDIS_NODISCARD #endif @@ -221,11 +223,15 @@ typedef enum { #define REDIS_STRICMP_STATIC(s, len, sstr) \ (len == sizeof(sstr) - 1 && !strncasecmp(s, sstr, len)) -/* On some versions of glibc strncmp is a macro. This wrapper allows us to - use it in combination with ZEND_STRL in those cases. */ +/* On some versions of glibc strncmp and strncasecmp can be a macro a macro. + * This wrapper allows us to use it in combination with ZEND_STRL in those + * cases. */ static inline int redis_strncmp(const char *s1, const char *s2, size_t n) { return strncmp(s1, s2, n); } +static inline int redis_strncasecmp(const char *s1, const char *s2, size_t n) { + return strncasecmp(s1, s2, n); +} /* Test if a zval is a string and (case insensitive) matches a static string */ #define ZVAL_STRICMP_STATIC(zv, sstr) \ @@ -259,11 +265,11 @@ typedef struct RedisHello { /* {{{ struct RedisSock */ typedef struct { php_stream *stream; - php_stream_context *stream_ctx; zend_string *host; int port; zend_string *user; zend_string *pass; + HashTable *context; double timeout; double read_timeout; long retry_interval; diff --git a/docs/DOCTUM_VERSION b/docs/DOCTUM_VERSION index d41f08f1f3..0413736d69 100644 --- a/docs/DOCTUM_VERSION +++ b/docs/DOCTUM_VERSION @@ -1 +1 @@ -5.5.1 \ No newline at end of file +5.5.4 \ No newline at end of file diff --git a/docs/PROJECT_VERSION b/docs/PROJECT_VERSION index 6563189c54..ce57f64563 100644 --- a/docs/PROJECT_VERSION +++ b/docs/PROJECT_VERSION @@ -1 +1 @@ -develop +develop \ No newline at end of file diff --git a/docs/Redis.html b/docs/Redis.html index dd7ee25ffc..009c813d0a 100644 --- a/docs/Redis.html +++ b/docs/Redis.html @@ -5,7 +5,7 @@ Redis | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> @@ -83,7 +472,7 @@

Redis

class - Redis (View source) + Redis (View source)

@@ -92,6 +481,511 @@

Redis +

Constants

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ REDIS_NOT_FOUND + +

Returned by \Redis::type() when the key does not exist or has a type +we are not familiar with.

+

+
+ REDIS_STRING + +

Returned by \Redis::type() when the key is a string.

+

+
+ REDIS_SET + +

Returned by \Redis::type() when the key is a set.

+

+
+ REDIS_LIST + +

Returned by \Redis::type() when the key is a list.

+

+
+ REDIS_ZSET + +

Returned by \Redis::type() when the key is a sorted set.

+

+
+ REDIS_HASH + +

Returned by \Redis::type() when the key is a hash.

+

+
+ REDIS_STREAM + +

Returned by \Redis::type() when the key is a stream.

+

+
+ REDIS_VECTORSET + +

Returned by \Redis::type() when the key is a vector set.

+

+
+ ATOMIC + +

Returned from \Redis::getMode() when we're not in a multi or pipeline +transaction.

+

+
+ MULTI + +

Returned from \Redis::getMode() when we're in a multi transaction.

+

+
+ PIPELINE + +

Returned from \Redis::getMode() when we're in a pipeline transaction.

+

+
+ OPT_SERIALIZER + +

Used with \Redis::setOption() to specify the serializer to use

+

+
+ OPT_PREFIX + +

Used to set an automatic prefix for keys used in commands.

+

+
+ OPT_READ_TIMEOUT + +

Used to set the read timeout for the connection.

+

+
+ OPT_TCP_KEEPALIVE + +

Used to enable or disable TCP keepalive on the connection.

+

+
+ OPT_COMPRESSION + +

Used to set the compression algorithm to use for compressing

+

+
+ OPT_REPLY_LITERAL + +

Causes PhpRedis to return the actual string in +OK style responses +from Redis. If disabled those replies are just converted to boolean +true.

+

+
+ OPT_COMPRESSION_LEVEL + +

Used to specify the compression level to use when compressing data.

+

+
+ OPT_NULL_MULTIBULK_AS_NULL + +

Tells PhpRedis to return a NULL multi-bulk (*-1\r\n) response +as null as opposed to an empty array.

+

+
+ OPT_PACK_IGNORE_NUMBERS + +

When enabled, this option tells PhpRedis to ignore purely numeric values +when packing and unpacking data. This does not include numeric strings.

+

If you want numeric strings to be ignored, typecast them to an int or +float.

+

The primary purpose of this option is to make it more ergonomic when +setting keys that will later be incremented or decremented.

+

Note: This option incurs a small performance penalty when reading data +because we have to see if the data is a string representation of an int +or float.

+
+ SERIALIZER_NONE + +

Sets the serializer to none (no serialization).

+

+
+ SERIALIZER_PHP + +

Sets the serializer to PHP's built-in serialize()/unserialize()

+

+
+ SERIALIZER_IGBINARY + +

Sets the serializer to igbinary. Note that phpredis must be compiled +with ighbinary support to use this serializer.

+

+
+ SERIALIZER_MSGPACK + +

Sets the serializer to msgpack. Note that phpredis must be compiled +with msgpack support to use this serializer.

+

+
+ SERIALIZER_JSON + +

Sets the serializer to JSON.

+

+
+ COMPRESSION_NONE + +

Disables compression.

+

+
+ COMPRESSION_LZF + +

Sets the compression algorithm to LZF. PhpRedis must be compiled with +lzf support but this serializer is bundled with the extension.

+

+
+ COMPRESSION_ZSTD + +

Sets the compression algorithm to ZSTD. PhpRedis must be compiled with +zstd support to use this serializer. This is often the best balance +between speed and compression ratio.

+

+
+ COMPRESSION_ZSTD_DEFAULT + +

This constant represents the "default" compression level for ZSTD. If +PhpRedis is compiled against a new enough ZSTD the value comes from the +library, otherwise we just set it to 3.

+

+
+ COMPRESSION_ZSTD_MIN + +

The minimum compression level ZSTD supports, which comes from the +underlying ZSTD library if new enough. Otherwise we just set it to 1.

+

+
+ COMPRESSION_ZSTD_MAX + +

The maximum compression level ZSTD supports, which comes from the +underlying ZSTD library.

+

+
+ COMPRESSION_LZ4 + +

Set the compression algorithm to LZ4. PhpRedis must be compiled with +lz4 support to use this serializer. This algorithm is generally +the fastest but has a lower compression ratio than ZSTD.

+

+
+ OPT_SCAN + +

Used with \Redis::setOption() to specify scan options.

+

+
+ SCAN_RETRY + +

When enabled, this option causes PhpRedis to automatically retry SCAN +commands when Redis returns a non-zero cursor but no keys. This can +happen due to the nature of Redis' scanning algorithm.

+

+
+ SCAN_NORETRY + +

Then enabled, this option tells PhpRedis to not retry SCAN commands +when Redis returns a non-zero cursor but no keys. This means that your +code must handle this case itself.

+

+
+ SCAN_PREFIX + +

Tells PhpRedis to prefix keys returned from SCAN commands with the +currently set key prefix.

+

+
+ SCAN_NOPREFIX + +

Tells PhpRedis to NOT prefix keys returned from SCAN commands with +the currently set key prefix.

+

+
+ BEFORE + +

This is just the string "before" which is used with various list +commands to indicate an insertion point.

+

+
+ AFTER + +

This is just the string "after" which is used with various list commands +to indicate an insertion point.

+

+
+ LEFT + +

This is just the string "left" which is used with various list commands +such as LMOVE.

+

+
+ RIGHT + +

This is just the string "right" which is used with various list commands +such as LMOVE.

+

+
+ OPT_MAX_RETRIES + +

How many times should PhpRedis attempt to reconnect when we are +disconnected.

+

+
+ OPT_BACKOFF_ALGORITHM + +

Used to specify the backoff algorithm to use when reconnecting.

+

+
+ BACKOFF_ALGORITHM_DEFAULT + +

Default backoff - random delay before the first retry, then constant base ms.

+

+
+ BACKOFF_ALGORITHM_CONSTANT + +

Constant backoff - always sleep for exactly base ms (capped by cap).

+

+
+ BACKOFF_ALGORITHM_UNIFORM + +

Uniform backoff - randomly sleep between 0 and base ms for each retry.

+

+
+ BACKOFF_ALGORITHM_EXPONENTIAL + +

Exponential backoff - doubles the delay every retry (up to 2^10) before cap.

+

+
+ BACKOFF_ALGORITHM_FULL_JITTER + +

Full jitter - exponential delay but pick a random value between 0 and that delay.

+

+
+ BACKOFF_ALGORITHM_EQUAL_JITTER + +

Equal jitter - half the exponential delay plus a random amount up to the other half.

+

+
+ BACKOFF_ALGORITHM_DECORRELATED_JITTER + +

Decorrelated jitter - pick a random delay between base and 3x the previous delay.

+

+
+ OPT_BACKOFF_BASE + +

Backoff base - minimum delay in milliseconds that algorithms start from.

+

+
+ OPT_BACKOFF_CAP + +

Backoff cap - maximum delay in milliseconds that any algorithm can reach.

+

+
+

Methods

@@ -102,7 +996,7 @@

Methods

Redis
- __construct(array $options = null) + __construct(array|null $options = null)

Create a new Redis instance. If passed sufficient information in the options array it is also possible to connect to an instance at the same @@ -116,8 +1010,7 @@

Methods

__destruct() -

No description

-
+

Destructor to clean up the Redis object.

@@ -127,8 +1020,8 @@

Methods

_compress(string $value) -

Compress a value with the currently configured compressor as set with -Redis::setOption().

+

Compress a value with the currently configured compressor (Redis::OPT_COMPRESSION) +exactly the same way PhpRedis does before sending data to Redis.

@@ -138,8 +1031,8 @@

Methods

_uncompress(string $value) -

Uncompress the provided argument that has been compressed with the -currently configured compressor as set with Redis::setOption().

+

Uncompress the provided argument using the compressor configured via +Redis::setOption() (Redis::OPT_COMPRESSION).

@@ -182,8 +1075,20 @@

Methods

_pack(mixed $value) -

Pack the provided value with the configured serializer and compressor -as set with Redis::setOption().

+

Pack the provided value by first serializing it (if Redis::OPT_SERIALIZER is set) +and then compressing the serialized payload (if Redis::OPT_COMPRESSION is set), +mirroring exactly what PhpRedis transmits to Redis.

+
+ +
+
+ string +
+
+ _digest(mixed $value) + +

Compute the XXH3 digest of a PHP value after it has been _packed, producing +the same digest Redis' DIGEST command would return for the stored value.

@@ -193,8 +1098,9 @@

Methods

_unpack(string $value) -

Unpack the provided value with the configured compressor and serializer -as set with Redis::setOption().

+

Unpack the provided value by first uncompressing it (if Redis::OPT_COMPRESSION +is set) and then unserializing it (if Redis::OPT_SERIALIZER is set) to recover +the original PHP value.

@@ -204,8 +1110,7 @@

Methods

acl(string $subcmd, string ...$args) -

No description

-
+

Execute Redis ACL subcommands.

@@ -247,6 +1152,17 @@

Methods

Asynchronously rewrite Redis' append-only file

+ +
+
+ Redis|array|false +
+
+ waitaof(int $numlocal, int $numreplicas, int $timeout) + +

No description

+
+
@@ -392,8 +1308,7 @@

Methods

client(string $opt, mixed ...$args) -

No description

-
+

Execute Redis CLIENT subcommands.

@@ -403,8 +1318,7 @@

Methods

close() -

No description

-
+

Closes the connection to Redis

@@ -412,10 +1326,9 @@

Methods

mixed
- command(string $opt = null, string|array $arg) + command(string|null $opt = null, mixed ...$args) -

No description

-
+

Execute Redis COMMAND subcommands.

@@ -423,7 +1336,7 @@

Methods

mixed
- config(string $operation, array|string|null $key_or_settings = NULL, string|null $value = NULL) + config(string $operation, array|string|null $key_or_settings = null, string|null $value = null)

Execute the Redis CONFIG command in a variety of ways.

@@ -433,10 +1346,9 @@

Methods

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) + connect(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null) -

No description

-
+

Connect to a Redis server

@@ -444,7 +1356,7 @@

Methods

Redis|bool
- copy(string $src, string $dst, array $options = null) + copy(string $src, string $dst, array|null $options = null)

Make a copy of a key.

@@ -466,8 +1378,9 @@

Methods

debug(string $key) -

No description

-
+

Execute the Redis DEBUG command. Note that this is disabled by default +and can be very dangerous, even allowing you to crash the server. Use +with caution

@@ -505,29 +1418,50 @@

Methods

Redis|int|false
- delete(array|string $key, string ...$other_keys) - deprecated -

No description

-
+ delex(string $key, array|null $options = null) + +

Delete a key conditionally based on its value or hash digest

- Redis|bool + Redis|int|false
- discard() + delifeq(string $key, mixed $value) -

Discard a transaction currently in progress.

+

Delete a key if it's equal to the specified value. This command is +specific to Valkey >= 9.0

- Redis|string + Redis|int|false
- dump(string $key) - + delete(array|string $key, string ...$other_keys) + deprecated +

No description

+
+
+
+
+
+ Redis|bool +
+
+ discard() + +

Discard a transaction currently in progress.

+
+
+
+
+ Redis|string|false +
+
+ dump(string $key) +

Dump Redis' internal binary representation of a key.

@@ -609,7 +1543,7 @@

Methods

Redis|bool
- expire(string $key, int $timeout, string|null $mode = NULL) + expire(string $key, int $timeout, string|null $mode = null)

Sets an expiration in seconds on the key in question. If connected to redis-server >= 7.0.0 you may send an additional "mode" argument which @@ -621,7 +1555,7 @@

Methods

Redis|bool
- expireAt(string $key, int $timestamp, string|null $mode = NULL) + expireAt(string $key, int $timestamp, string|null $mode = null)

Set a key to expire at an exact unix timestamp.

@@ -656,6 +1590,26 @@

Methods

Get the expiration timestamp of a given Redis key but in milliseconds.

+ +
+
+ mixed +
+
+ fcall(string $fn, array $keys = [], array $args = []) + +

Invoke a function.

+
+
+
+
+ mixed +
+
+ fcall_ro(string $fn, array $keys = [], array $args = []) + +

This is a read-only variant of the FCALL command that cannot execute commands that modify data.

+
@@ -676,6 +1630,16 @@

Methods

Deletes all the keys of the currently selected database.

+
+
+
+ Redis|bool|string|array +
+
+ function(string $operation, mixed ...$args) + +

Functions is an API for managing code to be executed on the server.

+
@@ -787,6 +1751,16 @@

Methods

Retrieve a string keys value.

+
+
+
+ Redis|array|false +
+
+ getWithMeta(string $key) + +

Retrieve a value and metadata of key.

+
@@ -897,6 +1871,26 @@

Methods

Get the port we are connected to. This number will be zero if we are connected to a unix socket.

+
+
+
+ string|false +
+
+ serverName() + +

Get the server name as reported by the HELLO response.

+
+
+
+
+ string|false +
+
+ serverVersion() + +

Get the server version as reported by the HELLO response.

+
@@ -913,7 +1907,7 @@

Methods

Redis|string|array|int|false
- lcs(string $key1, string $key2, array|null $options = NULL) + lcs(string $key1, string $key2, array|null $options = null)

Get the longest common subsequence between two string keys.

@@ -950,13 +1944,22 @@

Methods

- int|false + array
getTransferredBytes() -

No description

-
+

Get the number of bytes sent and received on the socket.

+
+ +
+
+ void +
+
+ clearTransferredBytes() + +

Reset the number of bytes sent and received on the socket.

@@ -999,6 +2002,16 @@

Methods

Read every field and value from a hash.

+ +
+
+ mixed +
+
+ hGetWithMeta(string $key, string $member) + +

Retrieve a value and metadata of hash field.

+
@@ -1049,6 +2062,37 @@

Methods

Get one or more fields from a hash.

+
+
+
+ Redis|array|false +
+
+ hgetex(string $key, array $fields, string|array|null $expiry = null) + +

Get one or more fields of a hash while optionally setting expiration +information

+
+
+
+
+ Redis|int|false +
+
+ hsetex(string $key, array $fields, array|null $expiry = null) + +

Set one or more fields in a hash with optional expiration information.

+
+
+
+
+ Redis|array|false +
+
+ hgetdel(string $key, array $fields) + +

Get one or more fields and delete them

+
@@ -1062,10 +2106,10 @@

Methods

- Redis|string|array + Redis|string|array|false
- hRandField(string $key, array $options = null) + hRandField(string $key, array|null $options = null)

Get one or more random field from a hash.

@@ -1075,10 +2119,9 @@

Methods

Redis|int|false
- hSet(string $key, string $member, mixed $value) + hSet(string $key, mixed ...$fields_and_vals) -

No description

-
+

Add or update one or more hash fields and values.

@@ -1086,7 +2129,7 @@

Methods

Redis|bool
- hSetNx(string $key, string $field, string $value) + hSetNx(string $key, string $field, mixed $value)

Set a hash field and value, but only if that field does not exist

@@ -1110,16 +2153,126 @@

Methods

Get all of the values from a hash.

+ +
+
+ Redis|array|false +
+
+ hexpire(string $key, int $ttl, array $fields, string|null $mode = NULL) + +

Set the expiration on one or more fields in a hash.

+
+
+
+
+ Redis|array|false +
+
+ hpexpire(string $key, int $ttl, array $fields, string|null $mode = NULL) + +

Set the expiration on one or more fields in a hash in milliseconds.

+
+
+
+
+ Redis|array|false +
+
+ hexpireat(string $key, int $time, array $fields, string|null $mode = NULL) + +

Set the expiration time on one or more fields of a hash.

+
+
+
+
+ Redis|array|false +
+
+ hpexpireat(string $key, int $mstime, array $fields, string|null $mode = NULL) + +

Set the expiration time on one or more fields of a hash in milliseconds.

+
+
+
+
+ Redis|array|false +
+
+ httl(string $key, array $fields) + +

Get the TTL of one or more fields in a hash

+
+
+
+
+ Redis|array|false +
+
+ hpttl(string $key, array $fields) + +

Get the millisecond TTL of one or more fields in a hash

+
+
+
+
+ Redis|array|false +
+
+ hexpiretime(string $key, array $fields) + +

Get the expiration time of one or more fields in a hash

+
+
+
+
+ Redis|array|false +
+
+ hpexpiretime(string $key, array $fields) + +

Get the expiration time in milliseconds of one or more fields in a hash

+
+
+
+
+ Redis|array|false +
+
+ hpersist(string $key, array $fields) + +

Persist one or more hash fields

+
Redis|array|bool
- hscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + hscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

Iterate over the fields and values of a hash in an incremental fashion.

+
+
+
+ Redis|int|false +
+
+ expiremember(string $key, string $field, int $ttl, string|null $unit = null) + +

Set an expiration on a key member (KeyDB only).

+
+
+
+
+ Redis|int|false +
+
+ expirememberat(string $key, string $field, int $timestamp) + +

Set an expiration on a key membert to a specific unix timestamp (KeyDB only).

+
@@ -1176,7 +2329,7 @@

Methods

- Redis|array|false + Redis|list<string>|false
keys(string $pattern) @@ -1215,6 +2368,17 @@

Methods

Move an element from one list into another.

+
+
+
+ Redis|string|false +
+
+ blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout) + +

No description

+
+
@@ -1231,7 +2395,7 @@

Methods

Redis|null|bool|int|array
- lPos(string $key, mixed $value, array $options = null) + lPos(string $key, mixed $value, array|null $options = null)

Retrieve the index of an element in a list.

@@ -1338,12 +2502,12 @@

Methods

- Redis|array + Redis|array|false
mget(array $keys) -

Get one ore more string keys.

+

Get one or more string keys.

@@ -1351,10 +2515,9 @@

Methods

Redis|bool
- migrate(string $host, int $port, string|array $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, mixed $credentials = NULL) + migrate(string $host, int $port, string|array $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, mixed $credentials = null) -

No description

-
+

Proxy for the Redis MIGRATE command.

@@ -1374,7 +2537,17 @@

Methods

mset(array $key_values) -

Set one ore more string keys.

+

Set one or more string keys.

+
+ +
+
+ Redis|int|false +
+
+ msetex(array $key_vals, int|float|array|null $expiry = null) + +

Set one or more keys and values with optional expiry information.

@@ -1384,7 +2557,7 @@

Methods

msetnx(array $key_values) -

Set one ore more string keys but only if none of the key exist.

+

Set one or more string keys but only if none of the key exist.

@@ -1404,8 +2577,7 @@

Methods

object(string $subcommand, string $key) -

No description

-
+

Get encoding and other information about a key.

@@ -1413,7 +2585,7 @@

Methods

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) + open(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null) deprecated

No description

@@ -1424,10 +2596,9 @@

Methods

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) + pconnect(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null) -

No description

-
+

Connects to a Redis server creating or reusing a persistent connection.

@@ -1445,7 +2616,7 @@

Methods

bool
- pexpire(string $key, int $timeout, string|null $mode = NULL) + pexpire(string $key, int $timeout, string|null $mode = null)

Sets an expiration in milliseconds on a given key. If connected to Redis >= 7.0.0 you can pass an optional mode argument that modifies how the command will execute.

@@ -1456,7 +2627,7 @@

Methods

Redis|bool
- pexpireAt(string $key, int $timestamp, string|null $mode = NULL) + pexpireAt(string $key, int $timestamp, string|null $mode = null)

Set a key's expiration to a specific Unix Timestamp in milliseconds. If connected to Redis >= 7.0.0 you can pass an optional 'mode' argument.

@@ -1474,10 +2645,10 @@

Methods

- Redis|int + Redis|int|false
- pfcount(string $key) + pfcount(array|string $key_or_keys)

Retrieve the cardinality of a Redis HyperLogLog key.

@@ -1497,7 +2668,7 @@

Methods

Redis|string|bool
- ping(string $message = NULL) + ping(string|null $message = null)

PING the redis server with an optional string argument.

@@ -1517,7 +2688,7 @@

Methods

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) + popen(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null) deprecated

No description

@@ -1570,8 +2741,7 @@

Methods

pubsub(string $command, mixed $arg = null) -

No description

-
+

Interact with the Redis PubSub subsystem.

@@ -1649,7 +2819,7 @@

Methods

Redis|bool
- restore(string $key, int $ttl, string $value, array|null $options = NULL) + restore(string $key, int $ttl, string $value, array|null $options = null)

Restore a key by the binary payload generated by the DUMP command.

@@ -1692,7 +2862,7 @@

Methods

sAddArray(string $key, array $values) -

Add one ore more values to a Redis SET key. This is an alternative to Redis::sadd() but +

Add one or more values to a Redis SET key. This is an alternative to Redis::sadd() but instead of being variadic, takes a single array of values.

@@ -1793,7 +2963,7 @@

Methods

- Redis|string|array|false + mixed
sRandMember(string $key, int $count = 0) @@ -1837,7 +3007,7 @@

Methods

array|false
- scan(int|null $iterator, string|null $pattern = null, int $count = 0, string $type = NULL) + scan(null|int|string $iterator, string|null $pattern = null, int $count = 0, string|null $type = null)

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

@@ -1877,7 +3047,7 @@

Methods

Redis|string|bool
- set(string $key, mixed $value, mixed $options = NULL) + set(string $key, mixed $value, mixed $options = null)

Create or set a Redis STRING key to a value.

@@ -1947,7 +3117,7 @@

Methods

Redis|bool
- slaveof(string $host = NULL, int $port = 6379) + slaveof(string|null $host = null, int $port = 6379) deprecated

Turn a redis instance into a replica of another or promote a replica to a primary.

@@ -1958,7 +3128,7 @@

Methods

Redis|bool
- replicaof(string $host = NULL, int $port = 6379) + replicaof(string|null $host = null, int $port = 6379)

Used to turn a Redis instance into a replica of another, or to remove replica status promoting the instance to a primary.

@@ -2064,10 +3234,20 @@

Methods

array|false
- sscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + sscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

Scan the members of a redis SET key.

+ +
+
+ bool +
+
+ ssubscribe(array $channels, callable $cb) + +

Subscribes the client to the specified shard channels.

+
@@ -2088,6 +3268,17 @@

Methods

Subscribe to one or more Redis pubsub channels.

+
+
+
+ Redis|array|bool +
+
+ sunsubscribe(array $channels) + +

Unsubscribes the client from the given shard channels, +or from all of them if none is given.

+
@@ -2190,7 +3381,7 @@

Methods

xack(string $key, string $group, array $ids) -

Acknowledge one ore more messages that are pending (have been consumed using XREADGROUP but +

Acknowledge one or more messages that are pending (have been consumed using XREADGROUP but not yet acknowledged by XACK.)

@@ -2237,12 +3428,12 @@

Methods

- mixed + Redis|array|false
- xgroup(string $operation, string $key = null, string $group = null, string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2) + xdelex(string $key, array $ids, string|null $mode = null) -

XGROUP

+

Remove one or more IDs from a stream with extended options.

@@ -2250,7 +3441,17 @@

Methods

mixed
- xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1) + xgroup(string $operation, string|null $key = null, string|null $group = null, string|null $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2) + +

XGROUP

+
+ +
+
+ mixed +
+
+ xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1)

Retrieve information about a stream key.

@@ -2315,6 +3516,146 @@

Methods

Get a range of entries from a STREAM key in reverse chronological order.

+ +
+
+ Redis|int|false +
+
+ vadd(string $key, array $values, mixed $element, array|null $options = null) + +

Add to a vector set

+
+
+
+
+ Redis|array|false +
+
+ vsim(string $key, mixed $member, array|null $options = null) + +

Query similarity of a vector by element or scores

+
+
+
+
+ Redis|int|false +
+
+ vcard(string $key) + +

Get the length of a vector set

+
+
+
+
+ Redis|int|false +
+
+ vdim(string $key) + +

Get the dimensions of a vector set

+
+
+
+
+ Redis|array|false +
+
+ vinfo(string $key) + +

Get various bits of information about a vector set

+
+
+
+
+ Redis|bool +
+
+ vismember(string $key, mixed $member) + +

Check if an element is a member of a vectorset

+
+
+
+
+ Redis|array|false +
+
+ vemb(string $key, mixed $member, bool $raw = false) + +

Get the embeddings for a specific member

+
+
+
+
+ Redis|array|string|false +
+
+ vrandmember(string $key, int $count = 0) + +

Get one or more random members from a vector set

+
+
+
+
+ Redis|array|false +
+
+ vrange(string $key, string $min, string $max, int $count = -1) + +

Retreive a lexographical range of elements from a vector set

+
+
+
+
+ Redis|int|false +
+
+ vrem(string $key, mixed $member) + +

Remove an element from a vector set

+
+
+
+
+ Redis|int|false +
+
+ vsetattr(string $key, mixed $member, array|string $attributes) + +

Set the attributes of a vector set element

+
+
+
+
+ Redis|array|string|false +
+
+ vgetattr(string $key, mixed $member, bool $decode = true) + +

Get the attributes of a vector set element

+
+
+
+
+ Redis|array|false +
+
+ vlinks(string $key, mixed $member, bool $withscores = false) + +

Get any adajcent values for a member of a vector set.

+
+
+
+
+ Redis|array|false +
+
+ gcra(string $key, int $maxBurst, int $requestsPerPeriod, int $period, int $tokens = 0) + +

Get rate limiting information

+
@@ -2328,7 +3669,7 @@

Methods

- Redis|int|false + Redis|int|float|false
zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems) @@ -2351,7 +3692,7 @@

Methods

Redis|int|false
- zCount(string $key, string $start, string $end) + zCount(string $key, int|string $start, int|string $end)

Count the number of members in a sorted set with scores inside a provided range.

@@ -2392,7 +3733,7 @@

Methods

Redis|array|false
- zPopMax(string $key, int $count = null) + zPopMax(string $key, int|null $count = null)

Pop one or more of the highest scoring elements from a sorted set.

@@ -2402,7 +3743,7 @@

Methods

Redis|array|false
- zPopMin(string $key, int $count = null) + zPopMin(string $key, int|null $count = null)

Pop one or more of the lowest scoring elements from a sorted set.

@@ -2412,7 +3753,7 @@

Methods

Redis|array|false
- zRange(string $key, mixed $start, mixed $end, array|bool|null $options = null) + zRange(string $key, string|int $start, string|int $end, array|bool|null $options = null)

Retrieve a range of elements of a sorted set between a start and end point.

@@ -2442,7 +3783,7 @@

Methods

Redis|int|false
- zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = NULL) + zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = null)

This command is similar to ZRANGE except that instead of returning the values directly it will store them in a destination key provided by the user

@@ -2453,7 +3794,7 @@

Methods

Redis|string|array
- zRandMember(string $key, array $options = null) + zRandMember(string $key, array|null $options = null)

Retrieve one or more random members from a Redis sorted set.

@@ -2563,7 +3904,7 @@

Methods

Redis|array|false
- zdiff(array $keys, array $options = null) + zdiff(array $keys, array|null $options = null)

Given one or more sorted set key names, return every element that is in the first set but not any of the others.

@@ -2607,7 +3948,7 @@

Methods

zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null) -

Compute the intersection of one ore more sorted sets storing the result in a new sorted set.

+

Compute the intersection of one or more sorted sets storing the result in a new sorted set.

@@ -2615,7 +3956,7 @@

Methods

Redis|array|false
- zscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + zscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

Scan the members of a sorted set incrementally, using a cursor

@@ -2635,10 +3976,20 @@

Methods

Redis|int|false
- zunionstore(string $dst, array $keys, array|null $weights = NULL, string|null $aggregate = NULL) + zunionstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)

Perform a union on one or more Redis sets and store the result in a destination sorted set.

+ +
+
+ Redis|string|false +
+
+ digest(string $key) + +

Ask the server for the XXH3 digest of a given key's value

+
@@ -2647,11 +3998,10 @@

Details

-

- - Redis - __construct(array $options = null) - + +

+ + Redis __construct(array|null $options = null)

@@ -2661,41 +4011,41 @@

Create a new Redis instance. If passed sufficient information in the options array it is also possible to connect to an instance at the same time.

NOTE: Below is an example options array with various setting

-
$options = [
-    'host'           => 'localhost',
-    'port'           => 6379,
-    'readTimeout'    => 2.5,
-    'connectTimeout' => 2.5,
-    'persistent'     => true,
-
-    // Valid formats: NULL, ['user', 'pass'], 'pass', or ['pass']
-    'auth' => ['phpredis', 'phpredis'],
-
-    // See PHP stream options for valid SSL configuration settings.
-    'ssl' => ['verify_peer' => false],
-
-    // How quickly to retry a connection after we time out or it  closes.
-    // Note that this setting is overridden by 'backoff' strategies.
-    'retryInterval'  => 100,
-
-     // Which backoff algorithm to use.  'decorrelated jitter' is
-     // likely the best one for most solution, but there are many
-     // to choose from:
-     //     REDIS_BACKOFF_ALGORITHM_DEFAULT
-     //     REDIS_BACKOFF_ALGORITHM_CONSTANT
-     //     REDIS_BACKOFF_ALGORITHM_UNIFORM
-     //     REDIS_BACKOFF_ALGORITHM_EXPONENTIAL
-     //     REDIS_BACKOFF_ALGORITHM_FULL_JITTER
-     //     REDIS_BACKOFF_ALGORITHM_EQUAL_JITTER
-     //     REDIS_BACKOFF_ALGORITHM_DECORRELATED_JITTER
-     // 'base', and 'cap' are in milliseconds and represent the first
-     // delay redis will use when reconnecting, and the maximum delay
-     // we will reach while retrying.
-    'backoff' => [
-        'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER,
-        'base'      => 500,
-        'cap'       => 750,
-    ]
+
$options = [
+   'host'           => 'localhost',
+   'port'           => 6379,
+   'readTimeout'    => 2.5,
+   'connectTimeout' => 2.5,
+   'persistent'     => true,
+
+   // Valid formats: NULL, ['user', 'pass'], 'pass', or ['pass']
+   'auth' => ['phpredis', 'phpredis'],
+
+   // See PHP stream options for valid SSL configuration settings.
+   'ssl' => ['verify_peer' => false],
+
+   // How quickly to retry a connection after we time out or it  closes.
+   // Note that this setting is overridden by 'backoff' strategies.
+   'retryInterval'  => 100,
+
+    // Which backoff algorithm to use.  'decorrelated jitter' is
+    // likely the best one for most solution, but there are many
+    // to choose from:
+    //     REDIS_BACKOFF_ALGORITHM_DEFAULT
+    //     REDIS_BACKOFF_ALGORITHM_CONSTANT
+    //     REDIS_BACKOFF_ALGORITHM_UNIFORM
+    //     REDIS_BACKOFF_ALGORITHM_EXPONENTIAL
+    //     REDIS_BACKOFF_ALGORITHM_FULL_JITTER
+    //     REDIS_BACKOFF_ALGORITHM_EQUAL_JITTER
+    //     REDIS_BACKOFF_ALGORITHM_DECORRELATED_JITTER
+    // 'base', and 'cap' are in milliseconds and represent the first
+    // delay redis will use when reconnecting, and the maximum delay
+    // we will reach while retrying.
+   'backoff' => [
+       'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER,
+       'base'      => 500,
+       'cap'       => 750,
+   ]
 ];

Note: If you do wish to connect via the constructor, only 'host' is strictly required, which will cause PhpRedis to connect to that @@ -2706,22 +4056,24 @@

Parameters

- +
arrayarray|null $options
-

Return Value

+

Return Value

- +
+
Redis
+

See also

@@ -2743,24 +4095,31 @@

See also

+

Examples

+ + + + + +
$redis = new Redis(['host' => '127.0.0.1', 'port' => 6380]);
+
-

- - - __destruct() - + +

+ + __destruct()

-

No description

- +

Destructor to clean up the Redis object.

This method will disconnect from Redis. If the connection is persistento +it will be stashed for future reuse.

@@ -2772,19 +4131,18 @@

-

- - string - _compress(string $value) - + +

+ + string _compress(string $value)

-

Compress a value with the currently configured compressor as set with -Redis::setOption().

+

Compress a value with the currently configured compressor (Redis::OPT_COMPRESSION) +exactly the same way PhpRedis does before sending data to Redis.

Parameters

@@ -2798,15 +4156,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
- +
string

The compressed result

The compressed result (or the original value if compression is disabled)

+

See also

@@ -2822,24 +4182,31 @@

See also

+

Examples

+ + + + + +
$redis->_compress('payload');
+
-

- - string - _uncompress(string $value) - + +

+ + string _uncompress(string $value)

-

Uncompress the provided argument that has been compressed with the -currently configured compressor as set with Redis::setOption().

+

Uncompress the provided argument using the compressor configured via +Redis::setOption() (Redis::OPT_COMPRESSION).

Parameters

@@ -2853,15 +4220,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
string

The uncompressed result.

+

See also

@@ -2877,16 +4246,23 @@

See also

+

Examples

+ + + + + +
$redis->_uncompress($redis->_compress('payload'));
+
-

- - string - _prefix(string $key) - + +

+ + string _prefix(string $key)

@@ -2908,28 +4284,37 @@

Parameters

-

Return Value

+

Return Value

- +
+
string

The prefixed string

+
+

Examples

+ + + + + +
$redis->_prefix('user:42');
+
-

- - string - _serialize(mixed $value) - + +

+ + string _serialize(mixed $value)

@@ -2951,15 +4336,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
string

The serialized result

+

See also

@@ -2975,16 +4362,23 @@

See also

+

Examples

+ + + + + +
$redis->_serialize(['answer' => 42]);
+
-

- - mixed - _unserialize(string $value) - + +

+ + mixed _unserialize(string $value)

@@ -3006,15 +4400,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed

The unserialized result

+

See also

@@ -3030,24 +4426,32 @@

See also

+

Examples

+ + + + + +
$redis->_unserialize($redis->_serialize(['answer' => 42]));
+
-

- - string - _pack(mixed $value) - + +

+ + string _pack(mixed $value)

-

Pack the provided value with the configured serializer and compressor -as set with Redis::setOption().

+

Pack the provided value by first serializing it (if Redis::OPT_SERIALIZER is set) +and then compressing the serialized payload (if Redis::OPT_COMPRESSION is set), +mirroring exactly what PhpRedis transmits to Redis.

Parameters

@@ -3061,9 +4465,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
string

The packed result having been serialized and @@ -3071,70 +4476,97 @@

Return Value

+
+

Examples

+ + + + + +
$redis->_pack(['count' => 5]);
+
-

- - mixed - _unpack(string $value) - + +

+ + string _digest(mixed $value)

-

Unpack the provided value with the configured compressor and serializer -as set with Redis::setOption().

+

Compute the XXH3 digest of a PHP value after it has been _packed, producing +the same digest Redis' DIGEST command would return for the stored value.

Parameters

- + - +
stringmixed $value

The value which has been serialized and compressed.

The value to compute the digest for.

-

Return Value

+

Return Value

- +
+
- - + +
mixed

The uncompressed and eserialized value.

string

The computed digest.

+
+

Exceptions

+ + + + + + +
RedisException
+ +

Examples

+ + + + + +
$redis->_digest(['token' => 'abc']);
+
-

- - mixed - acl(string $subcmd, string ...$args) - + +

+ + mixed _unpack(string $value)

-

No description

- +

Unpack the provided value by first uncompressing it (if Redis::OPT_COMPRESSION +is set) and then unserializing it (if Redis::OPT_SERIALIZER is set) to recover +the original PHP value.

Parameters

@@ -3142,46 +4574,50 @@

Parameters

- - - - - - - + +
string$subcmd
string...$args$value

The value which has been serialized and compressed.

-

Return Value

+

Return Value

- +
+
- +
mixed

The uncompressed and deserialized value.

+
+

Examples

+ + + + + +
$redis->_unpack($redis->_pack(['count' => 5]));
+
-

- - Redis|int|false - append(string $key, mixed $value) - + +

+ + mixed acl(string $subcmd, string ...$args)

-

Append data to a Redis STRING key.

+

Execute Redis ACL subcommands.

Parameters

@@ -3189,26 +4625,28 @@

Parameters

- - + + - - - + + +
string$key

The key in question

$subcmd
mixed$value

The data to append to the key.

string...$args
-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The new string length of the key or false on failure.

mixed
+

See also

@@ -3216,7 +4654,7 @@

See also

@@ -3227,8 +4665,7 @@

Examples

- https://redis.io/commands/append + https://redis.io/docs/latest/commands/acl/
- +
$redis->set('foo', 'hello);
-$redis->append('foo', 'world');
$redis->acl('list');
@@ -3237,11 +4674,78 @@

Examples

-

- - Redis|bool - auth(mixed $credentials) - + +

+ + Redis|int|false append(string $key, mixed $value) +

+
+ + + +
+

Append data to a Redis STRING key.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key in question

mixed$value

The data to append to the key.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The new string length of the key or false on failure.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/append/ +
+ + +

Examples

+ + + + + +
$redis->set('foo', 'hello);
+$redis->append('foo', 'world');
+ +
+
+ +
+
+ +

+ + Redis|bool auth(mixed $credentials)

@@ -3264,15 +4768,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|bool

Whether the AUTH was successful.

+

See also

@@ -3280,23 +4786,30 @@

See also

- https://redis.io/commands/auth + https://redis.io/docs/latest/commands/auth/
+

Examples

+ + + + + +
$redis->auth('secret');
+
-

- - Redis|bool - bgSave() - + +

+ + Redis|bool bgSave()

@@ -3307,15 +4820,17 @@

-

Return Value

+

Return Value

- +
+
Redis|bool

Whether the command was successful.

+

See also

@@ -3323,23 +4838,30 @@

See also

- https://redis.io/commands/bgsave + https://redis.io/docs/latest/commands/bgsave/
+

Examples

+ + + + + +
$redis->bgSave();
+
-

- - Redis|bool - bgrewriteaof() - + +

+ + Redis|bool bgrewriteaof()

@@ -3350,15 +4872,90 @@

-

Return Value

+

Return Value

- +
+
Redis|bool

Whether the command was successful.

+
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/bgrewriteaof/ +
+ + +

Examples

+ + + + + +
$redis->bgrewriteaof();
+ +
+ + + +
+ +

+ + Redis|array|false waitaof(int $numlocal, int $numreplicas, int $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
int$numlocal
int$numreplicas
int$timeout
+ + +

Return Value

+ +
+ + + + + +
Redis|array|false
+ +

See also

@@ -3366,23 +4963,30 @@

See also

- https://redis.io/commands/bgrewriteaof + https://redis.io/docs/latest/commands/waitaof/
+

Examples

+ + + + + +
$redis->waitaof(1, 1, 5000);
+
-

- - Redis|int|false - bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false) - + +

+ + Redis|int|false bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false)

@@ -3421,15 +5025,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of bits set in the requested range.

+

See also

@@ -3437,23 +5043,30 @@

See also

- https://redis.io/commands/bitcount/ + https://redis.io/docs/latest/commands/bitcount/
+

Examples

+ + + + + +
$redis->bitcount('bitmap', 0, -1);
+
-

- - Redis|int|false - bitop(string $operation, string $deskey, string $srckey, string ...$other_keys) - + +

+ + Redis|int|false bitop(string $operation, string $deskey, string $srckey, string ...$other_keys)

@@ -3490,15 +5103,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false
+
@@ -3507,11 +5122,10 @@

Return Value

-

- - Redis|int|false - bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false) - + +

+ + Redis|int|false bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false)

@@ -3553,15 +5167,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The position of the first set or unset bit.

+

See also

@@ -3569,23 +5185,30 @@

See also

- https://redis.io/commands/bitpos/ + https://redis.io/docs/latest/commands/bitpos/
+

Examples

+ + + + + +
$redis->bitpos('bitmap', true, 0, -1);
+
-

- - Redis|array|null|false - blPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed ...$extra_args) - + +

+ + Redis|array|null|false blPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed ...$extra_args)

@@ -3620,15 +5243,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|null|false

Can return various things depending on command and data in Redis.

+

See also

@@ -3636,7 +5261,7 @@

See also

@@ -3647,7 +5272,7 @@

Examples

- https://redis.io/commands/blpop/ + https://redis.io/docs/latest/commands/blpop/
-
$redis->blPop('list1', 'list2', 'list3', 1.5);
+
$redis->blPop('list1', 'list2', 'list3', 1.5);
 $relay->blPop(['list1', 'list2', 'list3'], 1.5);
@@ -3657,11 +5282,10 @@

Examples

-

- - Redis|array|null|false - brPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed ...$extra_args) - + +

+ + Redis|array|null|false brPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed ...$extra_args)

@@ -3692,15 +5316,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|null|false
+

See also

@@ -3708,7 +5334,7 @@

See also

@@ -3722,16 +5348,23 @@

See also

- https://redis.io/commands/brpop/ + https://redis.io/docs/latest/commands/brpop/
+

Examples

+ + + + + +
$redis->brPop(['queue:critical', 'queue:default'], 5);
+
-

- - Redis|string|false - brpoplpush(string $src, string $dst, int|float $timeout) - + +

+ + Redis|string|false brpoplpush(string $src, string $dst, int|float $timeout)

@@ -3764,15 +5397,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|string|false
+

See also

@@ -3780,23 +5415,30 @@

See also

- https://redis.io/commands/brpoplpush/ + https://redis.io/docs/latest/commands/brpoplpush/
+

Examples

+ + + + + +
$redis->brpoplpush('queue:pending', 'queue:processing', 5);
+
-

- - Redis|array|false - bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) - + +

+ + Redis|array|false bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args)

@@ -3815,7 +5457,7 @@

Parameters

string|array $key - +

Either a string key or an array of one or more keys.

string|int @@ -3833,15 +5475,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

The popped elements.

+

See also

@@ -3849,7 +5493,7 @@

See also

@@ -3860,7 +5504,7 @@

Examples

- https://redis.io/commands/bzpopmax + https://redis.io/docs/latest/commands/bzpopmax/
-
$redis->bzPopMax('key1', 'key2', 'key3', 1.5);
+
$redis->bzPopMax('key1', 'key2', 'key3', 1.5);
 $redis->bzPopMax(['key1', 'key2', 'key3'], 1.5);
@@ -3870,11 +5514,10 @@

Examples

-

- - Redis|array|false - bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) - + +

+ + Redis|array|false bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args)

@@ -3906,15 +5549,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false
+

See also

@@ -3922,7 +5567,7 @@

See also

@@ -3936,16 +5581,23 @@

See also

- https://redis.io/commands/bzpopmin + https://redis.io/docs/latest/commands/bzpopmin/
+

Examples

+ + + + + +
$redis->bzPopMin(['scores:high', 'scores:low'], 1.5);
+
-

- - Redis|array|null|false - bzmpop(float $timeout, array $keys, string $from, int $count = 1) - + +

+ + Redis|array|null|false bzmpop(float $timeout, array $keys, string $from, int $count = 1)

@@ -3983,9 +5635,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|null|false

This function will return an array of popped elements, or false @@ -3996,19 +5649,38 @@

Return Value

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/bzmpop/ +
+ +

Examples

+ + + + + +
$redis->bzmpop(1.5, ['scores:high', 'scores:low'], 'MIN', 2);
+
-

- - Redis|array|null|false - zmpop(array $keys, string $from, int $count = 1) - + +

+ + Redis|array|null|false zmpop(array $keys, string $from, int $count = 1)

@@ -4040,15 +5712,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|null|false

An array of popped elements or false if none could be popped.

+

See also

@@ -4056,23 +5730,30 @@

See also

- https://redis.io/commands/zmpop + https://redis.io/docs/latest/commands/zmpop/
+

Examples

+ + + + + +
$redis->zmpop(['scores:high', 'scores:low'], 'MAX', 2);
+
-

- - Redis|array|null|false - blmpop(float $timeout, array $keys, string $from, int $count = 1) - + +

+ + Redis|array|null|false blmpop(float $timeout, array $keys, string $from, int $count = 1)

@@ -4110,9 +5791,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|null|false

One or more elements popped from the list(s) or false if all LISTs @@ -4120,6 +5802,7 @@

Return Value

+

See also

@@ -4127,23 +5810,30 @@

See also

- https://redis.io/commands/blmpop + https://redis.io/docs/latest/commands/blmpop/
+

Examples

+ + + + + +
$redis->blmpop(1.5, ['queue:critical', 'queue:default'], 'LEFT', 2);
+
-

- - Redis|array|null|false - lmpop(array $keys, string $from, int $count = 1) - + +

+ + Redis|array|null|false lmpop(array $keys, string $from, int $count = 1)

@@ -4175,9 +5865,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|null|false

One or more elements popped from the LIST(s) or false if all the LISTs @@ -4185,6 +5876,7 @@

Return Value

+

See also

@@ -4192,23 +5884,30 @@

See also

- https://redis.io/commands/lmpop + https://redis.io/docs/latest/commands/lmpop/
+

Examples

+ + + + + +
$redis->lmpop(['queue:critical', 'queue:default'], 'RIGHT', 2);
+
-

- - bool - clearLastError() - + +

+ + bool clearLastError()

@@ -4219,15 +5918,17 @@

-

Return Value

+

Return Value

- +
+
bool

This should always return true or throw an exception if we're not connected.

+

See also

@@ -4247,11 +5948,11 @@

Examples

-
$redis = new Redis(['host' => 'localhost']);
-$redis->set('string', 'this_is_a_string');
-$redis->smembers('string');
-var_dump($redis->getLastError());
-$redis->clearLastError();
+
$redis = new Redis(['host' => 'localhost']);
+$redis->set('string', 'this_is_a_string');
+$redis->smembers('string');
+var_dump($redis->getLastError());
+$redis->clearLastError();
 var_dump($redis->getLastError());
@@ -4261,19 +5962,17 @@

Examples

-

- - mixed - client(string $opt, mixed ...$args) - + +

+ + mixed client(string $opt, mixed ...$args)

-

No description

- +

Execute Redis CLIENT subcommands.

Parameters

@@ -4282,119 +5981,176 @@

Parameters

string $opt - +

The CLIENT subcommand to execute.

mixed ...$args - +

Additional arguments depending on the subcommand.

-

Return Value

+

Return Value

- +
+
mixed
+
- +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/client/ +
+ + +

Examples

+ + + + + +
$redis->client('list');
+
-

- - bool - close() - + +

+ + bool close()

-

No description

- +

Closes the connection to Redis

This function will close the connection whether it is persistent or not.

-

Return Value

+

Return Value

- +
+
- +
bool

Whether the connection was successfully closed.

+
+

Examples

+ + + + + +
$redis = new Redis;
+$redis->pconnect('localhost', 6379);
+$id1 = $redis->client('id');
+$redis->close();
+
+$redis = new Redis;
+$redis->pconnect('localhost', 6379);
+$id2 = $redis->client('id');
+
+// Will print "id is different"
+printf("ID is %s\n", $id1 == $id2 ? 'the same' :  'different');
+
-

- - mixed - command(string $opt = null, string|array $arg) - + +

+ + mixed command(string|null $opt = null, mixed ...$args)

-

No description

- +

Execute Redis COMMAND subcommands.

Parameters

- + - - + +
stringstring|null $opt
string|array$argmixed...$args
-

Return Value

+

Return Value

- +
+
mixed
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/command/ +
+ +

Examples

+ + + + + +
$redis->command('command');
+
-

- - mixed - config(string $operation, array|string|null $key_or_settings = NULL, string|null $value = NULL) - + +

+ + mixed config(string $operation, array|string|null $key_or_settings = null, string|null $value = null)

@@ -4426,15 +6182,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed
+

See also

@@ -4442,7 +6200,7 @@

See also

@@ -4453,9 +6211,9 @@

Examples

- https://redis.io/commands/config + https://redis.io/docs/latest/commands/config/
-
$redis->config('GET', 'timeout');
-$redis->config('GET', ['timeout', 'databases']);
-$redis->config('SET', 'timeout', 30);
+
$redis->config('GET', 'timeout');
+$redis->config('GET', ['timeout', 'databases']);
+$redis->config('SET', 'timeout', 30);
 $redis->config('SET', ['timeout' => 30, 'loglevel' => 'warning']);
@@ -4465,19 +6223,17 @@

Examples

-

- - 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) - + +

+ + bool connect(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null)

-

No description

- +

Connect to a Redis server

Parameters

@@ -4486,63 +6242,97 @@

Parameters

string $host - +

The Redis server hostname or IP +address.

int $port - +

The Redis server port. Defaults to +6379.

float $timeout - +

The connection timeout in seconds. +Defaults to 0 (no timeout).

- string + string|null $persistent_id - +

If set, a persistent connection will +be made with this ID.

int $retry_interval - +

The number of milliseconds to wait +between connection attempts.

float $read_timeout - +

The read timeout in seconds. +Defaults to 0 (no timeout).

- array + array|null $context - +

An optional stream context to use +when connecting. +See \Redis::__construct() for more +details.

-

Return Value

+

Return Value

- +
+
- +
bool

Whether the connection was successful.

+
+

Exceptions

+ + + + + + +
RedisException
+ +

Examples

+ + + + + +
$redis = new \Redis;
+try {
+    $redis->connect('localhost', 6379, 2.5, null, 100, 2.5);
+    $foo = $redis->get('foo');
+    printf("foo: %s\n", $foo);
+} catch (Exception $ex) {
+    fprintf(STDERR, "Error: {$ex->getMessage()}\n");
+}
+
-

- - Redis|bool - copy(string $src, string $dst, array $options = null) - + +

+ + Redis|bool copy(string $src, string $dst, array|null $options = null)

@@ -4566,10 +6356,10 @@

Parameters

The name of the new key created from the source key.

- array + array|null $options

An array with modifiers on how COPY should operate.

-
$options = [
+
$options = [
     'REPLACE' => true|false # Whether to replace an existing key.
     'DB' => int             # Copy key to specific db.
 ];
@@ -4577,15 +6367,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|bool

True if the copy was completed and false if not.

+

See also

@@ -4593,7 +6385,7 @@

See also

@@ -4604,17 +6396,17 @@

Examples

- https://redis.io/commands/copy + https://redis.io/docs/latest/commands/copy/
-
$redis->pipeline()
- ->select(1)
- ->del('newkey')
- ->select(0)
- ->del('newkey')
- ->mset(['source1' => 'value1', 'exists' => 'old_value'])
- ->exec();
-
-var_dump($redis->copy('source1', 'newkey'));
-var_dump($redis->copy('source1', 'newkey', ['db' => 1]));
-var_dump($redis->copy('source1', 'exists'));
+
$redis->pipeline()
+      ->select(1)
+      ->del('newkey')
+      ->select(0)
+      ->del('newkey')
+      ->mset(['source1' => 'value1', 'exists' => 'old_value'])
+      ->exec();
+
+var_dump($redis->copy('source1', 'newkey'));
+var_dump($redis->copy('source1', 'newkey', ['db' => 1]));
+var_dump($redis->copy('source1', 'exists'));
 var_dump($redis->copy('source1', 'exists', ['REPLACE' => true]));
@@ -4624,11 +6416,10 @@

Examples

-

- - Redis|int|false - dbSize() - + +

+ + Redis|int|false dbSize()

@@ -4639,15 +6430,17 @@

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of keys or false on failure.

+

See also

@@ -4655,7 +6448,7 @@

See also

@@ -4666,11 +6459,11 @@

Examples

- https://redis.io/commands/dbsize + https://redis.io/docs/latest/commands/dbsize/
-
$redis = new Redis(['host' => 'localhost']);
-$redis->flushdb();
-$redis->set('foo', 'bar');
-var_dump($redis->dbsize());
-$redis->mset(['a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd']);
+
$redis = new Redis(['host' => 'localhost']);
+$redis->flushdb();
+$redis->set('foo', 'bar');
+var_dump($redis->dbsize());
+$redis->mset(['a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd']);
 var_dump($redis->dbsize());
@@ -4680,19 +6473,19 @@

Examples

-

- - Redis|string - debug(string $key) - + +

+ + Redis|string debug(string $key)

-

No description

- +

Execute the Redis DEBUG command. Note that this is disabled by default +and can be very dangerous, even allowing you to crash the server. Use +with caution

Parameters

@@ -4701,20 +6494,22 @@

Parameters

string $key - +

The DEBUG subcommand to execute.

-

Return Value

+

Return Value

- +
+
- +
Redis|string

The result of the DEBUG command.

+
@@ -4723,11 +6518,10 @@

Return Value

-

- - Redis|int|false - decr(string $key, int $by = 1) - + +

+ + Redis|int|false decr(string $key, int $by = 1)

@@ -4756,15 +6550,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The new value of the key or false on failure.

+

See also

@@ -4772,13 +6568,13 @@

See also

@@ -4801,11 +6597,10 @@

Examples

-

- - Redis|int|false - decrBy(string $key, int $value) - + +

+ + Redis|int|false decrBy(string $key, int $value)

@@ -4831,15 +6626,17 @@

Parameters

- https://redis.io/commands/decr + https://redis.io/docs/latest/commands/decr/
- https://redis.io/commands/decrby + https://redis.io/docs/latest/commands/decrby/
-

Return Value

+

Return Value

- +
+
Redis|int|false

The new value of the key or false on failure.

+

See also

@@ -4847,7 +6644,7 @@

See also

@@ -4870,11 +6667,10 @@

Examples

-

- - Redis|int|false - del(array|string $key, string ...$other_keys) - + +

+ + Redis|int|false del(array|string $key, string ...$other_keys)

@@ -4892,7 +6688,8 @@

Parameters

- + @@ -4902,15 +6699,17 @@

Parameters

- https://redis.io/commands/decrby + https://redis.io/docs/latest/commands/decrby/
array|string $key

Either an array with one or more key names or a string with +the name of a key.

string
-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of keys that were deleted

+

See also

@@ -4918,7 +6717,7 @@

See also

@@ -4941,96 +6740,133 @@

Examples

-

- - Redis|int|false - delete(array|string $key, string ...$other_keys) - deprecated + +

+ + Redis|int|false delex(string $key, array|null $options = null)

-

- deprecated -

- - - -

-

No description

- +

Delete a key conditionally based on its value or hash digest

Parameters

- https://redis.io/commands/del + https://redis.io/docs/latest/commands/del/
- + - + - - - + + +
array|stringstring $key

The key to delete

string...$other_keysarray|null$options

An array with options to modify how DELX works.

-

Return Value

+

Return Value

- +
+
- +
Redis|int|false

Returns 1 if the key was deleted, 0 if it was not.

+ +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/delex/ +
+ +

Examples

+ + + + + +
$redis->delex('session:42');
+
-

- - Redis|bool - discard() - + +

+ + Redis|int|false delifeq(string $key, mixed $value)

-

Discard a transaction currently in progress.

+

Delete a key if it's equal to the specified value. This command is +specific to Valkey >= 9.0

- -

Return Value

+

Parameters

+ + + + + + + + + + +
string$key

The key to delete

mixed$value

The value to compare against the key's value.

+ + +

Return Value

+ +
+ - - + +
Redis|bool

True if we could discard the transaction.

Redis|int|false

Returns 1 if the key was deleted, 0 if it was not.

+
+

See also

+ + + + + + +
+ https://valkey.io/commands/delifeq/ +
+

Examples

- +
$redis->getMode();
-$redis->set('foo', 'bar');
-$redis->discard();
-$redis->getMode();
$redis->delifeq('session:42', 'token');
@@ -5039,41 +6875,54 @@

Examples

-

- - Redis|string - dump(string $key) - + +

+ + Redis|int|false delete(array|string $key, string ...$other_keys) deprecated

+

+ deprecated + + + + +

-

Dump Redis' internal binary representation of a key.

$redis->zRange('new-zset', 0, -1, true);

-

+

No description

+

Parameters

- + - + + + + + +
stringarray|string $key

The key to dump.

string...$other_keys
-

Return Value

+

Return Value

- +
+
- - + +
Redis|string

A binary string representing the key's value.

Redis|int|false
+

See also

@@ -5081,7 +6930,7 @@

See also

@@ -5092,9 +6941,7 @@

Examples

- https://redis.io/commands/dump + https://redis.io/docs/latest/commands/del/
- +
$redis->zadd('zset', 0, 'zero', 1, 'one', 2, 'two');
-$binary = $redis->dump('zset');
-$redis->restore('new-zset', 0, $binary);
$redis->delete('legacy:key');
@@ -5103,40 +6950,31 @@

Examples

-

- - Redis|string|false - echo(string $str) - + +

+ + Redis|bool discard()

-

Have Redis repeat back an arbitrary string to the client.

+

Discard a transaction currently in progress.

-

Parameters

- - - - - - - -
string$str

The string to echo

- -

Return Value

+

Return Value

- +
+
- - + +
Redis|string|false

The string sent to Redis or false on failure.

Redis|bool

True if we could discard the transaction.

+

See also

@@ -5144,7 +6982,7 @@

See also

@@ -5155,7 +6993,10 @@

Examples

- https://redis.io/commands/echo + https://redis.io/docs/latest/commands/discard/
- +
$redis->echo('Hello, World');
$redis->getMode();
+$redis->set('foo', 'bar');
+$redis->discard();
+$redis->getMode();
@@ -5164,18 +7005,17 @@

Examples

-

- - mixed - eval(string $script, array $args = [], int $num_keys = 0) - + +

+ + Redis|string|false dump(string $key)

-

Execute a LUA script on the redis server.

+

Dump Redis' internal binary representation of a key.

Parameters

@@ -5183,34 +7023,23 @@

Parameters

- - - - - - - - - - - - + +
string$script

A string containing the LUA script

array$args

An array of arguments to pass to this script

int$num_keys

How many of the arguments are keys. This is needed -as redis distinguishes between key name arguments -and other data.

$key

The key to dump.

-

Return Value

+

Return Value

- +
+
- - + +
mixed

LUA scripts may return arbitrary data so this method can return -strings, arrays, nested arrays, etc.

Redis|string|false

A binary string representing the key's value.

+

See also

@@ -5218,23 +7047,169 @@

See also

- https://redis.io/commands/eval/ + https://redis.io/docs/latest/commands/dump/
+

Examples

+ + + + + +
$redis->zadd('zset', 0, 'zero', 1, 'one', 2, 'two');
+$binary = $redis->dump('zset');
+$redis->restore('new-zset', 0, $binary);
+
-

- - mixed - eval_ro(string $script_sha, array $args = [], int $num_keys = 0) - + +

+ + Redis|string|false echo(string $str) +

+
+ + + +
+

Have Redis repeat back an arbitrary string to the client.

+
+
+

Parameters

+ + + + + + + +
string$str

The string to echo

+ + +

Return Value

+ +
+ + + + + +
Redis|string|false

The string sent to Redis or false on failure.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/echo/ +
+ + +

Examples

+ + + + + +
$redis->echo('Hello, World');
+ +
+
+ +
+
+ +

+ + mixed eval(string $script, array $args = [], int $num_keys = 0) +

+
+ + + +
+

Execute a LUA script on the redis server.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$script

A string containing the LUA script

array$args

An array of arguments to pass to this script

int$num_keys

How many of the arguments are keys. This is needed +as redis distinguishes between key name arguments +and other data.

+ + +

Return Value

+ +
+ + + + + +
mixed

LUA scripts may return arbitrary data so this method can return +strings, arrays, nested arrays, etc.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/eval/ +
+ + +

Examples

+ + + + + +
$redis->eval('return redis.call("set", KEYS[1], ARGV[1])', ['counter', 1], 1);
+ +
+
+ +
+
+ +

+ + mixed eval_ro(string $script_sha, array $args = [], int $num_keys = 0)

@@ -5266,15 +7241,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed
+

See also

@@ -5286,20 +7263,33 @@

See also

Redis::eval_ro + + + + https://redis.io/docs/latest/commands/eval_ro/ + + +

Examples

+ + + + + +
$redis->eval_ro('return redis.call("get", KEYS[1])', ['counter'], 1);
+
-

- - mixed - evalsha(string $sha1, array $args = [], int $num_keys = 0) - + +

+ + mixed evalsha(string $sha1, array $args = [], int $num_keys = 0)

@@ -5316,7 +7306,10 @@

Parameters

string $sha1 - +

The SHA1 hash of the lua code. Note that the script +must already exist on the server, either having been +loaded with SCRIPT LOAD or having been executed directly +with EVAL first.

array @@ -5331,15 +7324,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed

Returns whatever the specific script does.

+

See also

@@ -5347,7 +7342,7 @@

See also

@@ -5361,16 +7356,24 @@

See also

- https://redis.io/commands/evalsha/ + https://redis.io/docs/latest/commands/evalsha/
+

Examples

+ + + + + +
$sha = $redis->script('load', 'return redis.call("incr", KEYS[1])');
+$redis->evalsha($sha, ['counter'], 1);
+
-

- - mixed - evalsha_ro(string $sha1, array $args = [], int $num_keys = 0) - + +

+ + mixed evalsha_ro(string $sha1, array $args = [], int $num_keys = 0)

@@ -5402,15 +7405,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed
+

See also

@@ -5422,20 +7427,34 @@

See also

Redis::evalsha + + + + https://redis.io/docs/latest/commands/evalsha_ro/ + + +

Examples

+ + + + + +
$sha = $redis->script('load', 'return redis.call("get", KEYS[1])');
+$redis->evalsha_ro($sha, ['counter'], 1);
+
-

- - Redis|array|false - exec() - + +

+ + Redis|array|false exec()

@@ -5446,15 +7465,17 @@

-

Return Value

+

Return Value

- +
+
Redis|array|false

The array of pipeline'd or multi replies or false on failure.

+

See also

@@ -5462,13 +7483,13 @@

See also

@@ -5493,11 +7514,11 @@

Examples

- https://redis.io/commands/exec + https://redis.io/docs/latest/commands/exec/
- https://redis.io/commands/multi + https://redis.io/docs/latest/commands/multi/
-
$res = $redis->multi()
-->set('foo', 'bar')
-->get('foo')
-->del('list')
-->rpush('list', 'one', 'two', 'three')
+
$res = $redis->multi()
+->set('foo', 'bar')
+->get('foo')
+->del('list')
+->rpush('list', 'one', 'two', 'three')
 ->exec();
@@ -5507,11 +7528,10 @@

Examples

-

- - Redis|int|bool - exists(mixed $key, mixed ...$other_keys) - + +

+ + Redis|int|bool exists(mixed $key, mixed ...$other_keys)

@@ -5538,15 +7558,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|bool

The number of keys that do exist and false on failure

+

See also

@@ -5554,7 +7576,7 @@

See also

@@ -5577,11 +7599,10 @@

Examples

-

- - Redis|bool - expire(string $key, int $timeout, string|null $mode = NULL) - + +

+ + Redis|bool expire(string $key, int $timeout, string|null $mode = null)

@@ -5604,7 +7625,7 @@

Parameters

- + @@ -5619,15 +7640,17 @@

Parameters

- https://redis.io/commands/exists + https://redis.io/docs/latest/commands/exists/
int $timeout

The number of seconds after which key will be automatically deleted.

string|null
-

Return Value

+

Return Value

- +
+
Redis|bool

True if an expiration was set and false otherwise.

+

See also

@@ -5635,23 +7658,30 @@

See also

- https://redis.io/commands/expire + https://redis.io/docs/latest/commands/expire/
+

Examples

+ + + + + +
$redis->expire('session:42', 60);
+
-

- - Redis|bool - expireAt(string $key, int $timestamp, string|null $mode = NULL) - + +

+ + Redis|bool expireAt(string $key, int $timestamp, string|null $mode = null)

@@ -5682,15 +7712,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|bool

True if an expiration was set, false if not.

+

See also

@@ -5698,13 +7730,13 @@

See also

@@ -5718,16 +7750,23 @@

See also

- https://redis.io/commands/expireat + https://redis.io/docs/latest/commands/expireat/
- https://redis.io/commands/expire + https://redis.io/docs/latest/commands/expire/
+

Examples

+ + + + + +
$redis->expireAt('session:42', time() + 300);
+
-

- - Redis|bool - failover(array|null $to = null, bool $abort = false, int $timeout = 0) - + +

+ + Redis|bool failover(array|null $to = null, bool $abort = false, int $timeout = 0)

@@ -5759,15 +7798,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|bool
+
@@ -5776,11 +7817,10 @@

Return Value

-

- - Redis|int|false - expiretime(string $key) - + +

+ + Redis|int|false expiretime(string $key)

@@ -5801,9 +7841,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The timestamp when the key expires, or -1 if the key has no expiry @@ -5811,6 +7852,7 @@

Return Value

+

See also

@@ -5818,7 +7860,7 @@

See also

@@ -5829,7 +7871,7 @@

Examples

- https://redis.io/commands/expiretime + https://redis.io/docs/latest/commands/expiretime/
-
$redis->setEx('mykey', 60, 'myval');
+
$redis->setEx('mykey', 60, 'myval');
 $redis->expiretime('mykey');
@@ -5839,11 +7881,10 @@

Examples

-

- - Redis|int|false - pexpiretime(string $key) - + +

+ + Redis|int|false pexpiretime(string $key)

@@ -5864,9 +7905,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The expiration timestamp of this key (in milliseconds) or -1 if the @@ -5874,6 +7916,7 @@

Return Value

+

See also

@@ -5881,7 +7924,7 @@

See also

@@ -5895,45 +7938,65 @@

See also

- https://redis.io/commands/pexpiretime + https://redis.io/docs/latest/commands/pexpiretime/
+

Examples

+ + + + + +
$redis->pexpiretime('session:42');
+
-

- - Redis|bool - flushAll(bool|null $sync = null) - + +

+ + mixed fcall(string $fn, array $keys = [], array $args = [])

-

Deletes every key in all Redis databases

+

Invoke a function.

Parameters

- - - + + + + + + + + + + + + +
bool|null$sync

Whether to perform the task in a blocking or non-blocking way.

string$fn

The name of the function

array$keys

Optional list of keys

array$args

Optional list of args

-

Return Value

+

Return Value

- +
+
- - + +
Redis|boolmixed

Function may return arbitrary data so this method can return +strings, arrays, nested arrays, etc.

+

See also

@@ -5941,52 +8004,72 @@

See also

- https://redis.io/commands/flushall + https://redis.io/docs/latest/commands/fcall/
+

Examples

+ + + + + +
$redis->fcall('mylib.increment', ['counter'], [1]);
+
-

- - Redis|bool - flushDB(bool|null $sync = null) - + +

+ + mixed fcall_ro(string $fn, array $keys = [], array $args = [])

-

Deletes all the keys of the currently selected database.

+

This is a read-only variant of the FCALL command that cannot execute commands that modify data.

Parameters

- - - + + + + + + + + + + + + +
bool|null$sync

Whether to perform the task in a blocking or non-blocking way.

string$fn

The name of the function

array$keys

Optional list of keys

array$args

Optional list of args

-

Return Value

+

Return Value

- +
+
- - + +
Redis|boolmixed

Function may return arbitrary data so this method can return +strings, arrays, nested arrays, etc.

+

See also

@@ -5994,42 +8077,248 @@

See also

- https://redis.io/commands/flushdb + https://redis.io/docs/latest/commands/fcall_ro/
+

Examples

+ + + + + +
$redis->fcall_ro('mylib.peek', ['counter']);
+
-

- - Redis|int|false - geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options) - + +

+ + Redis|bool flushAll(bool|null $sync = null)

-

Add one or more members to a geospacial sorted set

+

Deletes every key in all Redis databases

Parameters

- - - + + + - - +
string$key

The sorted set to add data to.

bool|null$sync

Whether to perform the task in a blocking or non-blocking way.

float
+ + +

Return Value

+ +
+ + + + + +
Redis|bool
+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/flushall/ +
+ + +

Examples

+ + + + + +
$redis->flushAll(true);
+ +
+
+ +
+
+ +

+ + Redis|bool flushDB(bool|null $sync = null) +

+
+ + + +
+

Deletes all the keys of the currently selected database.

+
+
+

Parameters

+ + + + + + + +
bool|null$sync

Whether to perform the task in a blocking or non-blocking way.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool
+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/flushdb/ +
+ + +

Examples

+ + + + + +
$redis->flushDB(true);
+ +
+
+ +
+
+ +

+ + Redis|bool|string|array function(string $operation, mixed ...$args) +

+
+ + + +
+

Functions is an API for managing code to be executed on the server.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$operation

The subcommand you intend to execute. Valid options are as follows +'LOAD' - Create a new library with the given library name and code. +'DELETE' - Delete the given library. +'LIST' - Return general information on all the libraries +'STATS' - Return information about the current function running +'KILL' - Kill the current running function +'FLUSH' - Delete all the libraries +'DUMP' - Return a serialized payload representing the current libraries +'RESTORE' - Restore the libraries represented by the given payload

mixed...$args

Additional arguments

+ + +

Return Value

+ +
+ + + + + +
Redis|bool|string|array

Depends on subcommand.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/function/ +
+ + +

Examples

+ + + + + +
$redis->function('LIST');
+ +
+
+ +
+
+ +

+ + Redis|int|false geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options) +

+
+ + + +
+

Add one or more members to a geospacial sorted set

+
+
+

Parameters

+ + + + + + + + + @@ -6053,9 +8342,10 @@

Parameters

string$key

The sorted set to add data to.

float $lng

The longitude of the first member

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of added elements is returned. If the 'CH' option is specified, @@ -6063,6 +8353,7 @@

Return Value

+

See also

@@ -6070,7 +8361,7 @@

See also

@@ -6093,11 +8384,10 @@

Examples

-

- - Redis|float|false - geodist(string $key, string $src, string $dst, string|null $unit = null) - + +

+ + Redis|float|false geodist(string $key, string $src, string $dst, string|null $unit = null)

@@ -6137,9 +8427,10 @@

Parameters

- https://redis.io/commands/geoadd + https://redis.io/docs/latest/commands/geoadd/
-

Return Value

+

Return Value

- +
+
Redis|float|false

The calculated distance in whichever units were specified or false @@ -6147,6 +8438,7 @@

Return Value

+

See also

@@ -6154,7 +8446,7 @@

See also

@@ -6174,11 +8466,10 @@

Examples

-

- - Redis|array|false - geohash(string $key, string $member, string ...$other_members) - + +

+ + Redis|array|false geohash(string $key, string $member, string ...$other_members)

@@ -6209,15 +8500,17 @@

Parameters

- https://redis.io/commands/geodist + https://redis.io/docs/latest/commands/geodist/
-

Return Value

+

Return Value

- +
+
Redis|array|false

An array of GeoHash encoded values.

+

See also

@@ -6225,7 +8518,7 @@

See also

@@ -6251,11 +8544,10 @@

Examples

-

- - Redis|array|false - geopos(string $key, string $member, string ...$other_members) - + +

+ + Redis|array|false geopos(string $key, string $member, string ...$other_members)

@@ -6286,15 +8578,17 @@

Parameters

- https://redis.io/commands/geohash + https://redis.io/docs/latest/commands/geohash/
-

Return Value

+

Return Value

- +
+
- +
Redis|array|false

array of longitude and latitude pairs.

An array of longitude and latitude pairs.

+

See also

@@ -6302,7 +8596,7 @@

See also

@@ -6322,11 +8616,10 @@

Examples

-

- - mixed - georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) - + +

+ + mixed georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])

@@ -6369,7 +8662,7 @@

Parameters

- https://redis.io/commands/geopos + https://redis.io/docs/latest/commands/geopos/
array $options

An array of options that modifies how the command behaves.

-
$options = [
+
$options = [
     'WITHCOORD',     # Return members and their coordinates.
     'WITHDIST',      # Return members and their distances from the center.
     'WITHHASH',      # Return members GeoHash string.
@@ -6389,15 +8682,17 @@ 

Parameters

-

Return Value

+

Return Value

- +
+
mixed

This command can return various things, depending on the options passed.

+

See also

@@ -6405,7 +8700,7 @@

See also

@@ -6425,11 +8720,10 @@

Examples

-

- - mixed - georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) - + +

+ + mixed georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])

@@ -6475,15 +8769,17 @@

Parameters

- https://redis.io/commands/georadius + https://redis.io/docs/latest/commands/georadius/
-

Return Value

+

Return Value

- +
+
mixed
+

See also

@@ -6494,20 +8790,33 @@

See also

Redis::georadius + + + + https://redis.io/docs/latest/commands/georadius_ro/ + + +

Examples

+ + + + + +
$redis->georadius_ro('cities', -122.335167, 47.608013, 100, 'km');
+
-

- - mixed - georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []) - + +

+ + mixed georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = [])

@@ -6550,17 +8859,30 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed

This command can return various things depending on options.

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/georadiusbymember/ +
+

Examples

@@ -6575,11 +8897,10 @@

Examples

-

- - mixed - georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []) - + +

+ + mixed georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = [])

@@ -6620,28 +8941,48 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/georadiusbymember_ro/ +
+ +

Examples

+ + + + + +
$redis->georadiusbymember_ro('cities', 'Seattle', 200, 'mi');
+
-

- - array - geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []) - + +

+ + array geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = [])

@@ -6686,28 +9027,48 @@

Parameters

-

Return Value

+

Return Value

- +
+
array
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/geosearch/ +
+ +

Examples

+ + + + + +
$redis->geosearch('cities', 'Seattle', 50, 'km', ['WITHDIST']);
+
-

- - Redis|array|int|false - geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []) - + +

+ + Redis|array|int|false geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = [])

@@ -6752,7 +9113,7 @@

Parameters

array $options -
$options = [
+                
$options = [
     'ASC' | 'DESC',  # The sort order of returned members
     'WITHDIST'       # Also store distances.
 
@@ -6764,28 +9125,48 @@ 

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|int|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/geosearchstore/ +
+ +

Examples

+ + + + + +
$redis->geosearchstore('west:cities', 'cities', 'Seattle', 50, 'km', ['DESC']);
+
-

- - mixed - get(string $key) - + +

+ + mixed get(string $key)

@@ -6806,15 +9187,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed

The keys value or false if it did not exist.

+

See also

@@ -6822,7 +9205,7 @@

See also

@@ -6842,30 +9225,82 @@

Examples

-

- - mixed - getAuth() - + +

+ + Redis|array|false getWithMeta(string $key)

-

Get the authentication information on the connection, if any.

+

Retrieve a value and metadata of key.

+

Parameters

+ +
- https://redis.io/commands/get + https://redis.io/docs/latest/commands/get/
+ + + + + +
string$key

The key to query

+ + +

Return Value

+ +
+ + + + + +
Redis|array|false
+ +
+ + -

Return Value

+

Examples

+ + + +
$redis->getWithMeta('foo');
+ +
+ + + +
+ +

+ + mixed getAuth() +

+
+ + + +
+

Get the authentication information on the connection, if any.

+
+
+ +

Return Value

+ +
+
mixed

The authentication information used to authenticate the connection.

+

See also

@@ -6881,16 +9316,23 @@

See also

+

Examples

+ + + + + +
$redis->getAuth();
+
-

- - Redis|int|false - getBit(string $key, int $idx) - + +

+ + Redis|int|false getBit(string $key, int $idx)

@@ -6916,15 +9358,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false
+

See also

@@ -6932,7 +9376,7 @@

See also

@@ -6952,11 +9396,10 @@

Examples

-

- - Redis|string|bool - getEx(string $key, array $options = []) - + +

+ + Redis|string|bool getEx(string $key, array $options = [])

@@ -6978,7 +9421,7 @@

Parameters

- https://redis.io/commands/getbit + https://redis.io/docs/latest/commands/getbit/
array $options

Options to modify how the command works.

-
$options = [
+
$options = [
     'EX'     => <seconds>      # Expire in N seconds
     'PX'     => <milliseconds> # Expire in N milliseconds
     'EXAT'   => <timestamp>    # Expire at a unix timestamp (in seconds)
@@ -6989,15 +9432,17 @@ 

Parameters

-

Return Value

+

Return Value

- +
+
Redis|string|bool

The key's value or false if it didn't exist.

+

See also

@@ -7005,7 +9450,7 @@

See also

@@ -7025,11 +9470,10 @@

Examples

-

- - int - getDBNum() - + +

+ + int getDBNum()

@@ -7040,15 +9484,17 @@

-

Return Value

+

Return Value

-
- https://redis.io/comands/getex + https://redis.io/docs/latest/commands/getex/
+
+
- +
int

database we're connected to.

The database we're connected to.

+

See also

@@ -7063,23 +9509,30 @@

See also

- https://redis.io/commands/select + https://redis.io/docs/latest/commands/select/ +

Examples

+ + + + + +
$redis->getDBNum();
+
-

- - Redis|string|bool - getDel(string $key) - + +

+ + Redis|string|bool getDel(string $key)

@@ -7100,15 +9553,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|string|bool

The value of the key or false if it didn't exist.

+

See also

@@ -7116,7 +9571,7 @@

See also

@@ -7136,11 +9591,10 @@

Examples

-

- - string - getHost() - + +

+ + string getHost()

@@ -7151,28 +9605,37 @@

-

Return Value

+

Return Value

-
- https://redis.io/commands/getdel + https://redis.io/docs/latest/commands/getdel/
+
+
string

The host or Unix socket.

+
+

Examples

+ + + + + +
$redis->getHost();
+
-

- - string|null - getLastError() - + +

+ + string|null getLastError()

@@ -7183,28 +9646,37 @@

-

Return Value

+

Return Value

- +
+
string|null

The error string or NULL if there is none.

+
+

Examples

+ + + + + +
$redis->getLastError();
+
-

- - int - getMode() - + +

+ + int getMode()

@@ -7215,28 +9687,37 @@

-

Return Value

+

Return Value

- +
+
int

The mode we're in.

+
+

Examples

+ + + + + +
$redis->getMode();
+
-

- - mixed - getOption(int $option) - + +

+ + mixed getOption(int $option)

@@ -7257,15 +9738,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
mixed

The setting itself or false on failure

+

See also

@@ -7281,16 +9764,23 @@

See also

+

Examples

+ + + + + +
$redis->getOption(Redis::OPT_PREFIX);
+
-

- - string|null - getPersistentID() - + +

+ + string|null getPersistentID()

@@ -7301,28 +9791,37 @@

-

Return Value

+

Return Value

- +
+
string|null

The ID or NULL if we don't have one.

+
+

Examples

+ + + + + +
$redis->getPersistentID();
+
-

- - int - getPort() - + +

+ + int getPort()

@@ -7333,28 +9832,119 @@

-

Return Value

+

Return Value

- +
+
int

The port.

+
+ + + +

Examples

+ + + + + +
$redis->getPort();
+ +
+ + + +
+ +

+ + string|false serverName() +

+
+ + + +
+

Get the server name as reported by the HELLO response.

+
+
+ +

Return Value

+ +
+ + + + + +
string|false
+ +
+ + + +

Examples

+ + + + + +
$redis->serverName();
+ +
+
+ +
+
+ +

+ + string|false serverVersion() +

+
+ + + +
+

Get the server version as reported by the HELLO response.

+
+
+ +

Return Value

+ +
+ + + + + +
string|false
+ +
+

Examples

+ + + + + +
$redis->serverVersion();
+
-

- - Redis|string|false - getRange(string $key, int $start, int $end) - + +

+ + Redis|string|false getRange(string $key, int $start, int $end)

@@ -7385,15 +9975,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|string|false

The substring or false on failure.

+

See also

@@ -7401,7 +9993,7 @@

See also

@@ -7412,7 +10004,7 @@

Examples

- https://redis.io/commands/getrange + https://redis.io/docs/latest/commands/getrange/
-
$redis->set('silly-word', 'Supercalifragilisticexpialidocious');
+
$redis->set('silly-word', 'Supercalifragilisticexpialidocious');
 echo $redis->getRange('silly-word', 0, 4) . "\n";
@@ -7422,11 +10014,10 @@

Examples

-

- - Redis|string|array|int|false - lcs(string $key1, string $key2, array|null $options = NULL) - + +

+ + Redis|string|array|int|false lcs(string $key1, string $key2, array|null $options = null)

@@ -7453,7 +10044,7 @@

Parameters

array|null $options

An optional array of modifiers for the command.

-
$options = [
+
$options = [
     'MINMATCHLEN'  => int  # Exclude matching substrings that are less than this value
 
     'WITHMATCHLEN' => bool # Whether each match should also include its length.
@@ -7468,15 +10059,17 @@ 

Parameters

-

Return Value

+

Return Value

- +
+
Redis|string|array|int|false

Various reply types depending on options.

+

See also

@@ -7484,7 +10077,7 @@

See also

@@ -7495,8 +10088,8 @@

Examples

- https://redis.io/commands/lcs + https://redis.io/docs/latest/commands/lcs/
-
$redis->set('seq1', 'gtaggcccgcacggtctttaatgtatccctgtttaccatgccatacctgagcgcatacgc');
-$redis->set('seq2', 'aactcggcgcgagtaccaggccaaggtcgttccagagcaaagactcgtgccccgctgagc');
+
$redis->set('seq1', 'gtaggcccgcacggtctttaatgtatccctgtttaccatgccatacctgagcgcatacgc');
+$redis->set('seq2', 'aactcggcgcgagtaccaggccaaggtcgttccagagcaaagactcgtgccccgctgagc');
 echo $redis->lcs('seq1', 'seq2') . "\n";
@@ -7506,11 +10099,10 @@

Examples

-

- - float - getReadTimeout() - + +

+ + float getReadTimeout()

@@ -7521,28 +10113,37 @@

-

Return Value

+

Return Value

- +
+
float

The timeout.

+
+

Examples

+ + + + + +
$redis->getReadTimeout();
+
-

- - Redis|string|false - getset(string $key, mixed $value) - + +

+ + Redis|string|false getset(string $key, mixed $value)

@@ -7568,15 +10169,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|string|false

The old value of the key or false if it didn't exist.

+

See also

@@ -7584,7 +10187,7 @@

See also

@@ -7595,7 +10198,7 @@

Examples

- https://redis.io/commands/getset + https://redis.io/docs/latest/commands/getset/
-
$redis->getset('captain', 'Pike');
+
$redis->getset('captain', 'Pike');
 $redis->getset('captain', 'Kirk');
@@ -7605,11 +10208,10 @@

Examples

-

- - float|false - getTimeout() - + +

+ + float|false getTimeout()

@@ -7620,61 +10222,119 @@

-

Return Value

+

Return Value

- +
+
float|false

The currently set timeout or false on failure (e.g. we aren't connected).

+
+

Examples

+ + + + + +
$redis->getTimeout();
+
-

- - int|false - getTransferredBytes() - + +

+ + array getTransferredBytes()

-

No description

- +

Get the number of bytes sent and received on the socket.

-

Return Value

+

Return Value

+ +
+ + + + + +
array

An array in the form [$sent_bytes, $received_bytes]

+ +
+ + + +

Examples

+ + + +
$redis->getTransferredBytes();
+ +
+
+ +
+
+ +

+ + void clearTransferredBytes() +

+
+ + + +
+

Reset the number of bytes sent and received on the socket.

+
+
+ +

Return Value

+ +
+ - +
int|falsevoid
+
+

Examples

+ + + + + +
$redis->clearTransferredBytes();
+
-

- - Redis|int|false - hDel(string $key, string $field, string ...$other_fields) - + +

+ + Redis|int|false hDel(string $key, string $field, string ...$other_fields)

@@ -7705,15 +10365,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of fields actually removed.

+

See also

@@ -7721,7 +10383,7 @@

See also

@@ -7741,11 +10403,10 @@

Examples

-

- - Redis|bool - hExists(string $key, string $field) - + +

+ + Redis|bool hExists(string $key, string $field)

@@ -7771,15 +10432,17 @@

Parameters

- https://redis.io/commands/hdel + https://redis.io/docs/latest/commands/hdel/
-

Return Value

+

Return Value

- +
+
Redis|bool

True if it exists, false if not.

+

See also

@@ -7787,7 +10450,7 @@

See also

@@ -7807,11 +10470,10 @@

Examples

-

- - mixed - hGet(string $key, string $member) - + +

+ + mixed hGet(string $key, string $member)

@@ -7838,15 +10500,17 @@

Parameters

- https://redis.io/commands/hexists + https://redis.io/docs/latest/commands/hexists/
-

Return Value

+

Return Value

- +
+
mixed
+ @@ -7855,11 +10519,10 @@

Return Value

-

- - Redis|array|false - hGetAll(string $key) - + +

+ + Redis|array|false hGetAll(string $key)

@@ -7880,15 +10543,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

All fields and values or false if the key didn't exist.

+

See also

@@ -7896,7 +10561,7 @@

See also

@@ -7916,11 +10581,66 @@

Examples

-

- - Redis|int|false - hIncrBy(string $key, string $field, int $value) - + +

+ + mixed hGetWithMeta(string $key, string $member) +

+
+ + + +
+

Retrieve a value and metadata of hash field.

+
+
+

Parameters

+ +
- https://redis.io/commands/hgetall + https://redis.io/docs/latest/commands/hgetall/
+ + + + + + + + + + +
string$key

The key to query

string$member

The key to query

+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +

Examples

+ + + + + +
$redis->hgetWithMeta('foo', 'field');
+ +
+ + + +
+ +

+ + Redis|int|false hIncrBy(string $key, string $field, int $value)

@@ -7951,15 +10671,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The new value of the field.

+

See also

@@ -7967,7 +10689,7 @@

See also

@@ -7978,7 +10700,7 @@

Examples

- https://redis.io/commands/hincrby + https://redis.io/docs/latest/commands/hincrby/
-
$redis->hMSet('player:1', ['name' => 'Alice', 'score' => 0]);
+
$redis->hMSet('player:1', ['name' => 'Alice', 'score' => 0]);
 $redis->hincrby('player:1', 'score', 10);
@@ -7988,11 +10710,10 @@

Examples

-

- - Redis|float|false - hIncrByFloat(string $key, string $field, float $value) - + +

+ + Redis|float|false hIncrByFloat(string $key, string $field, float $value)

@@ -8023,15 +10744,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|float|false

The field value after incremented.

+

See also

@@ -8039,7 +10762,7 @@

See also

@@ -8059,11 +10782,10 @@

Examples

-

- - Redis|array|false - hKeys(string $key) - + +

+ + Redis|array|false hKeys(string $key)

@@ -8084,15 +10806,17 @@

Parameters

- https://redis.io/commands/hincrbyfloat + https://redis.io/docs/latest/commands/hincrbyfloat/
-

Return Value

+

Return Value

- +
+
Redis|array|false

The fields in the hash or false if the hash doesn't exist.

+

See also

@@ -8100,7 +10824,7 @@

See also

@@ -8120,11 +10844,10 @@

Examples

-

- - Redis|int|false - hLen(string $key) - + +

+ + Redis|int|false hLen(string $key)

@@ -8145,15 +10868,17 @@

Parameters

- https://redis.io/commands/hkeys + https://redis.io/docs/latest/commands/hkeys/
-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of fields or false if the key didn't exist.

+

See also

@@ -8161,7 +10886,7 @@

See also

@@ -8181,11 +10906,10 @@

Examples

-

- - Redis|array|false - hMget(string $key, array $fields) - + +

+ + Redis|array|false hMget(string $key, array $fields)

@@ -8211,15 +10935,17 @@

Parameters

- https://redis.io/commands/hlen + https://redis.io/docs/latest/commands/hlen/
-

Return Value

+

Return Value

- +
+
Redis|array|false

The fields and values or false if the key didn't exist.

+

See also

@@ -8227,7 +10953,7 @@

See also

@@ -8247,18 +10973,18 @@

Examples

-

- - Redis|bool - hMset(string $key, array $fieldvals) - + +

+ + Redis|array|false hgetex(string $key, array $fields, string|array|null $expiry = null)

-

Add or update one or more hash fields and values

+

Get one or more fields of a hash while optionally setting expiration +information

Parameters

@@ -8267,25 +10993,32 @@

Parameters

- + - - + + + + + + +
- https://redis.io/commands/hmget + https://redis.io/docs/latest/commands/hmget/
string $key

The hash to create/update

The hash to query.

array$fieldvals

An associative array with fields and their values.

$fields

One or more fields to query in the hash.

string|array|null$expiry

Info about the expiration

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the operation was successful

Redis|array|false

The fields and values or false if the key didn't exist.

+

See also

@@ -8293,7 +11026,7 @@

See also

@@ -8304,7 +11037,7 @@

Examples

- https://redis.io/commands/hmset + https://redis.io/docs/latest/commands/hgetex/
- +
$redis->hmset('updates', ['status' => 'starting', 'elapsed' => 0]);
$redis->hgetex('profiles', ['name', 'email'], ['EX' => 60]);
@@ -8313,18 +11046,17 @@

Examples

-

- - Redis|string|array - hRandField(string $key, array $options = null) - + +

+ + Redis|int|false hsetex(string $key, array $fields, array|null $expiry = null)

-

Get one or more random field from a hash.

+

Set one or more fields in a hash with optional expiration information.

Parameters

@@ -8333,29 +11065,32 @@

Parameters

string $key -

The hash to query.

+

The hash to create/update.

array - $options -

An array of options to modify how the command behaves.

-
$options = [
-    'COUNT'      => int  # An optional number of fields to return.
-    'WITHVALUES' => bool # Also return the field values.
-];
+ $fields +

An array with fields values.

+ + + array|null + $expiry +

Info about the expiration

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|array

One or more random fields (and possibly values).

Redis|int|false

One if fields were set zero if not.

+

See also

@@ -8363,7 +11098,7 @@

See also

@@ -8374,10 +11109,7 @@

Examples

- https://redis.io/commands/hrandfield + https://redis.io/docs/latest/commands/hsetex/
- - - - +
$redis->hrandfield('settings');
$redis->hrandfield('settings', ['count' => 2, 'withvalues' => true]);
$redis->hsetex('profiles', ['token' => 'abc123'], ['EX' => 60]);
@@ -8386,19 +11118,17 @@

Examples

-

- - Redis|int|false - hSet(string $key, string $member, mixed $value) - + +

+ + Redis|array|false hgetdel(string $key, array $fields)

-

No description

- +

Get one or more fields and delete them

Parameters

@@ -8407,50 +11137,65 @@

Parameters

string $key - - - - string - $member - +

The hash in question

- mixed - $value - + array + $fields +

One or more fields

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|falseRedis|array|false

The field and values or false on failure

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/hgetdel/ +
+ +

Examples

+ + + + + +
$redis->hgetdel('profiles', ['token']);
+
-

- - Redis|bool - hSetNx(string $key, string $field, string $value) - + +

+ + Redis|bool hMset(string $key, array $fieldvals)

-

Set a hash field and value, but only if that field does not exist

+

Add or update one or more hash fields and values

Parameters

@@ -8459,30 +11204,27 @@

Parameters

string $key -

The hash to update.

- - - string - $field -

The value to set.

+

The hash to create/update

- string - $value - + array + $fieldvals +

An associative array with fields and their values.

-

Return Value

+

Return Value

- +
+
- +
Redis|bool

True if the field was set and false if not.

True if the operation was successful

+

See also

@@ -8490,7 +11232,7 @@

See also

@@ -8501,8 +11243,7 @@

Examples

- https://redis.io/commands/hsetnx + https://redis.io/docs/latest/commands/hmset/
- +
$redis->hsetnx('player:1', 'lock', 'enabled');
-$redis->hsetnx('player:1', 'lock', 'enabled');
$redis->hmset('updates', ['status' => 'starting', 'elapsed' => 0]);
@@ -8511,18 +11252,17 @@

Examples

-

- - Redis|int|false - hStrLen(string $key, string $field) - + +

+ + Redis|string|array|false hRandField(string $key, array|null $options = null)

-

Get the string length of a hash field

+

Get one or more random field from a hash.

Parameters

@@ -8534,22 +11274,28 @@

Parameters

The hash to query.

- string - $field -

The field to query.

+ array|null + $options +

An array of options to modify how the command behaves.

+
$options = [
+    'COUNT'      => int  # An optional number of fields to return.
+    'WITHVALUES' => bool # Also return the field values.
+];
-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The string length of the field or false.

Redis|string|array|false

One or more random fields (and possibly values).

+

See also

@@ -8557,7 +11303,7 @@

See also

@@ -8568,10 +11314,10 @@

Examples

- https://redis.io/commands/hstrlen + https://redis.io/docs/latest/commands/hrandfield/
- + + + +
$redis = new Redis(['host' => 'localhost']);
-$redis->del('hash');
-$redis->hmset('hash', ['50bytes' => str_repeat('a', 50)]);
-$redis->hstrlen('hash', '50bytes');
$redis->hrandfield('settings');
$redis->hrandfield('settings', ['count' => 2, 'withvalues' => true]);
@@ -8580,18 +11326,17 @@

Examples

-

- - Redis|array|false - hVals(string $key) - + +

+ + Redis|int|false hSet(string $key, mixed ...$fields_and_vals)

-

Get all of the values from a hash.

+

Add or update one or more hash fields and values.

Parameters

@@ -8600,20 +11345,28 @@

Parameters

string $key -

The hash to query.

+

The hash to create/update.

+ + + mixed + ...$fields_and_vals +

Argument pairs of fields and values. Alternatively, an associative array with the +fields and their values.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|false

The values from the hash.

Redis|int|false

The number of fields that were added, or false on failure.

+

See also

@@ -8621,7 +11374,7 @@

See also

@@ -8632,7 +11385,10 @@

Examples

- https://redis.io/commands/hvals + https://redis.io/docs/latest/commands/hset/
- + + + +
$redis->hvals('player:1');
$redis->hSet('player:1', 'name', 'Kim', 'score', 78);
$redis->hSet('player:1', ['name' => 'Kim', 'score' => 78]);
@@ -8641,18 +11397,17 @@

Examples

-

- - Redis|array|bool - hscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + Redis|bool hSetNx(string $key, string $field, mixed $value)

-

Iterate over the fields and values of a hash in an incremental fashion.

+

Set a hash field and value, but only if that field does not exist

Parameters

@@ -8661,37 +11416,32 @@

Parameters

string $key -

The hash to query.

- - - int|null - $iterator -

The scan iterator, which should be initialized to NULL before the first call. -This value will be updated after every call to hscan, until it reaches zero -meaning the scan is complete.

+

The hash to update.

- string|null - $pattern -

An optional glob-style pattern to filter fields with.

+ string + $field +

The value to set.

- int - $count -

An optional hint to Redis about how many fields and values to return per HSCAN.

+ mixed + $value + -

Return Value

+

Return Value

- +
+
- - + +
Redis|array|bool

An array with a subset of fields and values.

Redis|bool

True if the field was set and false if not.

+

See also

@@ -8699,13 +11449,7 @@

See also

- - - - @@ -8716,26 +11460,8 @@

Examples

- https://redis.io/commands/hscan -
- https://redis.io/commands/scan + https://redis.io/docs/latest/commands/hsetnx/
- +
$redis = new Redis(['host' => 'localhost']);
-
-$redis->del('big-hash');
-
-for ($i = 0; $i < 1000; $i++) {
- $fields["field:$i"] = "value:$i";
-}
-
-$redis->hmset('big-hash', $fields);
-
-$it = NULL;
-
-do {
- // Scan the hash but limit it to fields that match '*:1?3'
- $fields = $redis->hscan('big-hash', $it, '*:1?3');
-
- foreach ($fields as $field => $value) {
- echo "[$field] => $value\n";
- }
-} while ($it != 0);
$redis->hsetnx('player:1', 'lock', 'enabled');
+$redis->hsetnx('player:1', 'lock', 'enabled');
@@ -8744,18 +11470,17 @@

Examples

-

- - Redis|int|false - incr(string $key, int $by = 1) - + +

+ + Redis|int|false hStrLen(string $key, string $field)

-

Increment a key's value, optionally by a specific amount.

+

Get the string length of a hash field

Parameters

@@ -8764,25 +11489,27 @@

Parameters

string $key -

The key to increment

+

The hash to query.

- int - $by -

An optional amount to increment by.

+ string + $field +

The field to query.

-

Return Value

+

Return Value

- +
+
- +
Redis|int|false

The new value of the key after incremented.

The string length of the field or false.

+

See also

@@ -8790,13 +11517,7 @@

See also

- - - - @@ -8807,10 +11528,10 @@

Examples

- https://redis.io/commands/incr -
- https://redis.io/commands/incrby + https://redis.io/docs/latest/commands/hstrlen/
- - - - +
$redis->incr('mycounter');
$redis->incr('mycounter', 10);
$redis = new Redis(['host' => 'localhost']);
+$redis->del('hash');
+$redis->hmset('hash', ['50bytes' => str_repeat('a', 50)]);
+$redis->hstrlen('hash', '50bytes');
@@ -8819,18 +11540,17 @@

Examples

-

- - Redis|int|false - incrBy(string $key, int $value) - + +

+ + Redis|array|false hVals(string $key)

-

Increment a key by a specific integer value

+

Get all of the values from a hash.

Parameters

@@ -8839,25 +11559,22 @@

Parameters

string $key -

The key to increment.

- - - int - $value -

The amount to increment.

+

The hash to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|falseRedis|array|false

The values from the hash.

+

See also

@@ -8865,7 +11582,7 @@

See also

@@ -8876,11 +11593,7 @@

Examples

- https://redis.io/commands/incrby + https://redis.io/docs/latest/commands/hvals/
- +
$redis->set('primes', 2);
-$redis->incrby('primes', 1);
-$redis->incrby('primes', 2);
-$redis->incrby('primes', 2);
-$redis->incrby('primes', 4);
$redis->hvals('player:1');
@@ -8889,18 +11602,17 @@

Examples

-

- - Redis|float|false - incrByFloat(string $key, float $value) - + +

+ + Redis|array|false hexpire(string $key, int $ttl, array $fields, string|null $mode = NULL)

-

Increment a numeric key by a floating point value.

+

Set the expiration on one or more fields in a hash.

Parameters

@@ -8909,34 +11621,56 @@

Parameters

string $key -

The key to increment

+

The hash to update.

- float - $value -

How much to increment (or decrement) the value.

+ int + $ttl +

The time to live in seconds.

+ + + array + $fields +

The fields to set the expiration on.

+ + + string|null + $mode +

An optional mode (NX, XX, ETC)

-

Return Value

+

Return Value

- +
+
- - + +
Redis|float|false

The new value of the key or false if the key didn't contain a string.

Redis|array|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/hexpire/ +
+

Examples

- +
$redis->incrbyfloat('tau', 3.1415926);
-$redis->incrbyfloat('tau', 3.1415926);
$redis->hexpire('profiles', 300, ['token'], 'NX');
@@ -8945,21 +11679,17 @@

Examples

-

- - Redis|array|false - info(string ...$sections) - + +

+ + Redis|array|false hpexpire(string $key, int $ttl, array $fields, string|null $mode = NULL)

-

Retrieve information about the connected redis-server. If no arguments are passed to -this function, redis will return every info field. Alternatively you may pass a specific -section you want returned (e.g. 'server', or 'memory') to receive only information pertaining -to that section.

If connected to Redis server >= 7.0.0 you may pass multiple optional sections.

+

Set the expiration on one or more fields in a hash in milliseconds.

Parameters

@@ -8967,21 +11697,38 @@

Parameters

- - + + + + + + + + + + + + + + + + +
string...$sections

Optional section(s) you wish Redis server to return.

$key

The hash to update.

int$ttl

The time to live in milliseconds.

array$fields

The fields to set the expiration on.

string|null$mode

An optional mode (NX, XX, ETC)

-

Return Value

+

Return Value

- +
+
Redis|array|false
+

See also

@@ -8989,63 +11736,37 @@

See also

- https://redis.io/commands/info/ + https://redis.io/docs/latest/commands/hexpire/
-
-
- -
-
-

- - bool - isConnected() - -

-
- - - -
-

Check if we are currently connected to a Redis instance.

-
-
- -

Return Value

+

Examples

- - - - -
bool

True if we are, false if not

+ +
$redis->hpexpire('profiles', 1500, ['token']);
+ + - - -
-

- - Redis|array|false - keys(string $pattern) - + +

+ + Redis|array|false hexpireat(string $key, int $time, array $fields, string|null $mode = NULL)

-

No description

- +

Set the expiration time on one or more fields of a hash.

Parameters

@@ -9053,42 +11774,76 @@

Parameters

- - + + + + + + + + + + + + + + + + +
string$pattern$key

The hash to update.

int$time

The time to live in seconds.

array$fields

The fields to set the expiration on.

string|null$mode

An optional mode (NX, XX, ETC)

-

Return Value

+

Return Value

- +
+
- +
Redis|array|falseRedis|array|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/hexpire/ +
+ +

Examples

+ + + + + +
$redis->hexpireat('profiles', time() + 600, ['token']);
+
-

- - Redis|int|false - lInsert(string $key, string $pos, mixed $pivot, mixed $value) - + +

+ + Redis|array|false hpexpireat(string $key, int $mstime, array $fields, string|null $mode = NULL)

-

No description

- +

Set the expiration time on one or more fields of a hash in milliseconds.

Parameters

@@ -9097,55 +11852,75 @@

Parameters

string $key - +

The hash to update.

- string - $pos - + int + $mstime +

The time to live in milliseconds.

- mixed - $pivot - + array + $fields +

The fields to set the expiration on.

- mixed - $value - + string|null + $mode +

An optional mode (NX, XX, ETC)

-

Return Value

+

Return Value

- +
+
- +
Redis|int|falseRedis|array|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/hexpire/ +
+ +

Examples

+ + + + + +
$redis->hpexpireat('profiles', (int) (microtime(true) * 1000) + 60000, ['token']);
+
-

- - Redis|int|false - lLen(string $key) - + +

+ + Redis|array|false httl(string $key, array $fields)

-

Retrieve the length of a list.

+

Get the TTL of one or more fields in a hash

Parameters

@@ -9154,40 +11929,65 @@

Parameters

string $key -

The list

+

The hash to query.

+ + + array + $fields +

The fields to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of elements in the list or false on failure.

Redis|array|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/httl/ +
+ +

Examples

+ + + + + +
$redis->httl('profiles', ['token']);
+
-

- - Redis|string|false - lMove(string $src, string $dst, string $wherefrom, string $whereto) - + +

+ + Redis|array|false hpttl(string $key, array $fields)

-

Move an element from one list into another.

+

Get the millisecond TTL of one or more fields in a hash

Parameters

@@ -9195,47 +11995,47 @@

Parameters

- - - - - - - - - - - - + + - - - + + +
string$src

The source list.

string$dst

The destination list

string$wherefrom

Where in the source list to retrieve the element. This can be either -Redis::LEFT, or Redis::RIGHT.

$key

The hash to query.

string$whereto

Where in the destination list to put the element. This can be either -Redis::LEFT, or Redis::RIGHT.

array$fields

The fields to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|false

The element removed from the source list.

Redis|array|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/hpttl/ +
+

Examples

- +
$redis->rPush('numbers', 'one', 'two', 'three');
-$redis->lMove('numbers', 'odds', Redis::LEFT, Redis::LEFT);
$redis->hpttl('profiles', ['token']);
@@ -9244,18 +12044,17 @@

Examples

-

- - Redis|bool|string|array - lPop(string $key, int $count = 0) - + +

+ + Redis|array|false hexpiretime(string $key, array $fields)

-

Pop one or more elements off a list.

+

Get the expiration time of one or more fields in a hash

Parameters

@@ -9264,26 +12063,27 @@

Parameters

string $key -

The list to pop from.

+

The hash to query.

- int - $count -

Optional number of elements to remove. By default one element is popped.

+ array + $fields +

The fields to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool|string|array

Will return the element(s) popped from the list or false/NULL -if none was removed.

Redis|array|false
+

See also

@@ -9291,7 +12091,7 @@

See also

@@ -9302,10 +12102,7 @@

Examples

- https://redis.io/commands/lpop + https://redis.io/docs/latest/commands/hexpiretime/
- - - - +
$redis->lpop('mylist');
$redis->lpop('mylist', 4);
$redis->hexpiretime('profiles', ['token']);
@@ -9314,18 +12111,17 @@

Examples

-

- - Redis|null|bool|int|array - lPos(string $key, mixed $value, array $options = null) - + +

+ + Redis|array|false hpexpiretime(string $key, array $fields)

-

Retrieve the index of an element in a list.

+

Get the expiration time in milliseconds of one or more fields in a hash

Parameters

@@ -9334,65 +12130,65 @@

Parameters

string $key -

The list to query.

- - - mixed - $value -

The value to search for.

+

The hash to query.

array - $options -

Options to configure how the command operates

-
$options = [
-    # How many matches to return.  By default a single match is returned.
-    # If count is set to zero, it means unlimited.
-    'COUNT' => <num-matches>
-
-    # Specify which match you want returned.  `RANK` 1 means "the first match"
-    # 2 means the second, and so on.  If passed as a negative number the
-    # RANK is computed right to left, so a `RANK` of -1 means "the last match".
-    'RANK'  => <rank>
-
-    # This argument allows you to limit how many elements Redis will search before
-    # returning.  This is useful to prevent Redis searching very long lists while
-    # blocking the client.
-    'MAXLEN => <max-len>
-];
+ $fields +

The fields to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|null|bool|int|array

Returns one or more of the matching indexes, or null/false if none were found.

Redis|array|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/hpexpiretime/ +
+ +

Examples

+ + + + + +
$redis->hpexpiretime('profiles', ['token']);
+
-

- - Redis|int|false - lPush(string $key, mixed ...$elements) - + +

+ + Redis|array|false hpersist(string $key, array $fields)

-

Prepend one or more elements to a list.

+

Persist one or more hash fields

Parameters

@@ -9401,25 +12197,27 @@

Parameters

string $key -

The list to prepend.

+

The hash to query.

- mixed - ...$elements -

One or more elements to prepend.

+ array + $fields +

The fields to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The new length of the list after prepending.

Redis|array|false
+

See also

@@ -9427,7 +12225,7 @@

See also

@@ -9438,7 +12236,7 @@

Examples

- https://redis.io/commands/lpush + https://redis.io/docs/latest/commands/hpersist/
- +
$redis->lPush('mylist', 'cat', 'bear', 'aligator');
$redis->hpersist('profiles', ['token']);
@@ -9447,18 +12245,17 @@

Examples

-

- - Redis|int|false - rPush(string $key, mixed ...$elements) - + +

+ + Redis|array|bool hscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

-

Append one or more elements to a list.

+

Iterate over the fields and values of a hash in an incremental fashion.

Parameters

@@ -9467,25 +12264,39 @@

Parameters

string $key -

The list to append to.

+

The hash to query.

- mixed - ...$elements -

one or more elements to append.

+ null|int|string + $iterator +

The scan iterator, which should be initialized to NULL before the first call. +This value will be updated after every call to hscan, until it reaches zero +meaning the scan is complete.

+ + + string|null + $pattern +

An optional glob-style pattern to filter fields with.

+ + + int + $count +

An optional hint to Redis about how many fields and values to return per HSCAN.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The new length of the list

Redis|array|bool

An array with a subset of fields and values.

+

See also

@@ -9493,7 +12304,13 @@

See also

+ + + + @@ -9504,7 +12321,26 @@

Examples

- https://redis.io/commands/rpush + https://redis.io/docs/latest/commands/hscan/ +
+ https://redis.io/docs/latest/commands/scan/
- +
$redis->rPush('mylist', 'xray', 'yankee', 'zebra');
$redis = new Redis(['host' => 'localhost']);
+
+$redis->del('big-hash');
+
+for ($i = 0; $i < 1000; $i++) {
+    $fields["field:$i"] = "value:$i";
+}
+
+$redis->hmset('big-hash', $fields);
+
+$it = null;
+
+do {
+    // Scan the hash but limit it to fields that match '*:1?3'
+    $fields = $redis->hscan('big-hash', $it, '*:1?3');
+
+    foreach ($fields as $field => $value) {
+        echo "[$field] => $value\n";
+    }
+} while ($it != 0);
@@ -9513,18 +12349,17 @@

Examples

-

- - Redis|int|false - lPushx(string $key, mixed $value) - + +

+ + Redis|int|false expiremember(string $key, string $field, int $ttl, string|null $unit = null)

-

Prepend an element to a list but only if the list exists

+

Set an expiration on a key member (KeyDB only).

Parameters

@@ -9533,45 +12368,81 @@

Parameters

string $key -

The key to prepend to.

+

The key to expire

- mixed - $value -

The value to prepend.

+ string + $field +

The field to expire

+ + + int + $ttl + + + + string|null + $unit +

The unit of the ttl (s, or ms).

-

Return Value

+

Return Value

- +
+
- +
Redis|int|false

The new length of the list.

+
+

See also

+ + + + + + + + + + +
+ https://docs.keydb.dev/docs/commands/#expiremember +
+ https://redis.io/docs/latest/commands/expiremember/ +
+ +

Examples

+ + + + + +
$redis->expiremember('profiles', 'token', 60);
+
-

- - Redis|int|false - rPushx(string $key, mixed $value) - + +

+ + Redis|int|false expirememberat(string $key, string $field, int $timestamp)

-

Append an element to a list but only if the list exists

+

Set an expiration on a key membert to a specific unix timestamp (KeyDB only).

Parameters

@@ -9580,45 +12451,76 @@

Parameters

string $key -

The key to prepend to.

+

The key to expire

- mixed - $value -

The value to prepend.

+ string + $field +

The field to expire

+ + + int + $timestamp +

The unix timestamp to expire at.

-

Return Value

+

Return Value

- +
+
- +
Redis|int|false

The new length of the list.

+
+

See also

+ + + + + + + + + + +
+ https://docs.keydb.dev/docs/commands/#expirememberat +
+ https://redis.io/docs/latest/commands/expirememberat/ +
+ +

Examples

+ + + + + +
$redis->expirememberat('profiles', 'token', time() + 300);
+
-

- - Redis|bool - lSet(string $key, int $index, mixed $value) - + +

+ + Redis|int|false incr(string $key, int $by = 1)

-

Set a list element at an index to a specific value.

+

Increment a key's value, optionally by a specific amount.

Parameters

@@ -9627,30 +12529,27 @@

Parameters

string $key -

The list to modify.

+

The key to increment

int - $index -

The position of the element to change.

- - - mixed - $value -

The new value.

+ $by +

An optional amount to increment by.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the list was modified.

Redis|int|false

The new value of the key after incremented.

+

See also

@@ -9658,42 +12557,75 @@

See also

+ + + +
- https://redis.io/commands/lset + https://redis.io/docs/latest/commands/incr/ +
+ https://redis.io/docs/latest/commands/incrby/
+

Examples

+ + + + + + + + +
$redis->incr('mycounter');
$redis->incr('mycounter', 10);
+
-

- - int - lastSave() - + +

+ + Redis|int|false incrBy(string $key, int $value)

-

Retrieve the last time Redis' database was persisted to disk.

+

Increment a key by a specific integer value

- -

Return Value

+

Parameters

+ + + + + + + + + + +
string$key

The key to increment.

int$value

The amount to increment.

+ + +

Return Value

+ +
+ - - + +
int

The unix timestamp of the last save time

Redis|int|false
+

See also

@@ -9701,30 +12633,41 @@

See also

- https://redis.io/commands/lastsave + https://redis.io/docs/latest/commands/incrby/
+

Examples

+ + + + + +
$redis->set('primes', 2);
+$redis->incrby('primes', 1);
+$redis->incrby('primes', 2);
+$redis->incrby('primes', 2);
+$redis->incrby('primes', 4);
+
-

- - mixed - lindex(string $key, int $index) - + +

+ + Redis|float|false incrByFloat(string $key, float $value)

-

Get the element of a list by its index.

+

Increment a numeric key by a floating point value.

Parameters

@@ -9733,90 +12676,47 @@

Parameters

string $key -

The key to query

+

The key to increment

- int - $index -

The index to check.

+ float + $value +

How much to increment (or decrement) the value.

-

Return Value

+

Return Value

- +
+
- - + +
mixed

The index or NULL/false if the element was not found.

Redis|float|false

The new value of the key or false if the key didn't contain a string.

+
- -
-
- -
-
-

- - Redis|array|false - lrange(string $key, int $start, int $end) - -

-
- - - -
-

Retrieve elements from a list.

-
-
-

Parameters

+

See also

- - - - - - - - - - - - - + +
string$key

The list to query.

int$start

The beginning index to retrieve. This number can be negative -meaning start from the end of the list.

int$end

The end index to retrieve. This can also be negative to start -from the end of the list.

+ https://redis.io/docs/latest/commands/incrbyfloat/ +
-

Return Value

- - - - - - -
Redis|array|false

The range of elements between the indexes.

- - - -

Examples

- - - - +
$redis->lrange('mylist', 0, -1);  // the whole list
$redis->lrange('mylist', -2, -1); // the last two elements in the list.
$redis->incrbyfloat('tau', 3.1415926);
+$redis->incrbyfloat('tau', 3.1415926);
@@ -9825,18 +12725,20 @@

Examples

-

- - Redis|int|false - lrem(string $key, mixed $value, int $count = 0) - + +

+ + Redis|array|false info(string ...$sections)

-

Remove one or more matching elements from a list.

+

Retrieve information about the connected redis-server. If no arguments are passed to +this function, redis will return every info field. Alternatively you may pass a specific +section you want returned (e.g. 'server', or 'memory') to receive only information pertaining +to that section.

If connected to Redis server >= 7.0.0 you may pass multiple optional sections.

Parameters

@@ -9844,31 +12746,23 @@

Parameters

- - - - - - - - - - - - + +
string$key

The list to truncate.

mixed$value

The value to remove.

int$count

How many elements matching the value to remove.

...$sections

Optional section(s) you wish Redis server to return.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of elements removed.

Redis|array|false
+

See also

@@ -9876,62 +12770,51 @@

See also

- https://redis.io/commands/lrem + https://redis.io/docs/latest/commands/info/
+

Examples

+ + + + + +
$redis->info('server', 'stats');
+
-

- - Redis|bool - ltrim(string $key, int $start, int $end) - + +

+ + bool isConnected()

-

Trim a list to a subrange of elements.

+

Check if we are currently connected to a Redis instance.

-

Parameters

- - - - - - - - - - - - - - - - - -
string$key

The list to trim

int$start

The starting index to keep

int$end

The ending index to keep.

- -

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

true if the list was trimmed.

bool

True if we are, false if not

+
@@ -9939,7 +12822,7 @@

Examples

- +
$redis->ltrim('mylist', 0, 3);  // Keep the first four elements
$redis->isConnected();
@@ -9948,48 +12831,61 @@

Examples

-

- - Redis|array - mget(array $keys) - + +

+ + Redis|list&lt;string&gt;|false keys(string $pattern)

-

Get one ore more string keys.

+

No description

+

Parameters

- - - + + +
array$keys

The keys to retrieve

string$pattern
-

Return Value

+

Return Value

- +
+
- - + +
Redis|array

an array of keys with their values.

Redis|list<string>|false
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/keys/ +
+

Examples

- +
$redis->mget(['key1', 'key2']);
$redis->keys('session:*');
@@ -9998,11 +12894,10 @@

Examples

-

- - Redis|bool - migrate(string $host, int $port, string|array $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, mixed $credentials = NULL) - + +

+ + Redis|int|false lInsert(string $key, string $pos, mixed $pivot, mixed $value)

@@ -10018,145 +12913,100 @@

Parameters

- - - - - - - - - - - - - - - - - - - - - - + + - - + + - +
string$host
int$port
string|array $key
int$dstdb
int$timeout
bool$copystring$pos
bool$replacemixed$pivot
mixed$credentials$value
-

Return Value

+

Return Value

- +
+
- +
Redis|boolRedis|int|false
+
- -
-
- -
-
-

- - Redis|bool - move(string $key, int $index) - -

-
- - - -
-

Move a key to a different database on the same redis instance.

-
-
-

Parameters

+

See also

- - - - - - - +
string$key

The key to move

int$index + https://redis.io/docs/latest/commands/linsert/ +
-

Return Value

+

Examples

- - - - -
Redis|bool

True if the key was moved

+ +
$redis->lInsert('letters', Redis::AFTER, 'b', 'beta');
+ + - - -
-

- - Redis|bool - mset(array $key_values) - + +

+ + Redis|int|false lLen(string $key)

-

Set one ore more string keys.

+

Retrieve the length of a list.

Parameters

- - - + + +
array$key_values

An array with keys and their values.

string$key

The list

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the keys could be set.

Redis|int|false

The number of elements in the list or false on failure.

+

See also

@@ -10164,7 +13014,7 @@

See also

@@ -10175,7 +13025,7 @@

Examples

- https://redis.io/commands/mset + https://redis.io/docs/latest/commands/llen/
- +
$redis->mSet(['foo' => 'bar', 'baz' => 'bop']);
$redis->lLen('queue');
@@ -10184,40 +13034,62 @@

Examples

-

- - Redis|bool - msetnx(array $key_values) - + +

+ + Redis|string|false lMove(string $src, string $dst, string $wherefrom, string $whereto)

-

Set one ore more string keys but only if none of the key exist.

+

Move an element from one list into another.

Parameters

- - - + + + + + + + + + + + + + + + + + +
array$key_values

An array of keys with their values.

string$src

The source list.

string$dst

The destination list

string$wherefrom

Where in the source list to retrieve the element. This can be either

+
    +
  • Redis::LEFT, or Redis::RIGHT.
  • +
string$whereto

Where in the destination list to put the element. This can be either

+
    +
  • Redis::LEFT, or Redis::RIGHT.
  • +
-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the keys were set and false if not.

Redis|string|false

The element removed from the source list.

+

See also

@@ -10225,7 +13097,7 @@

See also

@@ -10236,7 +13108,8 @@

Examples

- https://redis.io/commands/msetnx + https://redis.io/docs/latest/commands/lmove/
- +
$redis->msetnx(['foo' => 'bar', 'baz' => 'bop']);
$redis->rPush('numbers', 'one', 'two', 'three');
+$redis->lMove('numbers', 'odds', Redis::LEFT, Redis::LEFT);
@@ -10245,41 +13118,2780 @@

Examples

-

- - bool|Redis - multi(int $value = Redis::MULTI) - + +

+ + Redis|string|false blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout)

-

Begin a transaction.

+

No description

+

Parameters

- - + + + + + + + + + + + + + + + + + + + + + + + + +
int$valuestring$src
string$dst
string$wherefrom
string$whereto
float$timeout
+ + +

Return Value

+ +
+ + + + + +
Redis|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + Redis|bool|string|array lPop(string $key, int $count = 0) +

+
+ + + +
+

Pop one or more elements off a list.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The list to pop from.

int$count

Optional number of elements to remove. By default one element is popped.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool|string|array

Will return the element(s) popped from the list or false/NULL +if none was removed.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lpop/ +
+ + +

Examples

+ + + + + + + + +
$redis->lpop('mylist');
$redis->lpop('mylist', 4);
+ +
+
+ +
+
+ +

+ + Redis|null|bool|int|array lPos(string $key, mixed $value, array|null $options = null) +

+
+ + + +
+

Retrieve the index of an element in a list.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key

The list to query.

mixed$value

The value to search for.

array|null$options

Options to configure how the command operates

+
$options = [
+    # How many matches to return.  By default a single match is returned.
+    # If count is set to zero, it means unlimited.
+    'COUNT' => <num-matches>
+
+    # Specify which match you want returned.  `RANK` 1 means "the first match"
+    # 2 means the second, and so on.  If passed as a negative number the
+    # RANK is computed right to left, so a `RANK` of -1 means "the last match".
+    'RANK'  => <rank>
+
+    # This argument allows you to limit how many elements Redis will search before
+    # returning.  This is useful to prevent Redis searching very long lists while
+    # blocking the client.
+    'MAXLEN => <max-len>
+];
+ + +

Return Value

+ +
+ + + + + +
Redis|null|bool|int|array

Returns one or more of the matching indexes, or null/false if none were found.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lpos/ +
+ + +

Examples

+ + + + + +
$redis->lPos('queue', 'job-42');
+ +
+
+ +
+
+ +

+ + Redis|int|false lPush(string $key, mixed ...$elements) +

+
+ + + +
+

Prepend one or more elements to a list.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The list to prepend.

mixed...$elements

One or more elements to prepend.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The new length of the list after prepending.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lpush/ +
+ + +

Examples

+ + + + + +
$redis->lPush('mylist', 'cat', 'bear', 'aligator');
+ +
+
+ +
+
+ +

+ + Redis|int|false rPush(string $key, mixed ...$elements) +

+
+ + + +
+

Append one or more elements to a list.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The list to append to.

mixed...$elements

one or more elements to append.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The new length of the list

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/rpush/ +
+ + +

Examples

+ + + + + +
$redis->rPush('mylist', 'xray', 'yankee', 'zebra');
+ +
+
+ +
+
+ +

+ + Redis|int|false lPushx(string $key, mixed $value) +

+
+ + + +
+

Prepend an element to a list but only if the list exists

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key to prepend to.

mixed$value

The value to prepend.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The new length of the list.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lpushx/ +
+ + +

Examples

+ + + + + +
$redis->lPushx('queue', 'job-42');
+ +
+
+ +
+
+ +

+ + Redis|int|false rPushx(string $key, mixed $value) +

+
+ + + +
+

Append an element to a list but only if the list exists

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key to prepend to.

mixed$value

The value to prepend.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The new length of the list.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/rpushx/ +
+ + +

Examples

+ + + + + +
$redis->rPushx('queue', 'job-99');
+ +
+
+ +
+
+ +

+ + Redis|bool lSet(string $key, int $index, mixed $value) +

+
+ + + +
+

Set a list element at an index to a specific value.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key

The list to modify.

int$index

The position of the element to change.

mixed$value

The new value.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if the list was modified.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lset/ +
+ + +

Examples

+ + + + + +
$redis->lSet('queue', 0, 'job-42');
+ +
+
+ +
+
+ +

+ + int lastSave() +

+
+ + + +
+

Retrieve the last time Redis' database was persisted to disk.

+
+
+ +

Return Value

+ +
+ + + + + +
int

The unix timestamp of the last save time

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lastsave/ +
+ + +

Examples

+ + + + + +
$redis->lastSave();
+ +
+
+ +
+
+ +

+ + mixed lindex(string $key, int $index) +

+
+ + + +
+

Get the element of a list by its index.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key to query

int$index

The index to check.

+ + +

Return Value

+ +
+ + + + + +
mixed

The index or NULL/false if the element was not found.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lindex/ +
+ + +

Examples

+ + + + + +
$redis->lindex('queue', 0);
+ +
+
+ +
+
+ +

+ + Redis|array|false lrange(string $key, int $start, int $end) +

+
+ + + +
+

Retrieve elements from a list.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key

The list to query.

int$start

The beginning index to retrieve. This number can be negative +meaning start from the end of the list.

int$end

The end index to retrieve. This can also be negative to start +from the end of the list.

+ + +

Return Value

+ +
+ + + + + +
Redis|array|false

The range of elements between the indexes.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lrange/ +
+ + +

Examples

+ + + + + + + + +
$redis->lrange('mylist', 0, -1);  // the whole list
$redis->lrange('mylist', -2, -1); // the last two elements in the list.
+ +
+
+ +
+
+ +

+ + Redis|int|false lrem(string $key, mixed $value, int $count = 0) +

+
+ + + +
+

Remove one or more matching elements from a list.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key

The list to truncate.

mixed$value

The value to remove.

int$count

How many elements matching the value to remove.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The number of elements removed.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/lrem/ +
+ + +

Examples

+ + + + + +
$redis->lrem('queue', 0, 'expired-job');
+ +
+
+ +
+
+ +

+ + Redis|bool ltrim(string $key, int $start, int $end) +

+
+ + + +
+

Trim a list to a subrange of elements.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key

The list to trim

int$start

The starting index to keep

int$end

The ending index to keep.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

true if the list was trimmed.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/ltrim/ +
+ + +

Examples

+ + + + + +
$redis->ltrim('mylist', 0, 3);  // Keep the first four elements
+ +
+
+ +
+
+ +

+ + Redis|array|false mget(array $keys) +

+
+ + + +
+

Get one or more string keys.

+
+
+

Parameters

+ + + + + + + +
array$keys

The keys to retrieve

+ + +

Return Value

+ +
+ + + + + +
Redis|array|false

an array of keys with their values.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/mget/ +
+ + +

Examples

+ + + + + +
$redis->mget(['key1', 'key2']);
+ +
+
+ +
+
+ +

+ + Redis|bool migrate(string $host, int $port, string|array $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, mixed $credentials = null) +

+
+ + + +
+

Proxy for the Redis MIGRATE command.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$host

The destination redis host.

int$port

The destination redis port.

string|array$key

The key or array of keys to migrate.

int$dstdb

The destination database index.

int$timeout

The timeout for the operation in +milliseconds.

bool$copy

Whether to copy the key(s) or move +them.

bool$replace

Whether to replace existing keys on +the destination.

mixed$credentials

Optional credentials for +authenticating to the destination +server.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool
+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/migrate/ +
+ + +

Examples

+ + + + + +
$redis->connect('localhost', 6379);
+$redis->set('foo', '6379_key');
+
+// Move the key to localhost:9999 with a 5 second timeout
+var_dump($redis->migrate('localhost', 9999, 'foo', 0, 5000));
+ +
+
+ +
+
+ +

+ + Redis|bool move(string $key, int $index) +

+
+ + + +
+

Move a key to a different database on the same redis instance.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key to move

int$index
+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if the key was moved

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/move/ +
+ + +

Examples

+ + + + + +
$redis->move('cart:42', 1);
+ +
+
+ +
+
+ +

+ + Redis|bool mset(array $key_values) +

+
+ + + +
+

Set one or more string keys.

+
+
+

Parameters

+ + + + + + + +
array$key_values

An array with keys and their values.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if the keys could be set.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/mset/ +
+ + +

Examples

+ + + + + +
$redis->mSet(['foo' => 'bar', 'baz' => 'bop']);
+ +
+
+ +
+
+ +

+ + Redis|int|false msetex(array $key_vals, int|float|array|null $expiry = null) +

+
+ + + +
+

Set one or more keys and values with optional expiry information.

+
+
+

Parameters

+ + + + + + + + + + + + +
array$key_vals

An array of keys with their values.

int|float|array|null$expiry

An optional array with expiry information.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

1 if all keys were set, 0 if none were.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/commands/msetex +
+ + +

Examples

+ + + + + +
$redis->msetex(['foo' => 'bar', 'baz' => 'bop'], ['EX' => 60]);
+ +
+
+ +
+
+ +

+ + Redis|bool msetnx(array $key_values) +

+
+ + + +
+

Set one or more string keys but only if none of the key exist.

+
+
+

Parameters

+ + + + + + + +
array$key_values

An array of keys with their values.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if the keys were set and false if not.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/msetnx/ +
+ + +

Examples

+ + + + + +
$redis->msetnx(['foo' => 'bar', 'baz' => 'bop']);
+ +
+
+ +
+
+ +

+ + bool|Redis multi(int $value = Redis::MULTI) +

+
+ + + +
+

Begin a transaction.

+
+
+

Parameters

+ + + + +
int$value

The type of transaction to start. This can either be Redis::MULTI or `Redis::PIPELINE'.

-

Return Value

+

Return Value

+ +
+ + + + + +
bool|Redis

True if the transaction could be started.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/multi/ +
+ + +

Examples

+ + + + + +
$redis->multi();
+$redis->set('foo', 'bar');
+$redis->get('foo');
+$redis->exec();
+ +
+
+ +
+
+ +

+ + Redis|int|string|false object(string $subcommand, string $key) +

+
+ + + +
+

Get encoding and other information about a key.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$subcommand

The subcommand to execute. This can be either 'encoding', 'freq', or 'idle'.

string$key

The key to query.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|string|false

The requested information about the key.

+ +
+ + + +

Examples

+ + + + + +
$redis->del('list1');
+$redis->rPush('list1', 'a', 'b', 'c');
+echo $redis->object('encoding', 'list1');
+ +
+
+ +
+
+ +

+ + bool open(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null) deprecated +

+
+

+ deprecated + + + + +

+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$host
int$port
float$timeout
string|null$persistent_id
int$retry_interval
float$read_timeout
array|null$context
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +

Examples

+ + + + + +
$redis->open('127.0.0.1', 6379);
+ +
+
+ +
+
+ +

+ + bool pconnect(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null) +

+
+ + + +
+

Connects to a Redis server creating or reusing a persistent connection.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$host

The Redis server hostname.

int$port

The Redis server port.

float$timeout

Connection timeout in seconds.

string|null$persistent_id

An optional persistent ID to use for the connection.

int$retry_interval

The number of microseconds to wait before retrying a connection.

float$read_timeout

Read timeout in seconds.

array|null$context

An optional stream context array.

+ + +

Return Value

+ +
+ + + + + +
bool

True if the connection was successful.

+ +
+ +

Exceptions

+ + + + + + +
RedisException
+ + + +

Examples

+ + + + + +
try {
+    $redis = new Redis();
+    $redis->pconnect('localhost', 6379);
+} catch (Exception $ex) {
+   echo "Could not connect to Redis: ", $ex->getMessage(), "\n";
+}
+ +
+
+ +
+
+ +

+ + Redis|bool persist(string $key) +

+
+ + + +
+

Remove the expiration from a key.

+
+
+

Parameters

+ + + + + + + +
string$key

The key to operate against.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if a timeout was removed and false if it was not or the key didn't exist.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/persist/ +
+ + +

Examples

+ + + + + +
$redis->persist('session:42');
+ +
+
+ +
+
+ +

+ + bool pexpire(string $key, int $timeout, string|null $mode = null) +

+
+ + + +
+

Sets an expiration in milliseconds on a given key. If connected to Redis >= 7.0.0 +you can pass an optional mode argument that modifies how the command will execute.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key

The key to set an expiration on.

int$timeout

The number of milliseconds after which key will be automatically deleted.

string|null$mode

A two character modifier that changes how the +command works.

+ + +

Return Value

+ +
+ + + + + +
bool

True if an expiry was set on the key, and false otherwise.

+ +
+ + +

See also

+ + + + + + + + + + +
+ +Redis::expire + for a description of the mode argument.
+ https://redis.io/docs/latest/commands/pexpire/ +
+ + +

Examples

+ + + + + +
$redis->pexpire('session:42', 5000);
+ +
+
+ +
+
+ +

+ + Redis|bool pexpireAt(string $key, int $timestamp, string|null $mode = null) +

+
+ + + +
+

Set a key's expiration to a specific Unix Timestamp in milliseconds. If connected to +Redis >= 7.0.0 you can pass an optional 'mode' argument.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$timestamp
string|null$mode
+ + +

Return Value

+ +
+ + + + + +
Redis|bool
+ +
+ + +

See also

+ + + + + + + + + + +
+ +Redis::expire + For a description of the mode argument.
+ https://redis.io/docs/latest/commands/pexpireat/ + @param string $key The key to set an expiration on. +@param int $timestamp The unix timestamp to expire at. +@param string|null $mode A two character modifier that changes how the + command works. + +@return Redis|bool True if an expiration was set on the key, false otherwise.
+ + +

Examples

+ + + + + +
$redis->pexpireAt('session:42', (int) (microtime(true) * 1000) + 60000);
+ +
+
+ +
+
+ +

+ + Redis|int pfadd(string $key, array $elements) +

+
+ + + +
+

Add one or more elements to a Redis HyperLogLog key

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key in question.

array$elements

One or more elements to add.

+ + +

Return Value

+ +
+ + + + + +
Redis|int

Returns 1 if the set was altered, and zero if not.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/pfadd/ +
+ + +

Examples

+ + + + + +
$redis->pfadd('visitors', ['alice', 'bob']);
+ +
+
+ +
+
+ +

+ + Redis|int|false pfcount(array|string $key_or_keys) +

+
+ + + +
+

Retrieve the cardinality of a Redis HyperLogLog key.

+
+
+

Parameters

+ + + + + + + +
array|string$key_or_keys

Either one key or an array of keys

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The estimated cardinality of the set.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/pfcount/ +
+ + +

Examples

+ + + + + +
$redis->pfcount(['visitors:today', 'visitors:yesterday']);
+ +
+
+ +
+
+ +

+ + Redis|bool pfmerge(string $dst, array $srckeys) +

+
+ + + +
+

Merge one or more source HyperLogLog sets into a destination set.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$dst

The destination key.

array$srckeys

One or more source keys.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

Always returns true.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/pfmerge/ +
+ + +

Examples

+ + + + + +
$redis->pfmerge('visitors:all', ['visitors:today', 'visitors:yesterday']);
+ +
+
+ +
+
+ +

+ + Redis|string|bool ping(string|null $message = null) +

+
+ + + +
+

PING the redis server with an optional string argument.

+
+
+

Parameters

+ + + + + + + +
string|null$message

An optional string message that Redis will reply with, if passed.

+ + +

Return Value

+ +
+ + + + + +
Redis|string|bool

If passed no message, this command will simply return true. +If a message is passed, it will return the message.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/ping/ +
+ + +

Examples

+ + + + + + + + +
$redis->ping();
$redis->ping('beep boop');
+ +
+
+ +
+
+ +

+ + bool|Redis pipeline() +

+
+ + + +
+

Enter into pipeline mode.

Pipeline mode is the highest performance way to send many commands to Redis +as they are aggregated into one stream of commands and then all sent at once +when the user calls Redis::exec().

+

NOTE: That this is shorthand for Redis::multi(Redis::PIPELINE)

+
+
+ +

Return Value

+ +
+ + + + + +
bool|Redis

The redis object is returned, to facilitate method chaining.

+ +
+ + + +

Examples

+ + + + + +
$redis->pipeline()
+->set('foo', 'bar')
+->del('mylist')
+->rpush('mylist', 'a', 'b', 'c')
+->exec();
+ +
+
+ +
+
+ +

+ + bool popen(string $host, int $port = 6379, float $timeout = 0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array|null $context = null) deprecated +

+
+

+ deprecated + + + + +

+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$host
int$port
float$timeout
string|null$persistent_id
int$retry_interval
float$read_timeout
array|null$context
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +

Examples

+ + + + + +
$redis->popen('127.0.0.1', 6379, 0.0, 'cache');
+ +
+
+ +
+
+ +

+ + Redis|bool psetex(string $key, int $expire, mixed $value) +

+
+ + + +
+

Set a key with an expiration time in milliseconds

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key

The key to set

int$expire

The TTL to set, in milliseconds.

mixed$value

The value to set the key to.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if the key could be set.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/psetex/ +
+ + +

Examples

+ + + + + +
$redis->psetex('mykey', 1000, 'myval');
+ +
+
+ +
+
+ +

+ + bool psubscribe(array $patterns, callable $cb) +

+
+ + + +
+

Subscribe to one or more glob-style patterns

+
+
+

Parameters

+ + + + + + + + + + + + +
array$patterns

One or more patterns to subscribe to.

callable$cb

A callback with the following prototype:

+
function ($redis, $channel, $message) { }
+ + +

Return Value

+ +
+ + + + + +
bool

True if we were subscribed.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/psubscribe/ +
+ + +

Examples

+ + + + + +
$redis->psubscribe(['user:*'], function (Redis $client, string $pattern, string $channel, string $message): void {
+    printf('[%s] %s' . PHP_EOL, $channel, $message);
+});
+ +
+
+ +
+
+ +

+ + Redis|int|false pttl(string $key) +

+
+ + + +
+

Get a keys time to live in milliseconds.

+
+
+

Parameters

+ + + + + + + +
string$key

The key to check.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The key's TTL or one of two special values if it has none.

+
-1 - The key has no TTL.
+-2 - The key did not exist.
+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/pttl/ +
+ + +

Examples

+ + + + + +
$redis->pttl('ttl-key');
+ +
+
+ +
+
+ +

+ + Redis|int|false publish(string $channel, string $message) +

+
+ + + +
+

Publish a message to a pubsub channel

+
+
+

Parameters

+ + + + + + + + + + + + +
string$channel

The channel to publish to.

string$message

The message itself.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The number of subscribed clients to the given channel.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/publish/ +
+ + +

Examples

+ + + + + +
$redis->publish('updates', 'build complete');
+ +
+
+ +
+
+ +

+ + mixed pubsub(string $command, mixed $arg = null) +

+
+ + + +
+

Interact with the Redis PubSub subsystem.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$command

The PubSub command to execute. This can be one of:

mixed$arg

An optional argument to the command.

+ + +

Return Value

+ +
+ + + + + +
mixed

Can return any number of things depending on the command executed.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/pubsub/ +
+ + +

Examples

+ + + + + +
$redis->pubsub('channels');
+ +
+
+ +
+
+ +

+ + Redis|array|bool punsubscribe(array $patterns) +

+
+ + + +
+

Unsubscribe from one or more channels by pattern

+
+
+

Parameters

+ + + + + + + +
array$patterns

One or more glob-style patterns of channel names.

+ + +

Return Value

+ +
+ + + + + +
Redis|array|bool

The array of subscribed patterns or false on failure.

+ +
+ + +

See also

+ + + + + + + + + + + + + + +
+ https://redis.io/docs/latest/commands/punsubscribe/ +
+ https://redis.io/docs/latest/commands/subscribe/ +
+ +Redis::subscribe +
+ + +

Examples

+ + + + + +
$redis->punsubscribe(['user:*', 'room:*']);
+ +
+
+ +
+
+ +

+ + Redis|array|string|bool rPop(string $key, int $count = 0) +

+
+ + + +
+

Pop one or more elements from the end of a list.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

A redis LIST key name.

int$count

The maximum number of elements to pop at once. +NOTE: The count argument requires Redis >= 6.2.0

+ + +

Return Value

+ +
+ + + + + +
Redis|array|string|bool

One or more popped elements or false if all were empty.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/rpop/ +
+ + +

Examples

+ + + + + + +
$redis->rPop('mylist');
$redis->rPop('mylist', 4);
+ +
+
+ +
+
+ +

+ + Redis|string|false randomKey() +

+
+ + + +
+

Return a random key from the current database

+
+
+ +

Return Value

+ +
+ - - + +
bool|Redis

True if the transaction could be started.

Redis|string|false

A random key name or false if no keys exist

+

See also

@@ -10287,7 +15899,7 @@

See also

@@ -10298,10 +15910,7 @@

Examples

- https://redis.io/commands/multi + https://redis.io/docs/latest/commands/randomkey/
- +
$redis->multi();
-$redis->set('foo', 'bar');
-$redis->get('foo');
-$redis->exec();
$redis->randomKey();
@@ -10310,19 +15919,17 @@

Examples

-

- - Redis|int|string|false - object(string $subcommand, string $key) - + +

+ + mixed rawcommand(string $command, mixed ...$args)

-

No description

- +

Execute any arbitrary Redis command by name.

Parameters

@@ -10330,54 +15937,251 @@

Parameters

- + + + + + + + + +
string$subcommand$command

The command to execute

mixed...$args

One or more arguments to pass to the command.

+ + +

Return Value

+ +
+ + + + + +
mixed

Can return any number of things depending on command executed.

+ +
+ + + +

Examples

+ + + + + + + + + + + +
$redis->rawCommand('del', 'mystring', 'mylist');
$redis->rawCommand('set', 'mystring', 'myvalue');
$redis->rawCommand('rpush', 'mylist', 'one', 'two', 'three');
+ +
+
+ +
+
+ +

+ + Redis|bool rename(string $old_name, string $new_name) +

+
+ + + +
+

Unconditionally rename a key from $old_name to $new_name

+
+
+

Parameters

+ + + + + + + + + + + + +
string$old_name

The original name of the key

string$new_name

The new name for the key

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if the key was renamed or false if not.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/rename/ +
+ + +

Examples

+ + + + + +
$redis->rename('config:pending', 'config:active');
+ +
+
+ +
+
+ +

+ + Redis|bool renameNx(string $key_src, string $key_dst) +

+
+ + + +
+

Renames $key_src to $key_dst but only if newkey does not exist.

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key_src

The source key name

string$key_dst

The destination key name.

+ + +

Return Value

+ +
+ + + + + +
Redis|bool

True if the key was renamed, false if not.

+ +
+ + +

See also

+ + + + +
+ https://redis.io/docs/latest/commands/renamenx/ +
+ + +

Examples

+ + + + + +
$redis->set('src', 'src_key');
+$redis->set('existing-dst', 'i_exist');
+
+$redis->renamenx('src', 'dst');
+$redis->renamenx('dst', 'existing-dst');
+ +
+
+ +
+
+ +

+ + Redis|bool reset() +

+
+ + + +
+

Reset the state of the connection.

+
+
+ +

Return Value

+ +
+ + + + + +
Redis|bool

Should always return true unless there is an error.

+ +
+ + +

See also

+ + - - +
string$key + https://redis.io/docs/latest/commands/reset/ +
-

Return Value

+

Examples

- - - - -
Redis|int|string|false
+ +
$redis->reset();
+ + - - -
-

- - 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 + +

+ + Redis|bool restore(string $key, int $ttl, string $value, array|null $options = null)

-

- deprecated - - - - -

-

No description

- +

Restore a key by the binary payload generated by the DUMP command.

Parameters

@@ -10385,187 +16189,159 @@

Parameters

- - + + - - - - - - - + + - - - - - - - - - - - - + + - - - + + +
string$host$key

The name of the key you wish to create.

int$port
float$timeout$ttl

What Redis should set the key's TTL (in milliseconds) to once it is created. +Zero means no TTL at all.

string$persistent_id
int$retry_interval
float$read_timeout$value

The serialized binary value of the string (generated by DUMP).

array$contextarray|null$options

An array of additional options that modifies how the command operates.

+
$options = [
+    'ABSTTL'          # If this is present, the `$ttl` provided by the user should
+                      # be an absolute timestamp, in milliseconds()
+
+    'REPLACE'         # This flag instructs Redis to store the key even if a key with
+                      # that name already exists.
+
+    'IDLETIME' => int # Tells Redis to set the keys internal 'idletime' value to a
+                      # specific number (see the Redis command OBJECT for more info).
+    'FREQ'     => int # Tells Redis to set the keys internal 'FREQ' value to a specific
+                      # number (this relates to Redis' LFU eviction algorithm).
+];
-

Return Value

+

Return Value

- +
+
- - + +
boolRedis|bool

True if the key was stored, false if not.

+
- -
-
- -
-
-

- - 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) - -

-
- - - -
-

No description

- -
-
-

Parameters

+

See also

- - - - - - - - - - - - - - - - - - - - - - + - - + - - +
string$host
int$port
float$timeout
string$persistent_id
int$retry_interval + https://redis.io/docs/latest/commands/restore/ +
float$read_timeout + https://redis.io/docs/latest/commands/dump/ +
array$context + +Redis::dump +
-

Return Value

+

Examples

- - - - -
bool
+ +
$redis->sAdd('captains', 'Janeway', 'Picard', 'Sisko', 'Kirk', 'Archer');
+$serialized = $redis->dump('captains');
+
+$redis->restore('captains-backup', 0, $serialized);
+ + - - -
-

- - Redis|bool - persist(string $key) - + +

+ + mixed role()

-

Remove the expiration from a key.

+

Query whether the connected instance is a primary or replica

-

Parameters

+ +

Return Value

+ +
+ + + + + +
mixed

Will return an array with the role of the connected instance unless there is +an error.

+ +
+ + +

See also

- - - + +
string$key

The key to operate against.

+ https://redis.io/docs/latest/commands/role/ +
-

Return Value

+

Examples

- - - - -
Redis|bool

True if a timeout was removed and false if it was not or the key didn't exist.

+ +
$redis->role();
+ + - - -
-

- - bool - pexpire(string $key, int $timeout, string|null $mode = NULL) - + +

+ + Redis|string|false rpoplpush(string $srckey, string $dstkey)

-

Sets an expiration in milliseconds on a given key. If connected to Redis >= 7.0.0 -you can pass an optional mode argument that modifies how the command will execute.

Redis::expire() for a description of the mode argument.

+

Atomically pop an element off the end of a Redis LIST and push it to the beginning of +another.

Parameters

@@ -10573,55 +16349,72 @@

Parameters

- - - - - - - + + - - - + + +
string$key

The key to set an expiration on. -@param string $mode A two character modifier that changes how the -command works.

-

@return Redis|bool True if an expiry was set on the key, and false otherwise.

int$timeout$srckey

The source key to pop from.

string|null$modestring$dstkey

The destination key to push to.

-

Return Value

+

Return Value

- +
+
- - + +
boolRedis|string|false

The popped element or false if the source key was empty.

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/rpoplpush/ +
+ +

Examples

+ + + + + +
$redis->pipeline()
+      ->del('list1', 'list2')
+      ->rpush('list1', 'list1-1', 'list1-2')
+      ->rpush('list2', 'list2-1', 'list2-2')
+      ->exec();
+
+$redis->rpoplpush('list2', 'list1');
+
-

- - Redis|bool - pexpireAt(string $key, int $timestamp, string|null $mode = NULL) - + +

+ + Redis|int|false sAdd(string $key, mixed $value, mixed ...$other_values)

-

Set a key's expiration to a specific Unix Timestamp in milliseconds. If connected to -Redis >= 7.0.0 you can pass an optional 'mode' argument.

+

Add one or more values to a Redis SET key.

Parameters

@@ -10630,68 +16423,74 @@

Parameters

string $key - +

The key name

- int - $timestamp - + mixed + $value +

A value to add to the set.

- string|null - $mode - + mixed + ...$other_values +

One or more additional values to add

-

Return Value

+

Return Value

- +
+
- - + +
Redis|boolRedis|int|false

The number of values added to the set.

+
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/sadd/ +
+ - -

See also

+

Examples

- - +$redis->sadd('myset', 'foo', 'bar', 'baz'); +$redis->sadd('myset', 'foo', 'new');
- -Redis::expire - For a description of the mode argument. +
$redis->del('myset');
 
-@param string  $key  The key to set an expiration on.
-@param string  $mode A two character modifier that changes how the
-                     command works.
-
-@return Redis|bool   True if an expiration was set on the key, false otherwise.
-
-

- - Redis|int - pfadd(string $key, array $elements) - + +

+ + int sAddArray(string $key, array $values)

-

Add one or more elements to a Redis HyperLogLog key

+

Add one or more values to a Redis SET key. This is an alternative to Redis::sadd() but +instead of being variadic, takes a single array of values.

Parameters

@@ -10700,25 +16499,27 @@

Parameters

string $key -

The key in question.

+

The set to add values to.

array - $elements -

One or more elements to add.

+ $values +

One or more members to add to the set.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int

Returns 1 if the set was altered, and zero if not.

int

The number of members added to the set.

+

See also

@@ -10726,30 +16527,47 @@

See also

+ + + +
- https://redis.io/commands/pfadd + https://redis.io/docs/latest/commands/sadd/ +
+ \Redis::sadd()
+

Examples

+ + + + + +
$redis->del('myset');
+
+$redis->sAddArray('myset', ['foo', 'bar', 'baz']);
+$redis->sAddArray('myset', ['foo', 'new']);
+
-

- - Redis|int - pfcount(string $key) - + +

+ + Redis|array|false sDiff(string $key, string ...$other_keys)

-

Retrieve the cardinality of a Redis HyperLogLog key.

+

Given one or more Redis SETS, this command returns all of the members from the first +set that are not in any subsequent set.

Parameters

@@ -10758,20 +16576,28 @@

Parameters

string $key -

The key name we wish to query.

+

The first set

+ + + string + ...$other_keys +

One or more additional sets

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int

The estimated cardinality of the set.

Redis|array|false

Returns the elements from keys 2..N that don't exist in the +first sorted set, or false on failure.

+

See also

@@ -10779,30 +16605,45 @@

See also

- https://redis.io/commands/pfcount + https://redis.io/docs/latest/commands/sdiff/
+

Examples

+ + + + + +
$redis->pipeline()
+      ->del('set1', 'set2', 'set3')
+      ->sadd('set1', 'apple', 'banana', 'carrot', 'date')
+      ->sadd('set2', 'carrot')
+      ->sadd('set3', 'apple', 'carrot', 'eggplant')
+      ->exec();
+
+$redis->sdiff('set1', 'set2', 'set3');
+
-

- - Redis|bool - pfmerge(string $dst, array $srckeys) - + +

+ + Redis|int|false sDiffStore(string $dst, string $key, string ...$other_keys)

-

Merge one or more source HyperLogLog sets into a destination set.

+

This method performs the same operation as SDIFF except it stores the resulting diff +values in a specified destination key.

Parameters

@@ -10811,25 +16652,32 @@

Parameters

string $dst -

The destination key.

+

The key where to store the result

- array - $srckeys -

One or more source keys.

+ string + $key +

The first key to perform the DIFF on

+ + + string + ...$other_keys +

One or more additional keys.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

Always returns true.

Redis|int|false

The number of values stored in the destination set or false on failure.

+

See also

@@ -10837,53 +16685,73 @@

See also

+ + + +
- https://redis.io/commands/pfmerge + https://redis.io/docs/latest/commands/sdiffstore/ +
+ \Redis::sdiff()
+

Examples

+ + + + + +
$redis->sDiffStore('diff:set', 'set:all', 'set:archived');
+
-

- - Redis|string|bool - ping(string $message = NULL) - + +

+ + Redis|array|false sInter(array|string $key, string ...$other_keys)

-

PING the redis server with an optional string argument.

+

Given one or more Redis SET keys, this command will return all of the elements that are +in every one.

Parameters

+ + + + + - - + +
array|string$key

The first SET key to intersect.

string$message

An optional string message that Redis will reply with, if passed.

...$other_keys

One or more Redis SET keys.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|bool

If passed no message, this command will simply return true. -If a message is passed, it will return the message.

Redis|array|false
+

See also

@@ -10891,7 +16759,7 @@

See also

@@ -10902,10 +16770,14 @@

Examples

- https://redis.io/commands/ping + https://redis.io/docs/latest/commands/sinter/
- - - - +
$redis->ping();
$redis->ping('beep boop');
$redis->pipeline()
+      ->del('alice_likes', 'bob_likes', 'bill_likes')
+      ->sadd('alice_likes', 'asparagus', 'broccoli', 'carrot', 'potato')
+      ->sadd('bob_likes', 'asparagus', 'carrot', 'potato')
+      ->sadd('bill_likes', 'broccoli', 'potato')
+      ->exec();
+
+var_dump($redis->sinter('alice_likes', 'bob_likes', 'bill_likes'));
@@ -10914,45 +16786,70 @@

Examples

-

- - bool|Redis - pipeline() - + +

+ + Redis|int|false sintercard(array $keys, int $limit = -1)

-

Enter into pipeline mode.

Pipeline mode is the highest performance way to send many commands to Redis -as they are aggregated into one stream of commands and then all sent at once -when the user calls Redis::exec().

-

NOTE: That this is shorthand for Redis::multi(Redis::PIPELINE)

+

Compute the intersection of one or more sets and return the cardinality of the result.

- -

Return Value

+

Parameters

+ + + + + + + + + + +
array$keys

One or more set key names.

int$limit

A maximum cardinality to return. This is useful to put an upper bound +on the amount of work Redis will do.

+ + +

Return Value

+ +
+ - - + +
bool|Redis

The redis object is returned, to facilitate method chaining.

Redis|int|falseThe
+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/sintercard/ +
+

Examples

- +
$redis->pipeline()
-->set('foo', 'bar')
-->del('mylist')
-->rpush('mylist', 'a', 'b', 'c')
-->exec();
$redis->sAdd('set1', 'apple', 'pear', 'banana', 'carrot');
+$redis->sAdd('set2', 'apple',         'banana');
+$redis->sAdd('set3',          'pear', 'banana');
+
+$redis->sInterCard(['set1', 'set2', 'set3']);
@@ -10961,98 +16858,95 @@

Examples

-

- - 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 + +

+ + Redis|int|false sInterStore(array|string $key, string ...$other_keys)

-

- deprecated - - - - -

-

No description

- +

Perform the intersection of one or more Redis SETs, storing the result in a destination +key, rather than returning them.

Parameters

- - - - - - - - - - - - - + + + - - - - - - - + + +
string$host
int$port
float$timeoutarray|string$key

Either a string key, or an array of keys (with at least two +elements, consisting of the destination key name and one +or more source keys names.

string$persistent_id
int$retry_interval...$other_keys

If the first argument was a string, subsequent arguments should +be source key names.

+ + +

Return Value

+ +
+ + + + + +
Redis|int|false

The number of values stored in the destination key or false on failure.

+ +
+ + +

See also

+ + - - + - - +
float$read_timeout + https://redis.io/docs/latest/commands/sinterstore/ +
array$context + \Redis::sinter() +
-

Return Value

+

Examples

- - - - -
bool
+ +
$redis->sInterStore(['dst', 'src1', 'src2', 'src3']);
+$redis->sInterStore('dst', 'src1', 'src'2', 'src3');
+ + - - -
-

- - Redis|bool - psetex(string $key, int $expire, mixed $value) - + +

+ + Redis|array|false sMembers(string $key)

-

Set a key with an expiration time in milliseconds

+

Retrieve every member from a set key.

Parameters

@@ -11061,38 +16955,42 @@

Parameters

string $key -

The key to set

- - - int - $expire -

The TTL to set, in milliseconds.

- - - mixed - $value -

The value to set the key to.

+

The set name.

-

Return Value

+

Return Value

- - - - +
+
Redis|bool

True if the key could be set.

+ + +
Redis|array|false

Every element in the set or false on failure.

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/smembers/ +
+

Examples

- +
$redis->psetex('mykey', 1000, 'myval');
$redis->sAdd('tng-crew', ...['Picard', 'Riker', 'Data', 'Worf', 'La Forge', 'Troi', 'Crusher', 'Broccoli']);
+$redis->sMembers('tng-crew');
@@ -11101,46 +16999,52 @@

Examples

-

- - bool - psubscribe(array $patterns, callable $cb) - + +

+ + Redis|array|false sMisMember(string $key, string $member, string ...$other_members)

-

Subscribe to one or more glob-style patterns

+

Check if one or more values are members of a set.

Parameters

- - - + + + - - - + + + + + + + +
array$patterns

One or more patterns to subscribe to.

string$key

The set to query.

callable$cb

A callback with the following prototype:

-
function ($redis, $channel, $message) { }
string$member

The first value to test if exists in the set.

string...$other_members

Any number of additional values to check.

-

Return Value

+

Return Value

- +
+
- - + +
bool

True if we were subscribed.

Redis|array|false

An array of integers representing whether each passed value +was a member of the set.

+

See also

@@ -11148,30 +17052,51 @@

See also

+ + + + + + + +
- https://redis.io/commands/psubscribe + https://redis.io/docs/latest/commands/smismember/ +
+ https://redis.io/docs/latest/commands/smember/ +
+ \Redis::smember()
+

Examples

+ + + + + +
$redis->sAdd('ds9-crew', ...["Sisko", "Kira", "Dax", "Worf", "Bashir", "O'Brien"]);
+$members = $redis->sMIsMember('ds9-crew', ...['Sisko', 'Picard', 'Data', 'Worf']);
+
-

- - Redis|int|false - pttl(string $key) - + +

+ + Redis|bool sMove(string $src, string $dst, mixed $value)

-

Get a keys time to live in milliseconds.

+

Pop a member from one set and push it onto another. This command will create the +destination set if it does not currently exist.

Parameters

@@ -11179,23 +17104,33 @@

Parameters

- - + + + + + + + + + + + +
string$key

The key to check.

$src

The source set.

string$dst

The destination set.

mixed$value

The member you wish to move.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The key's TTL or one of two special values if it has none.

-
-1 - The key has no TTL.
--2 - The key did not exist.
Redis|bool

True if the member was moved, and false if it wasn't in the set.

+

See also

@@ -11203,7 +17138,7 @@

See also

@@ -11214,7 +17149,10 @@

Examples

- https://redis.io/commands/pttl + https://redis.io/docs/latest/commands/smove/
- +
$redis->pttl('ttl-key');
$redis->sAdd('numbers', 'zero', 'one', 'two', 'three', 'four');
+$redis->sMove('numbers', 'evens', 'zero');
+$redis->sMove('numbers', 'evens', 'two');
+$redis->sMove('numbers', 'evens', 'four');
@@ -11223,18 +17161,17 @@

Examples

-

- - Redis|int|false - publish(string $channel, string $message) - + +

+ + Redis|string|array|false sPop(string $key, int $count = 0)

-

Publish a message to a pubsub channel

+

Remove one or more elements from a set.

Parameters

@@ -11242,26 +17179,29 @@

Parameters

- - + + - - - + + +
string$channel

The channel to publish to.

$key

The set in question.

string$message

The message itself.

int$count

An optional number of members to pop. This defaults to +removing one element.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of subscribed clients to the given channel.

Redis|string|array|false
+

See also

@@ -11269,31 +17209,39 @@

See also

- https://redis.io/commands/publish + https://redis.io/docs/latest/commands/spop/
+

Examples

+ + + + + +
$redis->del('numbers', 'evens');
+$redis->sAdd('numbers', 'zero', 'one', 'two', 'three', 'four');
+$redis->sPop('numbers');
+
-

- - mixed - pubsub(string $command, mixed $arg = null) - + +

+ + mixed sRandMember(string $key, int $count = 0)

-

No description

- +

Retrieve one or more random members of a set.

Parameters

@@ -11301,68 +17249,106 @@

Parameters

- - + + - - - + + +
string$command$key

The set to query.

mixed$argint$count

An optional count of members to return.

+

If this value is positive, Redis will return up to the requested +number but with unique elements that will never repeat. This means +you may receive fewer then $count replies.

+

If the number is negative, Redis will return the exact number requested +but the result may contain duplicate elements.

-

Return Value

+

Return Value

- +
+
- +
mixed

One or more random members or false on failure.

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/srandmember/ +
+ +

Examples

+ + + + + + + + + + + +
$redis->sRandMember('myset');
$redis->sRandMember('myset', 10);
$redis->sRandMember('myset', -10);
+
-

- - Redis|array|bool - punsubscribe(array $patterns) - + +

+ + Redis|array|false sUnion(string $key, string ...$other_keys)

-

Unsubscribe from one or more channels by pattern

+

Returns the union of one or more Redis SET keys.

Parameters

- - - + + + + + + + +
array$patterns

One or more glob-style patterns of channel names.

string$key

The first SET to do a union with

string...$other_keys

One or more subsequent keys

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|bool

The array of subscribed patterns or false on failure.

Redis|array|false

The union of the one or more input sets or false on failure.

+

See also

@@ -11370,43 +17356,37 @@

See also

- - - - +
- https://redis.io/commands/punsubscribe -
- https://redis.io/commands/subscribe + https://redis.io/docs/latest/commands/sunion/
+ + +

Examples

+ + - - +
- -Redis::subscribe -
$redis->sunion('set1', 'set2');
-
-

- - Redis|array|string|bool - rPop(string $key, int $count = 0) - + +

+ + Redis|int|false sUnionStore(string $dst, string $key, string ...$other_keys)

-

Pop one or more elements from the end of a list.

+

Perform a union of one or more Redis SET keys and store the result in a new set

Parameters

@@ -11414,27 +17394,34 @@

Parameters

+ + + + + - + - - - + + +
string$dst

The destination key

string $key

A redis LIST key name.

The first source key

int$count

The maximum number of elements to pop at once. -NOTE: The count argument requires Redis >= 6.2.0

string...$other_keys

One or more additional source keys

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|string|bool

One ore more popped elements or false if all were empty.

Redis|int|false

The number of elements stored in the destination SET or +false on failure.

+

See also

@@ -11442,7 +17429,13 @@

See also

+ + + + @@ -11453,10 +17446,7 @@

Examples

- https://redis.io/commands/rpop + https://redis.io/docs/latest/commands/sunionstore/ +
+ \Redis::sunion()
- - - - +
$redis->rPop('mylist');
$redis->rPop('mylist', 4);
$redis->sUnionStore('union:set', 'set:a', 'set:b');
@@ -11465,102 +17455,180 @@

Examples

-

- - Redis|string|false - randomKey() - + +

+ + Redis|bool save()

-

Return a random key from the current database

+

Persist the Redis database to disk. This command will block the server until the save is +completed. For a nonblocking alternative, see Redis::bgsave().

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|false

A random key name or false if no keys exist

Redis|bool

Returns true unless an error occurs.

+

See also

- - + + + + + + + +
- https://redis.io/commands/randomkey - + https://redis.io/docs/latest/commands/save/ +
+ \Redis::bgsave() +
+ + +

Examples

+ + + +
$redis->save();
-
-

- - mixed - rawcommand(string $command, mixed ...$args) - + +

+ + array|false scan(null|int|string $iterator, string|null $pattern = null, int $count = 0, string|null $type = null)

-

Execute any arbitrary Redis command by name.

+

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.

Parameters

- - - + + + - - - + + + + + + + + + + + + +
string$command

The command to execute

null|int|string$iterator

The cursor returned by Redis for every subsequent call to SCAN. On +the initial invocation of the call, it should be initialized by the +caller to NULL. Each time SCAN is invoked, the iterator will be +updated to a new number, until finally Redis will set the value to +zero, indicating that the scan is complete.

mixed...$args

One or more arguments to pass to the command.

string|null$pattern

An optional glob-style pattern for matching key names. If passed as +NULL, it is the equivalent of sending '*' (match every key).

int$count

A hint to redis that tells it how many keys to return in a single +call to SCAN. The larger the number, the longer Redis may block +clients while iterating the key space.

string|null$type

An optional argument to specify which key types to scan (e.g. +'STRING', 'LIST', 'SET')

-

Return Value

+

Return Value

- +
+
- - + +
mixed

Can return any number of things depending on command executed.

array|false

An array of keys, or false if no keys were returned for this +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.

+
- -

Examples

+

See also

- + + - + + +
$redis->rawCommand('del', 'mystring', 'mylist');
+ https://redis.io/docs/latest/commands/scan/ +
$redis->rawCommand('set', 'mystring', 'myvalue');
+ +Redis::setOption +
+ + +

Examples

+ + - +
$redis->rawCommand('rpush', 'mylist', 'one', 'two', 'three');
$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";
+    }
+}
@@ -11569,18 +17637,17 @@

Examples

-

- - Redis|bool - rename(string $old_name, string $new_name) - + +

+ + Redis|int|false scard(string $key)

-

Unconditionally rename a key from $old_name to $new_name

+

Retrieve the number of members in a Redis set.

Parameters

@@ -11588,26 +17655,23 @@

Parameters

- - - - - - - + +
string$old_name

The original name of the key

string$new_name

The new name for the key

$key

The set to get the cardinality of.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the key was renamed or false if not.

Redis|int|false

The cardinality of the set or false on failure.

+

See also

@@ -11615,30 +17679,37 @@

See also

- https://redis.io/commands/rename + https://redis.io/docs/latest/commands/scard/
+

Examples

+ + + + + +
$redis->scard('set');
+
-

- - Redis|bool - renameNx(string $key_src, string $key_dst) - + +

+ + mixed script(string $command, mixed ...$args)

-

Renames $key_src to $key_dst but only if newkey does not exist.

+

An administrative command used to interact with LUA scripts stored on the server.

Parameters

@@ -11646,26 +17717,28 @@

Parameters

- - + + - - - + + +
string$key_src

The source key name

$command

The script suboperation to execute.

string$key_dst

The destination key name.

mixed...$args

One or more additional argument

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the key was renamed, false if not.

mixed

This command returns various things depending on the specific operation executed.

+

See also

@@ -11673,7 +17746,7 @@

See also

@@ -11684,11 +17757,10 @@

Examples

- https://redis.io/commands/renamenx + https://redis.io/docs/latest/commands/script/
- + + + +
$redis->set('src', 'src_key');
-$redis->set('existing-dst', 'i_exist');
-
-$redis->renamenx('src', 'dst');
-$redis->renamenx('dst', 'existing-dst');
$redis->script('load', 'return 1');
$redis->script('exists', sha1('return 1'));
@@ -11697,100 +17769,41 @@

Examples

-

- - Redis|bool - reset() - -

-
- - - -
-

Reset the state of the connection.

-
-
- -

Return Value

- - - - - - -
Redis|bool

Should always return true unless there is an error.

- - - - -
-
- -
-
-

- - Redis|bool - restore(string $key, int $ttl, string $value, array|null $options = NULL) - + +

+ + Redis|bool select(int $db)

-

Restore a key by the binary payload generated by the DUMP command.

+

Select a specific Redis database.

Parameters

- - - - - - - - - - - - - - - - - + +
string$key

The name of the key you wish to create.

int$ttl

What Redis should set the key's TTL (in milliseconds) to once it is created. -Zero means no TTL at all.

string$value

The serialized binary value of the string (generated by DUMP).

array|null$options

An array of additional options that modifies how the command operates.

-
$options = [
-    'ABSTTL'          # If this is present, the `$ttl` provided by the user should
-                      # be an absolute timestamp, in milliseconds()
-
-    'REPLACE'         # This flag instructs Redis to store the key even if a key with
-                      # that name already exists.
-
-    'IDLETIME' => int # Tells Redis to set the keys internal 'idletime' value to a
-                      # specific number (see the Redis command OBJECT for more info).
-    'FREQ'     => int # Tells Redis to set the keys internal 'FREQ' value to a specific
-                      # number (this relates to Redis' LFU eviction algorithm).
-];
$db

The database to select. Note that by default Redis has 16 databases (0-15).

-

Return Value

+

Return Value

- +
+
- +
Redis|bool

True if the key was stored, false if not.

true on success and false on failure

+

See also

@@ -11798,20 +17811,7 @@

See also

- - - - - - - - @@ -11822,10 +17822,7 @@

Examples

- https://redis.io/commands/restore -
- https://redis.io/commands/dump -
- -Redis::dump + https://redis.io/docs/latest/commands/select/
- +
$redis->sAdd('captains', 'Janeway', 'Picard', 'Sisko', 'Kirk', 'Archer');
-$serialized = $redis->dump('captains');
-
-$redis->restore('captains-backup', 0, $serialized);
$redis->select(1);
@@ -11834,52 +17831,17 @@

Examples

-

- - mixed - role() - -

-
- - - -
-

Query whether the connected instance is a primary or replica

-
-
- -

Return Value

- - - - - - -
mixed

Will return an array with the role of the connected instance unless there is -an error.

- - - - -
-
- -
-
-

- - Redis|string|false - rpoplpush(string $srckey, string $dstkey) - + +

+ + Redis|string|bool set(string $key, mixed $value, mixed $options = null)

-

Atomically pop an element off the end of a Redis LIST and push it to the beginning of -another.

+

Create or set a Redis STRING key to a value.

Parameters

@@ -11887,26 +17849,46 @@

Parameters

- - + + - - - + + + + + + + +
string$srckey

The source key to pop from.

$key

The key name to set.

string$dstkey

The destination key to push to.

mixed$value

The value to set the key to.

mixed$options

Either an array with options for how to perform the set or an +integer with an expiration. If an expiration is set PhpRedis +will actually send the SETEX command.

+

OPTION DESCRIPTION

+
+

['EX' => 60] expire 60 seconds. +['PX' => 6000] expire in 6000 milliseconds. +['EXAT' => time() + 10] expire in 10 seconds. +['PXAT' => time()*1000 + 1000] expire in 1 second. +['KEEPTTL' => true] Redis will not update the key's current TTL. +['XX'] Only set the key if it already exists. +['NX'] Only set the key if it doesn't exist. +['GET'] Instead of returning +OK return the previous value of the +key or NULL if the key didn't exist.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|false

The popped element or false if the source key was empty.

Redis|string|bool

True if the key was set or false on failure.

+

See also

@@ -11914,7 +17896,13 @@

See also

+ + + + @@ -11925,13 +17913,10 @@

Examples

- https://redis.io/commands/rpoplpush + https://redis.io/docs/latest/commands/set/ +
+ https://redis.io/docs/latest/commands/setex/
- + + + +
$redis->pipeline()
- ->del('list1', 'list2')
- ->rpush('list1', 'list1-1', 'list1-2')
- ->rpush('list2', 'list2-1', 'list2-2')
- ->exec();
-
-$redis->rpoplpush('list2', 'list1');
$redis->set('key', 'value');
$redis->set('key', 'expires_in_60_seconds', 60);
@@ -11940,18 +17925,17 @@

Examples

-

- - Redis|int|false - sAdd(string $key, mixed $value, mixed ...$other_values) - + +

+ + Redis|int|false setBit(string $key, int $idx, bool $value)

-

Add one or more values to a Redis SET key.

+

Set a specific bit in a Redis string to zero or one

Parameters

@@ -11960,30 +17944,32 @@

Parameters

string $key -

The key name

+

The Redis STRING key to modify

- mixed - $value + int + $idx - mixed - ...$other_values - + bool + $value +

Whether to set the bit to zero or one.

-

Return Value

+

Return Value

- +
+
- +
Redis|int|false

The number of values added to the set.

The original value of the bit or false on failure.

+

See also

@@ -11991,7 +17977,7 @@

See also

@@ -12002,10 +17988,8 @@

Examples

- https://redis.io/commands/sadd + https://redis.io/docs/latest/commands/setbit/
- +
$redis->del('myset');
-
-$redis->sadd('myset', 'foo', 'bar', 'baz');
-$redis->sadd('myset', 'foo', 'new');
$redis->set('foo', 'bar');
+$redis->setbit('foo', 7, 1);
@@ -12014,19 +17998,17 @@

Examples

-

- - int - sAddArray(string $key, array $values) - + +

+ + Redis|int|false setRange(string $key, int $index, string $value)

-

Add one ore more values to a Redis SET key. This is an alternative to Redis::sadd() but -instead of being variadic, takes a single array of values.

+

Update or append to a Redis string at a specific starting index

Parameters

@@ -12035,25 +18017,32 @@

Parameters

string $key -

The set to add values to.

+

The key to update

- array - $values -

One or more members to add to the set.

+ int + $index +

Where to insert the provided value

+ + + string + $value +

The value to copy into the string.

-

Return Value

+

Return Value

- +
+
- - + +
int

The number of members added to the set.

Redis|int|false

The new length of the string or false on failure

+

See also

@@ -12061,13 +18050,7 @@

See also

- - - - @@ -12078,10 +18061,8 @@

Examples

- https://redis.io/commands/sadd -
- \Redis::sadd() + https://redis.io/docs/latest/commands/setrange/
- +
$redis->del('myset');
-
-$redis->sAddArray('myset', ['foo', 'bar', 'baz']);
-$redis->sAddArray('myset', ['foo', 'new']);
$redis->set('message', 'Hello World');
+$redis->setRange('message', 6, 'Redis');
@@ -12090,47 +18071,122 @@

Examples

-

- - Redis|array|false - sDiff(string $key, string ...$other_keys) - + +

+ + bool setOption(int $option, mixed $value)

-

Given one or more Redis SETS, this command returns all of the members from the first -set that are not in any subsequent set.

+

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

- - - + + + - - - + + +
string$key

The first set

int$option

The option constant.

string...$other_keys

One or more additional sets

mixed$value

The option value.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|false

Returns the elements from keys 2..N that don't exist in the -first sorted set, or false on failure.

bool

true if the setting was updated, false if not.

+

See also

@@ -12138,9 +18194,17 @@

See also

+ + + +
- https://redis.io/commands/sdiff + +Redis::getOption
+ +Redis::__construct + for details about backoff strategies.
@@ -12149,14 +18213,7 @@

Examples

- +
$redis->pipeline()
- ->del('set1', 'set2', 'set3')
- ->sadd('set1', 'apple', 'banana', 'carrot', 'date')
- ->sadd('set2', 'carrot')
- ->sadd('set3', 'apple', 'carrot', 'eggplant')
- ->exec();
-
-$redis->sdiff('set1', 'set2', 'set3');
$redis->setOption(Redis::OPT_PREFIX, 'app:');
@@ -12165,19 +18222,17 @@

Examples

-

- - Redis|int|false - sDiffStore(string $dst, string $key, string ...$other_keys) - + +

+ + Redis|bool setex(string $key, int $expire, mixed $value)

-

This method performs the same operation as SDIFF except it stores the resulting diff -values in a specified destination key.

+

Set a Redis STRING key with a specific expiration in seconds.

Parameters

@@ -12185,31 +18240,33 @@

Parameters

- - + + - - - + + + - - - + + +
string$dst

The key where to store the result

$key

The name of the key to set.

string$key

The first key to perform the DIFF on

int$expire

The key's expiration in seconds.

string...$other_keys

One or more additional keys.

mixed$value

The value to set the key.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of values stored in the destination set or false on failure.

Redis|bool

True on success or false on failure.

+

See also

@@ -12217,64 +18274,66 @@

See also

+
- https://redis.io/commands/sdiffstore + https://redis.io/docs/latest/commands/setex/
+ + +

Examples

+ + - - +
- \Redis::sdiff() -
$redis->setex('60s-ttl', 60, 'some-value');
-
-

- - Redis|array|false - sInter(array|string $key, string ...$other_keys) - + +

+ + Redis|bool setnx(string $key, mixed $value)

-

Given one or more Redis SET keys, this command will return all of the elements that are -in every one.

+

Set a key to a value, but only if that key does not already exist.

Parameters

- + - + - - - + + +
array|stringstring $key

The first SET key to intersect.

The key name to set.

string...$other_keys

One or more Redis SET keys.

mixed$value

What to set the key to.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|falseRedis|bool

Returns true if the key was set and false otherwise.

+

See also

@@ -12282,7 +18341,7 @@

See also

@@ -12293,15 +18352,10 @@

Examples

- https://redis.io/commands/sinter + https://redis.io/docs/latest/commands/setnx/
- + + + +
$redis->pipeline()
- ->del('alice_likes', 'bob_likes', 'bill_likes')
- ->sadd('alice_likes', 'asparagus', 'broccoli', 'carrot', 'potato')
- ->sadd('bob_likes', 'asparagus', 'carrot', 'potato')
- ->sadd('bill_likes', 'broccoli', 'potato')
- ->exec();
-
-var_dump($redis->sinter('alice_likes', 'bob_likes', 'bill_likes'));
-</code>
$redis->setnx('existing-key', 'existing-value');
$redis->setnx('new-key', 'new-value');
@@ -12310,46 +18364,46 @@

Examples

-

- - Redis|int|false - sintercard(array $keys, int $limit = -1) - + +

+ + Redis|bool sismember(string $key, mixed $value)

-

Compute the intersection of one or more sets and return the cardinality of the result.

+

Check whether a given value is the member of a Redis SET.

Parameters

- - - + + + - - - + + +
array$keys

One or more set key names.

string$key

The redis set to check.

int$limit

A maximum cardinality to return. This is useful to put an upper bound -on the amount of work Redis will do.

mixed$value

The value to test.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|falseTheRedis|bool

True if the member exists and false if not.

+

See also

@@ -12357,7 +18411,7 @@

See also

@@ -12368,13 +18422,7 @@

Examples

- https://redis.io/commands/sintercard + https://redis.io/docs/latest/commands/sismember/
- +
$redis->sAdd('set1', 'apple', 'pear', 'banana', 'carrot');
-$redis->sAdd('set2', 'apple', 'banana');
-$redis->sAdd('set3', 'pear', 'banana');
-
-$redis->sInterCard(['set1', 'set2', 'set3']);
-?>
-</code>
$redis->sismember('myset', 'mem1', 'mem2');
@@ -12383,47 +18431,58 @@

Examples

-

- - Redis|int|false - sInterStore(array|string $key, string ...$other_keys) - + +

+ + Redis|bool slaveof(string|null $host = null, int $port = 6379) deprecated

+

+ deprecated + + + + +

-

Perform the intersection of one or more Redis SETs, storing the result in a destination -key, rather than returning them.

+

Turn a redis instance into a replica of another or promote a replica +to a primary.

This method and the corresponding command in Redis has been marked deprecated +and users should instead use Redis::replicaof() if connecting to redis-server

+
+

= 5.0.0.

+

Parameters

- - + + - - - + + +
array|string$keystring|null$host
string...$other_keys

If the first argument was a string, subsequent arguments should -be source key names.

int$port
-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of values stored in the destination key or false on failure.

Redis|bool
+

See also

@@ -12431,13 +18490,20 @@

See also

+ + + + @@ -12448,12 +18514,7 @@

Examples

- https://redis.io/commands/sinterstore + https://redis.io/docs/latest/commands/slaveof/
- \Redis::sinter() + https://redis.io/docs/latest/commands/replicaof/ +
+ +Redis::replicaof
- - - - +
$redis->sInterStore(['dst', 'src1', 'src2', 'src3']);
$redis->sInterStore('dst', 'src1', 'src'2', 'src3');
-?>
-</code>
$redis->slaveof('10.0.0.5', 6380);
@@ -12462,40 +18523,48 @@

Examples

-

- - Redis|array|false - sMembers(string $key) - + +

+ + Redis|bool replicaof(string|null $host = null, int $port = 6379)

-

Retrieve every member from a set key.

+

Used to turn a Redis instance into a replica of another, or to remove +replica status promoting the instance to a primary.

Parameters

- - - + + + + + + + +
string$key

The set name.

string|null$host

The host of the primary to start replicating.

int$port

The port of the primary to start replicating.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|false

Every element in the set or false on failure.

Redis|bool

Success if we were successfully able to start replicating a primary or +were able to promote the replicat to a primary.

+

See also

@@ -12503,7 +18572,20 @@

See also

+ + + + + + + + @@ -12514,8 +18596,14 @@

Examples

- https://redis.io/commands/smembers + https://redis.io/docs/latest/commands/replicaof/ +
+ https://redis.io/docs/latest/commands/slaveof/ +
+ +Redis::slaveof
- +
$redis->sAdd('tng-crew', ...['Picard', 'Riker', 'Data', 'Worf', 'La Forge', 'Troi', 'Crusher', 'Broccoli']);
-$redis->sMembers('tng-crew');
$redis = new Redis(['host' => 'localhost']);
+
+// Attempt to become a replica of a Redis instance at 127.0.0.1:9999
+$redis->replicaof('127.0.0.1', 9999);
+
+// When passed no arguments, PhpRedis will deliver the command `REPLICAOF NO ONE`
+// attempting to promote the instance to a primary.
+$redis->replicaof();
@@ -12524,51 +18612,48 @@

Examples

-

- - Redis|array|false - sMisMember(string $key, string $member, string ...$other_members) - + +

+ + Redis|int|false touch(array|string $key_or_array, string ...$more_keys)

-

Check if one or more values are members of a set.

+

Update one or more keys last modified metadata.

Parameters

- - - - - - - - + + + - - + +
string$key

The set to query.

string$member

The first value to test if exists in the set.

array|string$key_or_array

Either the first key or if passed as the only argument +an array of keys.

string...$other_members

Any number of additional values to check.

...$more_keys

One or more keys to send to the command.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|false

An array of integers representing whether each passed value -was a member of the set.

Redis|int|false

This command returns the number of keys that exist and +had their last modified time reset

+

See also

@@ -12576,19 +18661,7 @@

See also

- - - - - - - - @@ -12599,8 +18672,7 @@

Examples

- https://redis.io/commands/smismember -
- https://redis.io/commands/smember -
- \Redis::smember() + https://redis.io/docs/latest/commands/touch/
- +
$redis->sAdd('ds9-crew', ...["Sisko", "Kira", "Dax", "Worf", "Bashir", "O'Brien"]);
-$members = $redis->sMIsMember('ds9-crew', ...['Sisko', 'Picard', 'Data', 'Worf']);
$redis->touch('cache:1', 'cache:2');
@@ -12609,19 +18681,18 @@

Examples

-

- - Redis|bool - sMove(string $src, string $dst, mixed $value) - + +

+ + mixed slowlog(string $operation, int $length = 0)

-

Pop a member from one set and push it onto another. This command will create the -destination set if it does not currently exist.

+

Interact with Redis' slowlog functionality in various ways, depending +on the value of 'operation'.

Parameters

@@ -12629,31 +18700,36 @@

Parameters

- - - - - - - + + - - - + + +
string$src

The source set.

string$dst

The destination set.

$operation

The operation you wish to perform.  This can +be one of the following values: +'GET' - Retrieve the Redis slowlog as an array. +'LEN' - Retrieve the length of the slowlog. +'RESET' - Remove all slowlog entries.

mixed$value

The member you wish to move.

int$length

This optional argument can be passed when operation +is 'get' and will specify how many elements to retrieve. +If omitted Redis will send up to a default number of +entries, which is configurable.

+

Note: With Redis >= 7.0.0 you can send -1 to mean "all".

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the member was moved, and false if it wasn't in the set.

mixed
+

See also

@@ -12661,7 +18737,7 @@

See also

@@ -12672,10 +18748,13 @@

Examples

- https://redis.io/commands/smove + https://redis.io/docs/latest/commands/slowlog/
- + + + + + + +
$redis->sAdd('numbers', 'zero', 'one', 'two', 'three', 'four');
-$redis->sMove('numbers', 'evens', 'zero');
-$redis->sMove('numbers', 'evens', 'two');
-$redis->sMove('numbers', 'evens', 'four');
$redis->slowlog('get', -1);   // Retrieve all slowlog entries.
$redis->slowlog('len');       // Retrieve slowlog length.
$redis->slowlog('reset');     // Reset the slowlog.
@@ -12684,18 +18763,17 @@

Examples

-

- - Redis|string|array|false - sPop(string $key, int $count = 0) - + +

+ + mixed sort(string $key, array|null $options = null)

-

Remove one or more elements from a set.

+

Sort the contents of a Redis key in various ways.

Parameters

@@ -12704,26 +18782,31 @@

Parameters

string $key -

The set in question.

+

The key you wish to sort

- int - $count -

An optional number of members to pop. This defaults to -removing one element.

+ array|null + $options +

Various options controlling how you would like the +data sorted. See blow for a detailed description +of this options array.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|array|falsemixed

This command can either return an array with the sorted data +or the number of elements placed in a destination set when +using the STORE option.

+

See also

@@ -12731,7 +18814,7 @@

See also

@@ -12742,9 +18825,17 @@

Examples

- https://redis.io/commands/spop + https://redis.io/docs/latest/commands/sort/
- +
$redis->del('numbers', 'evens');
-$redis->sAdd('numbers', 'zero', 'one', 'two', 'three', 'four');
-$redis->sPop('numbers');
$options = [
+    'SORT'  => 'ASC'|| 'DESC' // Sort in descending or descending order.
+    'ALPHA' => true || false  // Whether to sort alphanumerically.
+    'LIMIT' => [0, 10]        // Return a subset of the data at offset, count
+    'BY'    => 'weight_*'     // For each element in the key, read data from the
+                                 external key weight_* and sort based on that value.
+    'GET'   => 'weight_*'     // For each element in the source key, retrieve the
+                                 data from key weight_* and return that in the result
+                                 rather than the source keys' element.  This can
+                                 be used in combination with 'BY'
+];
@@ -12753,18 +18844,17 @@

Examples

-

- - Redis|string|array|false - sRandMember(string $key, int $count = 0) - + +

+ + mixed sort_ro(string $key, array|null $options = null)

-

Retrieve one or more random members of a set.

+

This is simply a read-only variant of the sort command

Parameters

@@ -12773,30 +18863,27 @@

Parameters

string $key -

The set to query.

+ - int - $count -

An optional count of members to return.

-

If this value is positive, Redis will return up to the requested -number but with unique elements that will never repeat. This means -you may receive fewer then $count replies.

-

If the number is negative, Redis will return the exact number requested -but the result may contain duplicate elements.

+ array|null + $options + -

Return Value

+

Return Value

- +
+
- - + +
Redis|string|array|false

One or more random members or false on failure.

mixed
+

See also

@@ -12804,7 +18891,14 @@

See also

+ + + + @@ -12815,13 +18909,7 @@

Examples

- https://redis.io/commands/srandmember + +Redis::sort +
+ https://redis.io/docs/latest/commands/sort_ro/
- - - - - - - +
$redis->sRandMember('myset');
$redis->sRandMember('myset', 10);
$redis->sRandMember('myset', -10);
$redis->sort_ro('numbers', ['LIMIT' => [0, 5]]);
@@ -12830,18 +18918,25 @@

Examples

-

- - Redis|array|false - sUnion(string $key, string ...$other_keys) - + +

+ + array sortAsc(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated

+

+ deprecated + + + + +

-

Returns the union of one or more Redis SET keys.

+

No description

+

Parameters

@@ -12850,25 +18945,47 @@

Parameters

string $key -

The first SET to do a union with

+ - string - ...$other_keys -

One or more subsequent keys

+ string|null + $pattern + + + + mixed + $get + + + + int + $offset + + + + int + $count + + + + string|null + $store + -

Return Value

+

Return Value

- - - - +
+
Redis|array|false

The union of the one or more input sets or false on failure.

+ + +
array
+

See also

@@ -12876,7 +18993,7 @@

See also

@@ -12887,7 +19004,7 @@

Examples

- https://redis.io/commands/sunion + https://redis.io/docs/latest/commands/sort/
- +
$redis->sunion('set1', 'set2');
$redis->sortAsc('numbers');
@@ -12896,18 +19013,25 @@

Examples

-

- - Redis|int|false - sUnionStore(string $dst, string $key, string ...$other_keys) - + +

+ + array sortAscAlpha(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated

+

+ deprecated + + + + +

-

Perform a union of one or more Redis SET keys and store the result in a new set

+

No description

+

Parameters

@@ -12915,82 +19039,48 @@

Parameters

- - + + - - - + + + - - - + + + -
string$dst

The destination key

$key
string$key

The first source key

string|null$pattern
string...$other_keys

One or more additional source keys

mixed$get
- - -

Return Value

- - - - - - -
Redis|int|false

The number of elements stored in the destination SET or -false on failure.

- - - -

See also

- - - + + - + + + + + + +
- https://redis.io/commands/sunionstore - int$offset
- \Redis::sunion() - int$count
string|null$store
-
-
- -
-
-

- - Redis|bool - save() - -

-
- - - -
-

Persist the Redis database to disk. This command will block the server until the save is -completed. For a nonblocking alternative, see Redis::bgsave().

-
-
- -

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

Returns true unless an error occurs.

array
+

See also

@@ -12998,89 +19088,94 @@

See also

+
- https://redis.io/commands/save + https://redis.io/docs/latest/commands/sort/
+ + +

Examples

+ + - - +
- \Redis::bgsave() -
$redis->sortAscAlpha('tags');
-
-

- - array|false - scan(int|null $iterator, string|null $pattern = null, int $count = 0, string $type = NULL) - + +

+ + array sortDesc(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated

+

+ deprecated + + + + +

-

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.

+

No description

+

Parameters

- - - + + + - + + + + + + + + + + + - + - - - + + +
int|null$iterator

The cursor returned by Redis for every subsequent call to SCAN. On -the initial invocation of the call, it should be initialized by the -caller to NULL. Each time SCAN is invoked, the iterator will be -updated to a new number, until finally Redis will set the value to -zero, indicating that the scan is complete.

string$key
string|null $pattern

An optional glob-style pattern for matching key names. If passed as -NULL, it is the equivalent of sending '*' (match every key).

mixed$get
int$offset
int $count

A hint to redis that tells it how many keys to return in a single -call to SCAN. The larger the number, the longer Redis may block -clients while iterating the key space.

string$type

An optional argument to specify which key types to scan (e.g. -'STRING', 'LIST', 'SET')

string|null$store
-

Return Value

+

Return Value

- +
+
- - + +
array|false

An array of keys, or false if no keys were returned for this -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.

array
+

See also

@@ -13088,14 +19183,7 @@

See also

- - - - @@ -13106,30 +19194,7 @@

Examples

- https://redis.io/commands/scan -
- -Redis::setOption + https://redis.io/docs/latest/commands/sort/
- +
$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";
- }
-}
$redis->sortDesc('numbers');
@@ -13138,18 +19203,25 @@

Examples

-

- - Redis|int|false - scard(string $key) - + +

+ + array sortDescAlpha(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) deprecated

+

+ deprecated + + + + +

-

Retrieve the number of members in a Redis set.

+

No description

+

Parameters

@@ -13158,20 +19230,47 @@

Parameters

string $key -

The set to get the cardinality of.

+ + + + string|null + $pattern + + + + mixed + $get + + + + int + $offset + + + + int + $count + + + + string|null + $store + -

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The cardinality of the set or false on failure.

array
+

See also

@@ -13179,7 +19278,7 @@

See also

@@ -13190,8 +19289,7 @@

Examples

- https://redis.io/commands/scard + https://redis.io/docs/latest/commands/sort/
- +
$redis->scard('set');
-</code>
$redis->sortDescAlpha('tags');
@@ -13200,18 +19298,17 @@

Examples

-

- - mixed - script(string $command, mixed ...$args) - + +

+ + Redis|int|false srem(string $key, mixed $value, mixed ...$other_values)

-

An administrative command used to interact with LUA scripts stored on the server.

+

Remove one or more values from a Redis SET key.

Parameters

@@ -13219,26 +19316,33 @@

Parameters

- - + + - - + + + + + + +
string$command

The script suboperation to execute.

$key

The Redis SET key in question.

mixed...$args

One ore more additional argument

$value

The first value to remove.

mixed...$other_values

One or more additional values to remove.

-

Return Value

+

Return Value

- +
+
- - + +
mixed

This command returns various things depending on the specific operation executed.

Redis|int|false

The number of values removed from the set or false on failure.

+

See also

@@ -13246,7 +19350,7 @@

See also

@@ -13257,10 +19361,7 @@

Examples

- https://redis.io/commands/script + https://redis.io/docs/latest/commands/srem/
- - - - +
$redis->script('load', 'return 1');
$redis->script('exists', sha1('return 1'));
$redis->sRem('set1', 'mem1', 'mem2', 'not-in-set');
@@ -13269,40 +19370,61 @@

Examples

-

- - Redis|bool - select(int $db) - + +

+ + array|false sscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

-

Select a specific Redis database.

+

Scan the members of a redis SET key.

Parameters

+ + + + + + + + + + + + + + + - - + +
string$key

The Redis SET key in question.

null|int|string$iterator

A reference to an iterator which should be initialized to NULL that +PhpRedis will update with the value returned from Redis after each +subsequent call to SSCAN. Once this cursor is zero you know all +members have been traversed.

string|null$pattern

An optional glob style pattern to match against, so Redis only +returns the subset of members matching this pattern.

int$db

The database to select. Note that by default Redis has 16 databases (0-15).

$count

A hint to Redis as to how many members it should scan in one command +before returning members for that iteration.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

true on success and false on failure

array|false
+

See also

@@ -13310,7 +19432,20 @@

See also

+ + + + + + + + @@ -13321,7 +19456,42 @@

Examples

- https://redis.io/commands/select + https://redis.io/docs/latest/commands/sscan/ +
+ https://redis.io/docs/latest/commands/scan/ +
+ +Redis::setOption
- +
$redis->select(1);
$redis->del('myset');
+for ($i = 0; $i < 10000; $i++) {
+    $redis->sAdd('myset', "member:$i");
+}
+$redis->sadd('myset', 'foofoo');
+
+$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_NORETRY);
+
+$scanned = 0;
+$it = null;
+
+// Without Redis::SCAN_RETRY we may receive empty results and
+// a nonzero iterator.
+do {
+    // Scan members containing '5'
+    $members = $redis->sscan('myset', $it, '*5*');
+    foreach ($members as $member) {
+         echo "NORETRY: $member\n";
+         $scanned++;
+    }
+} while ($it != 0);
+echo "TOTAL: $scanned\n";
+
+$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
+
+$scanned = 0;
+$it = null;
+
+// With Redis::SCAN_RETRY PhpRedis will never return an empty array
+// when the cursor is non-zero
+while (($members = $redis->sscan('myset', $it, '*5*'))) {
+    foreach ($members as $member) {
+        echo "RETRY: $member\n";
+        $scanned++;
+    }
+}
@@ -13330,63 +19500,48 @@

Examples

-

- - Redis|string|bool - set(string $key, mixed $value, mixed $options = NULL) - + +

+ + bool ssubscribe(array $channels, callable $cb)

-

Create or set a Redis STRING key to a value.

+

Subscribes the client to the specified shard channels.

Parameters

- - - - - - - - + + + - - - + + +
string$key

The key name to set.

mixed$value

The value to set the key to.

array$channels

One or more channel names.

mixed$options

Either an array with options for how to perform the set or an -integer with an expiration. If an expiration is set PhpRedis -will actually send the SETEX command.

-

OPTION DESCRIPTION

-
-

['EX' => 60] expire 60 seconds. -['PX' => 6000] expire in 6000 milliseconds. -['EXAT' => time() + 10] expire in 10 seconds. -['PXAT' => time()*1000 + 1000] expire in 1 second. -['KEEPTTL' => true] Redis will not update the key's current TTL. -['XX'] Only set the key if it already exists. -['NX'] Only set the key if it doesn't exist. -['GET'] Instead of returning +OK return the previous value of the -key or NULL if the key didn't exist.

callable$cb

The callback PhpRedis will invoke when we receive a message +from one of the subscribed channels.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|bool

True if the key was set or false on failure.

bool

True on success, false on faiilure. Note that this command will block the +client in a subscribe loop, waiting for messages to arrive.

+

See also

@@ -13394,13 +19549,7 @@

See also

- - - - @@ -13411,10 +19560,21 @@

Examples

- https://redis.io/commands/set -
- https://redis.io/commands/setex + https://redis.io/docs/latest/commands/ssubscribe/
- - - - +
$redis->set('key', 'value');
$redis->set('key', 'expires_in_60_seconds', 60);
$redis = new Redis(['host' => 'localhost']);
+
+$redis->ssubscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) {
+    echo "[$channel]: $message\n";
+
+    // Unsubscribe from the message channel when we read 'quit'
+    if ($message == 'quit') {
+        echo "Unsubscribing from '$channel'\n";
+        $redis->sunsubscribe([$channel]);
+    }
+});
+
+// Once we read 'quit' from both channel-1 and channel-2 the subscribe loop will be
+// broken and this command will execute.
+echo "Subscribe loop ended\n";
@@ -13423,18 +19583,17 @@

Examples

-

- - Redis|int|false - setBit(string $key, int $idx, bool $value) - + +

+ + Redis|int|false strlen(string $key)

-

Set a specific bit in a Redis string to zero or one

+

Retrieve the length of a Redis STRING key.

Parameters

@@ -13443,30 +19602,23 @@

Parameters

string $key -

The Redis STRING key to modify

- - - int - $idx - - - - bool - $value -

Whether to set the bit to zero or one.

+

The key we want the length of.

-

Return Value

+

Return Value

- +
+
- +
Redis|int|false

The original value of the bit or false on failure.

The length of the string key if it exists, zero if it does not, and +false on failure.

+

See also

@@ -13474,7 +19626,7 @@

See also

@@ -13485,8 +19637,7 @@

Examples

- https://redis.io/commands/setbit + https://redis.io/docs/latest/commands/strlen/
- +
$redis->set('foo', 'bar');
-$redis->setbit('foo', 7, 1);
$redis->strlen('mykey');
@@ -13495,50 +19646,48 @@

Examples

-

- - Redis|int|false - setRange(string $key, int $index, string $value) - + +

+ + bool subscribe(array $channels, callable $cb)

-

Update or append to a Redis string at a specific starting index

+

Subscribe to one or more Redis pubsub channels.

Parameters

- - - - - - - - + + + - - - + + +
string$key

The key to update

int$index

Where to insert the provided value

array$channels

One or more channel names.

string$value

The value to copy into the string.

callable$cb

The callback PhpRedis will invoke when we receive a message +from one of the subscribed channels.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The new length of the string or false on failure

bool

True on success, false on faiilure. Note that this command will block the +client in a subscribe loop, waiting for messages to arrive.

+

See also

@@ -13546,7 +19695,7 @@

See also

@@ -13557,8 +19706,21 @@

Examples

- https://redis.io/commands/setrange + https://redis.io/docs/latest/commands/subscribe/
- +
$redis->set('message', 'Hello World');
-$redis->setRange('message', 6, 'Redis');
$redis = new Redis(['host' => 'localhost']);
+
+$redis->subscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) {
+    echo "[$channel]: $message\n";
+
+    // Unsubscribe from the message channel when we read 'quit'
+    if ($message == 'quit') {
+        echo "Unsubscribing from '$channel'\n";
+        $redis->unsubscribe([$channel]);
+    }
+});
+
+// Once we read 'quit' from both channel-1 and channel-2 the subscribe loop will be
+// broken and this command will execute.
+echo "Subscribe loop ended\n";
@@ -13567,121 +19729,42 @@

Examples

-

- - bool - setOption(int $option, mixed $value) - + +

+ + Redis|array|bool sunsubscribe(array $channels)

-

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.

+

Unsubscribes the client from the given shard channels, +or from all of them if none is given.

Parameters

- - - - - - - - + + +
int$option

The option constant.

mixed$value

The option value.

array$channels

One or more channels to unsubscribe from.

-

Return Value

+

Return Value

- +
+
- - + +
bool

true if the setting was updated, false if not.

Redis|array|bool

The array of unsubscribed channels.

+

See also

@@ -13689,78 +19772,113 @@

See also

- +
- -Redis::getOption + https://redis.io/docs/latest/commands/sunsubscribe/
- -Redis::__construct + +Redis::ssubscribe for details about backoff strategies.
+

Examples

+ + + + + +
$redis->ssubscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) {
+    if ($message == 'quit') {
+        echo "$channel => 'quit' detected, unsubscribing!\n";
+        $redis->sunsubscribe([$channel]);
+    } else {
+        echo "$channel => $message\n";
+    }
+});
+
+echo "We've unsubscribed from both channels, exiting\n";
+
-

- - Redis|bool - setex(string $key, int $expire, mixed $value) - + +

+ + Redis|bool swapdb(int $src, int $dst)

-

Set a Redis STRING key with a specific expiration in seconds.

+

Atomically swap two Redis databases so that all of the keys in the source database will +now be in the destination database and vice-versa.

Note: This command simply swaps Redis' internal pointer to the database and is therefore +very fast, regardless of the size of the underlying databases.

Parameters

- - - - - - - + + - - - + + +
string$key

The name of the key to set.

int$expire

The key's expiration in seconds.

$src

The source database number

mixed$value

The value to set the key.

int$dst

The destination database number

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True on success or false on failure.

Redis|bool

Success if the databases could be swapped and false on failure.

+
+

See also

+ + + + + + + + + + +
+ https://redis.io/docs/latest/commands/swapdb/ +
+ +Redis::del +
+

Examples

- +
$redis->setex('60s-ttl', 60, 'some-value');
$redis->select(0);
+$redis->set('db0-key', 'db0-value');
+$redis->swapdb(0, 1);
+$redis->get('db0-key');
@@ -13769,45 +19887,32 @@

Examples

-

- - Redis|bool - setnx(string $key, mixed $value) - + +

+ + Redis|array time()

-

Set a key to a value, but only if that key does not already exist.

+

Retrieve the server time from the connected Redis instance.

-

Parameters

- - - - - - - - - - - - -
string$key

The key name to set.

mixed$value

What to set the key to.

- -

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

Returns true if the key was set and false otherwise.

Redis|array

A two element array consisting of a Unix Timestamp and the number of microseconds +elapsed since the second.

+

See also

@@ -13815,7 +19920,7 @@

See also

@@ -13826,10 +19931,7 @@

Examples

- https://redis.io/commands/setnx + https://redis.io/docs/latest/commands/time/
- - - - +
$redis->setnx('existing-key', 'existing-value');
$redis->setnx('new-key', 'new-value');
$redis->time();
@@ -13838,18 +19940,17 @@

Examples

-

- - Redis|bool - sismember(string $key, mixed $value) - + +

+ + Redis|int|false ttl(string $key)

-

Check whether a given value is the member of a Redis SET.

+

Get the amount of time a Redis key has before it will expire, in seconds.

Parameters

@@ -13858,33 +19959,43 @@

Parameters

string $key -

The redis set to check.

- - - mixed - $value -

The value to test.

+

The Key we want the TTL for.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

True if the member exists and false if not.

Redis|int|false

(a) The number of seconds until the key expires, or -1 if the key has +no expiration, and -2 if the key does not exist. In the event of an +error, this command will return false.

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/ttl/ +
+

Examples

- +
$redis->sismember('myset', 'mem1', 'mem2');
$redis->ttl('mykey');
@@ -13893,30 +20004,17 @@

Examples

-

- - Redis|bool - slaveof(string $host = NULL, int $port = 6379) - deprecated + +

+ + Redis|int|false type(string $key)

-

- deprecated - - - - -

-

Turn a redis instance into a replica of another or promote a replica -to a primary.

This method and the corresponding command in Redis has been marked deprecated -and users should instead use Redis::replicaof() if connecting to redis-server

-
-

= 5.0.0.

-

+

Get the type of a given Redis key.

Parameters

@@ -13924,26 +20022,32 @@

Parameters

- - - - - - - + +
string$host
int$port$key

The key to check

-

Return Value

+

Return Value

- +
+
- - + +
Redis|boolRedis|int|false

The Redis type constant or false on failure.

+

The Redis class defines several type constants that correspond with Redis key types.

+
Redis::REDIS_NOT_FOUND
+Redis::REDIS_STRING
+Redis::REDIS_SET
+Redis::REDIS_LIST
+Redis::REDIS_ZSET
+Redis::REDIS_HASH
+Redis::REDIS_STREAM
+Redis::REDIS_VECTORSET
+

See also

@@ -13951,72 +20055,72 @@

See also

- - - - +
- https://redis.io/commands/slaveof -
- https://redis.io/commands/replicaof + https://redis.io/docs/latest/commands/type/
+ + +

Examples

+ + - - +
- -Redis::replicaof -
foreach ($redis->keys('*') as $key) {
+    echo "$key => " . $redis->type($key) . "\n";
+}
-
-

- - Redis|bool - replicaof(string $host = NULL, int $port = 6379) - + +

-

Used to turn a Redis instance into a replica of another, or to remove -replica status promoting the instance to a primary.

+

Delete one or more keys from the Redis database. Unlike this operation, the actual +deletion is asynchronous, meaning it is safe to delete large keys without fear of +Redis blocking for a long period of time.

Parameters

- - - + + + - - - + + +
string$host

The host of the primary to start replicating.

array|string$key

Either an array with one or more keys or a string with +the first key to delete.

int$port

The port of the primary to start replicating.

string...$other_keys

If the first argument passed to this method was a string +you may pass any number of additional key names.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

Success if we were successfully able to start replicating a primary or -were able to promote the replicat to a primary.

Redis|int|false

The number of keys deleted or false on failure.

+

See also

@@ -14024,20 +20128,20 @@

See also

@@ -14048,14 +20152,10 @@

Examples

- https://redis.io/commands/replicaof + https://redis.io/docs/latest/commands/unlink/
- https://redis.io/commands/slaveof + https://redis.io/docs/latest/commands/del/
- -Redis::slaveof + +Redis::del
- + + + +
$redis = new Redis(['host' => 'localhost']);
-
-// Attempt to become a replica of a Redis instance at 127.0.0.1:9999
-$redis->replicaof('127.0.0.1', 9999);
-
-// When passed no arguments, PhpRedis will deliver the command `REPLICAOF NO ONE`
-// attempting to promote the instance to a primary.
-$redis->replicaof();
$redis->unlink('key1', 'key2', 'key3');
$redis->unlink(['key1', 'key2', 'key3']);
@@ -14064,46 +20164,41 @@

Examples

-

- - Redis|int|false - touch(array|string $key_or_array, string ...$more_keys) - + +

+ + Redis|array|bool unsubscribe(array $channels)

-

Update one or more keys last modified metadata.

+

Unsubscribe from one or more subscribed channels.

Parameters

- - - - - - - - + + +
array|string$key_or_array
string...$more_keys

One or more keys to send to the command.

array$channels

One or more channels to unsubscribe from.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

This command returns the number of keys that exist and -had their last modified time reset

Redis|array|bool

The array of unsubscribed channels.

+

See also

@@ -14111,66 +20206,67 @@

See also

+ + + +
- https://redis.io/commands/touch/ + https://redis.io/docs/latest/commands/unsubscribe/ +
+ +Redis::subscribe
+

Examples

+ + + + + +
$redis->subscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) {
+    if ($message == 'quit') {
+        echo "$channel => 'quit' detected, unsubscribing!\n";
+        $redis->unsubscribe([$channel]);
+    } else {
+        echo "$channel => $message\n";
+    }
+});
+
+echo "We've unsubscribed from both channels, exiting\n";
+
-

- - mixed - slowlog(string $operation, int $length = 0) - + +

+ + Redis|bool unwatch()

-

Interact with Redis' slowlog functionality in various ways, depending -on the value of 'operation'.

+

Remove any previously WATCH'ed keys in a transaction.

-

Parameters

- - - - - - - - - - - - -
string$operation

The operation you wish to perform.  This can -be one of the following values: -'GET' - Retrieve the Redis slowlog as an array. -'LEN' - Retrieve the length of the slowlog. -'RESET' - Remove all slowlog entries.

int$length

This optional argument can be passed when operation -is 'get' and will specify how many elements to retrieve. -If omitted Redis will send up to a default number of -entries, which is configurable.

-

Note: With Redis >= 7.0.0 you can send -1 to mean "all".

- -

Return Value

+

Return Value

- +
+
- - + +
mixedRedis|bool

True on success and false on failure.

+

See also

@@ -14178,24 +20274,31 @@

See also

-
- https://redis.io/commands/slowlog/ + https://redis.io/docs/latest/commands/unwatch/
- - -

Examples

- - - + + - + + +
$redis->slowlog('get', -1);   // Retrieve all slowlog entries.
+ https://redis.io/docs/latest/commands/unwatch/ +
$redis->slowlog('len');       // Retrieve slowlog length.
+ +Redis::watch +
+ + +

Examples

+ + - +
$redis->slowlog('reset');     // Reset the slowlog.
$redis->unwatch();
@@ -14204,49 +20307,47 @@

Examples

-

- - mixed - sort(string $key, array|null $options = null) - + +

+ + Redis|bool watch(array|string $key, string ...$other_keys)

-

Sort the contents of a Redis key in various ways.

+

Watch one or more keys for conditional execution of a transaction.

Parameters

- + - + - - - + + +
stringarray|string $key

The key you wish to sort

Either an array with one or more key names, or a string key name

array|null$options

Various options controlling how you would like the -data sorted. See blow for a detailed description -of this options array.

string...$other_keys

If the first argument was passed as a string, any number of additional +string key names may be passed variadically.

-

Return Value

+

Return Value

- +
+
- - + +
mixed

This command can either return an array with the sorted data -or the number of elements placed in a destination set when -using the STORE option.

Redis|bool
+

See also

@@ -14254,7 +20355,13 @@

See also

+ + + + @@ -14265,17 +20372,30 @@

Examples

- https://redis.io/commands/sort/ + https://redis.io/docs/latest/commands/watch/ +
+ https://redis.io/docs/latest/commands/unwatch/
- +
$options = [
- 'SORT' => 'ASC'|| 'DESC' // Sort in descending or descending order.
- 'ALPHA' => true || false // Whether to sort alphanumerically.
- 'LIMIT' => [0, 10] // Return a subset of the data at offset, count
- 'BY' => 'weight_*' // For each element in the key, read data from the
- external key weight_* and sort based on that value.
- 'GET' => 'weight_*' // For each element in the source key, retrieve the
- data from key weight_* and return that in the result
- rather than the source keys' element. This can
- be used in combination with 'BY'
-];
$redis1 = new Redis(['host' => 'localhost']);
+$redis2 = new Redis(['host' => 'localhost']);
+
+// Start watching 'incr-key'
+$redis1->watch('incr-key');
+
+// Retrieve its value.
+$val = $redis1->get('incr-key');
+
+// A second client modifies 'incr-key' after we read it.
+$redis2->set('incr-key', 0);
+
+// Because another client changed the value of 'incr-key' after we read it, this
+// is no longer a proper increment operation, but because we are `WATCH`ing the
+// key, this transaction will fail and we can try again.
+//
+// If were to comment out the above `$redis2->set('incr-key', 0)` line the
+// transaction would succeed.
+$redis1->multi();
+$redis1->set('incr-key', $val + 1);
+$res = $redis1->exec();
+
+// bool(false)
+var_dump($res);
@@ -14284,45 +20404,47 @@

Examples

-

- - mixed - sort_ro(string $key, array|null $options = null) - + +

+ + int|false wait(int $numreplicas, int $timeout)

-

This is simply a read-only variant of the sort command

+

Block the client up to the provided timeout until a certain number of replicas have confirmed +receiving them.

Parameters

- - - + + + - - - + + +
string$keyint$numreplicas

The number of replicas we want to confirm write operations

array|null$optionsint$timeout

How long to wait (zero meaning forever).

-

Return Value

+

Return Value

- +
+
- - + +
mixedint|false

The number of replicas that have confirmed or false on failure.

+

See also

@@ -14330,39 +20452,38 @@

See also

- -Redis::sort + https://redis.io/docs/latest/commands/wait/
+

Examples

+ + + + + +
$redis->wait(1, 1000);
+
-

- - array - sortAsc(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) - deprecated + +

+ + int|false xack(string $key, string $group, array $ids)

-

- deprecated - - - - -

-

No description

- +

Acknowledge one or more messages that are pending (have been consumed using XREADGROUP but +not yet acknowledged by XACK.)

Parameters

@@ -14371,73 +20492,105 @@

Parameters

string $key - +

The stream to query.

- string|null - $pattern - + string + $group +

The consumer group to use.

- mixed - $get - + array + $ids +

An array of stream entry IDs.

+ + + +

Return Value

+ +
+ + + + + +
int|false

The number of acknowledged messages

+ +
+ + +

See also

+ + - - + - - + - - +
int$offset + https://redis.io/docs/latest/commands/xack/ +
int$count + https://redis.io/docs/latest/commands/xreadgroup/ +
string|null$store + +Redis::xack +
-

Return Value

+

Examples

- - - - -
array
+ +
$redis->xAdd('ships', '*', ['name' => 'Enterprise']);
+$redis->xAdd('ships', '*', ['name' => 'Defiant']);
+
+$redis->xGroup('CREATE', 'ships', 'Federation', '0-0');
+
+// Consume a single message with the consumer group 'Federation'
+$ship = $redis->xReadGroup('Federation', 'Picard', ['ships' => '>'], 1);
+
+/* Retrieve the ID of the message we read.
+assert(isset($ship['ships']));
+$id = key($ship['ships']);
+
+// The message we just read is now pending.
+$res = $redis->xPending('ships', 'Federation'));
+var_dump($res);
+
+// We can tell Redis we were able to process the message by using XACK
+$res = $redis->xAck('ships', 'Federation', [$id]);
+assert($res === 1);
+
+// The message should no longer be pending.
+$res = $redis->xPending('ships', 'Federation');
+var_dump($res);
+ + - - -
-

- - array - sortAscAlpha(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) - deprecated + +

+ + Redis|string|false xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false, bool $nomkstream = false)

-

- deprecated - - - - -

-

No description

- +

Append a message to a stream.

Parameters

@@ -14446,148 +20599,95 @@

Parameters

string $key - +

The stream name.

- string|null - $pattern - + string + $id +

The ID for the message we want to add. This can be the special value '' +which means Redis will generate the ID that appends the message to the +end of the stream. It can also be a value in the form - which will +generate an ID that appends to the end of entries with the same value +(if any exist).

- mixed - $get + array + $values int - $offset - + $maxlen +

If specified Redis will append the new message but trim any number of the +oldest messages in the stream until the length is <= $maxlen.

- int - $count - + bool + $approx +

Used in conjunction with $maxlen, this flag tells Redis to trim the stream +but in a more efficient way, meaning the trimming may not be exactly to +$maxlen values.

- string|null - $store - + bool + $nomkstream +

If passed as TRUE, the stream must exist for Redis to append the message.

-

Return Value

+

Return Value

- +
+
- +
arrayRedis|string|false
+
- -
-
- -
-
-

- - array - sortDesc(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) - deprecated -

-
-

- deprecated - - - - -

- - - -
-

No description

- -
-
-

Parameters

+

See also

- - - - - - - - - - - - - - - - - - - - - - - - - - - +
string$key
string|null$pattern
mixed$get
int$offset
int$count
string|null$store + https://redis.io/docs/latest/commands/xadd/ +
-

Return Value

+

Examples

- - - - -
array
+ +
$redis->xAdd('ds9-season-1', '1-1', ['title' => 'Emissary Part 1']);
+ + +
$redis->xAdd('ds9-season-1', '1-2', ['title' => 'A Man Alone']);
+ + - - -
-

- - array - sortDescAlpha(string $key, string|null $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, string|null $store = null) - deprecated + +

+ + Redis|bool|array xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false)

-

- deprecated - - - - -

-

No description

- +

This command allows a consumer to claim pending messages that have been idle for a specified period of time.

Its purpose is to provide a mechanism for picking up messages that may have had a failed consumer.

Parameters

@@ -14596,65 +20696,119 @@

Parameters

string $key - +

The stream to check.

- string|null - $pattern - + string + $group +

The consumer group to query.

- mixed - $get - + string + $consumer +

Which consumer to check.

int - $offset - + $min_idle +

The minimum time in milliseconds for the message to have been pending.

+ + + string + $start +

The minimum message id to check.

int $count - +

An optional limit on how many messages are returned.

- string|null - $store - + bool + $justid +

If the client only wants message IDs and not all of their data.

-

Return Value

+

Return Value

- +
+
- - + +
arrayRedis|bool|array

An array of pending IDs or false if there are none, or on failure.

+
+

See also

+ + + + + + + + + + + + + + +
+ https://redis.io/docs/latest/commands/xautoclaim/ +
+ https://redis.io/docs/latest/commands/xclaim/ +
+ https://redis.io/docs/data-types/streams-tutorial/ +
+ +

Examples

+ + + + + +
$redis->xGroup('CREATE', 'ships', 'combatants', '0-0', true);
+
+$redis->xAdd('ships', '1424-74205', ['name' => 'Defiant']);
+
+// Consume the ['name' => 'Defiant'] message
+$msgs = $redis->xReadGroup('combatants', "Jem'Hadar", ['ships' => '>'], 1);
+
+// The "Jem'Hadar" consumer has the message presently
+$pending = $redis->xPending('ships', 'combatants');
+var_dump($pending);
+
+// Assume control of the pending message with a different consumer.
+$res = $redis->xAutoClaim('ships', 'combatants', 'Sisko', 0, '0-0');
+
+// Now the 'Sisko' consumer owns the message
+$pending = $redis->xPending('ships', 'combatants');
+var_dump($pending);
+
-

- - Redis|int|false - srem(string $key, mixed $value, mixed ...$other_values) - + +

+ + Redis|array|bool xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options)

-

Remove one or more values from a Redis SET key.

+

This method allows a consumer to take ownership of pending stream entries, by ID. Another +command that does much the same thing but does not require passing specific IDs is Redis::xAutoClaim.

Parameters

@@ -14663,30 +20817,62 @@

Parameters

string $key -

The Redis SET key in question.

+

The stream we wish to claim messages for.

- mixed - $value -

The first value to remove.

+ string + $group +

Our consumer group.

- mixed - ...$other_values + string + $consumer +

Our consumer.

+ + + int + $min_idle +

The minimum idle-time in milliseconds a message must have for ownership to be transferred.

+ + + array + $ids + + + array + $options +

An options array that modifies how the command operates.

+
# Following is an options array describing every option you can pass.  Note that
+# 'IDLE', and 'TIME' are mutually exclusive.
+$options = [
+    'IDLE'       => 3           # Set the idle time of the message to a 3.  By default
+                                # the idle time is set to zero.
+    'TIME'       => 1000*time() # Same as IDLE except it takes a unix timestamp in
+                                # milliseconds.
+    'RETRYCOUNT' => 0           # Set the retry counter to zero.  By default XCLAIM
+                                # doesn't modify the counter.
+    'FORCE'                     # Creates the pending message entry even if IDs are
+                                # not already
+                                # in the PEL with another client.
+    'JUSTID'                    # Return only an array of IDs rather than the messages
+                                # themselves.
+];
-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of values removed from the set or false on failure.

Redis|array|bool

An array of claimed messages or false on failure.

+

See also

@@ -14694,7 +20880,13 @@

See also

+ + + + @@ -14705,7 +20897,26 @@

Examples

- https://redis.io/commands/srem + https://redis.io/docs/latest/commands/xclaim/ +
+ https://redis.io/docs/latest/commands/xautoclaim./
- +
$redis->sRem('set1', 'mem1', 'mem2', 'not-in-set');
$redis->xGroup('CREATE', 'ships', 'combatants', '0-0', true);
+
+$redis->xAdd('ships', '1424-74205', ['name' => 'Defiant']);
+
+// Consume the ['name' => 'Defiant'] message
+$msgs = $redis->xReadGroup('combatants', "Jem'Hadar", ['ships' => '>'], 1);
+
+// The "Jem'Hadar" consumer has the message presently
+$pending = $redis->xPending('ships', 'combatants');
+var_dump($pending);
+
+assert($pending && isset($pending[1]));
+
+// Claim the message by ID.
+$claimed = $redis->xClaim('ships', 'combatants', 'Sisko', 0, [$pending[1]], ['JUSTID']);
+var_dump($claimed);
+
+// Now the 'Sisko' consumer owns the message
+$pending = $redis->xPending('ships', 'combatants');
+var_dump($pending);
@@ -14714,18 +20925,17 @@

Examples

-

- - array|false - sscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + Redis|int|false xdel(string $key, array $ids)

-

Scan the members of a redis SET key.

+

Remove one or more specific IDs from a stream.

Parameters

@@ -14734,40 +20944,27 @@

Parameters

string $key -

The Redis SET key in question.

- - - int|null - $iterator -

A reference to an iterator which should be initialized to NULL that -PhpRedis will update with the value returned from Redis after each -subsequent call to SSCAN. Once this cursor is zero you know all -members have been traversed.

- - - string|null - $pattern -

An optional glob style pattern to match against, so Redis only -returns the subset of members matching this pattern.

+

The stream to modify.

- int - $count -

A hint to Redis as to how many members it should scan in one command -before returning members for that iteration.

+ array + $ids +

One or more message IDs to remove.

-

Return Value

+

Return Value

- +
+
- - + +
array|falseRedis|int|false

The number of messages removed or false on failure.

+

See also

@@ -14775,20 +20972,7 @@

See also

- - - - - - - - @@ -14799,42 +20983,7 @@

Examples

- https://redis.io/commands/sscan -
- https://redis.io/commands/scan -
- -Redis::setOption + https://redis.io/docs/latest/commands/xdel/
- +
$redis->del('myset');
-for ($i = 0; $i < 10000; $i++) {
- $redis->sAdd('myset', "member:$i");
-}
-$redis->sadd('myset', 'foofoo');
-
-$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_NORETRY);
-
-$scanned = 0;
-$it = NULL;
-
-// Without Redis::SCAN_RETRY we may receive empty results and
-// a nonzero iterator.
-do {
- // Scan members containing '5'
- $members = $redis->sscan('myset', $it, '*5*');
- foreach ($members as $member) {
- echo "NORETRY: $member\n";
- $scanned++;
- }
-} while ($it != 0);
-echo "TOTAL: $scanned\n";
-
-$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
-
-$scanned = 0;
-$it = NULL;
-
-// With Redis::SCAN_RETRY PhpRedis will never return an empty array
-// when the cursor is non-zero
-while (($members = $redis->sscan('myset', $it, '*5*'))) {
- foreach ($members as $member) {
- echo "RETRY: $member\n";
- $scanned++;
- }
-}
$redis->xDel('stream', ['1-1', '2-1', '3-1']);
@@ -14843,18 +20992,17 @@

Examples

-

- - Redis|int|false - strlen(string $key) - + +

+ + Redis|array|false xdelex(string $key, array $ids, string|null $mode = null)

-

Retrieve the length of a Redis STRING key.

+

Remove one or more IDs from a stream with extended options.

Parameters

@@ -14863,21 +21011,34 @@

Parameters

string $key -

The key we want the length of.

+

The stream to modify.

+ + + array + $ids +

One or more message IDs to remove.

+ + + string|null + $mode +

An optional mode argument. Valid modes +are as follows: KEEPREF | DELREF | ACKED

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The length of the string key if it exists, zero if it does not, and -false on failure.

Redis|array|false

An array corresponding to IDs. 1 if the id was +deleted and 0 if not.

+

See also

@@ -14885,7 +21046,7 @@

See also

@@ -14896,7 +21057,8 @@

Examples

- https://redis.io/commands/strlen + https://redis.io/docs/latest/commands/xdelex/
- +
$redis->strlen('mykey');
$redis->xadd('s', '*', ['field' => 'value1']);
+$redis->xdelex('s', ['1-0'], 'KEEPREF');
@@ -14905,47 +21067,85 @@

Examples

-

- - bool - subscribe(array $channels, callable $cb) - + +

+ + mixed xgroup(string $operation, string|null $key = null, string|null $group = null, string|null $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2)

-

Subscribe to one or more Redis pubsub channels.

+

XGROUP

Perform various operation on consumer groups for a particular Redis STREAM. What the command does +is primarily based on which operation is passed.

Parameters

- - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + +
array$channels

One or more channel names.

string$operation

The subcommand you intend to execute. Valid options are as follows +'HELP' - Redis will return information about the command +Requires: none +'CREATE' - Create a consumer group. +Requires: Key, group, consumer. +'SETID' - Set the ID of an existing consumer group for the stream. +Requires: Key, group, id. +'CREATECONSUMER' - Create a new consumer group for the stream. You must +also pass key, group, and the consumer name you wish to +create. +Requires: Key, group, consumer. +'DELCONSUMER' - Delete a consumer from group attached to the stream. +Requires: Key, group, consumer. +'DESTROY' - Delete a consumer group from a stream. +Requires: Key, group.

callable$cb

The callback PhpRedis will invoke when we receive a message -from one of the subscribed channels.

string|null$key

The STREAM we're operating on.

string|null$group

The consumer group we want to create/modify/delete.

string|null$id_or_consumer

The STREAM id (e.g. '$') or consumer group. See the operation section +for information about which to send.

bool$mkstream

This flag may be sent in combination with the 'CREATE' operation, and +cause Redis to also create the STREAM if it doesn't currently exist.

int$entries_read

Allows you to set Redis' 'entries-read' STREAM value. This argument is +only relevant to the 'CREATE' and 'SETID' operations. +Note: Requires Redis >= 7.0.0.

-

Return Value

- - - - - +

Return Value

+ +
+
bool

True on success, false on faiilure. Note that this command will block the -client in a subscribe loop, waiting for messages to arrive.

+ + +
mixed

This command return various results depending on the operation performed.

+

See also

@@ -14953,7 +21153,7 @@

See also

@@ -14964,21 +21164,7 @@

Examples

- https://redis.io/commands/subscribe + https://redis.io/docs/latest/commands/xgroup/
- +
$redis = new Redis(['host' => 'localhost']);
-
-$redis->subscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) {
- echo "[$channel]: $message\n";
-
- // Unsubscribe from the message channel when we read 'quit'
- if ($message == 'quit') {
- echo "Unsubscribing from '$channel'\n";
- $redis->unsubscribe([$channel]);
- }
-});
-
-// Once we read 'quit' from both channel-1 and channel-2 the subscribe loop will be
-// broken and this command will execute.
-echo "Subscribe loop ended\n";
$redis->xgroup('CREATE', 'mystream', 'workers', '$');
@@ -14987,47 +21173,56 @@

Examples

-

- - Redis|bool - swapdb(int $src, int $dst) - + +

+ + mixed xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1)

-

Atomically swap two Redis databases so that all of the keys in the source database will -now be in the destination database and vice-versa.

Note: This command simply swaps Redis' internal pointer to the database and is therefore -very fast, regardless of the size of the underlying databases.

+

Retrieve information about a stream key.

Parameters

- - - + + + + + + + + + + + + + - - + +
int$src

The source database number

string$operation

The specific info operation to perform.

string|null$arg1

The first argument (depends on operation)

string|null$arg2

The second argument

int$dst

The destination database number

$count

The COUNT argument to XINFO STREAM

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

Success if the databases could be swapped and false on failure.

mixed

This command can return different things depending on the operation being called.

+

See also

@@ -15035,14 +21230,7 @@

See also

- - - - @@ -15053,62 +21241,13 @@

Examples

- https://redis.io/commands/swapdb -
- -Redis::del + https://redis.io/docs/latest/commands/xinfo/
- + -
$redis->select(0);
-$redis->set('db0-key', 'db0-value');
-$redis->swapdb(0, 1);
-$redis->get('db0-key');
$redis->xInfo('CONSUMERS', 'stream');
- -
-
- -
-
-

- - Redis|array - time() - -

-
- - - -
-

Retrieve the server time from the connected Redis instance.

-
-
- -

Return Value

- - - - - - -
Redis|array

two element array consisting of a Unix Timestamp and the number of microseconds -elapsed since the second.

- - - -

See also

- - - - + -
- https://redis.io/commands/time -
$redis->xInfo('GROUPS', 'stream');
- - -

Examples

- - - +
$redis->time();
$redis->xInfo('STREAM', 'stream');
@@ -15117,18 +21256,17 @@

Examples

-

- - Redis|int|false - ttl(string $key) - + +

+ + Redis|int|false xlen(string $key)

-

Get the amount of time a Redis key has before it will expire, in seconds.

+

Get the number of messages in a Redis STREAM key.

Parameters

@@ -15137,22 +21275,22 @@

Parameters

string $key -

The Key we want the TTL for.

+

The Stream to check.

-

Return Value

+

Return Value

- +
+
- +
Redis|int|false

(a) The number of seconds until the key expires, or -1 if the key has -no expiration, and -2 if the key does not exist. In the event of an -error, this command will return false.

The number of messages or false on failure.

+

See also

@@ -15160,7 +21298,7 @@

See also

@@ -15171,7 +21309,7 @@

Examples

- https://redis.io/commands/ttl + https://redis.io/docs/latest/commands/xlen/
- +
$redis->ttl('mykey');
$redis->xLen('stream');
@@ -15180,18 +21318,18 @@

Examples

-

- - Redis|int|false - type(string $key) - + +

+ + Redis|array|false xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null)

-

Get the type of a given Redis key.

+

Interact with stream messages that have been consumed by a consumer group but not yet +acknowledged with XACK.

Parameters

@@ -15200,28 +21338,47 @@

Parameters

string $key -

The key to check

+

The stream to inspect.

+ + + string + $group +

The user group we want to see pending messages from.

+ + + string|null + $start +

The minimum ID to consider.

+ + + string|null + $end +

The maximum ID to consider.

+ + + int + $count +

Optional maximum number of messages to return.

+ + + string|null + $consumer +

If provided, limit the returned messages to a specific consumer.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The Redis type constant or false on failure.

-

The Redis class defines several type constants that correspond with Redis key types.

-
Redis::REDIS_NOT_FOUND
-Redis::REDIS_STRING
-Redis::REDIS_SET
-Redis::REDIS_LIST
-Redis::REDIS_ZSET
-Redis::REDIS_HASH
-Redis::REDIS_STREAM
Redis|array|false

The pending messages belonging to the stream or false on failure.

+

See also

@@ -15229,7 +21386,13 @@

See also

+ + + + @@ -15240,9 +21403,7 @@

Examples

- https://redis.io/commands/type + https://redis.io/docs/latest/commands/xpending/ +
+ https://redis.io/docs/latest/commands/xreadgroup/
- +
foreach ($redis->keys('*') as $key) {
- echo "$key => " . $redis->type($key) . "\n";
-}
$redis->xpending('mystream', 'workers', '-', '+', 10);
@@ -15251,48 +21412,56 @@

Examples

-

+ + Redis|array|bool xrange(string $key, string $start, string $end, int $count = -1)

-

Delete one or more keys from the Redis database. Unlike this operation, the actual -deletion is asynchronous, meaning it is safe to delete large keys without fear of -Redis blocking for a long period of time.

+

Get a range of entries from a STREAM key.

Parameters

- + - + - - + + + + + + + + + + + +
array|stringstring $key

The stream key name to list.

string...$other_keys

If the first argument passed to this method was a string -you may pass any number of additional key names.

$start

The minimum ID to return.

string$end

The maximum ID to return.

int$count

An optional maximum number of entries to return.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of keys deleted or false on failure.

Redis|array|bool

The entries in the stream within the requested range or false on failure.

+

See also

@@ -15300,20 +21469,7 @@

See also

- - - - - - - - @@ -15324,10 +21480,10 @@

Examples

- https://redis.io/commands/unlink -
- https://redis.io/commands/del -
- -Redis::del + https://redis.io/docs/latest/commands/xrange/
- + - +
$redis->unlink('key1', 'key2', 'key3');
$redis->xRange('stream', '0-1', '0-2');
$redis->unlink(['key1', 'key2', 'key3']);
$redis->xRange('stream', '-', '+');
@@ -15336,18 +21492,17 @@

Examples

-

- - Redis|array|bool - unsubscribe(array $channels) - + +

+ + Redis|array|bool xread(array $streams, int $count = -1, int $block = -1)

-

Unsubscribe from one or more subscribed channels.

+

Consume one or more unconsumed elements in one or more streams.

Parameters

@@ -15355,21 +21510,34 @@

Parameters

- - + + + + + + + + + + + +
array$channels

One or more channels to unsubscribe from.

$streams

An associative array with stream name keys and minimum id values.

int$count

An optional limit to how many entries are returned per stream

int$block

An optional maximum number of milliseconds to block the caller if no +data is available on any of the provided streams.

-

Return Value

+

Return Value

- +
+
- +
Redis|array|bool

The array of unsubscribed channels.

An array of read elements or false if there aren't any.

+

See also

@@ -15377,14 +21545,7 @@

See also

- - - - @@ -15395,16 +21556,14 @@

Examples

- https://redis.io/commands/unsubscribe -
- -Redis::subscribe + https://redis.io/docs/latest/commands/xread/
- +
$redis->subscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) {
- if ($message == 'quit') {
- echo "$channel => 'quit' detected, unsubscribing!\n";
- $redis->unsubscribe([$channel]);
- } else {
- echo "$channel => $message\n";
- }
-});
-
-echo "We've unsubscribed from both channels, exiting\n";
$redis->xAdd('s03', '3-1', ['title' => 'The Search, Part I']);
+$redis->xAdd('s03', '3-2', ['title' => 'The Search, Part II']);
+$redis->xAdd('s03', '3-3', ['title' => 'The House Of Quark']);
+$redis->xAdd('s04', '4-1', ['title' => 'The Way of the Warrior']);
+$redis->xAdd('s04', '4-3', ['title' => 'The Visitor']);
+$redis->xAdd('s04', '4-4', ['title' => 'Hippocratic Oath']);
+
+$redis->xRead(['s03' => '3-2', 's04' => '4-1']);
@@ -15413,30 +21572,61 @@

Examples

-

- - Redis|bool - unwatch() - + +

+ + Redis|array|bool xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1)

-
-

Remove any previously WATCH'ed keys in a transaction.

-
-
+
+

Read one or more messages using a consumer group.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$group

The consumer group to use.

string$consumer

The consumer to use.

array$streams

An array of stream names and message IDs

int$count

Optional maximum number of messages to return

int$block

How long to block if there are no messages available.

+ -

Return Value

+

Return Value

- +
+
- - + +
Redis|bool

on success and false on failure.

Redis|array|bool

Zero or more unread messages or false on failure.

+

See also

@@ -15444,71 +21634,93 @@

See also

- - - - +
- https://redis.io/commands/unwatch -
- https://redis.io/commands/unwatch + https://redis.io/docs/latest/commands/xreadgroup/
+ + +

Examples

+ + - - +
- -Redis::watch -
$redis->xGroup('CREATE', 'episodes', 'ds9', '0-0', true);
+
+$redis->xAdd('episodes', '1-1', ['title' => 'Emissary: Part 1']);
+$redis->xAdd('episodes', '1-2', ['title' => 'A Man Alone']);
+
+$messages = $redis->xReadGroup('ds9', 'sisko', ['episodes' => '>']);
+
+// After having read the two messages, add another
+$redis->xAdd('episodes', '1-3', ['title' => 'Emissary: Part 2']);
+
+// Acknowledge the first two read messages
+foreach ($messages as $stream => $stream_messages) {
+    $ids = array_keys($stream_messages);
+    $redis->xAck('stream', 'ds9', $ids);
+}
+
+// We can now pick up where we left off, and will only get the final message
+$msgs = $redis->xReadGroup('ds9', 'sisko', ['episodes' => '>']);
-
-

- - Redis|bool - watch(array|string $key, string ...$other_keys) - + +

+ + Redis|array|bool xrevrange(string $key, string $end, string $start, int $count = -1)

-

Watch one or more keys for conditional execution of a transaction.

+

Get a range of entries from a STREAM key in reverse chronological order.

Parameters

- + - + - - + + + + + + + + + + + +
array|stringstring $key

The stream key to query.

string...$other_keys

If the first argument was passed as a string, any number of additional -string key names may be passed variadically.

$end

The maximum message ID to include.

string$start

The minimum message ID to include.

int$count

An optional maximum number of messages to include.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|boolRedis|array|bool

The entries within the requested range, from newest to oldest.

+

See also

@@ -15516,13 +21728,13 @@

See also

@@ -15533,30 +21745,10 @@

Examples

- https://redis.io/commands/watch + https://redis.io/docs/latest/commands/xrevrange/
- https://redis.io/commands/unwatch + https://redis.io/docs/latest/commands/xrange/
- + + + +
$redis1 = new Redis(['host' => 'localhost']);
-$redis2 = new Redis(['host' => 'localhost']);
-
-// Start watching 'incr-key'
-$redis1->watch('incr-key');
-
-// Retrieve its value.
-$val = $redis1->get('incr-key');
-
-// A second client modifies 'incr-key' after we read it.
-$redis2->set('incr-key', 0);
-
-// Because another client changed the value of 'incr-key' after we read it, this
-// is no longer a proper increment operation, but because we are `WATCH`ing the
-// key, this transaction will fail and we can try again.
-//
-// If were to comment out the above `$redis2->set('incr-key', 0)` line the
-// transaction would succeed.
-$redis1->multi();
-$redis1->set('incr-key', $val + 1);
-$res = $redis1->exec();
-
-// bool(false)
-var_dump($res);
$redis->xRevRange('stream', '0-2', '0-1');
$redis->xRevRange('stream', '+', '-');
@@ -15565,46 +21757,56 @@

Examples

-

- - int|false - wait(int $numreplicas, int $timeout) - + +

+ + Redis|int|false vadd(string $key, array $values, mixed $element, array|null $options = null)

-

Block the client up to the provided timeout until a certain number of replicas have confirmed -receiving them.

+

Add to a vector set

Parameters

- - - + + + - - - + + + + + + + + + + + + +
int$numreplicas

The number of replicas we want to confirm write operations

string$key

The vector set to add to.

int$timeout

How long to wait (zero meaning forever).

array$values

A non-empty array of floating point values

mixed$element

The element to add to the vector set.

array|null$options

An optional options array

-

Return Value

+

Return Value

- +
+
- - + +
int|false

The number of replicas that have confirmed or false on failure.

Redis|int|false

One if the key was added zero if not.

+

See also

@@ -15612,31 +21814,37 @@

See also

- https://redis.io/commands/wait + https://redis.io/docs/latest/commands/vadd/
+

Examples

+ + + + + +
$redis->vadd('embeddings', [0.12, 0.04, 0.88], 'doc:1');
+
-

- - int|false - xack(string $key, string $group, array $ids) - + +

+ + Redis|array|false vsim(string $key, mixed $member, array|null $options = null)

-

Acknowledge one ore more messages that are pending (have been consumed using XREADGROUP but -not yet acknowledged by XACK.)

+

Query similarity of a vector by element or scores

Parameters

@@ -15645,30 +21853,37 @@

Parameters

string $key -

The stream to query.

+

The vector set to query.

- string - $group -

The consumer group to use.

+ mixed + $member +

Either an element or array of scores. PhpRedis +will attempt to infer which it is, but since +there can be some ambiguity here due to +serialization you can also explicitly specify +ELE, VALUES, or FP32 in the options +array.

- array - $ids -

An array of stream entry IDs.

+ array|null + $options +

An optional options array

-

Return Value

+

Return Value

- +
+
- - + +
int|false

The number of acknowledged messages

Redis|array|false

An array of elements and their similarity scores, or false on failure.

+

See also

@@ -15676,20 +21891,7 @@

See also

- - - - - - - - @@ -15700,29 +21902,7 @@

Examples

- https://redis.io/commands/xack -
- https://redis.io/commands/xreadgroup -
- -Redis::xack + https://redis.io/docs/latest/commands/vsim/
- +
$redis->xAdd('ships', '*', ['name' => 'Enterprise']);
-$redis->xAdd('ships', '*', ['name' => 'Defiant']);
-
-$redis->xGroup('CREATE', 'ships', 'Federation', '0-0');
-
-// Consume a single message with the consumer group 'Federation'
-$ship = $redis->xReadGroup('Federation', 'Picard', ['ships' => '>'], 1);
-
-/* Retrieve the ID of the message we read.
-assert(isset($ship['ships']));
-$id = key($ship['ships']);
-
-// The message we just read is now pending.
-$res = $redis->xPending('ships', 'Federation'));
-var_dump($res);
-
-// We can tell Redis we were able to process the message by using XACK
-$res = $redis->xAck('ships', 'Federation', [$id]);
-assert($res === 1);
-
-// The message should no longer be pending.
-$res = $redis->xPending('ships', 'Federation');
-var_dump($res);
$redis->vsim('embeddings', 'doc:1', ['COUNT' => 3]);
@@ -15731,18 +21911,17 @@

Examples

-

- - Redis|string|false - xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false, bool $nomkstream = false) - + +

+ + Redis|int|false vcard(string $key)

-

Append a message to a stream.

+

Get the length of a vector set

Parameters

@@ -15751,52 +21930,22 @@

Parameters

string $key -

The stream name.

- - - string - $id -

The ID for the message we want to add. This can be the special value '' -which means Redis will generate the ID that appends the message to the -end of the stream. It can also be a value in the form - which will -generate an ID that appends to the end of entries with the same value -(if any exist).

- - - array - $values - - - - int - $maxlen -

If specified Redis will append the new message but trim any number of the -oldest messages in the stream until the length is <= $maxlen.

- - - bool - $approx -

Used in conjunction with $maxlen, this flag tells Redis to trim the stream -but in a more efficient way, meaning the trimming may not be exactly to -$maxlen values.

- - - bool - $nomkstream -

If passed as TRUE, the stream must exist for Redis to append the message.

+

The vector set to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|string|falseRedis|int|false

The number of elements in the vector set or false on failure.

+

See also

@@ -15804,7 +21953,7 @@

See also

@@ -15815,10 +21964,7 @@

Examples

- https://redis.io/commands/xadd + https://redis.io/docs/latest/commands/vcard/
- - - - +
$redis->xAdd('ds9-season-1', '1-1', ['title' => 'Emissary Part 1']);
$redis->xAdd('ds9-season-1', '1-2', ['title' => 'A Man Alone']);
$redis->vcard('embeddings');
@@ -15827,18 +21973,17 @@

Examples

-

- - Redis|bool|array - xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) - + +

+ + Redis|int|false vdim(string $key)

-

This command allows a consumer to claim pending messages that have been idle for a specified period of time.

Its purpose is to provide a mechanism for picking up messages that may have had a failed consumer.

+

Get the dimensions of a vector set

Parameters

@@ -15847,50 +21992,22 @@

Parameters

string $key -

The stream to check.

- - - string - $group -

The consumer group to query.

- - - string - $consumer -

Which consumer to check.

- - - int - $min_idle -

The minimum time in milliseconds for the message to have been pending.

- - - string - $start -

The minimum message id to check.

- - - int - $count -

An optional limit on how many messages are returned.

- - - bool - $justid -

If the client only wants message IDs and not all of their data.

+

The vector set to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|bool|array

An array of pending IDs or false if there are none, or on failure.

Redis|int|false

The number of dimensions in the vector set or false on failure.

+

See also

@@ -15898,19 +22015,7 @@

See also

- - - - - - - - @@ -15921,23 +22026,7 @@

Examples

- https://redis.io/commands/xautoclaim -
- https://redis.io/commands/xclaim -
- https://redis.io/docs/data-types/streams-tutorial/ + https://redis.io/docs/latest/commands/vdim/
- +
$redis->xGroup('CREATE', 'ships', 'combatants', '0-0', true);
-
-$redis->xAdd('ships', '1424-74205', ['name' => 'Defiant']);
-
-// Consume the ['name' => 'Defiant'] message
-$msgs = $redis->xReadGroup('combatants', "Jem'Hadar", ['ships' => '>'], 1);
-
-// The "Jem'Hadar" consumer has the message presently
-$pending = $redis->xPending('ships', 'combatants');
-var_dump($pending);
-
-// Assume control of the pending message with a different consumer.
-$res = $redis->xAutoClaim('ships', 'combatants', 'Sisko', 0, '0-0');
-
-// Now the 'Sisko' consumer owns the message
-$pending = $redis->xPending('ships', 'combatants');
-var_dump($pending);
$redis->vdim('embeddings');
@@ -15946,81 +22035,41 @@

Examples

-

- - Redis|array|bool - xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options) - -

-
- - - -
-

This method allows a consumer to take ownership of pending stream entries, by ID. Another -command that does much the same thing but does not require passing specific IDs is Redis::xAutoClaim.

-
-
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - + +

+ + Redis|array|false vinfo(string $key) +

+
+ + + +
+

Get various bits of information about a vector set

+
+
+

Parameters

+ +
string$key

The stream we wish to claim messages for.

string$group

Our consumer group.

string$consumer

Our consumer.

int$min_idle
array$ids
- - - + + +
array$options

An options array that modifies how the command operates.

-
# Following is an options array describing every option you can pass.  Note that
-# 'IDLE', and 'TIME' are mutually exclusive.
-$options = [
-    'IDLE'       => 3            # Set the idle time of the message to a 3.  By default
-                                 # the idle time is set to zero.
-    'TIME'       => 1000*time()  # Same as IDLE except it takes a unix timestamp in
-                                 # milliseconds.
-    'RETRYCOUNT' => 0            # Set the retry counter to zero.  By default XCLAIM
-                                 # doesn't modify the counter.
-    'FORCE'                      # Creates the pending message entry even if IDs are
-                                 # not already
-                                 # in the PEL with another client.
-    'JUSTID'                     # Return only an array of IDs rather than the messages
-                                 # themselves.
-];
string$key

The vector set to query.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|bool

An array of claimed messages or false on failure.

Redis|array|false

An array of information about the vector set or false on failure.

+

See also

@@ -16028,13 +22077,7 @@

See also

- - - - @@ -16045,26 +22088,7 @@

Examples

- https://redis.io/commands/xclaim -
- https://redis.io/commands/xautoclaim. + https://redis.io/docs/latest/commands/vinfo/
- +
$redis->xGroup('CREATE', 'ships', 'combatants', '0-0', true);
-
-$redis->xAdd('ships', '1424-74205', ['name' => 'Defiant']);
-
-// Consume the ['name' => 'Defiant'] message
-$msgs = $redis->xReadGroup('combatants', "Jem'Hadar", ['ships' => '>'], 1);
-
-// The "Jem'Hadar" consumer has the message presently
-$pending = $redis->xPending('ships', 'combatants');
-var_dump($pending);
-
-assert($pending && isset($pending[1]));
-
-// Claim the message by ID.
-$claimed = $redis->xClaim('ships', 'combatants', 'Sisko', 0, [$pending[1]], ['JUSTID']);
-var_dump($claimed);
-
-// Now the 'Sisko' consumer owns the message
-$pending = $redis->xPending('ships', 'combatants');
-var_dump($pending);
$redis->vinfo('embeddings');
@@ -16073,18 +22097,17 @@

Examples

-

- - Redis|int|false - xdel(string $key, array $ids) - + +

+ + Redis|bool vismember(string $key, mixed $member)

-

Remove one or more specific IDs from a stream.

+

Check if an element is a member of a vectorset

Parameters

@@ -16093,33 +22116,46 @@

Parameters

string $key -

The stream to modify.

+

The vector set to query.

- array - $ids -

One or more message IDs to remove.

+ mixed + $member +

The member to check for.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of messages removed or false on failure.

Redis|bool

true if the member exists, false if it does not.

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/vismember/ +
+

Examples

- +
$redis->xDel('stream', ['1-1', '2-1', '3-1']);
$redis->vismember('embeddings', 'doc:1');
@@ -16128,19 +22164,17 @@

Examples

-

- - mixed - xgroup(string $operation, string $key = null, string $group = null, string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2) - + +

+ + Redis|array|false vemb(string $key, mixed $member, bool $raw = false)

-

XGROUP

Perform various operation on consumer groups for a particular Redis STREAM. What the command does -is primarily based on which operation is passed.

+

Get the embeddings for a specific member

Parameters

@@ -16148,62 +22182,33 @@

Parameters

- - - - - - - - - - - + - - - + + + - - - - - - - + +
string$operation

The subcommand you intend to execute. Valid options are as follows -'HELP' - Redis will return information about the command -Requires: none -'CREATE' - Create a consumer group. -Requires: Key, group, consumer. -'SETID' - Set the ID of an existing consumer group for the stream. -Requires: Key, group, id. -'CREATECONSUMER' - Create a new consumer group for the stream. You must -also pass key, group, and the consumer name you wish to -create. -Requires: Key, group, consumer. -'DELCONSUMER' - Delete a consumer from group attached to the stream. -Requires: Key, group, consumer. -'DESTROY' - Delete a consumer group from a stream. -Requires: Key, group.

string $key

The STREAM we're operating on.

string$group

The consumer group we want to create/modify/delete.

The vector set to query.

string$id_or_consumer

The STREAM id (e.g. '$') or consumer group. See the operation section -for information about which to send.

mixed$member

The member to query.

bool$mkstream

This flag may be sent in combination with the 'CREATE' operation, and -cause Redis to also create the STREAM if it doesn't currently exist.

int$entries_read$raw

If set to true, the raw embeddings will be returned

-

Return Value

+

Return Value

- +
+
- - + +
mixed

This command return various results depending on the operation performed.

Redis|array|false

An array of embeddings for the member or false on failure.

+

See also

@@ -16211,30 +22216,37 @@

See also

- https://redis.io/commands/xgroup/ + https://redis.io/docs/latest/commands/vemb/
+

Examples

+ + + + + +
$redis->vemb('embeddings', 'doc:1');
+
-

- - mixed - xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1) - + +

+ + Redis|array|string|false vrandmember(string $key, int $count = 0)

-

Retrieve information about a stream key.

+

Get one or more random members from a vector set

Parameters

@@ -16242,36 +22254,28 @@

Parameters

- - - - - - - - - - - - + + - +
string$operation

The specific info operation to perform.

string|null$arg1

The first argument (depends on operation)

string|null$arg2

The second argument

$key

The vector set to query.

int $count

The COUNT argument to XINFO STREAM

The number of random members to return.

-

Return Value

+

Return Value

- +
+
- - + +
mixed

This command can return different things depending on the operation being called.

Redis|array|string|false
+

See also

@@ -16279,7 +22283,7 @@

See also

@@ -16290,13 +22294,7 @@

Examples

- https://redis.io/commands/xinfo + https://redis.io/docs/latest/commands/vrandmember/
- - - - - - - +
$redis->xInfo('CONSUMERS', 'stream');
$redis->xInfo('GROUPS', 'stream');
$redis->xInfo('STREAM', 'stream');
$redis->vrandmember('embeddings', 2);
@@ -16305,18 +22303,17 @@

Examples

-

- - Redis|int|false - xlen(string $key) - + +

+ + Redis|array|false vrange(string $key, string $min, string $max, int $count = -1)

-

Get the number of messages in a Redis STREAM key.

+

Retreive a lexographical range of elements from a vector set

Parameters

@@ -16325,20 +22322,37 @@

Parameters

string $key -

The Stream to check.

+

The vector set to query.

+ + + string + $min +

The minimum element to return.

+ + + string + $max +

The maximum element to return.

+ + + int + $count +

An optional maximum number of elements to return.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|int|false

The number of messages or false on failure.

Redis|array|false

An array of elements in the requested range or false on failure.

+

See also

@@ -16346,7 +22360,7 @@

See also

@@ -16357,7 +22371,7 @@

Examples

- https://redis.io/commands/xlen + https://redis.io/docs/latest/commands/vrange/
- +
$redis->xLen('stream');
$redis->vrange('embeddings', '-', '+', 5);
@@ -16366,19 +22380,17 @@

Examples

-

- - Redis|array|false - xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null) - + +

+ + Redis|int|false vrem(string $key, mixed $member)

-

Interact with stream messages that have been consumed by a consumer group but not yet -acknowledged with XACK.

+

Remove an element from a vector set

Parameters

@@ -16387,45 +22399,27 @@

Parameters

string $key -

The stream to inspect.

- - - string - $group -

The user group we want to see pending messages from.

- - - string|null - $start -

The minimum ID to consider.

- - - string|null - $end - - - - int - $count -

Optional maximum number of messages to return.

+

The vector set to remove from.

- string|null - $consumer -

If provided, limit the returned messages to a specific consumer.

+ mixed + $member +

The member to remove.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|false

The pending messages belonging to the stream or false on failure.

Redis|int|false

1 if the member was removed, 0 if it was not.

+

See also

@@ -16433,36 +22427,37 @@

See also

+
- https://redis.io/commands/xpending + https://redis.io/docs/latest/commands/vrem/
+ + +

Examples

+ + - - +
- https://redis.io/commands/xreadgroup -
$redis->vrem('embeddings', 'doc:1');
-
-

- - Redis|array|bool - xrange(string $key, string $start, string $end, int $count = -1) - + +

+ + Redis|int|false vsetattr(string $key, mixed $member, array|string $attributes)

-

Get a range of entries from a STREAM key.

+

Set the attributes of a vector set element

Parameters

@@ -16471,35 +22466,34 @@

Parameters

string $key -

The stream key name to list.

- - - string - $start -

The minimum ID to return.

+

The vector set to modify.

- string - $end -

The maximum ID to return.

+ mixed + $member +

The member to modify.

- int - $count -

An optional maximum number of entries to return.

+ array|string + $attributes +

The attributes to set. This should either +be a json encoded string or an array which +will be json encoded.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|bool

The entries in the stream within the requested range or false on failure.

Redis|int|false

1 if the attributes were set, 0 if they were not.

+

See also

@@ -16507,7 +22501,7 @@

See also

@@ -16518,10 +22512,7 @@

Examples

- https://redis.io/commands/xrange + https://redis.io/docs/latest/commands/vsetattr/
- - - - +
$redis->xRange('stream', '0-1', '0-2');
$redis->xRange('stream', '-', '+');
$redis->vsetattr('embeddings', 'doc:1', ['topic' => 'tech']);
@@ -16530,51 +22521,51 @@

Examples

-

- - Redis|array|bool - xread(array $streams, int $count = -1, int $block = -1) - + +

+ + Redis|array|string|false vgetattr(string $key, mixed $member, bool $decode = true)

-

Consume one or more unconsumed elements in one or more streams.

+

Get the attributes of a vector set element

Parameters

- - - + + + - - - + + + - - - + + +
array$streams

An associative array with stream name keys and minimum id values.

string$key

The vector set to query.

int$count

An optional limit to how many entries are returned per stream

mixed$member

The member to query.

int$block

An optional maximum number of milliseconds to block the caller if no -data is available on any of the provided streams.

bool$decode

Whether to automatically deserialize any returned json.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|bool

An array of read elements or false if there aren't any.

Redis|array|string|false

An array of attributes for the member or false on failure.

+

See also

@@ -16582,7 +22573,7 @@

See also

@@ -16593,14 +22584,7 @@

Examples

- https://redis.io/commands/xread + https://redis.io/docs/latest/commands/vgetattr/
- +
$redis->xAdd('s03', '3-1', ['title' => 'The Search, Part I']);
-$redis->xAdd('s03', '3-2', ['title' => 'The Search, Part II']);
-$redis->xAdd('s03', '3-3', ['title' => 'The House Of Quark']);
-$redis->xAdd('s04', '4-1', ['title' => 'The Way of the Warrior']);
-$redis->xAdd('s04', '4-3', ['title' => 'The Visitor']);
-$redis->xAdd('s04', '4-4', ['title' => 'Hippocratic Oath']);
-
-$redis->xRead(['s03' => '3-2', 's04' => '4-1']);
$redis->vgetattr('embeddings', 'doc:1');
@@ -16609,18 +22593,17 @@

Examples

-

- - Redis|array|bool - xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1) - + +

-

Read one or more messages using a consumer group.

+

Get any adajcent values for a member of a vector set.

Parameters

@@ -16628,41 +22611,33 @@

Parameters

- - - - - - - - - - - - + + - - - + + + - - - + + +
string$group

The consumer group to use.

string$consumer

The consumer to use.

array$streams

An array of stream names and message IDs

$key

The vector set to query.

int$count

Optional maximum number of messages to return

mixed$member

The member to query.

int$block

How long to block if there are no messages available.

bool$withscores

If set to true, the scores of the adjacent values will be returned.

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|bool

Zero or more unread messages or false on failure.

Redis|array|false

An array of adjacent values and their scores, or false on failure.

+

See also

@@ -16670,7 +22645,7 @@

See also

@@ -16681,24 +22656,7 @@

Examples

- https://redis.io/commands/xreadgroup + https://redis.io/docs/latest/commands/vlinks/
- +
$redis->xGroup('CREATE', 'episodes', 'ds9', '0-0', true);
-
-$redis->xAdd('episodes', '1-1', ['title' => 'Emissary: Part 1']);
-$redis->xAdd('episodes', '1-2', ['title' => 'A Man Alone']);
-
-$messages = $redis->xReadGroup('ds9', 'sisko', ['episodes' => '>']);
-
-// After having read the two messages, add another
-$redis->xAdd('episodes', '1-3', ['title' => 'Emissary: Part 2']);
-
-// Acknowledge the first two read messages
-foreach ($messages as $stream => $stream_messages) {
- $ids = array_keys($stream_messages);
- $redis->xAck('stream', 'ds9', $ids);
-}
-
-// We can now pick up where we left off, and will only get the final message
-$msgs = $redis->xReadGroup('ds9', 'sisko', ['episodes' => '>']);
$redis->vlinks('embeddings', 'doc:1', true);
@@ -16707,18 +22665,17 @@

Examples

-

- - Redis|array|bool - xrevrange(string $key, string $end, string $start, int $count = -1) - + +

+ + Redis|array|false gcra(string $key, int $maxBurst, int $requestsPerPeriod, int $period, int $tokens = 0)

-

Get a range of entries from a STREAM key in reverse chronological order.

+

Get rate limiting information

Parameters

@@ -16727,35 +22684,42 @@

Parameters

string $key -

The stream key to query.

+ - string - $end -

The maximum message ID to include.

+ int + $maxBurst + - string - $start -

The minimum message ID to include.

+ int + $requestsPerPeriod + int - $count -

An optional maximum number of messages to include.

+ $period + + + + int + $tokens +

= 0

-

Return Value

+

Return Value

- +
+
- - + +
Redis|array|bool

The entries within the requested range, from newest to oldest.

Redis|array|false
+

See also

@@ -16763,13 +22727,7 @@

See also

- - - - @@ -16780,10 +22738,7 @@

Examples

- https://redis.io/commands/xrevrange -
- https://redis.io/commands/xrange + https://redis.io/docs/latest/commands/gcra/
- - - - +
$redis->xRevRange('stream', '0-2', '0-1');
$redis->xRevRange('stream', '+', '-');
$redis->gcra('user:123', 10, 100, 3600);
@@ -16792,11 +22747,10 @@

Examples

-

- - Redis|int|false - xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1) - + +

+ + Redis|int|false xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1)

@@ -16841,15 +22795,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of entries deleted from the stream.

+

See also

@@ -16857,7 +22813,7 @@

See also

@@ -16880,11 +22836,10 @@

Examples

-

- - Redis|int|false - zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems) - + +

+ + Redis|int|float|false zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)

@@ -16906,8 +22861,7 @@

Parameters

+ ]; +

Note: 'GX', 'LT', and 'NX' cannot be passed together, and PhpRedis +will send whichever one is last in the options array.

@@ -16937,16 +22890,18 @@

Parameters

- https://redis.io/commands/xtrim + https://redis.io/docs/latest/commands/xtrim/
array|float $score_or_options

Either the score for the first element, or an array of options.

-

- $options = [
+
 $options = [
      'NX',       # Only update elements that already exist
      'NX',       # Only add new elements but don't update existing ones.
 
@@ -16924,10 +22878,9 @@ 

Parameters

# increment the element by the # provided score, much like ZINCRBY. When this option # is passed, you may only send a single score and member. - ]; - - Note: 'GX', 'LT', and 'NX' cannot be passed together, and PhpRedis - will send whichever one is last in the options array.
mixed
-

Return Value

+

Return Value

- +
+
- +
Redis|int|falseRedis|int|float|false

The return value varies depending on the options passed.

Following is information about the options that may be passed as the second argument:

+

See also

@@ -16954,7 +22909,7 @@

See also

@@ -16965,10 +22920,8 @@

Examples

- https://redis.io/commands/zadd + https://redis.io/docs/latest/commands/zadd/
- - - - +
$redis->zadd('zs', 1, 'first', 2, 'second', 3, 'third');
$redis->zAdd('zs', ['XX'], 8, 'second', 99, 'new-element');
$redis->zadd('zs', 1, 'first', 2, 'second', 3, 'third');
+$redis->zAdd('zs', ['XX'], 8, 'second', 99, 'new-element');
@@ -16977,11 +22930,10 @@

Examples

-

- - Redis|int|false - zCard(string $key) - + +

+ + Redis|int|false zCard(string $key)

@@ -17002,15 +22954,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of elements in the set or false on failure

+

See also

@@ -17018,7 +22972,7 @@

See also

@@ -17038,11 +22992,10 @@

Examples

-

- - Redis|int|false - zCount(string $key, string $start, string $end) - + +

+ + Redis|int|false zCount(string $key, int|string $start, int|string $end)

@@ -17061,27 +23014,31 @@

Parameters

- + - + - + - +
- https://redis.io/commands/zcard + https://redis.io/docs/latest/commands/zcard/

The sorted set to check.

stringint|string $start

The minimum score to include in the count

stringint|string $end

The maximum score to include in the count

+

NOTE: In addition to a floating point score you may pass the special values of '-inf' and +'+inf' meaning negative and positive infinity, respectively.

-

Return Value

+

Return Value

- +
+
Redis|int|false
+

See also

@@ -17089,7 +23046,7 @@

See also

@@ -17100,13 +23057,9 @@

Examples

- https://redis.io/commands/zcount + https://redis.io/docs/latest/commands/zcount/
- - - - - - - +
$redis->zCount('fruit-rankings', '0', '+inf');
$redis->zCount('fruit-rankings', 50, 60);
$redis->zCount('fruit-rankings', '-inf', 0);
$redis->zCount('fruit-rankings', '0', '+inf');
+$redis->zCount('fruit-rankings', 50, 60);
+$redis->zCount('fruit-rankings', '-inf', 0);
@@ -17115,11 +23068,10 @@

Examples

-

- - Redis|float|false - zIncrBy(string $key, float $value, mixed $member) - + +

+ + Redis|float|false zIncrBy(string $key, float $value, mixed $member)

@@ -17150,15 +23102,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|float|false

The new score of the member or false on failure.

+

See also

@@ -17166,7 +23120,7 @@

See also

@@ -17177,10 +23131,8 @@

Examples

- https://redis.io/commands/zincrby + https://redis.io/docs/latest/commands/zincrby/
- - - - +
$redis->zIncrBy('zs', 5.0, 'bananas');
$redis->zIncrBy('zs', 2.0, 'eggplants');
$redis->zIncrBy('zs', 5.0, 'bananas');
+$redis->zIncrBy('zs', 2.0, 'eggplants');
@@ -17189,11 +23141,10 @@

Examples

-

- - Redis|int|false - zLexCount(string $key, string $min, string $max) - + +

+ + Redis|int|false zLexCount(string $key, string $min, string $max)

@@ -17225,15 +23176,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of members that fall within the range or false on failure.

+

See also

@@ -17241,7 +23194,7 @@

See also

@@ -17252,7 +23205,7 @@

Examples

- https://redis.io/commands/zlexcount + https://redis.io/docs/latest/commands/zlexcount/
-
$redis->zAdd('captains', 0, 'Janeway', 0, 'Kirk', 0, 'Picard', 0, 'Sisko', 0, 'Archer');
+
$redis->zAdd('captains', 0, 'Janeway', 0, 'Kirk', 0, 'Picard', 0, 'Sisko', 0, 'Archer');
 $redis->zLexCount('captains', '[A', '[S');
@@ -17262,11 +23215,10 @@

Examples

-

- - Redis|array|false - zMscore(string $key, mixed $member, mixed ...$other_members) - + +

+ + Redis|array|false zMscore(string $key, mixed $member, mixed ...$other_members)

@@ -17297,15 +23249,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

An array of the scores of the requested elements.

+

See also

@@ -17313,7 +23267,7 @@

See also

@@ -17324,9 +23278,9 @@

Examples

- https://redis.io/commands/zmscore + https://redis.io/docs/latest/commands/zmscore/
-
$redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three');
-
-$redis->zMScore('zs', 'zero', 'two');
+
$redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three');
+
+$redis->zMScore('zs', 'zero', 'two');
 $redis->zMScore('zs', 'one', 'not-a-member');
@@ -17336,11 +23290,10 @@

Examples

-

- - Redis|array|false - zPopMax(string $key, int $count = null) - + +

+ + Redis|array|false zPopMax(string $key, int|null $count = null)

@@ -17359,22 +23312,24 @@

Parameters

The sorted set to pop elements from.

- int + int|null $count

An optional count of elements to pop.

-

Return Value

+

Return Value

- +
+
- +
Redis|array|false

All of the popped elements with scores or false on fialure.

All of the popped elements with scores or false on failure

+

See also

@@ -17382,7 +23337,7 @@

See also

@@ -17393,9 +23348,9 @@

Examples

- https://redis.io/commands/zpopmax + https://redis.io/docs/latest/commands/zpopmax/
-
$redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three');
-
-$redis->zPopMax('zs');
+
$redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three');
+
+$redis->zPopMax('zs');
 $redis->zPopMax('zs', 2);.
@@ -17405,11 +23360,10 @@

Examples

-

- - Redis|array|false - zPopMin(string $key, int $count = null) - + +

+ + Redis|array|false zPopMin(string $key, int|null $count = null)

@@ -17428,22 +23382,24 @@

Parameters

The sorted set to pop elements from.

- int + int|null $count

An optional count of elements to pop.

-

Return Value

+

Return Value

- +
+
Redis|array|false

The popped elements with their scores or false on failure.

+

See also

@@ -17451,7 +23407,7 @@

See also

@@ -17462,9 +23418,9 @@

Examples

- https://redis.io/commands/zpopmin + https://redis.io/docs/latest/commands/zpopmin/
-
$redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three');
-
-$redis->zPopMin('zs');
+
$redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three');
+
+$redis->zPopMin('zs');
 $redis->zPopMin('zs', 2);
@@ -17474,11 +23430,10 @@

Examples

-

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

+ + Redis|array|false zRange(string $key, string|int $start, string|int $end, array|bool|null $options = null)

@@ -17498,12 +23453,12 @@

Parameters

The sorted set in question.

- mixed + string|int $start

The starting index we want to return.

- mixed + string|int $end

The final index we want to return.

@@ -17513,27 +23468,29 @@

Parameters

This value may either be an array of options to pass to the command, or for historical purposes a boolean which controls just the 'WITHSCORES' option.

-
$options = [
+
$options = [
     'WITHSCORES' => true,     # Return both scores and members.
     'LIMIT'      => [10, 10], # Start at offset 10 and return 10 elements.
     'REV'                     # Return the elements in reverse order
     'BYSCORE',                # Treat `start` and `end` as scores instead
     'BYLEX'                   # Treat `start` and `end` as lexicographical values.
 ];
-

Note: 'BYLEX' and 'BYSCORE' are mutually exclusive.

+

Note: BYLEX and BYSCORE are mutually exclusive.

-

Return Value

+

Return Value

- +
+
Redis|array|false

An array with matching elements or false on failure.

+

See also

@@ -17541,7 +23498,7 @@

See also

@@ -17552,10 +23509,8 @@

Examples

- https://redis.io/commands/zrange/ + https://redis.io/docs/latest/commands/zrange/
- - - - +
$redis->zRange('zset', 0, -1);
$redis->zRange('zset', '-inf', 'inf', ['byscore' => true]);
$redis->zRange('zset', 0, -1);
+$redis->zRange('zset', '-inf', 'inf', ['byscore']);
@@ -17564,11 +23519,10 @@

Examples

-

- - Redis|array|false - zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) - + +

+ + Redis|array|false zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1)

@@ -17609,15 +23563,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

An array of matching elements or false on failure.

+

See also

@@ -17625,7 +23581,7 @@

See also

@@ -17636,10 +23592,10 @@

Examples

- https://redis.io/commands/zrangebylex + https://redis.io/docs/latest/commands/zrangebylex/
-
$redis = new Redis(['host' => 'localhost']);
-$redis->zAdd('captains', 0, 'Janeway', 0, 'Kirk', 0, 'Picard', 0, 'Sisko', 0, 'Archer');
-
-$redis->zRangeByLex('captains', '[A', '[S');
+
$redis = new Redis(['host' => 'localhost']);
+$redis->zAdd('captains', 0, 'Janeway', 0, 'Kirk', 0, 'Picard', 0, 'Sisko', 0, 'Archer');
+
+$redis->zRangeByLex('captains', '[A', '[S');
 $redis->zRangeByLex('captains', '[A', '[S', 2, 2);
@@ -17649,11 +23605,10 @@

Examples

-

- - Redis|array|false - zRangeByScore(string $key, string $start, string $end, array $options = []) - + +

+ + Redis|array|false zRangeByScore(string $key, string $start, string $end, array $options = [])

@@ -17692,15 +23647,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

The number of matching elements or false on failure.

+

See also

@@ -17708,7 +23665,7 @@

See also

@@ -17719,10 +23676,8 @@

Examples

- https://redis.io/commands/zrangebyscore + https://redis.io/docs/latest/commands/zrangebyscore/
- - - - +
$redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true]);
$redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true, 'LIMIT' => [5, 5]]);
$redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true]);
+$redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true, 'LIMIT' => [5, 5]]);
@@ -17731,11 +23686,10 @@

Examples

-

- - Redis|int|false - zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = NULL) - + +

+ + Redis|int|false zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = null)

@@ -17777,15 +23731,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of elements stored in $dstkey or false on failure.

+

See also

@@ -17793,7 +23749,7 @@

See also

@@ -17806,16 +23762,23 @@

See also

- https://redis.io/commands/zrange/ + https://redis.io/docs/latest/commands/zrange/
+

Examples

+ + + + + +
$redis->zrangestore('recent:leaders', 'leaders', '0', '9');
+
-

- - Redis|string|array - zRandMember(string $key, array $options = null) - + +

+ + Redis|string|array zRandMember(string $key, array|null $options = null)

@@ -17834,25 +23797,27 @@

Parameters

The sorted set to pull random members from.

- array + array|null $options -

One or more options that determine exactly how the command operates.

-

OPTION TYPE MEANING -'COUNT' int The number of random members to return. -'WITHSCORES' bool Whether to return scores and members instead of

+

One or more options that determine exactly how the command operates. +OPTION TYPE MEANING +'COUNT' int The number of random members to return. +'WITHSCORES' bool Whether to return scores and members instead of

-

Return Value

+

Return Value

- +
+
- +
Redis|string|array

One ore more random elements.

One or more random elements.

+

See also

@@ -17860,7 +23825,7 @@

See also

@@ -17880,11 +23845,10 @@

Examples

-

- - Redis|int|false - zRank(string $key, mixed $member) - + +

+ + Redis|int|false zRank(string $key, mixed $member)

@@ -17905,20 +23869,22 @@

Parameters

- +
- https://redis.io/commands/zrandmember + https://redis.io/docs/latest/commands/zrandmember/
mixed $member

The member to test.

-

Return Value

+

Return Value

- +
+
Redis|int|false

The rank of the requested member.

+

See also

@@ -17926,7 +23892,7 @@

See also

@@ -17937,10 +23903,8 @@

Examples

- https://redis.io/commands/zrank + https://redis.io/docs/latest/commands/zrank/
- - - - +
$redis->zRank('zs', 'zero');
$redis->zRank('zs', 'three');
$redis->zRank('zs', 'zero');
+$redis->zRank('zs', 'three');
@@ -17949,11 +23913,10 @@

Examples

-

- - Redis|int|false - zRem(mixed $key, mixed $member, mixed ...$other_members) - + +

+ + Redis|int|false zRem(mixed $key, mixed $member, mixed ...$other_members)

@@ -17984,15 +23947,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of members that were actually removed or false on failure.

+

See also

@@ -18000,7 +23965,7 @@

See also

@@ -18020,11 +23985,10 @@

Examples

-

- - Redis|int|false - zRemRangeByLex(string $key, string $min, string $max) - + +

+ + Redis|int|false zRemRangeByLex(string $key, string $min, string $max)

@@ -18055,15 +24019,17 @@

Parameters

- https://redis.io/commands/zrem + https://redis.io/docs/latest/commands/zrem/
-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of elements removed from the set or false on failure.

+

See also

@@ -18071,7 +24037,7 @@

See also

@@ -18088,10 +24054,8 @@

Examples

- https://redis.io/commands/zremrangebylex + https://redis.io/docs/latest/commands/zremrangebylex/
- - - - +
$redis->zRemRangeByLex('zs', '[a', '(b');
$redis->zRemRangeByLex('zs', '(banana', '(eggplant');
$redis->zRemRangeByLex('zs', '[a', '(b');
+$redis->zRemRangeByLex('zs', '(banana', '(eggplant');
@@ -18100,11 +24064,10 @@

Examples

-

- - Redis|int|false - zRemRangeByRank(string $key, int $start, int $end) - + +

+ + Redis|int|false zRemRangeByRank(string $key, int $start, int $end)

@@ -18135,15 +24098,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of members removed from the set or false on failure.

+

See also

@@ -18151,7 +24116,7 @@

See also

@@ -18171,11 +24136,10 @@

Examples

-

- - Redis|int|false - zRemRangeByScore(string $key, string $start, string $end) - + +

+ + Redis|int|false zRemRangeByScore(string $key, string $start, string $end)

@@ -18206,15 +24170,17 @@

Parameters

- https://redis.io/commands/zremrangebyrank + https://redis.io/docs/latest/commands/zremrangebyrank/
-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of members removed from the set or false on failure.

+

See also

@@ -18222,7 +24188,7 @@

See also

@@ -18233,7 +24199,7 @@

Examples

- https://redis.io/commands/zremrangebyrank + https://redis.io/docs/latest/commands/zremrangebyrank/
-
$redis->zAdd('zs', 2, 'two', 4, 'four', 6, 'six');
+
$redis->zAdd('zs', 2, 'two', 4, 'four', 6, 'six');
 $redis->zRemRangeByScore('zs', 2, 4);
@@ -18243,11 +24209,10 @@

Examples

-

- - Redis|array|false - zRevRange(string $key, int $start, int $end, mixed $scores = null) - + +

+ + Redis|array|false zRevRange(string $key, int $start, int $end, mixed $scores = null)

@@ -18278,14 +24243,16 @@

Parameters

mixed $scores - +

Whether or not Redis should also return each members score. See +the example below demonstrating how it may be used.

-

Return Value

+

Return Value

- +
+
Redis|array|false

The members (and possibly scores) of the matching elements or false @@ -18293,6 +24260,7 @@

Return Value

+

See also

@@ -18300,7 +24268,7 @@

See also

@@ -18311,16 +24279,10 @@

Examples

- https://redis.io/commands/zrevrange + https://redis.io/docs/latest/commands/zrevrange/
- - - - - - - - - - +
$redis->zRevRange('zs', 0, -1);
$redis->zRevRange('zs', 2, 3);
$redis->zRevRange('zs', 0, -1, true);
$redis->zRevRange('zs', 0, -1, ['withscores' => true]);
$redis->zRevRange('zs', 0, -1);
+$redis->zRevRange('zs', 2, 3);
+$redis->zRevRange('zs', 0, -1, true);
+$redis->zRevRange('zs', 0, -1, ['withscores' => true]);
@@ -18329,11 +24291,10 @@

Examples

-

- - Redis|array|false - zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1) - + +

+ + Redis|array|false zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1)

@@ -18354,12 +24315,12 @@

Parameters

string $max - +

The maximum legographical element to include in the result.

string $min -

The maximum legographical element to include in the result.

+

The minimum lexographical element to include in the result.

int @@ -18374,15 +24335,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

The matching members or false on failure.

+

See also

@@ -18390,7 +24353,7 @@

See also

@@ -18407,10 +24370,8 @@

Examples

- https://redis.io/commands/zrevrangebylex + https://redis.io/docs/latest/commands/zrevrangebylex/
- - - - +
$redis->zRevRangeByLex('captains', '[Q', '[J');
$redis->zRevRangeByLex('captains', '[Q', '[J', 1, 2);
$redis->zRevRangeByLex('captains', '[Q', '[J');
+$redis->zRevRangeByLex('captains', '[Q', '[J', 1, 2);
@@ -18419,11 +24380,10 @@

Examples

-

- - Redis|array|false - zRevRangeByScore(string $key, string $max, string $min, array|bool $options = []) - + +

+ + Redis|array|false zRevRangeByScore(string $key, string $max, string $min, array|bool $options = [])

@@ -18455,25 +24415,27 @@

Parameters

array|bool $options

An options array that modifies how the command executes.

-
$options = [
+
$options = [
     'WITHSCORES' => true|false # Whether or not to return scores
     'LIMIT' => [offset, count] # Return a subset of the matching members
 ];
-

NOTE: For legacy reason, you may also simply pass true for the +

NOTE: For legacy reason, you may also simply pass true for the options argument, to mean WITHSCORES.

-

Return Value

+

Return Value

- +
+
Redis|array|false

The matching members in reverse order of score or false on failure.

+

See also

@@ -18481,7 +24443,7 @@

See also

@@ -18492,14 +24454,14 @@

Examples

- https://redis.io/commands/zrevrangebyscore + https://redis.io/docs/latest/commands/zrevrangebyscore/
-
$redis->zadd('oldest-people', 122.4493, 'Jeanne Calment', 119.2932, 'Kane Tanaka',
- 119.2658, 'Sarah Knauss', 118.7205, 'Lucile Randon',
- 117.7123, 'Nabi Tajima', 117.6301, 'Marie-Louise Meilleur',
- 117.5178, 'Violet Brown', 117.3753, 'Emma Morano',
- 117.2219, 'Chiyo Miyako', 117.0740, 'Misao Okawa');
-
-$redis->zRevRangeByScore('oldest-people', 122, 119);
-$redis->zRevRangeByScore('oldest-people', 'inf', 118);
+
$redis->zadd('oldest-people', 122.4493, 'Jeanne Calment', 119.2932, 'Kane Tanaka',
+                              119.2658, 'Sarah Knauss',   118.7205, 'Lucile Randon',
+                              117.7123, 'Nabi Tajima',    117.6301, 'Marie-Louise Meilleur',
+                              117.5178, 'Violet Brown',   117.3753, 'Emma Morano',
+                              117.2219, 'Chiyo Miyako',   117.0740, 'Misao Okawa');
+
+$redis->zRevRangeByScore('oldest-people', 122, 119);
+$redis->zRevRangeByScore('oldest-people', 'inf', 118);
 $redis->zRevRangeByScore('oldest-people', '117.5', '-inf', ['LIMIT' => [0, 1]]);
@@ -18509,11 +24471,10 @@

Examples

-

- - Redis|int|false - zRevRank(string $key, mixed $member) - + +

+ + Redis|int|false zRevRank(string $key, mixed $member)

@@ -18539,9 +24500,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The reverse rank (the rank if counted high to low) of the member or @@ -18549,6 +24511,7 @@

Return Value

+

See also

@@ -18556,7 +24519,7 @@

See also

@@ -18567,9 +24530,9 @@

Examples

- https://redis.io/commands/zrevrank + https://redis.io/docs/latest/commands/zrevrank/
-
$redis->zAdd('ds9-characters', 10, 'Sisko', 9, 'Garak', 8, 'Dax', 7, 'Odo');
-
-$redis->zrevrank('ds9-characters', 'Sisko');
+
$redis->zAdd('ds9-characters', 10, 'Sisko', 9, 'Garak', 8, 'Dax', 7, 'Odo');
+
+$redis->zrevrank('ds9-characters', 'Sisko');
 $redis->zrevrank('ds9-characters', 'Garak');
@@ -18579,11 +24542,10 @@

Examples

-

- - Redis|float|false - zScore(string $key, mixed $member) - + +

+ + Redis|float|false zScore(string $key, mixed $member)

@@ -18609,15 +24571,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
- +
Redis|float|false

score of the requested element or false if it is not found.

The score of the requested element or false if it is not found.

+

See also

@@ -18625,7 +24589,7 @@

See also

@@ -18636,7 +24600,7 @@

Examples

- https://redis.io/commands/zscore + https://redis.io/docs/latest/commands/zscore/
-
$redis->zAdd('telescopes', 11.9, 'LBT', 10.4, 'GTC', 10, 'HET');
+
$redis->zAdd('telescopes', 11.9, 'LBT', 10.4, 'GTC', 10, 'HET');
 $redis->zScore('telescopes', 'LBT');
@@ -18646,11 +24610,10 @@

Examples

-

- - Redis|array|false - zdiff(array $keys, array $options = null) - + +

+ + Redis|array|false zdiff(array $keys, array|null $options = null)

@@ -18667,10 +24630,10 @@

Parameters

array $keys -

One ore more sorted sets.

+

One or more sorted sets.

- array + array|null $options

An array which can contain ['WITHSCORES' => true] if you want Redis to return members and scores.

@@ -18678,15 +24641,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

An array of members or false on failure.

+

See also

@@ -18694,7 +24659,7 @@

See also

@@ -18705,10 +24670,10 @@

Examples

- https://redis.io/commands/zdiff + https://redis.io/docs/latest/commands/zdiff/
-
$redis->zAdd('primes', 1, 'one', 3, 'three', 5, 'five');
-$redis->zAdd('evens', 2, 'two', 4, 'four');
-$redis->zAdd('mod3', 3, 'three', 6, 'six');
-
+
$redis->zAdd('primes', 1, 'one', 3, 'three', 5, 'five');
+$redis->zAdd('evens', 2, 'two', 4, 'four');
+$redis->zAdd('mod3', 3, 'three', 6, 'six');
+
 $redis->zDiff(['primes', 'evens', 'mod3']);
@@ -18718,11 +24683,10 @@

Examples

-

- - Redis|int|false - zdiffstore(string $dst, array $keys) - + +

+ + Redis|int|false zdiffstore(string $dst, array $keys)

@@ -18738,7 +24702,7 @@

Parameters

string $dst - +

The destination set name.

array @@ -18748,9 +24712,10 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of elements stored in the destination set or false on @@ -18758,6 +24723,7 @@

Return Value

+

See also

@@ -18765,7 +24731,7 @@

See also

@@ -18779,16 +24745,23 @@

See also

- https://redis.io/commands/zdiff + https://redis.io/docs/latest/commands/zdiff/
+

Examples

+ + + + + +
$redis->zdiffstore('only:new', ['all:users', 'inactive:users']);
+
-

- - Redis|array|false - zinter(array $keys, array|null $weights = null, array|null $options = null) - + +

+ + Redis|array|false zinter(array $keys, array|null $weights = null, array|null $options = null)

@@ -18804,7 +24777,7 @@

Parameters

array $keys -

One ore more sorted sets.

+

One or more sorted sets.

array|null @@ -18821,15 +24794,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

All of the members that exist in every set.

+

See also

@@ -18837,7 +24812,7 @@

See also

@@ -18848,11 +24823,11 @@

Examples

- https://redis.io/commands/zinter + https://redis.io/docs/latest/commands/zinter/
-
$redis->zAdd('TNG', 2, 'Worf', 2.5, 'Data', 4.0, 'Picard');
-$redis->zAdd('DS9', 2.5, 'Worf', 3.0, 'Kira', 4.0, 'Sisko');
-
-$redis->zInter(['TNG', 'DS9']);
-$redis->zInter(['TNG', 'DS9'], NULL, ['withscores' => true]);
+
$redis->zAdd('TNG', 2, 'Worf', 2.5, 'Data', 4.0, 'Picard');
+$redis->zAdd('DS9', 2.5, 'Worf', 3.0, 'Kira', 4.0, 'Sisko');
+
+$redis->zInter(['TNG', 'DS9']);
+$redis->zInter(['TNG', 'DS9'], NULL, ['withscores' => true]);
 $redis->zInter(['TNG', 'DS9'], NULL, ['withscores' => true, 'aggregate' => 'max']);
@@ -18862,11 +24837,10 @@

Examples

-

- - Redis|int|false - zintercard(array $keys, int $limit = -1) - + +

+ + Redis|int|false zintercard(array $keys, int $limit = -1)

@@ -18883,7 +24857,7 @@

Parameters

array $keys -

One ore more sorted set key names.

+

One or more sorted set key names.

int @@ -18895,15 +24869,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The cardinality of the intersection or false on failure.

+

See also

@@ -18911,13 +24887,13 @@

See also

@@ -18935,9 +24911,9 @@

Examples

- https://redis.io/commands/zintercard + https://redis.io/docs/latest/commands/zintercard/
- https://redis.io/commands/zinter + https://redis.io/docs/latest/commands/zinter/
-
$redis->zAdd('zs1', 1, 'one', 2, 'two', 3, 'three', 4, 'four');
-$redis->zAdd('zs2', 2, 'two', 4, 'four');
-
+
$redis->zAdd('zs1', 1, 'one', 2, 'two', 3, 'three', 4, 'four');
+$redis->zAdd('zs2', 2, 'two', 4, 'four');
+
 $redis->zInterCard(['zs1', 'zs2']);
@@ -18947,18 +24923,17 @@

Examples

-

- - Redis|int|false - zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null) - + +

+ + Redis|int|false zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)

-

Compute the intersection of one ore more sorted sets storing the result in a new sorted set.

+

Compute the intersection of one or more sorted sets storing the result in a new sorted set.

Parameters

@@ -18972,7 +24947,7 @@

Parameters

array $keys -

One ore more sorted set key names.

+

One or more sorted set key names.

array|null @@ -18982,23 +24957,25 @@

Parameters

string|null $aggregate -

An optional aggregation method to use.

-

'SUM' - Store sum of all intersected members (this is the default). +

An optional aggregation method to use. +'SUM' - Store sum of all intersected members (this is the default). 'MIN' - Store minimum value for each intersected member. 'MAX' - Store maximum value for each intersected member.

-

Return Value

+

Return Value

- +
+
Redis|int|false

The total number of members writtern to the destination set or false on failure.

+

See also

@@ -19006,13 +24983,13 @@

See also

@@ -19023,11 +25000,11 @@

Examples

- https://redis.io/commands/zinterstore + https://redis.io/docs/latest/commands/zinterstore/
- https://redis.io/commands/zinter + https://redis.io/docs/latest/commands/zinter/
-
$redis->zAdd('zs1', 3, 'apples', 2, 'pears');
-$redis->zAdd('zs2', 4, 'pears', 3, 'bananas');
-$redis->zAdd('zs3', 2, 'figs', 3, 'pears');
-
-$redis->zInterStore('fruit-sum', ['zs1', 'zs2', 'zs3']);
+
$redis->zAdd('zs1', 3, 'apples', 2, 'pears');
+$redis->zAdd('zs2', 4, 'pears', 3, 'bananas');
+$redis->zAdd('zs3', 2, 'figs', 3, 'pears');
+
+$redis->zInterStore('fruit-sum', ['zs1', 'zs2', 'zs3']);
 $redis->zInterStore('fruit-max', ['zs1', 'zs2', 'zs3'], NULL, 'MAX');
@@ -19037,11 +25014,10 @@

Examples

-

- - Redis|array|false - zscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + Redis|array|false zscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

@@ -19060,7 +25036,7 @@

Parameters

The sorted set to scan.

- int|null + null|int|string $iterator

A reference to an iterator that should be initialized to NULL initially, that will be updated after each subsequent call to ZSCAN. Once the iterator @@ -19082,15 +25058,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

An array of elements or false on failure.

+

See also

@@ -19098,13 +25076,13 @@

See also

@@ -19118,16 +25096,28 @@

See also

- https://redis.io/commands/zscan + https://redis.io/docs/latest/commands/zscan/
- https://redis.io/commands/scan + https://redis.io/docs/latest/commands/scan/
+

Examples

+ + + + + +
$it = null;
+while ($members = $redis->zscan('leaders', $it)) {
+    foreach ($members as $member => $score) {
+        printf('%s => %s' . PHP_EOL, $member, $score);
+    }
+}
+
-

- - Redis|array|false - zunion(array $keys, array|null $weights = null, array|null $options = null) - + +

+ + Redis|array|false zunion(array $keys, array|null $weights = null, array|null $options = null)

@@ -19143,7 +25133,7 @@

Parameters

array $keys -

One ore more sorted set key names

+

One or more sorted set key names

array|null @@ -19156,7 +25146,7 @@

Parameters

array|null $options

An array that modifies how this command functions.

-
$options = [
+
$options = [
     # By default when members exist in more than one set Redis will SUM
     # total score for each match.  Instead, it can return the AVG, MIN,
     # or MAX value based on this option.
@@ -19169,29 +25159,42 @@ 

Parameters

-

Return Value

+

Return Value

- +
+
Redis|array|false

The union of each sorted set or false on failure

+
+

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/zunion/ +
+

Examples

-
$redis->del('store1', 'store2', 'store3');
-$redis->zAdd('store1', 1, 'apples', 3, 'pears', 6, 'bananas');
-$redis->zAdd('store2', 3, 'apples', 5, 'coconuts', 2, 'bananas');
-$redis->zAdd('store3', 2, 'bananas', 6, 'apples', 4, 'figs');
-
-$redis->zUnion(['store1', 'store2', 'store3'], NULL, ['withscores' => true]);
-$redis->zUnion(['store1', 'store3'], [2, .5], ['withscores' => true]);
+
$redis->del('store1', 'store2', 'store3');
+$redis->zAdd('store1', 1, 'apples', 3, 'pears', 6, 'bananas');
+$redis->zAdd('store2', 3, 'apples', 5, 'coconuts', 2, 'bananas');
+$redis->zAdd('store3', 2, 'bananas', 6, 'apples', 4, 'figs');
+
+$redis->zUnion(['store1', 'store2', 'store3'], NULL, ['withscores' => true]);
+$redis->zUnion(['store1', 'store3'], [2, .5], ['withscores' => true]);
 $redis->zUnion(['store1', 'store3'], [2, .5], ['withscores' => true, 'aggregate' => 'MIN']);
@@ -19201,11 +25204,10 @@

Examples

-

- - Redis|int|false - zunionstore(string $dst, array $keys, array|null $weights = NULL, string|null $aggregate = NULL) - + +

+ + Redis|int|false zunionstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)

@@ -19242,15 +25244,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
Redis|int|false

The number of members stored in the destination set or false on failure.

+

See also

@@ -19258,7 +25262,7 @@

See also

@@ -19276,10 +25280,10 @@

Examples

- https://redis.io/commands/zunionstore + https://redis.io/docs/latest/commands/zunionstore/
-
$redis->zAdd('zs1', 1, 'one', 3, 'three');
-$redis->zAdd('zs1', 2, 'two', 4, 'four');
-$redis->zadd('zs3', 1, 'one', 7, 'five');
-
+
$redis->zAdd('zs1', 1, 'one', 3, 'three');
+$redis->zAdd('zs1', 2, 'two', 4, 'four');
+$redis->zadd('zs3', 1, 'one', 7, 'five');
+
 $redis->zUnionStore('dst', ['zs1', 'zs2', 'zs3']);
@@ -19287,6 +25291,68 @@

Examples

+
+
+ +

+ + Redis|string|false digest(string $key) +

+
+ + + +
+

Ask the server for the XXH3 digest of a given key's value

+
+
+

Parameters

+ + + + + + + +
string$key

The key to retrieve the digest for.

+ + +

Return Value

+ +
+ + + + + +
Redis|string|false

The XXH3 digest as a string or false on failure.

+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/docs/latest/commands/digest/ +
+ + +

Examples

+ + + + + +
$redis->digest('session:42');
+ +
+
+
diff --git a/docs/RedisArray.html b/docs/RedisArray.html index 2a8ffb4de1..c8d5b9b629 100644 --- a/docs/RedisArray.html +++ b/docs/RedisArray.html @@ -5,7 +5,7 @@ RedisArray | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> @@ -83,7 +472,7 @@

RedisArray

class - RedisArray (View source) + RedisArray (View source)

@@ -113,7 +502,7 @@

Methods

- __construct(string|array $name_or_hosts, array $options = NULL) + __construct(string|array $name_or_hosts, array|null $options = null)

No description

@@ -179,7 +568,7 @@

Methods

bool|null
- _rehash(callable $fn = NULL) + _rehash(callable|null $fn = null)

No description

@@ -231,7 +620,7 @@

Methods

- bool|null + bool|null|array
exec() @@ -278,7 +667,7 @@

Methods

bool|array
- hscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + hscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

No description

@@ -333,7 +722,7 @@

Methods

bool|RedisArray
- multi(string $host, int $mode = NULL) + multi(string $host, int|null $mode = null)

No description

@@ -366,7 +755,7 @@

Methods

bool|array
- scan(int|null $iterator, string $node, string|null $pattern = null, int $count = 0) + scan(null|int|string $iterator, string $node, string|null $pattern = null, int $count = 0)

No description

@@ -399,7 +788,7 @@

Methods

bool|array
- sscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + sscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

No description

@@ -432,24 +821,15252 @@

Methods

bool|array
- zscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + zscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

No description

+
+
+ mixed +
+
+ acl(string $subcmd, string $args) + +

No description

+
+
+
+
+ RedisArray|int|false +
+
+ append(string $key, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ auth(SensitiveParameter] $ixed $credentials) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ bgrewriteaof() + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ waitaof(int $numlocal, int $numreplicas, int $timeout) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ bitcount(string $key, int $start, int $end = -1, bool $bybit = false) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ bitop(string $operation, string $deskey, string $srckey, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ bitpos(string $key, bool $bit, int $start, int $end = -1, bool $bybit = false) + +

No description

+
+
+
+
+
+ RedisArray|array|null|false +
+
+ blPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed $extra_args) + +

No description

+
+
+
+
+
+ RedisArray|array|null|false +
+
+ brPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed $extra_args) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ brpoplpush(string $src, string $dst, int|float $timeout) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ bzPopMax(string|array $key, string|int $timeout_or_key, mixed $extra_args) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ bzPopMin(string|array $key, string|int $timeout_or_key, mixed $extra_args) + +

No description

+
+
+
+
+
+ RedisArray|array|null|false +
+
+ bzmpop(float $timeout, array $keys, string $from, int $count = 1) + +

No description

+
+
+
+
+
+ RedisArray|array|null|false +
+
+ zmpop(array $keys, string $from, int $count = 1) + +

No description

+
+
+
+
+
+ RedisArray|array|null|false +
+
+ blmpop(float $timeout, array $keys, string $from, int $count = 1) + +

No description

+
+
+
+
+
+ RedisArray|array|null|false +
+
+ lmpop(array $keys, string $from, int $count = 1) + +

No description

+
+
+
+
+
+ bool +
+
+ clearLastError() + +

No description

+
+
+
+
+
+ mixed +
+
+ client(string $opt, mixed $args) + +

No description

+
+
+
+
+
+ bool +
+
+ close() + +

No description

+
+
+
+
+
+ mixed +
+
+ command(?string $opt = null, mixed $args) + +

No description

+
+
+
+
+
+ mixed +
+
+ config(string $operation, array|string|null $key_or_settings = null, ?string $value = null) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ copy(string $src, string $dst, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ dbSize() + +

No description

+
+
+
+
+
+ RedisArray|string +
+
+ debug(string $key) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ decr(string $key, int $by = 1) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ decrBy(string $key, int $value) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ delex(string $key, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ delifeq(string $key, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ delete(array|string $key, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ dump(string $key) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ echo(string $str) + +

No description

+
+
+
+
+
+ mixed +
+
+ eval(string $script, array $args = [], int $num_keys) + +

No description

+
+
+
+
+
+ mixed +
+
+ eval_ro(string $script_sha, array $args = [], int $num_keys) + +

No description

+
+
+
+
+
+ mixed +
+
+ evalsha(string $sha1, array $args = [], int $num_keys) + +

No description

+
+
+
+
+
+ mixed +
+
+ evalsha_ro(string $sha1, array $args = [], int $num_keys) + +

No description

+
+
+
+
+
+ RedisArray|int|bool +
+
+ exists(mixed $key, mixed $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ expire(string $key, int $timeout, ?string $mode = null) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ expireAt(string $key, int $timestamp, ?string $mode = null) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ failover(?array $to = null, bool $abort = false, int $timeout) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ expiretime(string $key) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ pexpiretime(string $key) + +

No description

+
+
+
+
+
+ mixed +
+
+ fcall(string $fn, array $keys = [], array $args = []) + +

No description

+
+
+
+
+
+ mixed +
+
+ fcall_ro(string $fn, array $keys = [], array $args = []) + +

No description

+
+
+
+
+
+ RedisArray|bool|string|array +
+
+ function(string $operation, mixed $args) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ geoadd(string $key, float $lng, float $lat, string $member, mixed $other_triples_and_options) + +

No description

+
+
+
+
+
+ RedisArray|float|false +
+
+ geodist(string $key, string $src, string $dst, ?string $unit = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ geohash(string $key, string $member, string $other_members) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ geopos(string $key, string $member, string $other_members) + +

No description

+
+
+
+
+
+ mixed +
+
+ georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) + +

No description

+
+
+
+
+
+ mixed +
+
+ georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) + +

No description

+
+
+
+
+
+ mixed +
+
+ georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []) + +

No description

+
+
+
+
+
+ mixed +
+
+ georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []) + +

No description

+
+
+
+
+
+ array +
+
+ geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []) + +

No description

+
+
+
+
+
+ RedisArray|array|int|false +
+
+ geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []) + +

No description

+
+
+
+
+
+ mixed +
+
+ get(string $key) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ getWithMeta(string $key) + +

No description

+
+
+
+
+
+ mixed +
+
+ getAuth() + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ getBit(string $key, int $idx) + +

No description

+
+
+
+
+
+ RedisArray|string|bool +
+
+ getEx(string $key, array $options = []) + +

No description

+
+
+
+
+
+ int +
+
+ getDBNum() + +

No description

+
+
+
+
+
+ RedisArray|string|bool +
+
+ getDel(string $key) + +

No description

+
+
+
+
+
+ string +
+
+ getHost() + +

No description

+
+
+
+
+
+ string|null +
+
+ getLastError() + +

No description

+
+
+
+
+
+ int +
+
+ getMode() + +

No description

+
+
+
+
+
+ string|null +
+
+ getPersistentID() + +

No description

+
+
+
+
+
+ int +
+
+ getPort() + +

No description

+
+
+
+
+
+ string|false +
+
+ serverName() + +

No description

+
+
+
+
+
+ string|false +
+
+ serverVersion() + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ getRange(string $key, int $start, int $end) + +

No description

+
+
+
+
+
+ RedisArray|string|array|int|false +
+
+ lcs(string $key1, string $key2, ?array $options = null) + +

No description

+
+
+
+
+
+ float +
+
+ getReadTimeout() + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ getset(string $key, mixed $value) + +

No description

+
+
+
+
+
+ float|false +
+
+ getTimeout() + +

No description

+
+
+
+
+
+ array +
+
+ getTransferredBytes() + +

No description

+
+
+
+
+
+ void +
+
+ clearTransferredBytes() + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ hDel(string $key, string $field, string $other_fields) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ hExists(string $key, string $field) + +

No description

+
+
+
+
+
+ mixed +
+
+ hGet(string $key, string $member) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hGetAll(string $key) + +

No description

+
+
+
+
+
+ mixed +
+
+ hGetWithMeta(string $key, string $member) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ hIncrBy(string $key, string $field, int $value) + +

No description

+
+
+
+
+
+ RedisArray|float|false +
+
+ hIncrByFloat(string $key, string $field, float $value) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hKeys(string $key) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ hLen(string $key) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hMget(string $key, array $fields) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hgetex(string $key, array $fields, string|array|null $expiry = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ hsetex(string $key, array $fields, ?array $expiry = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hgetdel(string $key, array $fields) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ hMset(string $key, array $fieldvals) + +

No description

+
+
+
+
+
+ RedisArray|string|array|false +
+
+ hRandField(string $key, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ hSet(string $key, mixed $fields_and_vals) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ hSetNx(string $key, string $field, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ hStrLen(string $key, string $field) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hVals(string $key) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ httl(string $key, array $fields) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hpttl(string $key, array $fields) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hexpiretime(string $key, array $fields) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hpexpiretime(string $key, array $fields) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ hpersist(string $key, array $fields) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ expiremember(string $key, string $field, int $ttl, ?string $unit = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ expirememberat(string $key, string $field, int $timestamp) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ incr(string $key, int $by = 1) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ incrBy(string $key, int $value) + +

No description

+
+
+
+
+
+ RedisArray|float|false +
+
+ incrByFloat(string $key, float $value) + +

No description

+
+
+
+
+
+ bool +
+
+ isConnected() + +

No description

+
+
+
+
+
+ void +
+
+ lInsert(string $key, string $pos, mixed $pivot, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ lLen(string $key) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ lMove(string $src, string $dst, string $wherefrom, string $whereto) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout) + +

No description

+
+
+
+
+
+ RedisArray|bool|string|array +
+
+ lPop(string $key, int $count) + +

No description

+
+
+
+
+
+ RedisArray|null|bool|int|array +
+
+ lPos(string $key, mixed $value, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ lPush(string $key, mixed $elements) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ rPush(string $key, mixed $elements) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ lPushx(string $key, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ rPushx(string $key, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ lSet(string $key, int $index, mixed $value) + +

No description

+
+
+
+
+
+ int +
+
+ lastSave() + +

No description

+
+
+
+
+
+ mixed +
+
+ lindex(string $key, int $index) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ lrange(string $key, int $start, int $end) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ lrem(string $key, mixed $value, int $count) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ ltrim(string $key, int $start, int $end) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ move(string $key, int $index) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ msetex(array $key_vals, int|float|array|null $expiry = null) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ msetnx(array $key_values) + +

No description

+
+
+
+
+
+ RedisArray|int|string|false +
+
+ object(string $subcommand, string $key) + +

No description

+
+
+
+
+
+ bool +
+
+ open(string $host, int $port = 6379, float $timeout, ?string $persistent_id = null, int $retry_interval, float $read_timeout, ?array $context = null) + +

No description

+
+
+
+
+
+ bool +
+
+ pconnect(string $host, int $port = 6379, float $timeout, ?string $persistent_id = null, int $retry_interval, float $read_timeout, ?array $context = null) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ persist(string $key) + +

No description

+
+
+
+
+
+ bool +
+
+ pexpire(string $key, int $timeout, ?string $mode = null) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ pexpireAt(string $key, int $timestamp, ?string $mode = null) + +

No description

+
+
+
+
+
+ RedisArray|int +
+
+ pfadd(string $key, array $elements) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ pfcount(array|string $key_or_keys) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ pfmerge(string $dst, array $srckeys) + +

No description

+
+
+
+
+
+ RedisArray +
+
+ pipeline() + +

No description

+
+
+
+
+
+ bool +
+
+ popen(string $host, int $port = 6379, float $timeout, ?string $persistent_id = null, int $retry_interval, float $read_timeout, ?array $context = null) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ psetex(string $key, int $expire, mixed $value) + +

No description

+
+
+
+
+
+ bool +
+
+ psubscribe(array $patterns, callable $cb) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ pttl(string $key) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ publish(string $channel, string $message) + +

No description

+
+
+
+
+
+ mixed +
+
+ pubsub(string $command, mixed $arg = null) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ punsubscribe(array $patterns) + +

No description

+
+
+
+
+
+ RedisArray|array|string|bool +
+
+ rPop(string $key, int $count) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ randomKey() + +

No description

+
+
+
+
+
+ mixed +
+
+ rawcommand(string $command, mixed $args) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ rename(string $old_name, string $new_name) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ renameNx(string $key_src, string $key_dst) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ reset() + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ restore(string $key, int $ttl, string $value, ?array $options = null) + +

No description

+
+
+
+
+
+ mixed +
+
+ role() + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ rpoplpush(string $srckey, string $dstkey) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ sAdd(string $key, mixed $value, mixed $other_values) + +

No description

+
+
+
+
+
+ int +
+
+ sAddArray(string $key, array $values) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ sDiff(string $key, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ sDiffStore(string $dst, string $key, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ sInter(array|string $key, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ sintercard(array $keys, int $limit = -1) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ sInterStore(array|string $key, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ sMembers(string $key) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ sMisMember(string $key, string $member, string $other_members) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ sMove(string $src, string $dst, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|string|array|false +
+
+ sPop(string $key, int $count) + +

No description

+
+
+
+
+
+ mixed +
+
+ sRandMember(string $key, int $count) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ sUnion(string $key, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ sUnionStore(string $dst, string $key, string $other_keys) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ scard(string $key) + +

No description

+
+
+
+
+
+ mixed +
+
+ script(string $command, mixed $args) + +

No description

+
+
+
+
+
+ RedisArray|string|bool +
+
+ set(string $key, mixed $value, mixed $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ setBit(string $key, int $idx, bool $value) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ setRange(string $key, int $index, string $value) + +

No description

+
+
+
+
+
+ void +
+
+ setex(string $key, int $expire, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ setnx(string $key, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ sismember(string $key, mixed $value) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ slaveof(?string $host = null, int $port = 6379) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ replicaof(?string $host = null, int $port = 6379) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ touch(array|string $key_or_array, string $more_keys) + +

No description

+
+
+
+
+
+ mixed +
+
+ slowlog(string $operation, int $length) + +

No description

+
+
+
+
+
+ mixed +
+
+ sort(string $key, ?array $options = null) + +

No description

+
+
+
+
+
+ mixed +
+
+ sort_ro(string $key, ?array $options = null) + +

No description

+
+
+
+
+
+ array +
+
+ sortAsc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + +

No description

+
+
+
+
+
+ array +
+
+ sortAscAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + +

No description

+
+
+
+
+
+ array +
+
+ sortDesc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + +

No description

+
+
+
+
+
+ array +
+
+ sortDescAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ srem(string $key, mixed $value, mixed $other_values) + +

No description

+
+
+
+
+
+ bool +
+
+ ssubscribe(array $channels, callable $cb) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ strlen(string $key) + +

No description

+
+
+
+
+
+ bool +
+
+ subscribe(array $channels, callable $cb) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ sunsubscribe(array $channels) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ swapdb(int $src, int $dst) + +

No description

+
+
+
+
+
+ RedisArray|array +
+
+ time() + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ ttl(string $key) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ type(string $key) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ unsubscribe(array $channels) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ watch(array|string $key, string $other_keys) + +

No description

+
+
+
+
+
+ int|false +
+
+ wait(int $numreplicas, int $timeout) + +

No description

+
+
+
+
+
+ int|false +
+
+ xack(string $key, string $group, array $ids) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ xadd(string $key, string $id, array $values, int $maxlen, bool $approx = false, bool $nomkstream = false) + +

No description

+
+
+
+
+
+ RedisArray|bool|array +
+
+ xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ xdel(string $key, array $ids) + +

No description

+
+
+
+
+
+ Relay|array|false +
+
+ xdelex(string $key, array $ids, ?string $mode = null) + +

No description

+
+
+
+
+
+ mixed +
+
+ xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ xlen(string $key) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ xpending(string $key, string $group, ?string $start = null, ?string $end = null, int $count = -1, ?string $consumer = null) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ xrange(string $key, string $start, string $end, int $count = -1) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ xread(array $streams, int $count = -1, int $block = -1) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1) + +

No description

+
+
+
+
+
+ RedisArray|array|bool +
+
+ xrevrange(string $key, string $end, string $start, int $count = -1) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ vadd(string $key, array $values, mixed $element, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ vsim(string $key, mixed $member, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ vcard(string $key) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ vdim(string $key) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ vinfo(string $key) + +

No description

+
+
+
+
+
+ RedisArray|bool +
+
+ vismember(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ vemb(string $key, mixed $member, bool $raw = false) + +

No description

+
+
+
+
+
+ RedisArray|array|string|false +
+
+ vrandmember(string $key, int $count) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ vrange(string $key, string $min, string $max, int $count = -1) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ vrem(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ vsetattr(string $key, mixed $member, array|string $attributes) + +

No description

+
+
+
+
+
+ RedisArray|array|string|false +
+
+ vgetattr(string $key, mixed $member, bool $decode = true) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ vlinks(string $key, mixed $member, bool $withscores = false) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1) + +

No description

+
+
+
+
+
+ RedisArray|int|float|false +
+
+ zAdd(string $key, array|float $score_or_options, mixed $more_scores_and_mems) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zCard(string $key) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zCount(string $key, int|string $start, int|string $end) + +

No description

+
+
+
+
+
+ RedisArray|float|false +
+
+ zIncrBy(string $key, float $value, mixed $member) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zLexCount(string $key, string $min, string $max) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zMscore(string $key, mixed $member, mixed $other_members) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zPopMax(string $key, ?int $count = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zPopMin(string $key, ?int $count = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zRange(string $key, string|int $start, string|int $end, array|bool|null $options = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zRangeByScore(string $key, string $start, string $end, array $options = []) + +

No description

+
+
+
+
+
+ RedisArray|string|array +
+
+ zRandMember(string $key, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zRank(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zRem(mixed $key, mixed $member, mixed $other_members) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zRemRangeByLex(string $key, string $min, string $max) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zRemRangeByRank(string $key, int $start, int $end) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zRemRangeByScore(string $key, string $start, string $end) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zRevRange(string $key, int $start, int $end, mixed $scores = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zRevRangeByScore(string $key, string $max, string $min, array|bool $options = []) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zRevRank(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisArray|float|false +
+
+ zScore(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zdiff(array $keys, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zdiffstore(string $dst, array $keys) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zinter(array $keys, ?array $weights = null, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zintercard(array $keys, int $limit = -1) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zinterstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null) + +

No description

+
+
+
+
+
+ RedisArray|array|false +
+
+ zunion(array $keys, ?array $weights = null, ?array $options = null) + +

No description

+
+
+
+
+
+ RedisArray|int|false +
+
+ zunionstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null) + +

No description

+
+
+
+
+
+ RedisArray|string|false +
+
+ digest(string $key) + +

No description

+
+
+
+
+ + +

Details

+ +
+
+ +

+ + mixed __call(string $function_name, array $arguments) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$function_name
array$arguments
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + __construct(string|array $name_or_hosts, array|null $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string|array$name_or_hosts
array|null$options
+ + + + + +
+
+ +
+
+ +

+ + bool|array _continuum() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|callable _distributor() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|callable
+ +
+ + + +
+
+ +
+
+ +

+ + bool|callable _function() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|callable
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array _hosts() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|null|Redis _instance(string $host) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$host
+ + +

Return Value

+ +
+ + + + + +
bool|null|Redis
+ +
+ + + +
+
+ +
+
+ +

+ + bool|null _rehash(callable|null $fn = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
callable|null$fn
+ + +

Return Value

+ +
+ + + + + +
bool|null
+ +
+ + + +
+
+ +
+
+ +

+ + bool|string|null _target(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
bool|string|null
+ +
+ + + +
+
+ +
+
+ +

+ + array bgsave() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|int del(string|array $key, string ...$otherkeys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string|array$key
string...$otherkeys
+ + +

Return Value

+ +
+ + + + + +
bool|int
+ +
+ + + +
+
+ +
+
+ +

+ + bool|null discard() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|null
+ +
+ + + +
+
+ +
+
+ +

+ + bool|null|array exec() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|null|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array flushall() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array flushdb() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array getOption(int $opt) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
int$opt
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array hscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
null|int|string$iterator
string|null$pattern
int$count
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array info() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array keys(string $pattern) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$pattern
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array mget(array $keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
array$keys
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool mset(array $pairs) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
array$pairs
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + bool|RedisArray multi(string $host, int|null $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$host
int|null$mode
+ + +

Return Value

+ +
+ + + + + +
bool|RedisArray
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array ping() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array save() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array scan(null|int|string $iterator, string $node, string|null $pattern = null, int $count = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
null|int|string$iterator
string$node
string|null$pattern
int$count
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array select(int $index) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
int$index
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array setOption(int $opt, string $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
int$opt
string$value
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array sscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
null|int|string$iterator
string|null$pattern
int$count
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ + +
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string|array$key
string...$otherkeys
+ + +

Return Value

+ +
+ + + + + +
bool|int
+ +
+ + + +
+
+ +
+
+ +

+ + bool|null unwatch() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool|null
+ +
+ + + +
+
+ +
+
+ +

+ + bool|array zscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
null|int|string$iterator
string|null$pattern
int$count
+ + +

Return Value

+ +
+ + + + + +
bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + mixed acl(string $subcmd, string $args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$subcmd
string$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false append(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool auth(SensitiveParameter] $ixed $credentials) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
SensitiveParameter]$ixed $credentials
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool bgrewriteaof() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false waitaof(int $numlocal, int $numreplicas, int $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
int$numlocal
int$numreplicas
int$timeout
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false bitcount(string $key, int $start, int $end = -1, bool $bybit = false) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
int$start
int$end
bool$bybit
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false bitop(string $operation, string $deskey, string $srckey, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$operation
string$deskey
string$srckey
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false bitpos(string $key, bool $bit, int $start, int $end = -1, bool $bybit = false) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
bool$bit
int$start
int$end
bool$bybit
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|null|false blPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed $extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key_or_keys
string|float|int$timeout_or_key
mixed$extra_args
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|null|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|null|false brPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed $extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key_or_keys
string|float|int$timeout_or_key
mixed$extra_args
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|null|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false brpoplpush(string $src, string $dst, int|float $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$src
string$dst
int|float$timeout
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false bzPopMax(string|array $key, string|int $timeout_or_key, mixed $extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key
string|int$timeout_or_key
mixed$extra_args
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false bzPopMin(string|array $key, string|int $timeout_or_key, mixed $extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key
string|int$timeout_or_key
mixed$extra_args
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|null|false bzmpop(float $timeout, array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
float$timeout
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|null|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|null|false zmpop(array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|null|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|null|false blmpop(float $timeout, array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
float$timeout
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|null|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|null|false lmpop(array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|null|false
+ +
+ + + +
+
+ +
+
+ +

+ + bool clearLastError() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + mixed client(string $opt, mixed $args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$opt
mixed$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + bool close() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + mixed command(?string $opt = null, mixed $args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
?string$opt
mixed$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed config(string $operation, array|string|null $key_or_settings = null, ?string $value = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$operation
array|string|null$key_or_settings
?string$value
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool copy(string $src, string $dst, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$src
string$dst
?array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false dbSize() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string debug(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false decr(string $key, int $by = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$by
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false decrBy(string $key, int $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false delex(string $key, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
?array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false delifeq(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false delete(array|string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array|string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false dump(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false echo(string $str) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$str
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed eval(string $script, array $args = [], int $num_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$script
array$args
int$num_keys
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed eval_ro(string $script_sha, array $args = [], int $num_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$script_sha
array$args
int$num_keys
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed evalsha(string $sha1, array $args = [], int $num_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$sha1
array$args
int$num_keys
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed evalsha_ro(string $sha1, array $args = [], int $num_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$sha1
array$args
int$num_keys
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|bool exists(mixed $key, mixed $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
mixed$key
mixed$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool expire(string $key, int $timeout, ?string $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$timeout
?string$mode
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool expireAt(string $key, int $timestamp, ?string $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$timestamp
?string$mode
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool failover(?array $to = null, bool $abort = false, int $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
?array$to
bool$abort
int$timeout
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false expiretime(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false pexpiretime(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed fcall(string $fn, array $keys = [], array $args = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$fn
array$keys
array$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed fcall_ro(string $fn, array $keys = [], array $args = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$fn
array$keys
array$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool|string|array function(string $operation, mixed $args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$operation
mixed$args
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool|string|array
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false geoadd(string $key, float $lng, float $lat, string $member, mixed $other_triples_and_options) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
float$lng
float$lat
string$member
mixed$other_triples_and_options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|float|false geodist(string $key, string $src, string $dst, ?string $unit = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
string$src
string$dst
?string$unit
+ + +

Return Value

+ +
+ + + + + +
RedisArray|float|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false geohash(string $key, string $member, string $other_members) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$member
string$other_members
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false geopos(string $key, string $member, string $other_members) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$member
string$other_members
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
float$lng
float$lat
float$radius
string$unit
array$options
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
float$lng
float$lat
float$radius
string$unit
array$options
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
string$member
float$radius
string$unit
array$options
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
string$member
float$radius
string$unit
array$options
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + array geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
array|string$position
array|int|float$shape
string$unit
array$options
+ + +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|int|false geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$dst
string$src
array|string$position
array|int|float$shape
string$unit
array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed get(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false getWithMeta(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed getAuth() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false getBit(string $key, int $idx) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$idx
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|bool getEx(string $key, array $options = []) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|bool
+ +
+ + + +
+
+ +
+
+ +

+ + int getDBNum() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
int
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|bool getDel(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|bool
+ +
+ + + +
+
+ +
+
+ +

+ + string getHost() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
string
+ +
+ + + +
+
+ +
+
+ +

+ + string|null getLastError() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
string|null
+ +
+ + + +
+
+ +
+
+ +

+ + int getMode() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
int
+ +
+ + + +
+
+ +
+
+ +

+ + string|null getPersistentID() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
string|null
+ +
+ + + +
+
+ +
+
+ +

+ + int getPort() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
int
+ +
+ + + +
+
+ +
+
+ +

+ + string|false serverName() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
string|false
+ +
+ + + +
+
+ +
+
+ +

+ + string|false serverVersion() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false getRange(string $key, int $start, int $end) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$start
int$end
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|array|int|false lcs(string $key1, string $key2, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key1
string$key2
?array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|array|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + float getReadTimeout() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
float
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false getset(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + float|false getTimeout() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
float|false
+ +
+ + + +
+
+ +
+
+ +

+ + array getTransferredBytes() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + void clearTransferredBytes() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
void
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false hDel(string $key, string $field, string $other_fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$field
string$other_fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool hExists(string $key, string $field) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
string$field
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + mixed hGet(string $key, string $member) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
string$member
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hGetAll(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed hGetWithMeta(string $key, string $member) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
string$member
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false hIncrBy(string $key, string $field, int $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$field
int$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|float|false hIncrByFloat(string $key, string $field, float $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$field
float$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|float|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hKeys(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false hLen(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hMget(string $key, array $fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hgetex(string $key, array $fields, string|array|null $expiry = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
array$fields
string|array|null$expiry
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false hsetex(string $key, array $fields, ?array $expiry = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
array$fields
?array$expiry
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hgetdel(string $key, array $fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool hMset(string $key, array $fieldvals) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fieldvals
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|array|false hRandField(string $key, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
?array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false hSet(string $key, mixed $fields_and_vals) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$fields_and_vals
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool hSetNx(string $key, string $field, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$field
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false hStrLen(string $key, string $field) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
string$field
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hVals(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false httl(string $key, array $fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hpttl(string $key, array $fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hexpiretime(string $key, array $fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hpexpiretime(string $key, array $fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false hpersist(string $key, array $fields) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$fields
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false expiremember(string $key, string $field, int $ttl, ?string $unit = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
string$field
int$ttl
?string$unit
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false expirememberat(string $key, string $field, int $timestamp) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$field
int$timestamp
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false incr(string $key, int $by = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$by
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false incrBy(string $key, int $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|float|false incrByFloat(string $key, float $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
float$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|float|false
+ +
+ + + +
+
+ +
+
+ +

+ + bool isConnected() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + void lInsert(string $key, string $pos, mixed $pivot, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
string$pos
mixed$pivot
mixed$value
+ + +

Return Value

+ +
+ + + + + +
void
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false lLen(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false lMove(string $src, string $dst, string $wherefrom, string $whereto) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$src
string$dst
string$wherefrom
string$whereto
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$src
string$dst
string$wherefrom
string$whereto
float$timeout
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool|string|array lPop(string $key, int $count) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool|string|array
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|null|bool|int|array lPos(string $key, mixed $value, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$value
?array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|null|bool|int|array
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false lPush(string $key, mixed $elements) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$elements
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false rPush(string $key, mixed $elements) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$elements
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false lPushx(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false rPushx(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool lSet(string $key, int $index, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$index
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + int lastSave() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
int
+ +
+ + + +
+
+ +
+
+ +

+ + mixed lindex(string $key, int $index) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$index
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false lrange(string $key, int $start, int $end) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$start
int$end
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false lrem(string $key, mixed $value, int $count) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$value
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool ltrim(string $key, int $start, int $end) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$start
int$end
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool move(string $key, int $index) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$index
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false msetex(array $key_vals, int|float|array|null $expiry = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array$key_vals
int|float|array|null$expiry
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool msetnx(array $key_values) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
array$key_values
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|string|false object(string $subcommand, string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$subcommand
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + bool open(string $host, int $port = 6379, float $timeout, ?string $persistent_id = null, int $retry_interval, float $read_timeout, ?array $context = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$host
int$port
float$timeout
?string$persistent_id
int$retry_interval
float$read_timeout
?array$context
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + bool pconnect(string $host, int $port = 6379, float $timeout, ?string $persistent_id = null, int $retry_interval, float $read_timeout, ?array $context = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$host
int$port
float$timeout
?string$persistent_id
int$retry_interval
float$read_timeout
?array$context
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool persist(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + bool pexpire(string $key, int $timeout, ?string $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$timeout
?string$mode
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool pexpireAt(string $key, int $timestamp, ?string $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$timestamp
?string$mode
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int pfadd(string $key, array $elements) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$elements
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false pfcount(array|string $key_or_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
array|string$key_or_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool pfmerge(string $dst, array $srckeys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$dst
array$srckeys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray pipeline() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
RedisArray
+ +
+ + + +
+
+ +
+
+ +

+ + bool popen(string $host, int $port = 6379, float $timeout, ?string $persistent_id = null, int $retry_interval, float $read_timeout, ?array $context = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$host
int$port
float$timeout
?string$persistent_id
int$retry_interval
float$read_timeout
?array$context
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool psetex(string $key, int $expire, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$expire
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + bool psubscribe(array $patterns, callable $cb) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array$patterns
callable$cb
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false pttl(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false publish(string $channel, string $message) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$channel
string$message
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed pubsub(string $command, mixed $arg = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$command
mixed$arg
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool punsubscribe(array $patterns) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
array$patterns
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|string|bool rPop(string $key, int $count) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|string|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false randomKey() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed rawcommand(string $command, mixed $args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$command
mixed$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool rename(string $old_name, string $new_name) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$old_name
string$new_name
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool renameNx(string $key_src, string $key_dst) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key_src
string$key_dst
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool reset() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool restore(string $key, int $ttl, string $value, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
int$ttl
string$value
?array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + mixed role() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false rpoplpush(string $srckey, string $dstkey) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$srckey
string$dstkey
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false sAdd(string $key, mixed $value, mixed $other_values) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$value
mixed$other_values
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + int sAddArray(string $key, array $values) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$values
+ + +

Return Value

+ +
+ + + + + +
int
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false sDiff(string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false sDiffStore(string $dst, string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$dst
string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false sInter(array|string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array|string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false sintercard(array $keys, int $limit = -1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array$keys
int$limit
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false sInterStore(array|string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array|string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false sMembers(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false sMisMember(string $key, string $member, string $other_members) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$member
string$other_members
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool sMove(string $src, string $dst, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$src
string$dst
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|array|false sPop(string $key, int $count) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed sRandMember(string $key, int $count) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$count
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false sUnion(string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false sUnionStore(string $dst, string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$dst
string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false scard(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed script(string $command, mixed $args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$command
mixed$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|bool set(string $key, mixed $value, mixed $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$value
mixed$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false setBit(string $key, int $idx, bool $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$idx
bool$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false setRange(string $key, int $index, string $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$index
string$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + void setex(string $key, int $expire, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
int$expire
mixed$value
+ + +

Return Value

+ +
+ + + + + +
void
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool setnx(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool sismember(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool slaveof(?string $host = null, int $port = 6379) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
?string$host
int$port
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool replicaof(?string $host = null, int $port = 6379) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
?string$host
int$port
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false touch(array|string $key_or_array, string $more_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array|string$key_or_array
string$more_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed slowlog(string $operation, int $length) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$operation
int$length
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed sort(string $key, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
?array$options
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + mixed sort_ro(string $key, ?array $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
?array$options
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + array sortAsc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
?string$pattern
mixed$get
int$offset
int$count
?string$store
+ + +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + array sortAscAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
?string$pattern
mixed$get
int$offset
int$count
?string$store
+ + +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + array sortDesc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
?string$pattern
mixed$get
int$offset
int$count
?string$store
+ + +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + array sortDescAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
?string$pattern
mixed$get
int$offset
int$count
?string$store
+ + +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false srem(string $key, mixed $value, mixed $other_values) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$value
mixed$other_values
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + bool ssubscribe(array $channels, callable $cb) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array$channels
callable$cb
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false strlen(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + bool subscribe(array $channels, callable $cb) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array$channels
callable$cb
+ + +

Return Value

+ +
+ + + + + +
bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool sunsubscribe(array $channels) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
array$channels
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool swapdb(int $src, int $dst) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
int$src
int$dst
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array time() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
RedisArray|array
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false ttl(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false type(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool unsubscribe(array $channels) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
array$channels
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool watch(array|string $key, string $other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array|string$key
string$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + int|false wait(int $numreplicas, int $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
int$numreplicas
int$timeout
+ + +

Return Value

+ +
+ + + + + +
int|false
+ +
+ + + +
+
+ +
+
+ +

+ + int|false xack(string $key, string $group, array $ids) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
string$group
array$ids
+ + +

Return Value

+ +
+ + + + + +
int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|string|false xadd(string $key, string $id, array $values, int $maxlen, bool $approx = false, bool $nomkstream = false) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
string$id
array$values
int$maxlen
bool$approx
bool$nomkstream
+ + +

Return Value

+ +
+ + + + + +
RedisArray|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool|array xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
string$group
string$consumer
int$min_idle
string$start
int$count
bool$justid
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool|array
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
string$group
string$consumer
int$min_idle
array$ids
array$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false xdel(string $key, array $ids) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
array$ids
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + Relay|array|false xdelex(string $key, array $ids, ?string $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
array$ids
?string$mode
+ + +

Return Value

+ +
+ + + + + +
Relay|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + mixed xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$operation
?string$arg1
?string$arg2
int$count
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false xlen(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false xpending(string $key, string $group, ?string $start = null, ?string $end = null, int $count = -1, ?string $consumer = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
string$group
?string$start
?string$end
int$count
?string$consumer
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool xrange(string $key, string $start, string $end, int $count = -1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
string$start
string$end
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool xread(array $streams, int $count = -1, int $block = -1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
array$streams
int$count
int$block
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$group
string$consumer
array$streams
int$count
int$block
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|bool xrevrange(string $key, string $end, string $start, int $count = -1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
string$end
string$start
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false vadd(string $key, array $values, mixed $element, array|null $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
array$values
mixed$element
array|null$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false vsim(string $key, mixed $member, array|null $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$member
array|null$options
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false vcard(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false vdim(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false vinfo(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|bool vismember(string $key, mixed $member) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$member
+ + +

Return Value

+ +
+ + + + + +
RedisArray|bool
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false vemb(string $key, mixed $member, bool $raw = false) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$member
bool$raw
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|string|false vrandmember(string $key, int $count) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|string|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|false vrange(string $key, string $min, string $max, int $count = -1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
string$min
string$max
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false vrem(string $key, mixed $member) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$member
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|int|false vsetattr(string $key, mixed $member, array|string $attributes) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$member
array|string$attributes
+ + +

Return Value

+ +
+ + + + + +
RedisArray|int|false
+ +
+ + + +
+
+ +
+
+ +

+ + RedisArray|array|string|false vgetattr(string $key, mixed $member, bool $decode = true) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$member
bool$decode
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|string|false
+ +
+ + + +
+
+ +
+
+ + +
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$key
mixed$member
bool$withscores
+ + +

Return Value

+ +
+ + + + + +
RedisArray|array|false
+ +
+ + + +
+
- -

Details

- -
+
-

- - mixed - __call(string $function_name, array $arguments) - + +

+ + RedisArray|int|false xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1)

@@ -465,26 +16082,43 @@

Parameters

- + - - + + + + + + + + + + + + + + + + +
string$function_name$key
array$argumentsstring$threshold
bool$approx
bool$minid
int$limit
-

Return Value

+

Return Value

- +
+
- +
mixedRedisArray|int|false
+
@@ -493,11 +16127,10 @@

Return Value

-

- - - __construct(string|array $name_or_hosts, array $options = NULL) - + +

+ + RedisArray|int|float|false zAdd(string $key, array|float $score_or_options, mixed $more_scores_and_mems)

@@ -512,18 +16145,34 @@

Parameters

- - + + - - + + + + + + +
string|array$name_or_hostsstring$key
array$optionsarray|float$score_or_options
mixed$more_scores_and_mems
+

Return Value

+ +
+ + + + + +
RedisArray|int|float|false
+ +
@@ -532,11 +16181,10 @@

Parameters

-

- - bool|array - _continuum() - + +

+ + RedisArray|int|false zCard(string $key)

@@ -547,16 +16195,28 @@

- -

Return Value

+

Parameters

+ + + + + +
string$key
+ + +

Return Value

+ +
+ - +
bool|arrayRedisArray|int|false
+
@@ -565,11 +16225,10 @@

Return Value

-

- - bool|callable - _distributor() - + +

+ + RedisArray|int|false zCount(string $key, int|string $start, int|string $end)

@@ -580,16 +16239,38 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + +
string$key
int|string$start
int|string$end
+ + +

Return Value

+ +
+ - +
bool|callableRedisArray|int|false
+
@@ -598,11 +16279,10 @@

Return Value

-

- - bool|callable - _function() - + +

+ + RedisArray|float|false zIncrBy(string $key, float $value, mixed $member)

@@ -613,16 +16293,38 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + +
string$key
float$value
mixed$member
+ + +

Return Value

+ +
+ - +
bool|callableRedisArray|float|false
+
@@ -631,11 +16333,10 @@

Return Value

-

- - bool|array - _hosts() - + +

+ + RedisArray|int|false zLexCount(string $key, string $min, string $max)

@@ -646,16 +16347,38 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + +
string$key
string$min
string$max
+ + +

Return Value

+ +
+ - +
bool|arrayRedisArray|int|false
+
@@ -664,11 +16387,10 @@

Return Value

-

- - bool|null|Redis - _instance(string $host) - + +

+ + RedisArray|array|false zMscore(string $key, mixed $member, mixed $other_members)

@@ -684,21 +16406,33 @@

Parameters

- + + + + + + + + + + +
string$host$key
mixed$member
mixed$other_members
-

Return Value

+

Return Value

- +
+
- +
bool|null|RedisRedisArray|array|false
+
@@ -707,11 +16441,10 @@

Return Value

-

- - bool|null - _rehash(callable $fn = NULL) - + +

+ + RedisArray|array|false zPopMax(string $key, ?int $count = null)

@@ -726,22 +16459,29 @@

Parameters

- - + + + + + + +
callable$fnstring$key
?int$count
-

Return Value

+

Return Value

- +
+
- +
bool|nullRedisArray|array|false
+
@@ -750,11 +16490,10 @@

Return Value

-

- - bool|string|null - _target(string $key) - + +

+ + RedisArray|array|false zPopMin(string $key, ?int $count = null)

@@ -772,19 +16511,26 @@

Parameters

string $key + + + ?int + $count + -

Return Value

+

Return Value

- +
+
- +
bool|string|nullRedisArray|array|false
+
@@ -793,11 +16539,10 @@

Return Value

-

- - array - bgsave() - + +

+ + RedisArray|array|false zRange(string $key, string|int $start, string|int $end, array|bool|null $options = null)

@@ -808,16 +16553,43 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
string$key
string|int$start
string|int$end
array|bool|null$options
+ + +

Return Value

+ +
+ - +
arrayRedisArray|array|false
+
@@ -826,11 +16598,10 @@

Return Value

-

- - bool|int - del(string|array $key, string ...$otherkeys) - + +

+ + RedisArray|array|false zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1)

@@ -845,27 +16616,44 @@

Parameters

- + - + + + + + + + + + + + + + + + +
string|arraystring $key
string...$otherkeys$min
string$max
int$offset
int$count
-

Return Value

+

Return Value

- +
+
- +
bool|intRedisArray|array|false
+
@@ -874,11 +16662,10 @@

Return Value

-

- - bool|null - discard() - + +

+ + RedisArray|array|false zRangeByScore(string $key, string $start, string $end, array $options = [])

@@ -889,16 +16676,43 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
string$key
string$start
string$end
array$options
+ + +

Return Value

+ +
+ - +
bool|nullRedisArray|array|false
+
@@ -907,11 +16721,10 @@

Return Value

-

- - bool|null - exec() - + +

+ + RedisArray|string|array zRandMember(string $key, ?array $options = null)

@@ -922,16 +16735,33 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + +
string$key
?array$options
+ + +

Return Value

+ +
+ - +
bool|nullRedisArray|string|array
+
@@ -940,11 +16770,10 @@

Return Value

-

- - bool|array - flushall() - + +

+ + RedisArray|int|false zRank(string $key, mixed $member)

@@ -955,16 +16784,33 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + +
string$key
mixed$member
+ + +

Return Value

+ +
+ - +
bool|arrayRedisArray|int|false
+
@@ -973,11 +16819,10 @@

Return Value

-

- - bool|array - flushdb() - + +

+ + RedisArray|int|false zRem(mixed $key, mixed $member, mixed $other_members)

@@ -988,16 +16833,38 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + +
mixed$key
mixed$member
mixed$other_members
+ + +

Return Value

+ +
+ - +
bool|arrayRedisArray|int|false
+
@@ -1006,11 +16873,10 @@

Return Value

-

- - bool|array - getOption(int $opt) - + +

+ + RedisArray|int|false zRemRangeByLex(string $key, string $min, string $max)

@@ -1025,22 +16891,34 @@

Parameters

- - + + + + + + + + + + + +
int$optstring$key
string$min
string$max
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|int|false
+
@@ -1049,11 +16927,10 @@

Return Value

-

- - bool|array - hscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + RedisArray|int|false zRemRangeByRank(string $key, int $start, int $end)

@@ -1073,32 +16950,29 @@

Parameters

- int|null - $iterator - - - - string|null - $pattern + int + $start int - $count + $end -

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|int|false
+
@@ -1107,11 +16981,10 @@

Return Value

-

- - bool|array - info() - + +

+ + RedisArray|int|false zRemRangeByScore(string $key, string $start, string $end)

@@ -1122,16 +16995,38 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + +
string$key
string$start
string$end
+ + +

Return Value

+ +
+ - +
bool|arrayRedisArray|int|false
+
@@ -1140,11 +17035,10 @@

Return Value

-

- - bool|array - keys(string $pattern) - + +

+ + RedisArray|array|false zRevRange(string $key, int $start, int $end, mixed $scores = null)

@@ -1160,21 +17054,38 @@

Parameters

- + + + + + + + + + + + + + + + +
string$pattern$key
int$start
int$end
mixed$scores
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|array|false
+
@@ -1183,11 +17094,10 @@

Return Value

-

- - bool|array - mget(array $keys) - + +

+ + RedisArray|array|false zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1)

@@ -1202,22 +17112,44 @@

Parameters

- - + + + + + + + + + + + + + + + + + + + + + +
array$keysstring$key
string$max
string$min
int$offset
int$count
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|array|false
+
@@ -1226,11 +17158,10 @@

Return Value

-

- - bool - mset(array $pairs) - + +

+ + RedisArray|array|false zRevRangeByScore(string $key, string $max, string $min, array|bool $options = [])

@@ -1245,22 +17176,39 @@

Parameters

- - + + + + + + + + + + + + + + + + +
array$pairsstring$key
string$max
string$min
array|bool$options
-

Return Value

+

Return Value

- +
+
- +
boolRedisArray|array|false
+
@@ -1269,11 +17217,10 @@

Return Value

-

- - bool|RedisArray - multi(string $host, int $mode = NULL) - + +

+ + RedisArray|int|false zRevRank(string $key, mixed $member)

@@ -1289,26 +17236,28 @@

Parameters

- + - - + +
string$host$key
int$modemixed$member
-

Return Value

+

Return Value

- +
+
- +
bool|RedisArrayRedisArray|int|false
+
@@ -1317,11 +17266,10 @@

Return Value

-

- - bool|array - ping() - + +

+ + RedisArray|float|false zScore(string $key, mixed $member)

@@ -1332,16 +17280,33 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + +
string$key
mixed$member
+ + +

Return Value

+ +
+ - +
bool|arrayRedisArray|float|false
+
@@ -1350,11 +17315,10 @@

Return Value

-

- - bool|array - save() - + +

+ + RedisArray|array|false zdiff(array $keys, ?array $options = null)

@@ -1365,16 +17329,33 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + +
array$keys
?array$options
+ + +

Return Value

+ +
+ - +
bool|arrayRedisArray|array|false
+
@@ -1383,11 +17364,10 @@

Return Value

-

- - bool|array - scan(int|null $iterator, string $node, string|null $pattern = null, int $count = 0) - + +

+ + RedisArray|int|false zdiffstore(string $dst, array $keys)

@@ -1402,37 +17382,29 @@

Parameters

- - - - - - - - - - - + - - + +
int|null$iterator
string$node
string|null$pattern$dst
int$countarray$keys
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|int|false
+
@@ -1441,11 +17413,10 @@

Return Value

-

- - bool|array - select(int $index) - + +

+ + RedisArray|array|false zinter(array $keys, ?array $weights = null, ?array $options = null)

@@ -1460,22 +17431,34 @@

Parameters

- - + + + + + + + + + + + +
int$indexarray$keys
?array$weights
?array$options
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|array|false
+
@@ -1484,11 +17467,10 @@

Return Value

-

- - bool|array - setOption(int $opt, string $value) - + +

+ + RedisArray|int|false zintercard(array $keys, int $limit = -1)

@@ -1503,27 +17485,29 @@

Parameters

- - + + - - + +
int$optarray$keys
string$valueint$limit
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|int|false
+
@@ -1532,11 +17516,10 @@

Return Value

-

- - bool|array - sscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + RedisArray|int|false zinterstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null)

@@ -1552,36 +17535,38 @@

Parameters

- + - - + + - - + + - - + +
string$key$dst
int|null$iteratorarray$keys
string|null$pattern?array$weights
int$count?string$aggregate
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|int|false
+
@@ -1590,11 +17575,10 @@

Return Value

-

+ + RedisArray|array|false zunion(array $keys, ?array $weights = null, ?array $options = null)

@@ -1609,27 +17593,34 @@

Parameters

- - + + - - + + + + + + +
string|array$keyarray$keys
string...$otherkeys?array$weights
?array$options
-

Return Value

+

Return Value

- +
+
- +
bool|intRedisArray|array|false
+
@@ -1638,11 +17629,10 @@

Return Value

-

- - bool|null - unwatch() - + +

+ + RedisArray|int|false zunionstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null)

@@ -1653,16 +17643,43 @@

- -

Return Value

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
string$dst
array$keys
?array$weights
?string$aggregate
+ + +

Return Value

+ +
+ - +
bool|nullRedisArray|int|false
+
@@ -1671,11 +17688,10 @@

Return Value

-

- - bool|array - zscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + RedisArray|string|false digest(string $key)

@@ -1693,34 +17709,21 @@

Parameters

string $key - - - int|null - $iterator - - - - string|null - $pattern - - - - int - $count - -

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisArray|string|false
+
diff --git a/docs/RedisCluster.html b/docs/RedisCluster.html index 4e9fb9fa9e..3187136751 100644 --- a/docs/RedisCluster.html +++ b/docs/RedisCluster.html @@ -5,7 +5,7 @@ RedisCluster | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> @@ -83,7 +472,7 @@

RedisCluster

class - RedisCluster (View source) + RedisCluster (View source)

@@ -92,6 +481,56 @@

RedisCluster +

Constants

+ + + + + + + + + + + + + + + + + + + + +
+ OPT_SLAVE_FAILOVER + +

Used to configure how PhpRedis will failover to replica nodes when a +primary node fails to respond.

+

+
+ FAILOVER_NONE + +

Never read from replicas.

+

+
+ FAILOVER_ERROR + +

Attempt to read from replicas when the primary errors out or is down.

+

+
+ FAILOVER_DISTRIBUTE + +

Distribute readonly commands at random between the primary and +replica(s).

+

+
+ FAILOVER_DISTRIBUTE_SLAVES + +

Distribute readonly commands between the replicas only.

+

+
+

Methods

@@ -102,7 +541,7 @@

Methods

- __construct(string|null $name, array $seeds = NULL, int|float $timeout = 0, int|float $read_timeout = 0, bool $persistent = false, mixed $auth = NULL, array $context = NULL) + __construct(string|null $name, array|null $seeds = null, int|float $timeout = 0, int|float $read_timeout = 0, bool $persistent = false, mixed $auth = null, array|null $context = null)

No description

@@ -115,8 +554,7 @@

Methods

_compress(string $value) -

No description

-
+

{\Redis::_compress()}

@@ -164,6 +602,17 @@

Methods

+
+ string +
+
+ _digest(mixed $value) + +

No description

+
+
+
+
mixed
@@ -241,6 +690,28 @@

Methods

+
+ RedisCluster|int|false +
+
+ wait(string|array $key_or_address, int $numreplicas, int $timeout) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ waitaof(string|array $key_or_address, int $numlocal, int $numreplicas, int $timeout) + +

No description

+
+
+
+
RedisCluster|bool
@@ -290,7 +761,8 @@

Methods

blpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args) -

See Redis::blpop()

+

No description

+
@@ -300,7 +772,8 @@

Methods

brpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args) -

See Redis::brpop()

+

No description

+
@@ -310,7 +783,28 @@

Methods

brpoplpush(string $srckey, string $deskey, int $timeout) -

See Redis::brpoplpush()

+

No description

+
+
+
+
+
+ RedisCluster|string|false +
+
+ lmove(string $src, string $dst, string $wherefrom, string $whereto) + +

Move an element from one list into another.

+
+
+
+
+ RedisCluster|string|false +
+
+ blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout) + +

Move an element from one list to another, blocking up to a timeout until an element is available.

@@ -395,7 +889,7 @@

Methods

array|string|bool
- client(string|array $key_or_address, string $subcommand, string|null $arg = NULL) + client(string|array $key_or_address, string $subcommand, string|null $arg = null)

No description

@@ -457,6 +951,17 @@

Methods

+
+ RedisCluster|bool +
+
+ copy(string $src, string $dst, array|null $options = null) + +

No description

+
+
+
+
RedisCluster|int|false
@@ -499,6 +1004,27 @@

Methods

No description

+
+
+
+ RedisCluster|int|false +
+
+ delex(string $key, array|null $options = null) + +

Delete a key conditionally based on its value or hash digest

+
+
+
+
+ RedisCluster|int|false +
+
+ delifeq(string $key, mixed $value) + +

Delete a key if it's equal to the specified value. This command is +specific to Valkey >= 9.0

+
@@ -615,7 +1141,7 @@

Methods

RedisCluster|bool
- expire(string $key, int $timeout, string|null $mode = NULL) + expire(string $key, int $timeout, string|null $mode = null)

No description

@@ -626,7 +1152,7 @@

Methods

RedisCluster|bool
- expireat(string $key, int $timestamp, string|null $mode = NULL) + expireat(string $key, int $timestamp, string|null $mode = null)

No description

@@ -766,10 +1292,10 @@

Methods

- mixed + RedisCluster|array
- get(string $key) + geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = [])

No description

@@ -777,10 +1303,10 @@

Methods

- RedisCluster|int|false + RedisCluster|array|int|false
- getbit(string $key, int $value) + geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = [])

No description

@@ -788,10 +1314,10 @@

Methods

- string|null + mixed
- getlasterror() + get(string $key)

No description

@@ -799,10 +1325,10 @@

Methods

- int + mixed
- getmode() + getdel(string $key)

No description

@@ -810,10 +1336,10 @@

Methods

- mixed + RedisCluster|array|false
- getoption(int $option) + getWithMeta(string $key)

No description

@@ -824,7 +1350,7 @@

Methods

RedisCluster|string|false
- getrange(string $key, int $start, int $end) + getex(string $key, array $options = [])

No description

@@ -832,10 +1358,10 @@

Methods

- RedisCluster|string|array|int|false + RedisCluster|int|false
- lcs(string $key1, string $key2, array|null $options = NULL) + getbit(string $key, int $value)

No description

@@ -843,10 +1369,10 @@

Methods

- RedisCluster|string|bool + string|null
- getset(string $key, mixed $value) + getlasterror()

No description

@@ -854,10 +1380,10 @@

Methods

- int|false + int
- gettransferredbytes() + getmode()

No description

@@ -865,10 +1391,10 @@

Methods

- RedisCluster|int|false + mixed
- hdel(string $key, string $member, string ...$other_members) + getoption(int $option)

No description

@@ -876,10 +1402,10 @@

Methods

- RedisCluster|bool + RedisCluster|string|false
- hexists(string $key, string $member) + getrange(string $key, int $start, int $end)

No description

@@ -887,10 +1413,10 @@

Methods

- mixed + RedisCluster|string|array|int|false
- hget(string $key, string $member) + lcs(string $key1, string $key2, array|null $options = null)

No description

@@ -898,10 +1424,10 @@

Methods

- RedisCluster|array|false + RedisCluster|string|bool
- hgetall(string $key) + getset(string $key, mixed $value)

No description

@@ -909,10 +1435,10 @@

Methods

- RedisCluster|int|false + array|false
- hincrby(string $key, string $member, int $value) + gettransferredbytes()

No description

@@ -920,10 +1446,10 @@

Methods

- RedisCluster|float|false + void
- hincrbyfloat(string $key, string $member, float $value) + cleartransferredbytes()

No description

@@ -931,10 +1457,10 @@

Methods

- RedisCluster|array|false + RedisCluster|int|false
- hkeys(string $key) + hdel(string $key, string $member, string ...$other_members)

No description

@@ -942,10 +1468,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool
- hlen(string $key) + hexists(string $key, string $member)

No description

@@ -953,10 +1479,10 @@

Methods

- RedisCluster|array|false + mixed
- hmget(string $key, array $keys) + hget(string $key, string $member)

No description

@@ -964,10 +1490,10 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- hmset(string $key, array $key_values) + hgetall(string $key)

No description

@@ -975,10 +1501,10 @@

Methods

- array|bool + mixed
- hscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + hgetWithMeta(string $key, string $member)

No description

@@ -989,7 +1515,7 @@

Methods

RedisCluster|int|false
- hset(string $key, string $member, mixed $value) + hincrby(string $key, string $member, int $value)

No description

@@ -997,10 +1523,10 @@

Methods

- RedisCluster|bool + RedisCluster|float|false
- hsetnx(string $key, string $member, mixed $value) + hincrbyfloat(string $key, string $member, float $value)

No description

@@ -1008,10 +1534,10 @@

Methods

- RedisCluster|int|false + RedisCluster|array|false
- hstrlen(string $key, string $field) + hkeys(string $key)

No description

@@ -1019,10 +1545,10 @@

Methods

- RedisCluster|array|false + RedisCluster|int|false
- hvals(string $key) + hlen(string $key)

No description

@@ -1030,10 +1556,10 @@

Methods

- RedisCluster|int|false + RedisCluster|array|false
- incr(string $key, int $by = 1) + hmget(string $key, array $keys)

No description

@@ -1041,10 +1567,10 @@

Methods

- RedisCluster|int|false + RedisCluster|array|false
- incrby(string $key, int $value) + hgetex(string $key, array $fields, string|array|null $expiry = null)

No description

@@ -1052,10 +1578,10 @@

Methods

- RedisCluster|float|false + RedisCluster|int|false
- incrbyfloat(string $key, float $value) + hsetex(string $key, array $fields, array|null $expiry = null)

No description

@@ -1066,20 +1592,18 @@

Methods

RedisCluster|array|false
- info(string|array $key_or_address, string ...$sections) + hgetdel(string $key, array $fields) -

Retrieve information about the connected redis-server. If no arguments are passed to -this function, redis will return every info field. Alternatively you may pass a specific -section you want returned (e.g. 'server', or 'memory') to receive only information pertaining -to that section.

+

No description

+
- RedisCluster|array|false + RedisCluster|bool
- keys(string $pattern) + hmset(string $key, array $key_values)

No description

@@ -1087,10 +1611,10 @@

Methods

- RedisCluster|int|false + array|bool
- lastsave(string|array $key_or_address) + hscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

No description

@@ -1098,10 +1622,10 @@

Methods

- RedisCluster|string|bool + RedisCluster|int|false
- lget(string $key, int $index) + expiremember(string $key, string $field, int $ttl, string|null $unit = null)

No description

@@ -1109,10 +1633,10 @@

Methods

- mixed + RedisCluster|int|false
- lindex(string $key, int $index) + expirememberat(string $key, string $field, int $timestamp)

No description

@@ -1120,10 +1644,10 @@

Methods

- RedisCluster|int|false + RedisCluster|string|array
- linsert(string $key, string $pos, mixed $pivot, mixed $value) + hrandfield(string $key, array|null $options = null)

No description

@@ -1131,10 +1655,10 @@

Methods

- RedisCluster|int|bool + RedisCluster|int|false
- llen(string $key) + hset(string $key, string $member, mixed $value)

No description

@@ -1142,10 +1666,10 @@

Methods

- RedisCluster|bool|string|array + RedisCluster|bool
- lpop(string $key, int $count = 0) + hsetnx(string $key, string $member, mixed $value)

No description

@@ -1153,10 +1677,10 @@

Methods

- RedisCluster|int|bool + RedisCluster|int|false
- lpush(string $key, mixed $value, mixed ...$other_values) + hstrlen(string $key, string $field)

No description

@@ -1164,10 +1688,10 @@

Methods

- RedisCluster|int|bool + RedisCluster|array|false
- lpushx(string $key, mixed $value) + hexpire(string $key, int $ttl, array $fields, string|null $mode = NULL)

No description

@@ -1178,7 +1702,7 @@

Methods

RedisCluster|array|false
- lrange(string $key, int $start, int $end) + hpexpire(string $key, int $ttl, array $fields, string|null $mode = NULL)

No description

@@ -1186,10 +1710,10 @@

Methods

- RedisCluster|int|bool + RedisCluster|array|false
- lrem(string $key, mixed $value, int $count = 0) + hexpireat(string $key, int $time, array $fields, string|null $mode = NULL)

No description

@@ -1197,10 +1721,10 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- lset(string $key, int $index, mixed $value) + hpexpireat(string $key, int $mstime, array $fields, string|null $mode = NULL)

No description

@@ -1208,10 +1732,10 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- ltrim(string $key, int $start, int $end) + httl(string $key, array $fields)

No description

@@ -1222,7 +1746,7 @@

Methods

RedisCluster|array|false
- mget(array $keys) + hpttl(string $key, array $fields)

No description

@@ -1230,10 +1754,10 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- mset(array $key_values) + hexpiretime(string $key, array $fields)

No description

@@ -1244,7 +1768,7 @@

Methods

RedisCluster|array|false
- msetnx(array $key_values) + hpexpiretime(string $key, array $fields)

No description

@@ -1252,10 +1776,10 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- multi(int $value = Redis::MULTI) + hpersist(string $key, array $fields)

No description

@@ -1263,10 +1787,10 @@

Methods

- RedisCluster|int|string|false + RedisCluster|array|false
- object(string $subcommand, string $key) + hvals(string $key)

No description

@@ -1274,10 +1798,10 @@

Methods

- RedisCluster|bool + RedisCluster|int|false
- persist(string $key) + incr(string $key, int $by = 1)

No description

@@ -1285,10 +1809,10 @@

Methods

- RedisCluster|bool + RedisCluster|int|false
- pexpire(string $key, int $timeout, string|null $mode = NULL) + incrby(string $key, int $value)

No description

@@ -1296,10 +1820,10 @@

Methods

- RedisCluster|bool + RedisCluster|float|false
- pexpireat(string $key, int $timestamp, string|null $mode = NULL) + incrbyfloat(string $key, float $value)

No description

@@ -1307,10 +1831,23 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- pfadd(string $key, array $elements) + info(string|array $key_or_address, string ...$sections) + +

Retrieve information about the connected redis-server. If no arguments are passed to +this function, redis will return every info field. Alternatively you may pass a specific +section you want returned (e.g. 'server', or 'memory') to receive only information pertaining +to that section.

+
+
+
+
+ RedisCluster|array|false +
+
+ keys(string $pattern)

No description

@@ -1321,7 +1858,7 @@

Methods

RedisCluster|int|false
- pfcount(string $key) + lastsave(string|array $key_or_address)

No description

@@ -1329,10 +1866,10 @@

Methods

- RedisCluster|bool + RedisCluster|string|bool
- pfmerge(string $key, array $keys) + lget(string $key, int $index)

No description

@@ -1343,17 +1880,18 @@

Methods

mixed
- ping(string|array $key_or_address, string|null $message = NULL) + lindex(string $key, int $index) -

PING an instance in the redis cluster.

+

No description

+
- RedisCluster|bool + RedisCluster|int|false
- psetex(string $key, int $timeout, string $value) + linsert(string $key, string $pos, mixed $pivot, mixed $value)

No description

@@ -1361,10 +1899,10 @@

Methods

- void + RedisCluster|int|bool
- psubscribe(array $patterns, callable $callback) + llen(string $key)

No description

@@ -1372,10 +1910,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool|string|array
- pttl(string $key) + lpop(string $key, int $count = 0)

No description

@@ -1383,10 +1921,10 @@

Methods

- RedisCluster|bool + RedisCluster|null|bool|int|array
- publish(string $channel, string $message) + lpos(string $key, mixed $value, array|null $options = null)

No description

@@ -1394,10 +1932,10 @@

Methods

- mixed + RedisCluster|int|bool
- pubsub(string|array $key_or_address, string ...$values) + lpush(string $key, mixed $value, mixed ...$other_values)

No description

@@ -1405,10 +1943,10 @@

Methods

- bool|array + RedisCluster|int|bool
- punsubscribe(string $pattern, string ...$other_patterns) + lpushx(string $key, mixed $value)

No description

@@ -1416,10 +1954,10 @@

Methods

- RedisCluster|bool|string + RedisCluster|array|false
- randomkey(string|array $key_or_address) + lrange(string $key, int $start, int $end)

No description

@@ -1427,10 +1965,10 @@

Methods

- mixed + RedisCluster|int|bool
- rawcommand(string|array $key_or_address, string $command, mixed ...$args) + lrem(string $key, mixed $value, int $count = 0)

No description

@@ -1441,7 +1979,7 @@

Methods

RedisCluster|bool
- rename(string $key_src, string $key_dst) + lset(string $key, int $index, mixed $value)

No description

@@ -1452,7 +1990,7 @@

Methods

RedisCluster|bool
- renamenx(string $key, string $newkey) + ltrim(string $key, int $start, int $end)

No description

@@ -1460,10 +1998,10 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- restore(string $key, int $timeout, string $value, array|null $options = NULL) + mget(array $keys)

No description

@@ -1471,10 +2009,10 @@

Methods

- mixed + RedisCluster|bool
- role(string|array $key_or_address) + mset(array $key_values)

No description

@@ -1482,10 +2020,10 @@

Methods

- RedisCluster|bool|string|array + RedisCluster|array|false
- rpop(string $key, int $count = 0) + msetnx(array $key_values)

No description

@@ -1493,10 +2031,10 @@

Methods

- RedisCluster|bool|string + Redis|int|false
- rpoplpush(string $src, string $dst) + msetex(array $key_vals, int|float|array|null $expiry = null)

No description

@@ -1504,10 +2042,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool
- rpush(string $key, mixed ...$elements) + multi(int $value = Redis::MULTI)

No description

@@ -1515,10 +2053,10 @@

Methods

- RedisCluster|bool|int + RedisCluster|int|string|false
- rpushx(string $key, string $value) + object(string $subcommand, string $key)

No description

@@ -1526,10 +2064,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool
- sadd(string $key, mixed $value, mixed ...$other_values) + persist(string $key)

No description

@@ -1537,10 +2075,10 @@

Methods

- RedisCluster|bool|int + RedisCluster|bool
- saddarray(string $key, array $values) + pexpire(string $key, int $timeout, string|null $mode = null)

No description

@@ -1551,7 +2089,7 @@

Methods

RedisCluster|bool
- save(string|array $key_or_address) + pexpireat(string $key, int $timestamp, string|null $mode = null)

No description

@@ -1559,10 +2097,10 @@

Methods

- bool|array + RedisCluster|bool
- scan(int|null $iterator, string|array $key_or_address, string|null $pattern = null, int $count = 0) + pfadd(string $key, array $elements)

No description

@@ -1573,7 +2111,7 @@

Methods

RedisCluster|int|false
- scard(string $key) + pfcount(string $key)

No description

@@ -1581,10 +2119,10 @@

Methods

- mixed + RedisCluster|bool
- script(string|array $key_or_address, mixed ...$args) + pfmerge(string $key, array $keys)

No description

@@ -1592,21 +2130,20 @@

Methods

- RedisCluster|array|false + mixed
- sdiff(string $key, string ...$other_keys) + ping(string|array $key_or_address, string|null $message = null) -

No description

-
+

PING an instance in the redis cluster.

- RedisCluster|int|false + RedisCluster|bool
- sdiffstore(string $dst, string $key, string ...$other_keys) + psetex(string $key, int $timeout, string $value)

No description

@@ -1614,10 +2151,10 @@

Methods

- RedisCluster|string|bool + void
- set(string $key, mixed $value, mixed $options = NULL) + psubscribe(array $patterns, callable $callback)

No description

@@ -1628,7 +2165,7 @@

Methods

RedisCluster|int|false
- setbit(string $key, int $offset, bool $onoff) + pttl(string $key)

No description

@@ -1636,10 +2173,10 @@

Methods

- RedisCluster|bool + RedisCluster|bool|int
- setex(string $key, int $expire, mixed $value) + publish(string $channel, string $message)

No description

@@ -1647,10 +2184,10 @@

Methods

- RedisCluster|bool + mixed
- setnx(string $key, mixed $value) + pubsub(string|array $key_or_address, string ...$values)

No description

@@ -1658,10 +2195,10 @@

Methods

- bool + bool|array
- setoption(int $option, mixed $value) + punsubscribe(string $pattern, string ...$other_patterns)

No description

@@ -1669,10 +2206,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool|string
- setrange(string $key, int $offset, string $value) + randomkey(string|array $key_or_address)

No description

@@ -1680,10 +2217,10 @@

Methods

- RedisCluster|array|false + mixed
- sinter(array|string $key, string ...$other_keys) + rawcommand(string|array $key_or_address, string $command, mixed ...$args)

No description

@@ -1691,10 +2228,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool
- sintercard(array $keys, int $limit = -1) + rename(string $key_src, string $key_dst)

No description

@@ -1702,10 +2239,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool
- sinterstore(array|string $key, string ...$other_keys) + renamenx(string $key, string $newkey)

No description

@@ -1716,7 +2253,7 @@

Methods

RedisCluster|bool
- sismember(string $key, mixed $value) + restore(string $key, int $timeout, string $value, array|null $options = null)

No description

@@ -1727,7 +2264,7 @@

Methods

mixed
- slowlog(string|array $key_or_address, mixed ...$args) + role(string|array $key_or_address)

No description

@@ -1735,10 +2272,10 @@

Methods

- RedisCluster|array|false + RedisCluster|bool|string|array
- smembers(string $key) + rpop(string $key, int $count = 0)

No description

@@ -1746,10 +2283,10 @@

Methods

- RedisCluster|bool + RedisCluster|bool|string
- smove(string $src, string $dst, string $member) + rpoplpush(string $src, string $dst)

No description

@@ -1757,10 +2294,10 @@

Methods

- RedisCluster|array|bool|int|string + RedisCluster|int|false
- sort(string $key, array|null $options = NULL) + rpush(string $key, mixed ...$elements)

No description

@@ -1768,10 +2305,10 @@

Methods

- RedisCluster|array|bool|int|string + RedisCluster|bool|int
- sort_ro(string $key, array|null $options = NULL) + rpushx(string $key, string $value)

No description

@@ -1779,10 +2316,10 @@

Methods

- RedisCluster|string|array|false + RedisCluster|int|false
- spop(string $key, int $count = 0) + sadd(string $key, mixed $value, mixed ...$other_values)

No description

@@ -1790,10 +2327,10 @@

Methods

- RedisCluster|string|array|false + RedisCluster|bool|int
- srandmember(string $key, int $count = 0) + saddarray(string $key, array $values)

No description

@@ -1801,10 +2338,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool
- srem(string $key, mixed $value, mixed ...$other_values) + save(string|array $key_or_address)

No description

@@ -1812,10 +2349,10 @@

Methods

- array|false + bool|array
- sscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + scan(null|int|string $iterator, string|array $key_or_address, string|null $pattern = null, int $count = 0)

No description

@@ -1826,7 +2363,7 @@

Methods

RedisCluster|int|false
- strlen(string $key) + scard(string $key)

No description

@@ -1834,10 +2371,10 @@

Methods

- void + mixed
- subscribe(array $channels, callable $cb) + script(string|array $key_or_address, mixed ...$args)

No description

@@ -1845,10 +2382,10 @@

Methods

- RedisCluster|bool|array + RedisCluster|array|false
- sunion(string $key, string ...$other_keys) + sdiff(string $key, string ...$other_keys)

No description

@@ -1859,7 +2396,7 @@

Methods

RedisCluster|int|false
- sunionstore(string $dst, string $key, string ...$other_keys) + sdiffstore(string $dst, string $key, string ...$other_keys)

No description

@@ -1867,10 +2404,10 @@

Methods

- RedisCluster|bool|array + RedisCluster|string|bool
- time(string|array $key_or_address) + set(string $key, mixed $value, mixed $options = null)

No description

@@ -1881,7 +2418,7 @@

Methods

RedisCluster|int|false
- ttl(string $key) + setbit(string $key, int $offset, bool $onoff)

No description

@@ -1889,10 +2426,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool
- type(string $key) + setex(string $key, int $expire, mixed $value)

No description

@@ -1900,10 +2437,10 @@

Methods

- bool|array + RedisCluster|bool
- unsubscribe(array $channels) + setnx(string $key, mixed $value)

No description

@@ -1911,10 +2448,10 @@

Methods

- RedisCluster|int|false + bool
- unlink(array|string $key, string ...$other_keys) + setoption(int $option, mixed $value)

No description

@@ -1922,10 +2459,10 @@

Methods

- bool + RedisCluster|int|false
- unwatch() + setrange(string $key, int $offset, string $value)

No description

@@ -1933,10 +2470,10 @@

Methods

- RedisCluster|bool + RedisCluster|array|false
- watch(string $key, string ...$other_keys) + sinter(array|string $key, string ...$other_keys)

No description

@@ -1947,7 +2484,7 @@

Methods

RedisCluster|int|false
- xack(string $key, string $group, array $ids) + sintercard(array $keys, int $limit = -1)

No description

@@ -1955,10 +2492,10 @@

Methods

- RedisCluster|string|false + RedisCluster|int|false
- xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false) + sinterstore(array|string $key, string ...$other_keys)

No description

@@ -1966,10 +2503,10 @@

Methods

- RedisCluster|string|array|false + RedisCluster|bool
- xclaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options) + sismember(string $key, mixed $value)

No description

@@ -1977,10 +2514,10 @@

Methods

- RedisCluster|int|false + RedisCluster|array|false
- xdel(string $key, array $ids) + smismember(string $key, string $member, string ...$other_members)

No description

@@ -1991,7 +2528,7 @@

Methods

mixed
- xgroup(string $operation, string $key = null, string $group = null, string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2) + slowlog(string|array $key_or_address, mixed ...$args)

No description

@@ -1999,10 +2536,10 @@

Methods

- Redis|bool|array + RedisCluster|array|false
- xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) + smembers(string $key)

No description

@@ -2010,10 +2547,10 @@

Methods

- mixed + RedisCluster|bool
- xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1) + smove(string $src, string $dst, string $member)

No description

@@ -2021,10 +2558,10 @@

Methods

- RedisCluster|int|false + RedisCluster|array|bool|int|string
- xlen(string $key) + sort(string $key, array|null $options = null)

No description

@@ -2032,10 +2569,10 @@

Methods

- RedisCluster|array|false + RedisCluster|array|bool|int|string
- xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null) + sort_ro(string $key, array|null $options = null)

No description

@@ -2043,10 +2580,10 @@

Methods

- RedisCluster|bool|array + RedisCluster|string|array|false
- xrange(string $key, string $start, string $end, int $count = -1) + spop(string $key, int $count = 0)

No description

@@ -2054,10 +2591,10 @@

Methods

- RedisCluster|bool|array + RedisCluster|string|array|false
- xread(array $streams, int $count = -1, int $block = -1) + srandmember(string $key, int $count = 0)

No description

@@ -2065,10 +2602,10 @@

Methods

- RedisCluster|bool|array + RedisCluster|int|false
- xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1) + srem(string $key, mixed $value, mixed ...$other_values)

No description

@@ -2076,10 +2613,10 @@

Methods

- RedisCluster|bool|array + array|false
- xrevrange(string $key, string $start, string $end, int $count = -1) + sscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

No description

@@ -2090,7 +2627,7 @@

Methods

RedisCluster|int|false
- xtrim(string $key, int $maxlen, bool $approx = false, bool $minid = false, int $limit = -1) + strlen(string $key)

No description

@@ -2098,10 +2635,10 @@

Methods

- RedisCluster|int|false + void
- zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems) + subscribe(array $channels, callable $cb)

No description

@@ -2109,10 +2646,10 @@

Methods

- RedisCluster|int|false + RedisCluster|bool|array
- zcard(string $key) + sunion(string $key, string ...$other_keys)

No description

@@ -2123,7 +2660,7 @@

Methods

RedisCluster|int|false
- zcount(string $key, string $start, string $end) + sunionstore(string $dst, string $key, string ...$other_keys)

No description

@@ -2131,10 +2668,10 @@

Methods

- RedisCluster|float|false + RedisCluster|bool|array
- zincrby(string $key, float $value, string $member) + time(string|array $key_or_address)

No description

@@ -2145,7 +2682,7 @@

Methods

RedisCluster|int|false
- zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null) + ttl(string $key)

No description

@@ -2156,7 +2693,18 @@

Methods

RedisCluster|int|false
- zintercard(array $keys, int $limit = -1) + type(string $key) + +

No description

+
+
+
+
+
+ bool|array +
+
+ unsubscribe(array $channels)

No description

@@ -2167,7 +2715,7 @@

Methods

RedisCluster|int|false
- zlexcount(string $key, string $min, string $max) + unlink(array|string $key, string ...$other_keys)

No description

@@ -2175,10 +2723,10 @@

Methods

- RedisCluster|bool|array + bool
- zpopmax(string $key, int $value = null) + unwatch()

No description

@@ -2186,10 +2734,10 @@

Methods

- RedisCluster|bool|array + RedisCluster|bool
- zpopmin(string $key, int $value = null) + watch(string $key, string ...$other_keys)

No description

@@ -2197,10 +2745,21 @@

Methods

- RedisCluster|array|bool + RedisCluster|int|false
- zrange(string $key, mixed $start, mixed $end, array|bool|null $options = null) + vadd(string $key, array $values, mixed $element, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ vsim(string $key, mixed $member, array|null $options = null)

No description

@@ -2211,7 +2770,18 @@

Methods

RedisCluster|int|false
- zrangestore(string $dstkey, string $srckey, int $start, int $end, array|bool|null $options = null) + vcard(string $key) + +

No description

+
+
+ +
+
+ RedisCluster|int|false +
+
+ vdim(string $key)

No description

@@ -2222,29 +2792,82 @@

Methods

RedisCluster|array|false
- zrangebylex(string $key, string $min, string $max, int $offset = -1, int $count = -1) + vinfo(string $key)

No description

+ +
+
+ RedisCluster|bool +
+
+ vismember(string $key, mixed $member) + +

Check if an element is a member of a vectorset

+
RedisCluster|array|false
- zrangebyscore(string $key, string $start, string $end, array $options = []) + vemb(string $key, mixed $member, bool $raw = false) + +

No description

+
+
+
+
+
+ RedisCluster|array|string|false +
+
+ vrandmember(string $key, int $count = 0)

No description

+
+
+
+ RedisCluster|array|false +
+
+ vrange(string $key, string $min, string $max, int $count = -1) + +

Retreive a lexographical range of elements from a vector set

+
RedisCluster|int|false
- zrank(string $key, mixed $member) + vrem(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ vlinks(string $key, mixed $member, bool $withscores = false) + +

No description

+
+
+
+
+
+ RedisCluster|array|string|false +
+
+ vgetattr(string $key, mixed $member, bool $decode = true)

No description

@@ -2255,7 +2878,18 @@

Methods

RedisCluster|int|false
- zrem(string $key, string $value, string ...$other_values) + vsetattr(string $key, mixed $member, array|string $attributes) + +

No description

+
+
+ +
+
+ RedisCluster|array|false +
+
+ gcra(string $key, int $maxBurst, int $requestsPerPeriod, int $period, int $tokens = 0)

No description

@@ -2266,7 +2900,29 @@

Methods

RedisCluster|int|false
- zremrangebylex(string $key, string $min, string $max) + xack(string $key, string $group, array $ids) + +

No description

+
+
+ +
+
+ RedisCluster|string|false +
+
+ xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false) + +

No description

+
+
+
+
+
+ RedisCluster|string|array|false +
+
+ xclaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options)

No description

@@ -2277,7 +2933,51 @@

Methods

RedisCluster|int|false
- zremrangebyrank(string $key, string $min, string $max) + xdel(string $key, array $ids) + +

No description

+
+
+ +
+
+ RedisCluster|array|false +
+
+ xdelex(string $key, array $ids, string|null $mode = null) + +

No description

+
+
+
+
+
+ mixed +
+
+ xgroup(string $operation, string|null $key = null, string|null $group = null, string|null $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) + +

No description

+
+
+
+
+
+ mixed +
+
+ xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1)

No description

@@ -2288,7 +2988,29 @@

Methods

RedisCluster|int|false
- zremrangebyscore(string $key, string $min, string $max) + xlen(string $key) + +

No description

+
+
+ +
+
+ RedisCluster|array|false +
+
+ xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ xrange(string $key, string $start, string $end, int $count = -1)

No description

@@ -2299,7 +3021,7 @@

Methods

RedisCluster|bool|array
- zrevrange(string $key, string $min, string $max, array $options = null) + xread(array $streams, int $count = -1, int $block = -1)

No description

@@ -2310,7 +3032,7 @@

Methods

RedisCluster|bool|array
- zrevrangebylex(string $key, string $min, string $max, array $options = null) + xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1)

No description

@@ -2321,7 +3043,7 @@

Methods

RedisCluster|bool|array
- zrevrangebyscore(string $key, string $min, string $max, array $options = null) + xrevrange(string $key, string $start, string $end, int $count = -1)

No description

@@ -2332,7 +3054,7 @@

Methods

RedisCluster|int|false
- zrevrank(string $key, mixed $member) + xtrim(string $key, int $maxlen, bool $approx = false, bool $minid = false, int $limit = -1)

No description

@@ -2340,10 +3062,32 @@

Methods

- RedisCluster|bool|array + RedisCluster|int|float|false +
+
+ zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zcard(string $key) + +

No description

+
+
+
+
+
+ RedisCluster|int|false
- zscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) + zcount(string $key, string $start, string $end)

No description

@@ -2354,7 +3098,7 @@

Methods

RedisCluster|float|false
- zscore(string $key, mixed $member) + zincrby(string $key, float $value, string $member)

No description

@@ -2365,24 +3109,3507 @@

Methods

RedisCluster|int|false
- zunionstore(string $dst, array $keys, array|null $weights = NULL, string|null $aggregate = NULL) + zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)

No description

+
+
+ RedisCluster|int|false +
+
+ zintercard(array $keys, int $limit = -1) + +

No description

+
+
+
+
+ RedisCluster|int|false +
+
+ zlexcount(string $key, string $min, string $max) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ zpopmax(string $key, int|null $value = null) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ zpopmin(string $key, int|null $value = null) + +

No description

+
+
+
+
+
+ RedisCluster|array|bool +
+
+ zrange(string $key, mixed $start, mixed $end, array|bool|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zrangestore(string $dstkey, string $srckey, int $start, int $end, array|bool|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|string|array +
+
+ zrandmember(string $key, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ zrangebylex(string $key, string $min, string $max, int $offset = -1, int $count = -1) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ zrangebyscore(string $key, string $start, string $end, array $options = []) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zrank(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zrem(string $key, string $value, string ...$other_values) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zremrangebylex(string $key, string $min, string $max) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zremrangebyrank(string $key, string $min, string $max) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zremrangebyscore(string $key, string $min, string $max) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ zrevrange(string $key, string $min, string $max, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ zrevrangebylex(string $key, string $min, string $max, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ zrevrangebyscore(string $key, string $min, string $max, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zrevrank(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisCluster|bool|array +
+
+ zscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0) + +

No description

+
+
+
+
+
+ RedisCluster|float|false +
+
+ zscore(string $key, mixed $member) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ zmscore(string $key, mixed $member, mixed ...$other_members) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zunionstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ zinter(array $keys, array|null $weights = null, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|int|false +
+
+ zdiffstore(string $dst, array $keys) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ zunion(array $keys, array|null $weights = null, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|array|false +
+
+ zdiff(array $keys, array|null $options = null) + +

No description

+
+
+
+
+
+ RedisCluster|string|false +
+
+ digest(string $key) + +

No description

+
+
+
+ + + +

Details

+ +
+
+ +

+ + __construct(string|null $name, array|null $seeds = null, int|float $timeout = 0, int|float $read_timeout = 0, bool $persistent = false, mixed $auth = null, array|null $context = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string|null$name
array|null$seeds
int|float$timeout
int|float$read_timeout
bool$persistent
mixed$auth
array|null$context
+ + + + + +
+
+ +
+
+ +

+ + string _compress(string $value) +

+
+ + + + +
+

Parameters

+ + + + + + + +
string$value
+ + +

Return Value

+ +
+ + + + + +
string
+ +
+ + + +
+
+ +
+
+ +

+ + string _uncompress(string $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$value
+ + +

Return Value

+ +
+ + + + + +
string
+ +
+ + +

See also

+ + + + + + +
+ +Redis::_uncompress +
+ + +
+
+ +
+
+ +

+ + bool|string _serialize(mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
mixed$value
+ + +

Return Value

+ +
+ + + + + +
bool|string
+ +
+ + +

See also

+ + + + + + +
+ +Redis::_serialize +
+ + +
+
+ +
+
+ +

+ + mixed _unserialize(string $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$value
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::_unserialize +
+ + +
+
+ +
+
+ +

+ + string _pack(mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
mixed$value
+ + +

Return Value

+ +
+ + + + + +
string
+ +
+ + +

See also

+ + + + + + +
+ +Redis::_pack +
+ + +
+
+ +
+
+ +

+ + string _digest(mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
mixed$value
+ + +

Return Value

+ +
+ + + + + +
string
+ +
+ + +

See also

+ + + + + + +
+ +Redis::_digest +
+ + +
+
+ +
+
+ +

+ + mixed _unpack(string $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$value
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::_unpack +
+ + +
+
+ +
+
+ +

+ + bool|string _prefix(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
bool|string
+ +
+ + +

See also

+ + + + + + +
+ +Redis::_prefix +
+ + +
+
+ +
+
+ +

+ + array _masters() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
array
+ +
+ + + +
+
+ +
+
+ +

+ + string|null _redir() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
string|null
+ +
+ + + +
+
+ +
+
+ +

+ + mixed acl(string|array $key_or_address, string $subcmd, string ...$args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key_or_address
string$subcmd
string...$args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::acl +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool|int append(string $key, mixed $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
mixed$value
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool|int
+ +
+ + +

See also

+ + + + + + +
+ +Redis::append +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool bgrewriteaof(string|array $key_or_address) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string|array$key_or_address
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::bgrewriteaof +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int|false wait(string|array $key_or_address, int $numreplicas, int $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key_or_address
int$numreplicas
int$timeout
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::wait +
+ + +
+
+ +
+
+ +

+ + RedisCluster|array|false waitaof(string|array $key_or_address, int $numlocal, int $numreplicas, int $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string|array$key_or_address
int$numlocal
int$numreplicas
int$timeout
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|array|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::waitaof +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool bgsave(string|array $key_or_address) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string|array$key_or_address
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::bgSave +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool|int bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$key
int$start
int$end
bool$bybit
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool|int
+ +
+ + +

See also

+ + + + + + +
+ +Redis::bitcount +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool|int bitop(string $operation, string $deskey, string $srckey, string ...$otherkeys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$operation
string$deskey
string$srckey
string...$otherkeys
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool|int
+ +
+ + +

See also

+ + + + + + +
+ +Redis::bitop +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int|false bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false) +

+
+ + + +
+

Return the position of the first bit set to 0 or 1 in a string.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key

The key to check (must be a string)

bool$bit

Whether to look for an unset (0) or set (1) bit.

int$start

Where in the string to start looking.

int$end

Where in the string to stop looking.

bool$bybit

If true, Redis will treat $start and $end as BIT values and not bytes, so if start +was 0 and end was 2, Redis would only search the first two bits.

+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|false
+ +
+ + +

See also

+ + + + + + +
+ https://https://redis.io/commands/bitpos/ +
+ + +
+
+ +
+
+ +

+ + RedisCluster|array|null|false blpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key
string|float|int$timeout_or_key
mixed...$extra_args
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|array|null|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::blPop +
+ + +
+
+ +
+
+ +

+ + RedisCluster|array|null|false brpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key
string|float|int$timeout_or_key
mixed...$extra_args
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|array|null|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::brPop +
+ + +
+
+ +
+
+ +

+ + mixed brpoplpush(string $srckey, string $deskey, int $timeout) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$srckey
string$deskey
int$timeout
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::brpoplpush +
+ + +
+
+ +
+
+ +

+ + RedisCluster|string|false lmove(string $src, string $dst, string $wherefrom, string $whereto) +

+
+ + + +
+

Move an element from one list into another.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
string$src
string$dst
string$wherefrom
string$whereto
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|string|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::lMove +
+ + +
+
+ +
+
+ +

+ + RedisCluster|string|false blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout) +

+
+ + + +
+

Move an element from one list to another, blocking up to a timeout until an element is available.

+
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$src
string$dst
string$wherefrom
string$whereto
float$timeout
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|string|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::blmove +
+ + +
+
+ +
+
+ +

+ + array bzpopmax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key
string|int$timeout_or_key
mixed...$extra_args
+ + +

Return Value

+ +
+ + + + + +
array
+ +
+ + +

See also

+ + + + + + +
+ +Redis::bzPopMax +
+ + +
+
+ +
+
+ +

+ + array bzpopmin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key
string|int$timeout_or_key
mixed...$extra_args
+ + +

Return Value

+ +
+ + + + + +
array
+ +
+ + +

See also

+ + + + + + +
+ +Redis::bzPopMin +
+ + +
+
+ +
+
+ +

+ + RedisCluster|array|null|false bzmpop(float $timeout, array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
float$timeout
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|array|null|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::bzmpop +
+ + +
+
+ +
+
+ +

+ + RedisCluster|array|null|false zmpop(array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|array|null|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::zmpop +
+ + +
+
+ +
+
+ +

+ + RedisCluster|array|null|false blmpop(float $timeout, array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
float$timeout
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|array|null|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::blmpop +
+ + +
+
+ +
+
+ +

+ + RedisCluster|array|null|false lmpop(array $keys, string $from, int $count = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
array$keys
string$from
int$count
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|array|null|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::lmpop +
+ + +
+
+ +
+
+ +

+ + bool clearlasterror() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::clearLastError +
+ + +
+
+ +
+
+ +

+ + array|string|bool client(string|array $key_or_address, string $subcommand, string|null $arg = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key_or_address
string$subcommand
string|null$arg
+ + +

Return Value

+ +
+ + + + + +
array|string|bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::client +
+ + +
+
+ +
+
+ +

+ + bool close() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::close +
+ + +
+
+ +
+
+ +

+ + mixed cluster(string|array $key_or_address, string $command, mixed ...$extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key_or_address
string$command
mixed...$extra_args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ \Redis::cluster() +
+ + +
+
+ +
+
+ +

+ + mixed command(mixed ...$extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
mixed...$extra_args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::command +
+ + +
+
+ +
+
+ +

+ + mixed config(string|array $key_or_address, string $subcommand, mixed ...$extra_args) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string|array$key_or_address
string$subcommand
mixed...$extra_args
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::config +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int dbsize(string|array $key_or_address) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string|array$key_or_address
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int
+ +
+ + +

See also

+ + + + + + +
+ +Redis::dbSize +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool copy(string $src, string $dst, array|null $options = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$src
string$dst
array|null$options
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool
+ +
+ + +

See also

+ + + + + + +
+ https://redis.io/commands/copy +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int|false decr(string $key, int $by = 1) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$by
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::decr +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int|false decrby(string $key, int $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
int$value
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::decrBy +
+ + +
+
+ +
+
+ +

+ + float decrbyfloat(string $key, float $value) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string$key
float$value
+ + +

Return Value

+ +
+ + + + + +
float
+ +
+ + +

See also

+ + + + + + +
+ \Redis::decrbyfloat() +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int|false del(array|string $key, string ...$other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
array|string$key
string...$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::del +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int|false delex(string $key, array|null $options = null) +

+
+ + + +
+

Delete a key conditionally based on its value or hash digest

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key to delete

array|null$options

An array with options to modify how DELX works.

+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|false

Returns 1 if the key was deleted, 0 if it was not.

+ +
+ + + +
+
+ +
+
+ +

+ + RedisCluster|int|false delifeq(string $key, mixed $value) +

+
+ + + +
+

Delete a key if it's equal to the specified value. This command is +specific to Valkey >= 9.0

+
+
+

Parameters

+ + + + + + + + + + + + +
string$key

The key to delete

mixed$value

The value to compare against the key's value.

+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|false

Returns 1 if the key was deleted, 0 if it was not.

+ +
+ + + +
+
+ +
+
+ +

+ + bool discard() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::discard +
+ + +
+
+ +
+
+ +

+ + RedisCluster|string|false dump(string $key) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + +
string$key
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|string|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::dump +
+ + +
+
+ +
+
+ +

+ + RedisCluster|string|false echo(string|array $key_or_address, string $msg) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
string|array$key_or_address
string$msg
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|string|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::echo +
+ + +
+
+ +
+
+ +

+ + mixed eval(string $script, array $args = [], int $num_keys = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$script
array$args
int$num_keys
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::eval +
+ + +
+
+ +
+
+ +

+ + mixed eval_ro(string $script, array $args = [], int $num_keys = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$script
array$args
int$num_keys
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::eval_ro +
+ + +
+
+ +
+
+ +

+ + mixed evalsha(string $script_sha, array $args = [], int $num_keys = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$script_sha
array$args
int$num_keys
+ + +

Return Value

+ +
+ + + + + +
mixed
+ +
+ + +

See also

+ + + + + + +
+ +Redis::evalsha +
+ + +
+
+ +
+
+ +

+ + mixed evalsha_ro(string $script_sha, array $args = [], int $num_keys = 0) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
string$script_sha
array$args
int$num_keys
+ +

Return Value

-

Details

+
+ + + + + +
mixed
-
+
+ + +

See also

+ + + + + + +
+ +Redis::evalsha_ro +
+ + +
+
+ +
+
+ +

+ + array|false exec() +

+
+ + + +
+

No description

+ +
+
+ +

Return Value

+ +
+ + + + + +
array|false
+ +
+ + +

See also

+ + + + + + +
+ +Redis::exec +
+ + +
+
+ +
-

- - - __construct(string|null $name, array $seeds = NULL, int|float $timeout = 0, int|float $read_timeout = 0, bool $persistent = false, mixed $auth = NULL, array $context = NULL) - + +

+ + RedisCluster|int|bool exists(mixed $key, mixed ...$other_keys)

@@ -2397,56 +6624,246 @@

Parameters

- - + + - - + + +
string|null$namemixed$key
array$seedsmixed...$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|bool
+ +
+ + +

See also

+ + - + + + +
int|float + +Redis::exists +
+ + +
+
+ +
+
+ +

+ + RedisCluster|int|bool touch(mixed $key, mixed ...$other_keys) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + + + + +
mixed$key
mixed...$other_keys
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|int|bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::touch +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool expire(string $key, int $timeout, string|null $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + + + + + - - + + + + +
string$key
int $timeout
int|float$read_timeoutstring|null$mode
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool
+ +
+ + +

See also

+ + + + + + +
+ +Redis::expire +
+ + +
+
+ +
+
+ +

+ + RedisCluster|bool expireat(string $key, int $timestamp, string|null $mode = null) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + + + + - - + + - - + + +
string$key
bool$persistentint$timestamp
mixed$authstring|null$mode
+ + +

Return Value

+ +
+ + + + + +
RedisCluster|bool
+ +
+ + +

See also

+ + - - +
array$context + +Redis::expireAt +
- - -
-

- - string - _compress(string $value) - + +

+ + RedisCluster|int|false expiretime(string $key)

@@ -2462,21 +6879,23 @@

Parameters

- +
string$value$key
-

Return Value

+

Return Value

- +
+
- +
stringRedisCluster|int|false
+

See also

@@ -2484,8 +6903,8 @@

See also

@@ -2497,11 +6916,10 @@

See also

-

- - string - _uncompress(string $value) - + +

+ + RedisCluster|int|false pexpiretime(string $key)

@@ -2517,21 +6935,23 @@

Parameters

- -Redis::_compress + +Redis::expiretime
- +
string$value$key
-

Return Value

+

Return Value

- +
+
- +
stringRedisCluster|int|false
+

See also

@@ -2539,8 +6959,8 @@

See also

@@ -2552,11 +6972,10 @@

See also

-

- - bool|string - _serialize(mixed $value) - + +

+ + RedisCluster|bool flushall(string|array $key_or_address, bool $async = false)

@@ -2571,22 +6990,29 @@

Parameters

- -Redis::_uncompress + +Redis::pexpiretime
- - + + + + + + +
mixed$valuestring|array$key_or_address
bool$async
-

Return Value

+

Return Value

- +
+
- +
bool|stringRedisCluster|bool
+

See also

@@ -2594,8 +7020,8 @@

See also

@@ -2607,11 +7033,10 @@

See also

-

- - mixed - _unserialize(string $value) - + +

+ + RedisCluster|bool flushdb(string|array $key_or_address, bool $async = false)

@@ -2626,22 +7051,29 @@

Parameters

- -Redis::_serialize + +Redis::flushAll
- - + + + + + + +
string$valuestring|array$key_or_address
bool$async
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|bool
+

See also

@@ -2649,8 +7081,8 @@

See also

@@ -2662,11 +7094,10 @@

See also

-

- - string - _pack(mixed $value) - + +

+ + RedisCluster|int|false geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options)

@@ -2681,22 +7112,44 @@

Parameters

- -Redis::_unserialize + +Redis::flushDB
+ + + + + + + + + + + + + + + + + + + + - +
string$key
float$lng
float$lat
string$member
mixed$value...$other_triples_and_options
-

Return Value

+

Return Value

- +
+
- +
stringRedisCluster|int|false
+

See also

@@ -2704,8 +7157,8 @@

See also

@@ -2717,11 +7170,10 @@

See also

-

- - mixed - _unpack(string $value) - + +

+ + RedisCluster|float|false geodist(string $key, string $src, string $dest, string|null $unit = null)

@@ -2737,21 +7189,38 @@

Parameters

- -Redis::_pack + +Redis::geoadd
- + + + + + + + + + + + + + + + +
string$value$key
string$src
string$dest
string|null$unit
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|float|false
+

See also

@@ -2759,8 +7228,8 @@

See also

@@ -2772,11 +7241,10 @@

See also

-

- - bool|string - _prefix(string $key) - + +

+ + RedisCluster|array|false geohash(string $key, string $member, string ...$other_members)

@@ -2794,19 +7262,31 @@

Parameters

+ + + + + + + + + +
- -Redis::_unpack + +Redis::geodist
string $key
string$member
string...$other_members
-

Return Value

+

Return Value

- +
+
- +
bool|stringRedisCluster|array|false
+

See also

@@ -2814,8 +7294,8 @@

See also

@@ -2827,11 +7307,10 @@

See also

-

- - array - _masters() - + +

+ + RedisCluster|array|false geopos(string $key, string $member, string ...$other_members)

@@ -2842,62 +7321,62 @@

- -

Return Value

+

Parameters

- -Redis::_prefix + +Redis::geohash
- - - - -
array
- - - - - - - - -
-

- - string|null - _redir() - -

-
- - + + string + $key + + + + string + $member + + + + string + ...$other_members + + + -
-

No description

- -
-
-

Return Value

+

Return Value

- +
+
- +
string|nullRedisCluster|array|false
+
+

See also

+ + + + + + +
+ +Redis::geopos +
+
-

- - mixed - acl(string|array $key_or_address, string $subcmd, string ...$args) - + +

+ + mixed georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])

@@ -2912,32 +7391,49 @@

Parameters

- - + + - - + + + + + + + + + + + + - + + + + + +
string|array$key_or_addressstring$key
string$subcmdfloat$lng
float$lat
float$radius
string...$args$unit
array$options
-

Return Value

+

Return Value

- +
+
mixed
+

See also

@@ -2945,7 +7441,8 @@

See also

@@ -2957,11 +7454,10 @@

See also

-

- - RedisCluster|bool|int - append(string $key, mixed $value) - + +

+ + mixed georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])

@@ -2981,22 +7477,44 @@

Parameters

- - + + + + + + + + + + + + + + + + + + + + + +
- Redis::acl + +Redis::georadius
mixed$valuefloat$lng
float$lat
float$radius
string$unit
array$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|intmixed
+

See also

@@ -3004,8 +7522,8 @@

See also

@@ -3017,11 +7535,10 @@

See also

-

- - RedisCluster|bool - bgrewriteaof(string|array $key_or_address) - + +

+ + mixed georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = [])

@@ -3036,22 +7553,44 @@

Parameters

- -Redis::append + +Redis::georadius_ro
- - + + + + + + + + + + + + + + + + + + + + + +
string|array$key_or_addressstring$key
string$member
float$radius
string$unit
array$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolmixed
+

See also

@@ -3059,7 +7598,8 @@

See also

@@ -3071,11 +7611,10 @@

See also

-

- - RedisCluster|bool - bgsave(string|array $key_or_address) - + +

+ + mixed georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = [])

@@ -3090,22 +7629,44 @@

Parameters

- Redis::bgrewriteaof + +Redis::georadiusbymember
- - + + + + + + + + + + + + + + + + + + + + + +
string|array$key_or_addressstring$key
string$member
float$radius
string$unit
array$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolmixed
+

See also

@@ -3113,7 +7674,8 @@

See also

@@ -3125,11 +7687,10 @@

See also

-

- - RedisCluster|bool|int - bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false) - + +

+ + RedisCluster|array geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = [])

@@ -3149,32 +7710,39 @@

Parameters

- - + + - - + + - - + + + + + + +
- Redis::bgsave + +Redis::georadiusbymember_ro
int$startarray|string$position
int$endarray|int|float$shape
bool$bybitstring$unit
array$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|intRedisCluster|array
+

See also

@@ -3182,7 +7750,7 @@

See also

@@ -3194,11 +7762,10 @@

See also

-

- - RedisCluster|bool|int - bitop(string $operation, string $deskey, string $srckey, string ...$otherkeys) - + +

+ + RedisCluster|array|int|false geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = [])

@@ -3214,36 +7781,48 @@

Parameters

- Redis::bitcount + https://redis.io/commands/geosearch
- + - + - - + + + + + + + - + + + + + +
string$operation$dst
string$deskey$src
string$srckeyarray|string$position
array|int|float$shape
string...$otherkeys$unit
array$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|intRedisCluster|array|int|false
+

See also

@@ -3251,7 +7830,7 @@

See also

@@ -3263,18 +7842,18 @@

See also

-

- - RedisCluster|int|false - bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false) - + +

+ + mixed get(string $key)

-

Return the position of the first bit set to 0 or 1 in a string.

+

No description

+

Parameters

@@ -3283,41 +7862,22 @@

Parameters

- - - - - - - - - - - - - - - - - - - - - +
- Redis::bitop + https://redis.io/commands/geosearchstore
string $key

The key to check (must be a string)

bool$bit

Whether to look for an unset (0) or set (1) bit.

int$start

Where in the string to start looking.

int$end

Where in the string to stop looking.

bool$bybit

If true, Redis will treat $start and $end as BIT values and not bytes, so if start -was 0 and end was 2, Redis would only search the first two bits.

-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falsemixed
+

See also

@@ -3325,7 +7885,8 @@

See also

@@ -3337,122 +7898,130 @@

See also

-

- - RedisCluster|array|null|false - blpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args) - + +

+ + mixed getdel(string $key)

-

See Redis::blpop()

+

No description

+

Parameters

- https://https://redis.io/commands/bitpos/ + +Redis::get
- + - - - - - - - - - -
string|arraystring $key
string|float|int$timeout_or_key
mixed...$extra_args
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|null|falsemixed
+ +

See also

+ + + + + + +
+ +Redis::getDel +
+
-

- - RedisCluster|array|null|false - brpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args) - + +

+ + RedisCluster|array|false getWithMeta(string $key)

-

See Redis::brpop()

+

No description

+

Parameters

- + - - - - - - - - - -
string|arraystring $key
string|float|int$timeout_or_key
mixed...$extra_args
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|null|falseRedisCluster|array|false
+
+

See also

+ + + + + + +
+ +Redis::getWithMeta +
+
-

- - mixed - brpoplpush(string $srckey, string $deskey, int $timeout) - + +

+ + RedisCluster|string|false getex(string $key, array $options = [])

-

See Redis::brpoplpush()

+

No description

+

Parameters

@@ -3460,44 +8029,52 @@

Parameters

- - - - - - + - - + +
string$srckey
string$deskey$key
int$timeoutarray$options
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|string|false
+
+

See also

+ + + + + + +
+ +Redis::getEx +
+
-

- - array - bzpopmax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) - + +

+ + RedisCluster|int|false getbit(string $key, int $value)

@@ -3512,32 +8089,29 @@

Parameters

- + - - - - - - - + +
string|arraystring $key
string|int$timeout_or_key
mixed...$extra_argsint$value
-

Return Value

+

Return Value

- +
+
- +
arrayRedisCluster|int|false
+

See also

@@ -3545,7 +8119,8 @@

See also

@@ -3557,11 +8132,10 @@

See also

-

- - array - bzpopmin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) - + +

+ + string|null getlasterror()

@@ -3572,36 +8146,18 @@

-

Parameters

- -
- Redis::bzpopmax + +Redis::getBit
- - - - - - - - - - - - - - - -
string|array$key
string|int$timeout_or_key
mixed...$extra_args
- -

Return Value

+

Return Value

- +
+
- +
arraystring|null
+

See also

@@ -3609,7 +8165,8 @@

See also

@@ -3621,11 +8178,10 @@

See also

-

- - RedisCluster|array|null|false - bzmpop(float $timeout, array $keys, string $from, int $count = 1) - + +

+ + int getmode()

@@ -3636,41 +8192,74 @@

-

Parameters

+ +

Return Value

+ +
+
- Redis::bzpopmin + +Redis::getLastError
+ + + + +
int
+ + + + +

See also

- - - - - - - - - - - - + +
float$timeout
array$keys
string$from + +Redis::getMode +
+ + + + + + +
+ +

+ + mixed getoption(int $option) +

+
+ + + +
+

No description

+ +
+
+

Parameters

+ + - +
int$count$option
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|null|falsemixed
+

See also

@@ -3678,7 +8267,8 @@

See also

@@ -3690,11 +8280,10 @@

See also

-

- - RedisCluster|array|null|false - zmpop(array $keys, string $from, int $count = 1) - + +

+ + RedisCluster|string|false getrange(string $key, int $start, int $end)

@@ -3709,32 +8298,34 @@

Parameters

- Redis::bzmpop + +Redis::getOption
- - + + - - + + - +
array$keysstring$key
string$fromint$start
int$count$end
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|null|falseRedisCluster|string|false
+

See also

@@ -3742,7 +8333,8 @@

See also

@@ -3754,11 +8346,10 @@

See also

-

- - RedisCluster|array|null|false - blmpop(float $timeout, array $keys, string $from, int $count = 1) - + +

+ + RedisCluster|string|array|int|false lcs(string $key1, string $key2, array|null $options = null)

@@ -3773,37 +8364,34 @@

Parameters

- Redis::zmpop + +Redis::getRange
- - - - - - - + + - + - - + +
float$timeout
array$keysstring$key1
string$from$key2
int$countarray|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|null|falseRedisCluster|string|array|int|false
+

See also

@@ -3811,8 +8399,8 @@

See also

@@ -3824,11 +8412,10 @@

See also

-

- - RedisCluster|array|null|false - lmpop(array $keys, string $from, int $count = 1) - + +

+ + RedisCluster|string|bool getset(string $key, mixed $value)

@@ -3843,32 +8430,29 @@

Parameters

- -Redis::blmpop + +Redis::lcs
- - - - - - + - - + +
array$keys
string$from$key
int$countmixed$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|null|falseRedisCluster|string|bool
+

See also

@@ -3876,8 +8460,8 @@

See also

@@ -3889,11 +8473,10 @@

See also

-

- - bool - clearlasterror() - + +

+ + array|false gettransferredbytes()

@@ -3905,15 +8488,17 @@

-

Return Value

+

Return Value

-
- -Redis::lmpop + +Redis::getset
+
+
- +
boolarray|false
+

See also

@@ -3921,7 +8506,8 @@

See also

@@ -3933,11 +8519,10 @@

See also

-

- - array|string|bool - client(string|array $key_or_address, string $subcommand, string|null $arg = NULL) - + +

+ + void cleartransferredbytes()

@@ -3948,36 +8533,18 @@

-

Parameters

- -
- \Redis::clearlasterror() + +Redis::getTransferredBytes
- - - - - - - - - - - - - - - -
string|array$key_or_address
string$subcommand
string|null$arg
- -

Return Value

+

Return Value

- +
+
- +
array|string|boolvoid
+

See also

@@ -3985,7 +8552,8 @@

See also

@@ -3997,11 +8565,10 @@

See also

-

- - bool - close() - + +

+ + RedisCluster|int|false hdel(string $key, string $member, string ...$other_members)

@@ -4012,16 +8579,38 @@

- -

Return Value

+

Parameters

- Redis::client + +Redis::clearTransferredBytes
+ + + + + + + + + + + + + + + +
string$key
string$member
string...$other_members
+ + +

Return Value

+ +
+ - +
boolRedisCluster|int|false
+

See also

@@ -4029,7 +8618,8 @@

See also

@@ -4041,11 +8631,10 @@

See also

-

- - mixed - cluster(string|array $key_or_address, string $command, mixed ...$extra_args) - + +

+ + RedisCluster|bool hexists(string $key, string $member)

@@ -4060,32 +8649,29 @@

Parameters

- Redis::close + +Redis::hDel
- - - - - - + - - + +
string|array$key_or_address
string$command$key
mixed...$extra_argsstring$member
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|bool
+

See also

@@ -4093,7 +8679,8 @@

See also

@@ -4105,11 +8692,10 @@

See also

-

- - mixed - command(mixed ...$extra_args) - + +

+ + mixed hget(string $key, string $member)

@@ -4124,22 +8710,29 @@

Parameters

- Redis::cluster + +Redis::hExists
- - + + + + + + +
mixed...$extra_argsstring$key
string$member
-

Return Value

+

Return Value

- +
+
mixed
+

See also

@@ -4147,7 +8740,8 @@

See also

@@ -4159,11 +8753,10 @@

See also

-

- - mixed - config(string|array $key_or_address, string $subcommand, mixed ...$extra_args) - + +

+ + RedisCluster|array|false hgetall(string $key)

@@ -4178,32 +8771,24 @@

Parameters

- Redis::command + +Redis::hGet
- - - - - - - - - - - +
string|array$key_or_address
string$subcommand
mixed...$extra_args$key
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|array|false
+

See also

@@ -4211,8 +8796,8 @@

See also

@@ -4224,11 +8809,10 @@

See also

-

- - RedisCluster|int - dbsize(string|array $key_or_address) - + +

+ + mixed hgetWithMeta(string $key, string $member)

@@ -4243,22 +8827,29 @@

Parameters

- -Redis::config + +Redis::hGetAll
- - + + + + + + +
string|array$key_or_addressstring$key
string$member
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|intmixed
+

See also

@@ -4266,7 +8857,8 @@

See also

@@ -4278,11 +8870,10 @@

See also

-

- - RedisCluster|int|false - decr(string $key, int $by = 1) - + +

+ + RedisCluster|int|false hincrby(string $key, string $member, int $value)

@@ -4300,24 +8891,31 @@

Parameters

+ + + + + - +
- \Redis::dbsize() + +Redis::hGetWithMeta
string $key
string$member
int$by$value
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -4325,8 +8923,8 @@

See also

@@ -4338,11 +8936,10 @@

See also

-

- - RedisCluster|int|false - decrby(string $key, int $value) - + +

+ + RedisCluster|float|false hincrbyfloat(string $key, string $member, float $value)

@@ -4362,22 +8959,29 @@

Parameters

- + + + + + +
- -Redis::decr + +Redis::hIncrBy
intstring$member
float $value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|float|false
+

See also

@@ -4385,7 +8989,8 @@

See also

@@ -4397,11 +9002,10 @@

See also

-

- - float - decrbyfloat(string $key, float $value) - + +

+ + RedisCluster|array|false hkeys(string $key)

@@ -4419,24 +9023,21 @@

Parameters

- - - - -
- \Redis::decrby() + +Redis::hIncrByFloat
string $key
float$value
-

Return Value

+

Return Value

- +
+
- +
floatRedisCluster|array|false
+

See also

@@ -4444,7 +9045,8 @@

See also

@@ -4456,11 +9058,10 @@

See also

-

- - RedisCluster|int|false - del(array|string $key, string ...$other_keys) - + +

+ + RedisCluster|int|false hlen(string $key)

@@ -4475,27 +9076,24 @@

Parameters

- Redis::decrbyfloat + +Redis::hKeys
- - - - - - +
array|string$key
string...$other_keys$key
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -4503,8 +9101,8 @@

See also

@@ -4516,11 +9114,10 @@

See also

-

- - bool - discard() - + +

+ + RedisCluster|array|false hmget(string $key, array $keys)

@@ -4531,16 +9128,33 @@

- -

Return Value

+

Parameters

- -Redis::del + +Redis::hLen
+ + + + + + + + + + +
string$key
array$keys
+ + +

Return Value

+ +
+ - +
boolRedisCluster|array|false
+

See also

@@ -4548,7 +9162,8 @@

See also

@@ -4560,11 +9175,10 @@

See also

-

- - RedisCluster|string|false - dump(string $key) - + +

+ + RedisCluster|array|false hgetex(string $key, array $fields, string|array|null $expiry = null)

@@ -4582,19 +9196,31 @@

Parameters

+ + + + + + + + + +
- Redis::discard + +Redis::hMget
string $key
array$fields
string|array|null$expiry
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|falseRedisCluster|array|false
+

See also

@@ -4602,7 +9228,8 @@

See also

@@ -4614,11 +9241,10 @@

See also

-

- - RedisCluster|string|false - echo(string|array $key_or_address, string $msg) - + +

+ + RedisCluster|int|false hsetex(string $key, array $fields, array|null $expiry = null)

@@ -4633,27 +9259,34 @@

Parameters

- Redis::dump + +Redis::hgetex
- - + + + + + + + - - + +
string|array$key_or_addressstring$key
array$fields
string$msgarray|null$expiry
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|falseRedisCluster|int|false
+

See also

@@ -4661,8 +9294,8 @@

See also

@@ -4674,11 +9307,10 @@

See also

-

- - mixed - eval(string $script, array $args = [], int $num_keys = 0) - + +

+ + RedisCluster|array|false hgetdel(string $key, array $fields)

@@ -4694,31 +9326,28 @@

Parameters

- -Redis::echo + +Redis::hsetex
- + - - - - - - +
string$script$key
array$args
int$num_keys$fields
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|array|false
+

See also

@@ -4726,7 +9355,8 @@

See also

@@ -4738,11 +9368,10 @@

See also

-

- - mixed - eval_ro(string $script, array $args = [], int $num_keys = 0) - + +

+ + RedisCluster|bool hmset(string $key, array $key_values)

@@ -4758,31 +9387,28 @@

Parameters

- Redis::eval + +Redis::hgetdel
- + - - - - - - +
string$script$key
array$args
int$num_keys$key_values
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|bool
+

See also

@@ -4790,7 +9416,8 @@

See also

@@ -4802,11 +9429,10 @@

See also

-

- - mixed - evalsha(string $script_sha, array $args = [], int $num_keys = 0) - + +

+ + array|bool hscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

@@ -4822,31 +9448,38 @@

Parameters

- Redis::eval_ro + +Redis::hMset
- + - - + + + + + + + - +
string$script_sha$key
array$argsnull|int|string$iterator
string|null$pattern
int$num_keys$count
-

Return Value

+

Return Value

- +
+
- +
mixedarray|bool
+

See also

@@ -4854,7 +9487,8 @@

See also

@@ -4866,11 +9500,10 @@

See also

-

- - mixed - evalsha_ro(string $script_sha, array $args = [], int $num_keys = 0) - + +

+ + RedisCluster|int|false expiremember(string $key, string $field, int $ttl, string|null $unit = null)

@@ -4886,31 +9519,38 @@

Parameters

- Redis::evalsha + +Redis::hscan
- + - - + + - + + + + + +
string$script_sha$key
array$argsstring$field
int$num_keys$ttl
string|null$unit
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|false
+

See also

@@ -4918,7 +9558,8 @@

See also

@@ -4930,11 +9571,10 @@

See also

-

- - array|false - exec() - + +

+ + RedisCluster|int|false expirememberat(string $key, string $field, int $timestamp)

@@ -4945,16 +9585,38 @@

- -

Return Value

+

Parameters

- Redis::evalsha_ro + +Redis::expiremember
+ + + + + + + + + + + + + + + +
string$key
string$field
int$timestamp
+ + +

Return Value

+ +
+ - +
array|falseRedisCluster|int|false
+

See also

@@ -4962,8 +9624,8 @@

See also

@@ -4975,11 +9637,10 @@

See also

-

- - RedisCluster|int|bool - exists(mixed $key, mixed ...$other_keys) - + +

+ + RedisCluster|string|array hrandfield(string $key, array|null $options = null)

@@ -4994,27 +9655,29 @@

Parameters

- -Redis::exec + +Redis::expirememberat
- + - - + +
mixedstring $key
mixed...$other_keysarray|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|boolRedisCluster|string|array
+

See also

@@ -5022,7 +9685,7 @@

See also

@@ -5034,11 +9697,10 @@

See also

-

- - RedisCluster|int|bool - touch(mixed $key, mixed ...$other_keys) - + +

+ + RedisCluster|int|false hset(string $key, string $member, mixed $value)

@@ -5053,27 +9715,34 @@

Parameters

- Redis::exists + https://redis.io/commands/hrandfield
- + + + + + + - +
mixedstring $key
string$member
mixed...$other_keys$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|boolRedisCluster|int|false
+

See also

@@ -5081,8 +9750,8 @@

See also

@@ -5094,11 +9763,10 @@

See also

-

- - RedisCluster|bool - expire(string $key, int $timeout, string|null $mode = NULL) - + +

+ + RedisCluster|bool hsetnx(string $key, string $member, mixed $value)

@@ -5118,27 +9786,29 @@

Parameters

- - + + - - + +
- -Redis::touch + +Redis::hSet
int$timeoutstring$member
string|null$modemixed$value
-

Return Value

+

Return Value

- +
+
RedisCluster|bool
+

See also

@@ -5146,7 +9816,8 @@

See also

@@ -5158,11 +9829,10 @@

See also

-

- - RedisCluster|bool - expireat(string $key, int $timestamp, string|null $mode = NULL) - + +

+ + RedisCluster|int|false hstrlen(string $key, string $field)

@@ -5182,27 +9852,24 @@

Parameters

- - - - - - - + +
- Redis::expire + +Redis::hSetNx
int$timestamp
string|null$modestring$field
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|int|false
+

See also

@@ -5210,7 +9877,8 @@

See also

@@ -5222,11 +9890,10 @@

See also

-

- - RedisCluster|int|false - expiretime(string $key) - + +

+ + RedisCluster|array|false hexpire(string $key, int $ttl, array $fields, string|null $mode = NULL)

@@ -5244,19 +9911,36 @@

Parameters

+ + + + + + + + + + + + + + +
- Redis::expireat + +Redis::hStrLen
string $key
int$ttl
array$fields
string|null$mode
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|false
+

See also

@@ -5264,8 +9948,8 @@

See also

@@ -5277,11 +9961,10 @@

See also

-

- - RedisCluster|int|false - pexpiretime(string $key) - + +

+ + RedisCluster|array|false hpexpire(string $key, int $ttl, array $fields, string|null $mode = NULL)

@@ -5299,19 +9982,36 @@

Parameters

+ + + + + + + + + + + + + + +
- -Redis::expiretime + +Redis::hexpire
string $key
int$ttl
array$fields
string|null$mode
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|false
+

See also

@@ -5319,8 +10019,8 @@

See also

@@ -5332,11 +10032,10 @@

See also

-

- - RedisCluster|bool - flushall(string|array $key_or_address, bool $async = false) - + +

+ + RedisCluster|array|false hexpireat(string $key, int $time, array $fields, string|null $mode = NULL)

@@ -5351,27 +10050,39 @@

Parameters

- -Redis::pexpiretime + +Redis::hpexpire
- - + + - - + + + + + + + + + + + +
string|array$key_or_addressstring$key
bool$asyncint$time
array$fields
string|null$mode
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|array|false
+

See also

@@ -5379,7 +10090,8 @@

See also

@@ -5391,11 +10103,10 @@

See also

-

- - RedisCluster|bool - flushdb(string|array $key_or_address, bool $async = false) - + +

+ + RedisCluster|array|false hpexpireat(string $key, int $mstime, array $fields, string|null $mode = NULL)

@@ -5410,27 +10121,39 @@

Parameters

- Redis::flushall + +Redis::hexpireat
- - + + - - + + + + + + + + + + + +
string|array$key_or_addressstring$key
bool$asyncint$mstime
array$fields
string|null$mode
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|array|false
+

See also

@@ -5438,7 +10161,8 @@

See also

@@ -5450,11 +10174,10 @@

See also

-

- - RedisCluster|int|false - geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options) - + +

+ + RedisCluster|array|false httl(string $key, array $fields)

@@ -5474,37 +10197,24 @@

Parameters

- - - - - - - - - - - - - - - - - + +
- Redis::flushdb + +Redis::hpexpireat
float$lng
float$lat
string$member
mixed...$other_triples_and_optionsarray$fields
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|false
+

See also

@@ -5512,7 +10222,8 @@

See also

@@ -5524,11 +10235,10 @@

See also

-

- - RedisCluster|float|false - geodist(string $key, string $src, string $dest, string|null $unit = null) - + +

+ + RedisCluster|array|false hpttl(string $key, array $fields)

@@ -5548,32 +10258,24 @@

Parameters

- - - - - - - - - - - - + +
- Redis::geoadd + +Redis::httl
string$src
string$dest
string|null$unitarray$fields
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|float|falseRedisCluster|array|false
+

See also

@@ -5581,7 +10283,8 @@

See also

@@ -5593,11 +10296,10 @@

See also

-

- - RedisCluster|array|false - geohash(string $key, string $member, string ...$other_members) - + +

+ + RedisCluster|array|false hexpiretime(string $key, array $fields)

@@ -5617,27 +10319,24 @@

Parameters

- - - - - - - + +
- Redis::geodist + +Redis::hpttl
string$member
string...$other_membersarray$fields
-

Return Value

+

Return Value

- +
+
RedisCluster|array|false
+

See also

@@ -5645,7 +10344,8 @@

See also

@@ -5657,11 +10357,10 @@

See also

-

- - RedisCluster|array|false - geopos(string $key, string $member, string ...$other_members) - + +

+ + RedisCluster|array|false hpexpiretime(string $key, array $fields)

@@ -5681,27 +10380,24 @@

Parameters

- - - - - - - + +
- Redis::geohash + +Redis::hexpiretime
string$member
string...$other_membersarray$fields
-

Return Value

+

Return Value

- +
+
RedisCluster|array|false
+

See also

@@ -5709,7 +10405,8 @@

See also

@@ -5721,11 +10418,10 @@

See also

-

- - mixed - georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) - + +

+ + RedisCluster|array|false hpersist(string $key, array $fields)

@@ -5743,44 +10439,26 @@

Parameters

- - - - - - - - - - - - - - - - - - - - - +
- Redis::geopos + +Redis::hpexpiretime
string $key
float$lng
float$lat
float$radius
string$unit
array$options$fields
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|array|false
+

See also

@@ -5788,7 +10466,8 @@

See also

@@ -5800,11 +10479,10 @@

See also

-

- - mixed - georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) - + +

+ + RedisCluster|array|false hvals(string $key)

@@ -5822,44 +10500,21 @@

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - -
- Redis::georadius + +Redis::hpexpiretime
string $key
float$lng
float$lat
float$radius
string$unit
array$options
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|array|false
+

See also

@@ -5867,7 +10522,8 @@

See also

@@ -5879,11 +10535,10 @@

See also

-

- - mixed - georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []) - + +

+ + RedisCluster|int|false incr(string $key, int $by = 1)

@@ -5903,37 +10558,24 @@

Parameters

- - - - - - - - - - - - - - - - - + +
- Redis::georadius_ro + +Redis::hVals
string$member
float$radius
string$unit
array$optionsint$by
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|false
+

See also

@@ -5941,7 +10583,8 @@

See also

@@ -5953,11 +10596,10 @@

See also

-

- - mixed - georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []) - + +

+ + RedisCluster|int|false incrby(string $key, int $value)

@@ -5977,37 +10619,24 @@

Parameters

- - - - - - - - - - - - - - - - - + +
- Redis::georadiusbymember + +Redis::incr
string$member
float$radius
string$unit
array$optionsint$value
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|false
+

See also

@@ -6015,7 +10644,8 @@

See also

@@ -6027,11 +10657,10 @@

See also

-

- - mixed - get(string $key) - + +

+ + RedisCluster|float|false incrbyfloat(string $key, float $value)

@@ -6049,19 +10678,26 @@

Parameters

+ + + + +
- Redis::georadiusbymember_ro + +Redis::incrBy
string $key
float$value
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|float|false
+

See also

@@ -6069,7 +10705,8 @@

See also

@@ -6081,46 +10718,50 @@

See also

-

- - RedisCluster|int|false - getbit(string $key, int $value) - + +

+ + RedisCluster|array|false info(string|array $key_or_address, string ...$sections)

-

No description

- +

Retrieve information about the connected redis-server. If no arguments are passed to +this function, redis will return every info field. Alternatively you may pass a specific +section you want returned (e.g. 'server', or 'memory') to receive only information pertaining +to that section.

If connected to Redis server >= 7.0.0 you may pass multiple optional sections.

Parameters

- Redis::get + +Redis::incrByFloat
- - - + + + - - - + + +
string$keystring|array$key_or_address

Either a key name or array with host and port indicating +which cluster node we want to send the command to.

int$valuestring...$sections

Optional section(s) you wish Redis server to return.

-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|false
+

See also

@@ -6128,7 +10769,7 @@

See also

@@ -6140,11 +10781,10 @@

See also

-

- - string|null - getlasterror() - + +

+ + RedisCluster|array|false keys(string $pattern)

@@ -6155,16 +10795,28 @@

- -

Return Value

+

Parameters

- Redis::getbit + https://redis.io/commands/info/
+ + + + + +
string$pattern
+ + +

Return Value

+ +
+ - +
string|nullRedisCluster|array|false
+

See also

@@ -6172,7 +10824,8 @@

See also

@@ -6184,11 +10837,10 @@

See also

-

- - int - getmode() - + +

+ + RedisCluster|int|false lastsave(string|array $key_or_address)

@@ -6199,16 +10851,28 @@

- -

Return Value

+

Parameters

- Redis::getlasterror + +Redis::keys
+ + + + + +
string|array$key_or_address
+ + +

Return Value

+ +
+ - +
intRedisCluster|int|false
+

See also

@@ -6216,7 +10880,8 @@

See also

@@ -6228,11 +10893,10 @@

See also

-

- - mixed - getoption(int $option) - + +

+ + RedisCluster|string|bool lget(string $key, int $index)

@@ -6247,22 +10911,29 @@

Parameters

- Redis::getmode + +Redis::lastSave
+ + + + + - +
string$key
int$option$index
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|string|bool
+

See also

@@ -6270,7 +10941,7 @@

See also

@@ -6282,11 +10953,10 @@

See also

-

- - RedisCluster|string|false - getrange(string $key, int $start, int $end) - + +

+ + mixed lindex(string $key, int $index)

@@ -6307,26 +10977,23 @@

Parameters

- - - - - - +
- Redis::getoption + \Redis::lget()
int$start
int$end$index
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|falsemixed
+

See also

@@ -6334,7 +11001,8 @@

See also

@@ -6346,11 +11014,10 @@

See also

-

- - RedisCluster|string|array|int|false - lcs(string $key1, string $key2, array|null $options = NULL) - + +

+ + RedisCluster|int|false linsert(string $key, string $pos, mixed $pivot, mixed $value)

@@ -6366,31 +11033,38 @@

Parameters

- Redis::getrange + +Redis::lindex
- + - + - - + + + + + + +
string$key1$key
string$key2$pos
array|null$optionsmixed$pivot
mixed$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|array|int|falseRedisCluster|int|false
+

See also

@@ -6398,7 +11072,8 @@

See also

@@ -6410,11 +11085,10 @@

See also

-

- - RedisCluster|string|bool - getset(string $key, mixed $value) - + +

+ + RedisCluster|int|bool llen(string $key)

@@ -6432,24 +11106,21 @@

Parameters

- - - - -
- Redis::lcs + +Redis::lInsert
string $key
mixed$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|boolRedisCluster|int|bool
+

See also

@@ -6457,7 +11128,8 @@

See also

@@ -6469,11 +11141,10 @@

See also

-

- - int|false - gettransferredbytes() - + +

+ + RedisCluster|bool|string|array lpop(string $key, int $count = 0)

@@ -6484,16 +11155,33 @@

- -

Return Value

+

Parameters

- Redis::getset + +Redis::lLen
+ + + + + + + + + + +
string$key
int$count
+ + +

Return Value

+ +
+ - +
int|falseRedisCluster|bool|string|array
+

See also

@@ -6501,7 +11189,8 @@

See also

@@ -6513,11 +11202,10 @@

See also

-

- - RedisCluster|int|false - hdel(string $key, string $member, string ...$other_members) - + +

+ + RedisCluster|null|bool|int|array lpos(string $key, mixed $value, array|null $options = null)

@@ -6537,27 +11225,29 @@

Parameters

- - + + - - + +
- Redis::gettransferredbytes + +Redis::lPop
string$membermixed$value
string...$other_membersarray|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|null|bool|int|array
+

See also

@@ -6565,7 +11255,8 @@

See also

@@ -6577,11 +11268,10 @@

See also

-

- - RedisCluster|bool - hexists(string $key, string $member) - + +

+ + RedisCluster|int|bool lpush(string $key, mixed $value, mixed ...$other_values)

@@ -6601,22 +11291,29 @@

Parameters

- - + + + + + + +
- Redis::hdel + +Redis::lPos
string$membermixed$value
mixed...$other_values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|int|bool
+

See also

@@ -6624,7 +11321,8 @@

See also

@@ -6636,11 +11334,10 @@

See also

-

- - mixed - hget(string $key, string $member) - + +

+ + RedisCluster|int|bool lpushx(string $key, mixed $value)

@@ -6660,22 +11357,24 @@

Parameters

- - + +
- Redis::hexists + +Redis::lPush
string$membermixed$value
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|bool
+

See also

@@ -6683,7 +11382,8 @@

See also

@@ -6695,11 +11395,10 @@

See also

-

- - RedisCluster|array|false - hgetall(string $key) - + +

+ + RedisCluster|array|false lrange(string $key, int $start, int $end)

@@ -6717,19 +11416,31 @@

Parameters

+ + + + + + + + + +
- Redis::hget + +Redis::lPushx
string $key
int$start
int$end
-

Return Value

+

Return Value

- +
+
RedisCluster|array|false
+

See also

@@ -6737,7 +11448,8 @@

See also

@@ -6749,11 +11461,10 @@

See also

-

- - RedisCluster|int|false - hincrby(string $key, string $member, int $value) - + +

+ + RedisCluster|int|bool lrem(string $key, mixed $value, int $count = 0)

@@ -6773,27 +11484,29 @@

Parameters

- - + + - +
- Redis::hgetall + +Redis::lrange
string$membermixed$value
int$value$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|int|bool
+

See also

@@ -6801,7 +11514,8 @@

See also

@@ -6813,11 +11527,10 @@

See also

-

- - RedisCluster|float|false - hincrbyfloat(string $key, string $member, float $value) - + +

+ + RedisCluster|bool lset(string $key, int $index, mixed $value)

@@ -6837,27 +11550,29 @@

Parameters

- - + + - +
- Redis::hincrby + +Redis::lrem
string$memberint$index
floatmixed $value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|float|falseRedisCluster|bool
+

See also

@@ -6865,7 +11580,8 @@

See also

@@ -6877,11 +11593,10 @@

See also

-

- - RedisCluster|array|false - hkeys(string $key) - + +

+ + RedisCluster|bool ltrim(string $key, int $start, int $end)

@@ -6899,19 +11614,31 @@

Parameters

+ + + + + + + + + +
- Redis::hincrbyfloat + +Redis::lSet
string $key
int$start
int$end
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool
+

See also

@@ -6919,7 +11646,8 @@

See also

@@ -6931,11 +11659,10 @@

See also

-

- - RedisCluster|int|false - hlen(string $key) - + +

+ + RedisCluster|array|false mget(array $keys)

@@ -6950,22 +11677,24 @@

Parameters

- Redis::hkeys + +Redis::ltrim
- - + +
string$keyarray$keys
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|false
+

See also

@@ -6973,7 +11702,8 @@

See also

@@ -6985,11 +11715,10 @@

See also

-

- - RedisCluster|array|false - hmget(string $key, array $keys) - + +

+ + RedisCluster|bool mset(array $key_values)

@@ -7004,27 +11733,24 @@

Parameters

- Redis::hlen + +Redis::mget
- - - - - - +
string$key
array$keys$key_values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool
+

See also

@@ -7032,7 +11758,8 @@

See also

@@ -7044,11 +11771,10 @@

See also

-

- - RedisCluster|bool - hmset(string $key, array $key_values) - + +

+ + RedisCluster|array|false msetnx(array $key_values)

@@ -7063,11 +11789,6 @@

Parameters

- Redis::hmget + +Redis::mset
- - - - - @@ -7075,15 +11796,17 @@

Parameters

string$key
array $key_values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|array|false
+

See also

@@ -7091,7 +11814,8 @@

See also

@@ -7103,11 +11827,10 @@

See also

-

- - array|bool - hscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + Redis|int|false msetex(array $key_vals, int|float|array|null $expiry = null)

@@ -7122,37 +11845,29 @@

Parameters

- Redis::hmset + +Redis::msetnx
- - - - - - - - - - - - + + - - + +
string$key
int|null$iterator
string|null$patternarray$key_vals
int$countint|float|array|null$expiry
-

Return Value

+

Return Value

- +
+
- +
array|boolRedis|int|false
+

See also

@@ -7160,7 +11875,8 @@

See also

@@ -7172,11 +11888,10 @@

See also

-

- - RedisCluster|int|false - hset(string $key, string $member, mixed $value) - + +

+ + RedisCluster|bool multi(int $value = Redis::MULTI)

@@ -7191,56 +11906,36 @@

Parameters

- Redis::hscan + +Redis::msetex
- - - - - - - - - - - +
string$key
string$member
mixedint $value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool
+ -

See also

- - - - - - -
- Redis::hset -
-
-

- - RedisCluster|bool - hsetnx(string $key, string $member, mixed $value) - + +

+ + RedisCluster|int|string|false object(string $subcommand, string $key)

@@ -7256,31 +11951,28 @@

Parameters

- + - - - - - - +
string$key$subcommand
string$member
mixed$value$key
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|int|string|false
+

See also

@@ -7288,7 +11980,8 @@

See also

@@ -7300,11 +11993,10 @@

See also

-

- - RedisCluster|int|false - hstrlen(string $key, string $field) - + +

+ + RedisCluster|bool persist(string $key)

@@ -7322,24 +12014,21 @@

Parameters

- - - - -
- Redis::hsetnx + +Redis::object
string $key
string$field
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool
+

See also

@@ -7347,7 +12036,8 @@

See also

@@ -7359,11 +12049,10 @@

See also

-

- - RedisCluster|array|false - hvals(string $key) - + +

+ + RedisCluster|bool pexpire(string $key, int $timeout, string|null $mode = null)

@@ -7381,19 +12070,31 @@

Parameters

+ + + + + + + + + +
- Redis::hstrlen + +Redis::persist
string $key
int$timeout
string|null$mode
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool
+

See also

@@ -7401,7 +12102,8 @@

See also

@@ -7413,11 +12115,10 @@

See also

-

- - RedisCluster|int|false - incr(string $key, int $by = 1) - + +

+ + RedisCluster|bool pexpireat(string $key, int $timestamp, string|null $mode = null)

@@ -7438,21 +12139,28 @@

Parameters

- + + + + + +
- Redis::hvals + +Redis::pexpire
int$by$timestamp
string|null$mode
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool
+

See also

@@ -7460,7 +12168,8 @@

See also

@@ -7472,11 +12181,10 @@

See also

-

- - RedisCluster|int|false - incrby(string $key, int $value) - + +

+ + RedisCluster|bool pfadd(string $key, array $elements)

@@ -7496,22 +12204,24 @@

Parameters

- - + +
- Redis::incr + +Redis::pexpireAt
int$valuearray$elements
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool
+

See also

@@ -7519,7 +12229,8 @@

See also

@@ -7531,11 +12242,10 @@

See also

-

- - RedisCluster|float|false - incrbyfloat(string $key, float $value) - + +

+ + RedisCluster|int|false pfcount(string $key)

@@ -7553,24 +12263,21 @@

Parameters

- - - - -
- Redis::incrby + +Redis::pfadd
string $key
float$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|float|falseRedisCluster|int|false
+

See also

@@ -7578,7 +12285,8 @@

See also

@@ -7590,49 +12298,47 @@

See also

-

- - RedisCluster|array|false - info(string|array $key_or_address, string ...$sections) - + +

+ + RedisCluster|bool pfmerge(string $key, array $keys)

-

Retrieve information about the connected redis-server. If no arguments are passed to -this function, redis will return every info field. Alternatively you may pass a specific -section you want returned (e.g. 'server', or 'memory') to receive only information pertaining -to that section.

If connected to Redis server >= 7.0.0 you may pass multiple optional sections.

+

No description

+

Parameters

- Redis::incrbyfloat + +Redis::pfcount
- - - + + + - - - + + +
string|array$key_or_address

Either a key name or array with host and port indicating -which cluster node we want to send the command to.

string$key
string...$sections

Optional section(s) you wish Redis server to return.

array$keys
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool
+

See also

@@ -7640,7 +12346,8 @@

See also

@@ -7652,41 +12359,48 @@

See also

-

- - RedisCluster|array|false - keys(string $pattern) - + +

+ + mixed ping(string|array $key_or_address, string|null $message = null)

-

No description

- +

PING an instance in the redis cluster.

Parameters

- https://redis.io/commands/info/ + +Redis::pfmerge
- - - + + + + + + + +
string$patternstring|array$key_or_address

Either a key name or a two element array with host and +address, informing RedisCluster which node to ping.

string|null$message

An optional message to send.

-

Return Value

+

Return Value

- +
+
- - + +
RedisCluster|array|falsemixed

This method always returns true if no message was sent, and the message itself +if one was.

+

See also

@@ -7694,7 +12408,8 @@

See also

@@ -7706,11 +12421,10 @@

See also

-

- - RedisCluster|int|false - lastsave(string|array $key_or_address) - + +

+ + RedisCluster|bool psetex(string $key, int $timeout, string $value)

@@ -7725,22 +12439,34 @@

Parameters

- Redis::keys + +Redis::ping
- - + + + + + + + + + + + +
string|array$key_or_addressstring$key
int$timeout
string$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool
+

See also

@@ -7748,7 +12474,8 @@

See also

@@ -7760,11 +12487,10 @@

See also

-

- - RedisCluster|string|bool - lget(string $key, int $index) - + +

+ + void psubscribe(array $patterns, callable $callback)

@@ -7779,27 +12505,29 @@

Parameters

- Redis::lastsave + +Redis::psetex
- - + + - - + +
string$keyarray$patterns
int$indexcallable$callback
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|boolvoid
+

See also

@@ -7807,7 +12535,8 @@

See also

@@ -7819,11 +12548,10 @@

See also

-

- - mixed - lindex(string $key, int $index) - + +

+ + RedisCluster|int|false pttl(string $key)

@@ -7841,24 +12569,21 @@

Parameters

- - - - -
- Redis::lget + +Redis::psubscribe
string $key
int$index
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|false
+

See also

@@ -7866,7 +12591,8 @@

See also

@@ -7878,11 +12604,10 @@

See also

-

- - RedisCluster|int|false - linsert(string $key, string $pos, mixed $pivot, mixed $value) - + +

+ + RedisCluster|bool|int publish(string $channel, string $message)

@@ -7898,36 +12623,28 @@

Parameters

- Redis::lindex + +Redis::pttl
- + - - - - - - - - - - - +
string$key$channel
string$pos
mixed$pivot
mixed$value$message
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool|int
+

See also

@@ -7935,7 +12652,8 @@

See also

@@ -7947,11 +12665,10 @@

See also

-

- - RedisCluster|int|bool - llen(string $key) - + +

+ + mixed pubsub(string|array $key_or_address, string ...$values)

@@ -7966,22 +12683,29 @@

Parameters

- Redis::linsert + +Redis::publish
+ + + + + - +
string|array$key_or_address
string$key...$values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|boolmixed
+

See also

@@ -7989,7 +12713,8 @@

See also

@@ -8001,11 +12726,10 @@

See also

-

- - RedisCluster|bool|string|array - lpop(string $key, int $count = 0) - + +

+ + bool|array punsubscribe(string $pattern, string ...$other_patterns)

@@ -8021,26 +12745,28 @@

Parameters

- Redis::llen + +Redis::pubsub
- + - - + +
string$key$pattern
int$countstring...$other_patterns
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|string|arraybool|array
+

See also

@@ -8048,7 +12774,8 @@

See also

@@ -8060,11 +12787,10 @@

See also

-

- - RedisCluster|int|bool - lpush(string $key, mixed $value, mixed ...$other_values) - + +

+ + RedisCluster|bool|string randomkey(string|array $key_or_address)

@@ -8079,32 +12805,24 @@

Parameters

- Redis::lpop + +Redis::punsubscribe
- - - - - - - - - - - - + +
string$key
mixed$value
mixed...$other_valuesstring|array$key_or_address
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|boolRedisCluster|bool|string
+

See also

@@ -8112,7 +12830,8 @@

See also

@@ -8124,11 +12843,10 @@

See also

-

- - RedisCluster|int|bool - lpushx(string $key, mixed $value) - + +

+ + mixed rawcommand(string|array $key_or_address, string $command, mixed ...$args)

@@ -8143,27 +12861,34 @@

Parameters

- Redis::lpush + +Redis::randomKey
+ + + + + - + - +
string|array$key_or_address
string$key$command
mixed$value...$args
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|boolmixed
+

See also

@@ -8171,7 +12896,8 @@

See also

@@ -8183,11 +12909,10 @@

See also

-

- - RedisCluster|array|false - lrange(string $key, int $start, int $end) - + +

+ + RedisCluster|bool rename(string $key_src, string $key_dst)

@@ -8203,31 +12928,28 @@

Parameters

- Redis::lpushx + +Redis::rawcommand
- - - - - - + - - + +
string$key
int$start$key_src
int$endstring$key_dst
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool
+

See also

@@ -8235,7 +12957,8 @@

See also

@@ -8247,11 +12970,10 @@

See also

-

- - RedisCluster|int|bool - lrem(string $key, mixed $value, int $count = 0) - + +

+ + RedisCluster|bool renamenx(string $key, string $newkey)

@@ -8271,27 +12993,24 @@

Parameters

- - - - - - - + +
- Redis::lrange + +Redis::rename
mixed$value
int$countstring$newkey
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|boolRedisCluster|bool
+

See also

@@ -8299,7 +13018,8 @@

See also

@@ -8311,11 +13031,10 @@

See also

-

- - RedisCluster|bool - lset(string $key, int $index, mixed $value) - + +

+ + RedisCluster|bool restore(string $key, int $timeout, string $value, array|null $options = null)

@@ -8336,26 +13055,33 @@

Parameters

- + - + + + + + +
- Redis::lrem + +Redis::renameNx
int$index$timeout
mixedstring $value
array|null$options
-

Return Value

+

Return Value

- +
+
RedisCluster|bool
+

See also

@@ -8363,7 +13089,8 @@

See also

@@ -8375,11 +13102,10 @@

See also

-

- - RedisCluster|bool - ltrim(string $key, int $start, int $end) - + +

+ + mixed role(string|array $key_or_address)

@@ -8394,32 +13120,24 @@

Parameters

- Redis::lset + +Redis::restore
- - - - - - - - - - - - + +
string$key
int$start
int$endstring|array$key_or_address
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolmixed
+

See also

@@ -8427,7 +13145,8 @@

See also

@@ -8439,11 +13158,10 @@

See also

-

- - RedisCluster|array|false - mget(array $keys) - + +

+ + RedisCluster|bool|string|array rpop(string $key, int $count = 0)

@@ -8458,22 +13176,29 @@

Parameters

- Redis::ltrim + +Redis::role
- - + + + + + + +
array$keysstring$key
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool|string|array
+

See also

@@ -8481,7 +13206,8 @@

See also

@@ -8493,11 +13219,10 @@

See also

-

- - RedisCluster|bool - mset(array $key_values) - + +

+ + RedisCluster|bool|string rpoplpush(string $src, string $dst)

@@ -8512,22 +13237,29 @@

Parameters

- Redis::mget + +Redis::rPop
- - + + + + + + +
array$key_valuesstring$src
string$dst
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|bool|string
+

See also

@@ -8535,7 +13267,8 @@

See also

@@ -8547,11 +13280,10 @@

See also

-

- - RedisCluster|array|false - msetnx(array $key_values) - + +

+ + RedisCluster|int|false rpush(string $key, mixed ...$elements)

@@ -8566,22 +13298,29 @@

Parameters

- Redis::mset + +Redis::rpoplpush
- - + + + + + + +
array$key_valuesstring$key
mixed...$elements
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|int|false
+

See also

@@ -8589,7 +13328,8 @@

See also

@@ -8601,11 +13341,10 @@

See also

-

- - RedisCluster|bool - multi(int $value = Redis::MULTI) - + +

+ + RedisCluster|bool|int rpushx(string $key, string $value)

@@ -8620,35 +13359,53 @@

Parameters

- Redis::msetnx + +Redis::rPush
- + + + + + +
intstring$key
string $value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|bool|int
+ +

See also

+ + + + + + +
+ +Redis::rPushx +
+
-

- - RedisCluster|int|string|false - object(string $subcommand, string $key) - + +

+ + RedisCluster|int|false sadd(string $key, mixed $value, mixed ...$other_values)

@@ -8664,26 +13421,33 @@

Parameters

- + - - + + + + + + +
string$subcommand$key
string$keymixed$value
mixed...$other_values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|string|falseRedisCluster|int|false
+

See also

@@ -8691,7 +13455,8 @@

See also

@@ -8703,11 +13468,10 @@

See also

-

- - RedisCluster|bool - persist(string $key) - + +

+ + RedisCluster|bool|int saddarray(string $key, array $values)

@@ -8725,19 +13489,26 @@

Parameters

+ + + + +
- Redis::object + +Redis::sAdd
string $key
array$values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|bool|int
+

See also

@@ -8745,7 +13516,8 @@

See also

@@ -8757,11 +13529,10 @@

See also

-

- - RedisCluster|bool - pexpire(string $key, int $timeout, string|null $mode = NULL) - + +

+ + RedisCluster|bool save(string|array $key_or_address)

@@ -8776,32 +13547,24 @@

Parameters

- Redis::persist + +Redis::sAddArray
- - - - - - - - - - - - + +
string$key
int$timeout
string|null$modestring|array$key_or_address
-

Return Value

+

Return Value

- +
+
RedisCluster|bool
+

See also

@@ -8809,7 +13572,8 @@

See also

@@ -8821,11 +13585,10 @@

See also

-

- - RedisCluster|bool - pexpireat(string $key, int $timestamp, string|null $mode = NULL) - + +

+ + bool|array scan(null|int|string $iterator, string|array $key_or_address, string|null $pattern = null, int $count = 0)

@@ -8840,32 +13603,39 @@

Parameters

- Redis::pexpire + +Redis::save
- - + + - - + + - + + + + + +
string$keynull|int|string$iterator
int$timestampstring|array$key_or_address
string|null$mode$pattern
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolbool|array
+

See also

@@ -8873,7 +13643,8 @@

See also

@@ -8885,11 +13656,10 @@

See also

-

- - RedisCluster|bool - pfadd(string $key, array $elements) - + +

+ + RedisCluster|int|false scard(string $key)

@@ -8907,24 +13677,21 @@

Parameters

- - - - -
- Redis::pexpireat + +Redis::scan
string $key
array$elements
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|int|false
+

See also

@@ -8932,8 +13699,8 @@

See also

@@ -8945,11 +13712,10 @@

See also

-

- - RedisCluster|int|false - pfcount(string $key) - + +

+ + mixed script(string|array $key_or_address, mixed ...$args)

@@ -8964,22 +13730,29 @@

Parameters

- -Redis::pfadd + +Redis::scard
- - + + + + + + +
string$keystring|array$key_or_address
mixed...$args
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falsemixed
+

See also

@@ -8987,8 +13760,8 @@

See also

@@ -9000,11 +13773,10 @@

See also

-

- - RedisCluster|bool - pfmerge(string $key, array $keys) - + +

+ + RedisCluster|array|false sdiff(string $key, string ...$other_keys)

@@ -9024,22 +13796,24 @@

Parameters

- - + +
- -Redis::pfcount + +Redis::script
array$keysstring...$other_keys
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|array|false
+

See also

@@ -9047,8 +13821,8 @@

See also

@@ -9060,47 +13834,52 @@

See also

-

- - mixed - ping(string|array $key_or_address, string|null $message = NULL) - + +

+ + RedisCluster|int|false sdiffstore(string $dst, string $key, string ...$other_keys)

-

PING an instance in the redis cluster.

+

No description

+

Parameters

- -Redis::pfmerge + +Redis::sDiff
- - - + + + - - - + + + + + + + +
string|array$key_or_address

Either a key name or a two element array with host and -address, informing RedisCluster which node to ping.

string$dst
string|null$message

An optional message to send.

string$key
string...$other_keys
-

Return Value

+

Return Value

- +
+
- - + +
mixed

This method always returns true if no message was sent, and the message itself -if one was.

RedisCluster|int|false
+

See also

@@ -9108,8 +13887,8 @@

See also

@@ -9121,11 +13900,10 @@

See also

-

- - RedisCluster|bool - psetex(string $key, int $timeout, string $value) - + +

+ + RedisCluster|string|bool set(string $key, mixed $value, mixed $options = null)

@@ -9145,27 +13923,29 @@

Parameters

- - + + - - + +
- -Redis::ping + +Redis::sDiffStore
int$timeoutmixed$value
string$valuemixed$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|string|bool
+

See also

@@ -9173,7 +13953,7 @@

See also

@@ -9185,11 +13965,10 @@

See also

-

- - void - psubscribe(array $patterns, callable $callback) - + +

+ + RedisCluster|int|false setbit(string $key, int $offset, bool $onoff)

@@ -9204,27 +13983,34 @@

Parameters

- Redis::psetex + https://redis.io/commands/set
- - + + - - + + + + + + +
array$patternsstring$key
callable$callbackint$offset
bool$onoff
-

Return Value

+

Return Value

- +
+
- +
voidRedisCluster|int|false
+

See also

@@ -9232,7 +14018,8 @@

See also

@@ -9244,11 +14031,10 @@

See also

-

- - RedisCluster|int|false - pttl(string $key) - + +

+ + RedisCluster|bool setex(string $key, int $expire, mixed $value)

@@ -9266,19 +14052,31 @@

Parameters

+ + + + + + + + + +
- Redis::psubscribe + +Redis::setBit
string $key
int$expire
mixed$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool
+

See also

@@ -9286,7 +14084,8 @@

See also

@@ -9298,11 +14097,10 @@

See also

-

- - RedisCluster|bool - publish(string $channel, string $message) - + +

+ + RedisCluster|bool setnx(string $key, mixed $value)

@@ -9318,26 +14116,28 @@

Parameters

- Redis::pttl + +Redis::setex
- + - - + +
string$channel$key
string$messagemixed$value
-

Return Value

+

Return Value

- +
+
RedisCluster|bool
+

See also

@@ -9345,7 +14145,8 @@

See also

@@ -9357,11 +14158,10 @@

See also

-

- - mixed - pubsub(string|array $key_or_address, string ...$values) - + +

+ + bool setoption(int $option, mixed $value)

@@ -9376,27 +14176,29 @@

Parameters

- Redis::publish + +Redis::setnx
- - + + - - + +
string|array$key_or_addressint$option
string...$valuesmixed$value
-

Return Value

+

Return Value

- +
+
- +
mixedbool
+

See also

@@ -9404,7 +14206,8 @@

See also

@@ -9416,11 +14219,10 @@

See also

-

- - bool|array - punsubscribe(string $pattern, string ...$other_patterns) - + +

+ + RedisCluster|int|false setrange(string $key, int $offset, string $value)

@@ -9436,26 +14238,33 @@

Parameters

- Redis::pubsub + +Redis::setOption
- + + + + + + - +
string$pattern$key
int$offset
string...$other_patterns$value
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisCluster|int|false
+

See also

@@ -9463,7 +14272,8 @@

See also

@@ -9475,11 +14285,10 @@

See also

-

- - RedisCluster|bool|string - randomkey(string|array $key_or_address) - + +

+ + RedisCluster|array|false sinter(array|string $key, string ...$other_keys)

@@ -9494,22 +14303,29 @@

Parameters

- Redis::punsubscribe + +Redis::setRange
- - + + + + + + +
string|array$key_or_addressarray|string$key
string...$other_keys
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|stringRedisCluster|array|false
+

See also

@@ -9517,7 +14333,8 @@

See also

@@ -9529,11 +14346,10 @@

See also

-

- - mixed - rawcommand(string|array $key_or_address, string $command, mixed ...$args) - + +

+ + RedisCluster|int|false sintercard(array $keys, int $limit = -1)

@@ -9548,32 +14364,29 @@

Parameters

- Redis::randomkey + +Redis::sInter
- - - - - - - + + - - + +
string|array$key_or_address
string$commandarray$keys
mixed...$argsint$limit
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|false
+

See also

@@ -9581,7 +14394,8 @@

See also

@@ -9593,11 +14407,10 @@

See also

-

- - RedisCluster|bool - rename(string $key_src, string $key_dst) - + +

+ + RedisCluster|int|false sinterstore(array|string $key, string ...$other_keys)

@@ -9612,27 +14425,29 @@

Parameters

- Redis::rawcommand + +Redis::sintercard
- - + + - +
string$key_srcarray|string$key
string$key_dst...$other_keys
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|int|false
+

See also

@@ -9640,7 +14455,8 @@

See also

@@ -9652,11 +14468,10 @@

See also

-

- - RedisCluster|bool - renamenx(string $key, string $newkey) - + +

+ + RedisCluster|bool sismember(string $key, mixed $value)

@@ -9676,22 +14491,24 @@

Parameters

- - + +
- Redis::rename + +Redis::sInterStore
string$newkeymixed$value
-

Return Value

+

Return Value

- +
+
RedisCluster|bool
+

See also

@@ -9699,7 +14516,8 @@

See also

@@ -9711,11 +14529,10 @@

See also

-

- - RedisCluster|bool - restore(string $key, int $timeout, string $value, array|null $options = NULL) - + +

+ + RedisCluster|array|false smismember(string $key, string $member, string ...$other_members)

@@ -9733,34 +14550,31 @@

Parameters

- - - - - - + - - + +
- Redis::renamenx + +Redis::sismember
string $key
int$timeout
string$value$member
array|null$optionsstring...$other_members
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|array|false
+

See also

@@ -9768,7 +14582,8 @@

See also

@@ -9780,11 +14595,10 @@

See also

-

- - mixed - role(string|array $key_or_address) - + +

+ + mixed slowlog(string|array $key_or_address, mixed ...$args)

@@ -9802,19 +14616,26 @@

Parameters

+ + + + +
- Redis::restore + +Redis::sMisMember
string|array $key_or_address
mixed...$args
-

Return Value

+

Return Value

- +
+
mixed
+

See also

@@ -9822,7 +14643,8 @@

See also

@@ -9834,11 +14656,10 @@

See also

-

- - RedisCluster|bool|string|array - rpop(string $key, int $count = 0) - + +

+ + RedisCluster|array|false smembers(string $key)

@@ -9856,24 +14677,21 @@

Parameters

- - - - -
- Redis::role + +Redis::slowlog
string $key
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|string|arrayRedisCluster|array|false
+

See also

@@ -9881,7 +14699,8 @@

See also

@@ -9893,11 +14712,10 @@

See also

-

- - RedisCluster|bool|string - rpoplpush(string $src, string $dst) - + +

+ + RedisCluster|bool smove(string $src, string $dst, string $member)

@@ -9920,19 +14738,26 @@

Parameters

+ + + + +
- \Redis::rpop() + +Redis::sMembers
string $dst
string$member
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|stringRedisCluster|bool
+

See also

@@ -9940,8 +14765,8 @@

See also

@@ -9953,11 +14778,10 @@

See also

-

- - RedisCluster|int|false - rpush(string $key, mixed ...$elements) - + +

+ + RedisCluster|array|bool|int|string sort(string $key, array|null $options = null)

@@ -9977,22 +14801,24 @@

Parameters

- - + +
- -Redis::rpoplpush + +Redis::sMove
mixed...$elementsarray|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|bool|int|string
+

See also

@@ -10000,7 +14826,8 @@

See also

@@ -10012,11 +14839,10 @@

See also

-

- - RedisCluster|bool|int - rpushx(string $key, string $value) - + +

+ + RedisCluster|array|bool|int|string sort_ro(string $key, array|null $options = null)

@@ -10036,22 +14862,24 @@

Parameters

- - + +
- Redis::rpush + +Redis::sort
string$valuearray|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|intRedisCluster|array|bool|int|string
+

See also

@@ -10059,7 +14887,8 @@

See also

@@ -10071,11 +14900,10 @@

See also

-

- - RedisCluster|int|false - sadd(string $key, mixed $value, mixed ...$other_values) - + +

+ + RedisCluster|string|array|false spop(string $key, int $count = 0)

@@ -10095,27 +14923,24 @@

Parameters

- - - - - - - + +
- Redis::rpushx + +Redis::sort_ro
mixed$value
mixed...$other_valuesint$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|string|array|false
+

See also

@@ -10123,7 +14948,8 @@

See also

@@ -10135,11 +14961,10 @@

See also

-

- - RedisCluster|bool|int - saddarray(string $key, array $values) - + +

+ + RedisCluster|string|array|false srandmember(string $key, int $count = 0)

@@ -10159,22 +14984,24 @@

Parameters

- - + +
- \Redis::sadd() + +Redis::sPop
array$valuesint$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|intRedisCluster|string|array|false
+

See also

@@ -10182,7 +15009,8 @@

See also

@@ -10194,11 +15022,10 @@

See also

-

- - RedisCluster|bool - save(string|array $key_or_address) - + +

+ + RedisCluster|int|false srem(string $key, mixed $value, mixed ...$other_values)

@@ -10213,22 +15040,34 @@

Parameters

- \Redis::saddarray() + +Redis::sRandMember
- - + + + + + + + + + + + +
string|array$key_or_addressstring$key
mixed$value
mixed...$other_values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|int|false
+

See also

@@ -10236,7 +15075,8 @@

See also

@@ -10248,11 +15088,10 @@

See also

-

- - bool|array - scan(int|null $iterator, string|array $key_or_address, string|null $pattern = null, int $count = 0) - + +

+ + array|false sscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

@@ -10267,13 +15106,13 @@

Parameters

- Redis::save + +Redis::srem
- - + + - - + + @@ -10289,15 +15128,17 @@

Parameters

int|null$iteratorstring$key
string|array$key_or_addressnull|int|string$iterator
-

Return Value

+

Return Value

- +
+
- +
bool|arrayarray|false
+

See also

@@ -10305,7 +15146,8 @@

See also

@@ -10317,11 +15159,10 @@

See also

-

- - RedisCluster|int|false - scard(string $key) - + +

+ + RedisCluster|int|false strlen(string $key)

@@ -10343,15 +15184,17 @@

Parameters

- Redis::scan + +Redis::sscan
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -10359,7 +15202,8 @@

See also

@@ -10371,11 +15215,10 @@

See also

-

- - mixed - script(string|array $key_or_address, mixed ...$args) - + +

+ + void subscribe(array $channels, callable $cb)

@@ -10390,27 +15233,29 @@

Parameters

- Redis::scard + +Redis::strlen
- - + + - - + +
string|array$key_or_addressarray$channels
mixed...$argscallable$cb
-

Return Value

+

Return Value

- +
+
- +
mixedvoid
+

See also

@@ -10418,7 +15263,8 @@

See also

@@ -10430,11 +15276,10 @@

See also

-

- - RedisCluster|array|false - sdiff(string $key, string ...$other_keys) - + +

+ + RedisCluster|bool|array sunion(string $key, string ...$other_keys)

@@ -10461,15 +15306,17 @@

Parameters

- Redis::script + +Redis::subscribe
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool|array
+

See also

@@ -10477,7 +15324,8 @@

See also

@@ -10489,11 +15337,10 @@

See also

-

- - RedisCluster|int|false - sdiffstore(string $dst, string $key, string ...$other_keys) - + +

+ + RedisCluster|int|false sunionstore(string $dst, string $key, string ...$other_keys)

@@ -10525,15 +15372,17 @@

Parameters

- \Redis::sdiff() + +Redis::sUnion
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -10541,7 +15390,8 @@

See also

@@ -10553,11 +15403,10 @@

See also

-

- - RedisCluster|string|bool - set(string $key, mixed $value, mixed $options = NULL) - + +

+ + RedisCluster|bool|array time(string|array $key_or_address)

@@ -10572,32 +15421,24 @@

Parameters

- \Redis::sdiffstore() + +Redis::sUnionStore
- - - - - - - - - - - - + +
string$key
mixed$value
mixed$optionsstring|array$key_or_address
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|boolRedisCluster|bool|array
+

See also

@@ -10605,7 +15446,8 @@

See also

@@ -10617,11 +15459,10 @@

See also

-

- - RedisCluster|int|false - setbit(string $key, int $offset, bool $onoff) - + +

+ + RedisCluster|int|false ttl(string $key)

@@ -10639,29 +15480,21 @@

Parameters

- - - - - - - - - -
- https://redis.io/commands/set + +Redis::time
string $key
int$offset
bool$onoff
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -10669,7 +15502,8 @@

See also

@@ -10681,11 +15515,10 @@

See also

-

- - RedisCluster|bool - setex(string $key, int $expire, mixed $value) - + +

+ + RedisCluster|int|false type(string $key)

@@ -10703,29 +15536,21 @@

Parameters

- - - - - - - - - -
- Redis::setbit + +Redis::ttl
string $key
int$expire
mixed$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|int|false
+

See also

@@ -10733,7 +15558,8 @@

See also

@@ -10745,11 +15571,10 @@

See also

-

- - RedisCluster|bool - setnx(string $key, mixed $value) - + +

+ + bool|array unsubscribe(array $channels)

@@ -10764,27 +15589,24 @@

Parameters

- Redis::setex + +Redis::type
- - - - - - - + +
string$key
mixed$valuearray$channels
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolbool|array
+

See also

@@ -10792,7 +15614,8 @@

See also

@@ -10804,11 +15627,10 @@

See also

-

- - bool - setoption(int $option, mixed $value) - + +

@@ -10823,27 +15645,29 @@

Parameters

- Redis::setnx + +Redis::unsubscribe
- - + + - - + +
int$optionarray|string$key
mixed$valuestring...$other_keys
-

Return Value

+

Return Value

- +
+
- +
boolRedisCluster|int|false
+

See also

@@ -10851,7 +15675,8 @@

See also

@@ -10863,11 +15688,10 @@

See also

-

- - RedisCluster|int|false - setrange(string $key, int $offset, string $value) - + +

+ + bool unwatch()

@@ -10878,36 +15702,18 @@

-

Parameters

- -
- Redis::setoption + +Redis::unlink
- - - - - - - - - - - - - - - -
string$key
int$offset
string$value
- -

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falsebool
+

See also

@@ -10915,7 +15721,8 @@

See also

@@ -10927,11 +15734,10 @@

See also

-

- - RedisCluster|array|false - sinter(array|string $key, string ...$other_keys) - + +

+ + RedisCluster|bool watch(string $key, string ...$other_keys)

@@ -10946,7 +15752,7 @@

Parameters

- Redis::setrange + +Redis::unwatch
- + @@ -10958,15 +15764,17 @@

Parameters

array|stringstring $key
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool
+

See also

@@ -10974,7 +15782,8 @@

See also

@@ -10986,11 +15795,10 @@

See also

-

- - RedisCluster|int|false - sintercard(array $keys, int $limit = -1) - + +

+ + RedisCluster|int|false vadd(string $key, array $values, mixed $element, array|null $options = null)

@@ -11005,86 +15813,39 @@

Parameters

- \Redis::sinter() + +Redis::watch
- - - - - - - + + -
array$keys
int$limitstring$key
- - -

Return Value

- - - - - - -
RedisCluster|int|false
- - - -

See also

- - - + + -
- Redis::sintercard - array$values
- - - - - - -
-

- - RedisCluster|int|false - sinterstore(array|string $key, string ...$other_keys) - -

-
- - - -
-

No description

- -
-
-

Parameters

- - - - - + + + - - + +
array|string$key
mixed$element
string...$other_keysarray|null$options
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -11092,7 +15853,8 @@

See also

@@ -11104,11 +15866,10 @@

See also

-

- - RedisCluster|bool - sismember(string $key, mixed $value) - + +

+ + RedisCluster|array|false vsim(string $key, mixed $member, array|null $options = null)

@@ -11129,21 +15890,28 @@

Parameters

- + + + + + +
- \Redis::sinterstore() + +Redis::vadd
mixed$value$member
array|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|array|false
+

See also

@@ -11151,7 +15919,8 @@

See also

@@ -11163,11 +15932,10 @@

See also

-

- - mixed - slowlog(string|array $key_or_address, mixed ...$args) - + +

+ + RedisCluster|int|false vcard(string $key)

@@ -11182,27 +15950,24 @@

Parameters

- Redis::sismember + +Redis::vsim
- - - - - - - + +
string|array$key_or_address
mixed...$argsstring$key
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|false
+

See also

@@ -11210,7 +15975,8 @@

See also

@@ -11222,11 +15988,10 @@

See also

-

- - RedisCluster|array|false - smembers(string $key) - + +

+ + RedisCluster|int|false vdim(string $key)

@@ -11248,15 +16013,17 @@

Parameters

- Redis::slowlog + +Redis::vcard
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|int|false
+

See also

@@ -11264,7 +16031,8 @@

See also

@@ -11276,11 +16044,10 @@

See also

-

- - RedisCluster|bool - smove(string $src, string $dst, string $member) - + +

+ + RedisCluster|array|false vinfo(string $key)

@@ -11296,31 +16063,23 @@

Parameters

- \Redis::smembers() + +Redis::vdim
- - - - - - - - - - - +
string$src
string$dst
string$member$key
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolRedisCluster|array|false
+

See also

@@ -11328,7 +16087,8 @@

See also

@@ -11340,19 +16100,17 @@

See also

-

- - RedisCluster|array|bool|int|string - sort(string $key, array|null $options = NULL) - + +

+ + RedisCluster|bool vismember(string $key, mixed $member)

-

No description

- +

Check if an element is a member of a vectorset

Parameters

@@ -11361,50 +16119,39 @@

Parameters

- + - - - + + +
- \Redis::smove() + +Redis::vinfo
string $key

The vector set to query.

array|null$optionsmixed$member

The member to check for.

-

Return Value

+

Return Value

- +
+
- - + +
RedisCluster|array|bool|int|stringRedisCluster|bool

true if the member exists, false if it does not.

+ -

See also

- - - - - - -
- -Redis::sort -
-
-

- - RedisCluster|array|bool|int|string - sort_ro(string $key, array|null $options = NULL) - + +

+ + RedisCluster|array|false vemb(string $key, mixed $member, bool $raw = false)

@@ -11424,22 +16171,29 @@

Parameters

- array|null - $options + mixed + $member + + + + bool + $raw -

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|bool|int|stringRedisCluster|array|false
+

See also

@@ -11447,8 +16201,8 @@

See also

@@ -11460,11 +16214,10 @@

See also

-

- - RedisCluster|string|array|false - spop(string $key, int $count = 0) - + +

+ + RedisCluster|array|string|false vrandmember(string $key, int $count = 0)

@@ -11491,15 +16244,17 @@

Parameters

- -Redis::sort_ro + +Redis::vemb
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|array|falseRedisCluster|array|string|false
+

See also

@@ -11507,7 +16262,8 @@

See also

@@ -11519,19 +16275,17 @@

See also

-

- - RedisCluster|string|array|false - srandmember(string $key, int $count = 0) - + +

+ + RedisCluster|array|false vrange(string $key, string $min, string $max, int $count = -1)

-

No description

- +

Retreive a lexographical range of elements from a vector set

Parameters

@@ -11540,49 +16294,49 @@

Parameters

- + + + + + + + + + + + - +
- Redis::spop + +Redis::vrandmember
string $key

The vector set to query.

string$min

The minimum element to return.

string$max

The maximum element to return.

int $count

An optional maximum number of elements to return.

-

Return Value

+

Return Value

- +
+
- - + +
RedisCluster|string|array|falseRedisCluster|array|false

An array of elements in the specified range.`

+ -

See also

- - - - - - -
- Redis::srandmember -
-
-

- - RedisCluster|int|false - srem(string $key, mixed $value, mixed ...$other_values) - + +

+ + RedisCluster|int|false vrem(string $key, mixed $member)

@@ -11603,26 +16357,23 @@

Parameters

mixed - $value - - - - mixed - ...$other_values + $member -

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -11630,7 +16381,8 @@

See also

@@ -11642,11 +16394,10 @@

See also

-

- - array|false - sscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

@@ -11666,32 +16417,29 @@

Parameters

- - - - - - - + + - - + +
- Redis::srem + +Redis::vrem
int|null$iterator
string|null$patternmixed$member
int$countbool$withscores
-

Return Value

+

Return Value

- +
+
- +
array|falseRedisCluster|array|false
+

See also

@@ -11699,7 +16447,8 @@

See also

@@ -11711,11 +16460,10 @@

See also

-

- - RedisCluster|int|false - strlen(string $key) - + +

+ + RedisCluster|array|string|false vgetattr(string $key, mixed $member, bool $decode = true)

@@ -11733,19 +16481,31 @@

Parameters

+ + + + + + + + + +
- Redis::sscan + +Redis::vlinks
string $key
mixed$member
bool$decode
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|string|false
+

See also

@@ -11753,7 +16513,8 @@

See also

@@ -11765,11 +16526,10 @@

See also

-

- - void - subscribe(array $channels, callable $cb) - + +

+ + RedisCluster|int|false vsetattr(string $key, mixed $member, array|string $attributes)

@@ -11784,27 +16544,34 @@

Parameters

- Redis::strlen + +Redis::vgetattr
- - + + - - + + + + + + +
array$channelsstring$key
callable$cbmixed$member
array|string$attributes
-

Return Value

+

Return Value

- +
+
- +
voidRedisCluster|int|false
+

See also

@@ -11812,7 +16579,8 @@

See also

@@ -11824,11 +16592,10 @@

See also

-

- - RedisCluster|bool|array - sunion(string $key, string ...$other_keys) - + +

+ + RedisCluster|array|false gcra(string $key, int $maxBurst, int $requestsPerPeriod, int $period, int $tokens = 0)

@@ -11848,22 +16615,39 @@

Parameters

- - + + + + + + + + + + + + + + + + +
- Redis::subscribe + +Redis::vsetattr
string...$other_keysint$maxBurst
int$requestsPerPeriod
int$period
int$tokens
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|array|false
+

See also

@@ -11871,7 +16655,8 @@

See also

@@ -11883,11 +16668,10 @@

See also

-

- - RedisCluster|int|false - sunionstore(string $dst, string $key, string ...$other_keys) - + +

+ + RedisCluster|int|false xack(string $key, string $group, array $ids)

@@ -11903,31 +16687,33 @@

Parameters

- \Redis::sunion() + +Redis::gcra
- + - + - - + +
string$dst$key
string$key$group
string...$other_keysarray$ids
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -11935,7 +16721,8 @@

See also

@@ -11947,11 +16734,10 @@

See also

-

- - RedisCluster|bool|array - time(string|array $key_or_address) - + +

+ + RedisCluster|string|false xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false)

@@ -11966,22 +16752,44 @@

Parameters

- \Redis::sunionstore() + +Redis::xack
- - + + + + + + + + + + + + + + + + + + + + + +
string|array$key_or_addressstring$key
string$id
array$values
int$maxlen
bool$approx
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|string|false
+

See also

@@ -11989,7 +16797,8 @@

See also

@@ -12001,11 +16810,10 @@

See also

-

- - RedisCluster|int|false - ttl(string $key) - + +

+ + RedisCluster|string|array|false xclaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options)

@@ -12023,19 +16831,46 @@

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + +
- Redis::time + +Redis::xadd
string $key
string$group
string$consumer
int$min_iddle
array$ids
array$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|string|array|false
+

See also

@@ -12043,7 +16878,8 @@

See also

@@ -12055,11 +16891,10 @@

See also

-

- - RedisCluster|int|false - type(string $key) - + +

+ + RedisCluster|int|false xdel(string $key, array $ids)

@@ -12077,19 +16912,26 @@

Parameters

+ + + + +
- Redis::ttl + +Redis::xclaim
string $key
array$ids
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -12097,7 +16939,8 @@

See also

@@ -12109,11 +16952,10 @@

See also

-

- - bool|array - unsubscribe(array $channels) - + +

+ + RedisCluster|array|false xdelex(string $key, array $ids, string|null $mode = null)

@@ -12128,22 +16970,34 @@

Parameters

- Redis::type + +Redis::xdel
+ + + + + - + + + + + +
string$key
array$channels$ids
string|null$mode
-

Return Value

+

Return Value

- +
+
- +
bool|arrayRedisCluster|array|false
+

See also

@@ -12151,7 +17005,8 @@

See also

@@ -12163,11 +17018,10 @@

See also

-

+ + mixed xgroup(string $operation, string|null $key = null, string|null $group = null, string|null $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2)

@@ -12182,27 +17036,49 @@

Parameters

- Redis::unsubscribe + +Redis::xdelex
- + + + + + + - - + + + + + + + + + + + + + + + + +
array|stringstring$operation
string|null $key
string...$other_keysstring|null$group
string|null$id_or_consumer
bool$mkstream
int$entries_read
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falsemixed
+

See also

@@ -12210,7 +17086,8 @@

See also

@@ -12222,11 +17099,10 @@

See also

-

- - bool - unwatch() - + +

+ + RedisCluster|bool|array xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false)

@@ -12237,16 +17113,58 @@

- -

Return Value

+

Parameters

- Redis::unlink + +Redis::xgroup
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$key
string$group
string$consumer
int$min_idle
string$start
int$count
bool$justid
+ + +

Return Value

+ +
+ - +
boolRedisCluster|bool|array
+

See also

@@ -12254,7 +17172,8 @@

See also

@@ -12266,11 +17185,10 @@

See also

-

- - RedisCluster|bool - watch(string $key, string ...$other_keys) - + +

+ + mixed xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1)

@@ -12286,26 +17204,38 @@

Parameters

- Redis::unwatch + +Redis::xautoclaim
- + - - + + + + + + + + + + + +
string$key$operation
string...$other_keysstring|null$arg1
string|null$arg2
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|boolmixed
+

See also

@@ -12313,7 +17243,8 @@

See also

@@ -12325,11 +17256,10 @@

See also

-

- - RedisCluster|int|false - xack(string $key, string $group, array $ids) - + +

+ + RedisCluster|int|false xlen(string $key)

@@ -12347,29 +17277,21 @@

Parameters

- - - - - - - - - -
- Redis::watch + +Redis::xinfo
string $key
string$group
array$ids
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -12377,7 +17299,8 @@

See also

@@ -12389,11 +17312,10 @@

See also

-

- - RedisCluster|string|false - xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false) - + +

+ + RedisCluster|array|false xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null)

@@ -12414,36 +17336,43 @@

Parameters

- + - - + + + + + + + - + - - + +
- Redis::xack + +Redis::xlen
string$id$group
array$valuesstring|null$start
string|null$end
int$maxlen$count
bool$approxstring|null$consumer
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|falseRedisCluster|array|false
+

See also

@@ -12451,7 +17380,8 @@

See also

@@ -12463,11 +17393,10 @@

See also

-

- - RedisCluster|string|array|false - xclaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options) - + +

+ + RedisCluster|bool|array xrange(string $key, string $start, string $end, int $count = -1)

@@ -12488,41 +17417,33 @@

Parameters

- + - + - - - - - - - - - - - +
- Redis::xadd + +Redis::xpending
string$group$start
string$consumer$end
int$min_iddle
array$ids
array$options$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|string|array|falseRedisCluster|bool|array
+

See also

@@ -12530,7 +17451,8 @@

See also

@@ -12542,11 +17464,10 @@

See also

-

- - RedisCluster|int|false - xdel(string $key, array $ids) - + +

+ + RedisCluster|bool|array xread(array $streams, int $count = -1, int $block = -1)

@@ -12561,27 +17482,34 @@

Parameters

- Redis::xclaim + +Redis::xrange
- - + + - - + + + + + + +
string$keyarray$streams
array$idsint$count
int$block
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool|array
+

See also

@@ -12589,7 +17517,8 @@

See also

@@ -12601,11 +17530,10 @@

See also

-

- - mixed - xgroup(string $operation, string $key = null, string $group = null, string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2) - + +

+ + RedisCluster|bool|array xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1)

@@ -12621,46 +17549,43 @@

Parameters

- Redis::xdel + +Redis::xread
- - - - - - + - + - - + + - - + + - +
string$operation
string$key$group
string$group$consumer
string$id_or_consumerarray$streams
bool$mkstreamint$count
int$entries_read$block
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|bool|array
+

See also

@@ -12668,7 +17593,8 @@

See also

@@ -12680,11 +17606,10 @@

See also

-

- - Redis|bool|array - xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) - + +

+ + RedisCluster|bool|array xrevrange(string $key, string $start, string $end, int $count = -1)

@@ -12705,46 +17630,33 @@

Parameters

- - - - - - - - - - - + - + - - - - -
- Redis::xgroup + +Redis::xreadgroup
string$group
string$consumer
int$min_idle$start
string$start$end
int $count
bool$justid
-

Return Value

+

Return Value

- +
+
- +
Redis|bool|arrayRedisCluster|bool|array
+

See also

@@ -12752,7 +17664,8 @@

See also

@@ -12764,11 +17677,10 @@

See also

-

- - mixed - xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1) - + +

+ + RedisCluster|int|false xtrim(string $key, int $maxlen, bool $approx = false, bool $minid = false, int $limit = -1)

@@ -12784,36 +17696,43 @@

Parameters

- Redis::xautoclaim + +Redis::xrevrange
- + - - + + - - + + + + + + + - +
string$operation$key
string|null$arg1int$maxlen
string|null$arg2bool$approx
bool$minid
int$count$limit
-

Return Value

+

Return Value

- +
+
- +
mixedRedisCluster|int|false
+

See also

@@ -12821,7 +17740,8 @@

See also

@@ -12833,11 +17753,10 @@

See also

-

- - RedisCluster|int|false - xlen(string $key) - + +

+ + RedisCluster|int|float|false zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)

@@ -12855,19 +17774,31 @@

Parameters

+ + + + + + + + + +
- Redis::xinfo + +Redis::xtrim
string $key
array|float$score_or_options
mixed...$more_scores_and_mems
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|int|float|false
+

See also

@@ -12875,7 +17806,8 @@

See also

@@ -12887,11 +17819,10 @@

See also

-

- - RedisCluster|array|false - xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null) - + +

+ + RedisCluster|int|false zcard(string $key)

@@ -12909,44 +17840,21 @@

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - -
- Redis::xlen + +Redis::zAdd
string $key
string$group
string|null$start
string|null$end
int$count
string|null$consumer
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|int|false
+

See also

@@ -12954,7 +17862,8 @@

See also

@@ -12966,11 +17875,10 @@

See also

-

- - RedisCluster|bool|array - xrange(string $key, string $start, string $end, int $count = -1) - + +

+ + RedisCluster|int|false zcount(string $key, string $start, string $end)

@@ -12998,24 +17906,21 @@

Parameters

- - - - -
- Redis::xpending + +Redis::zCard
string $end
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|int|false
+

See also

@@ -13023,7 +17928,8 @@

See also

@@ -13035,11 +17941,10 @@

See also

-

- - RedisCluster|bool|array - xread(array $streams, int $count = -1, int $block = -1) - + +

+ + RedisCluster|float|false zincrby(string $key, float $value, string $member)

@@ -13054,32 +17959,34 @@

Parameters

- Redis::xrange + +Redis::zCount
- - + + - - + + - - + +
array$streamsstring$key
int$countfloat$value
int$blockstring$member
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|float|false
+

See also

@@ -13087,7 +17994,8 @@

See also

@@ -13099,11 +18007,10 @@

See also

-

- - RedisCluster|bool|array - xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1) - + +

+ + RedisCluster|int|false zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)

@@ -13119,41 +18026,38 @@

Parameters

- Redis::xread + +Redis::zIncrBy
- - - - - - + - + - - + + - - + +
string$group
string$consumer$dst
array$streams$keys
int$countarray|null$weights
int$blockstring|null$aggregate
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|int|false
+

See also

@@ -13161,7 +18065,8 @@

See also

@@ -13173,11 +18078,10 @@

See also

-

- - RedisCluster|bool|array - xrevrange(string $key, string $start, string $end, int $count = -1) - + +

+ + RedisCluster|int|false zintercard(array $keys, int $limit = -1)

@@ -13192,37 +18096,29 @@

Parameters

- Redis::xreadgroup + +Redis::zinterstore
- - - - - - - - - - - - + + - +
string$key
string$start
string$endarray$keys
int$count$limit
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|int|false
+

See also

@@ -13230,7 +18126,8 @@

See also

@@ -13242,11 +18139,10 @@

See also

-

- - RedisCluster|int|false - xtrim(string $key, int $maxlen, bool $approx = false, bool $minid = false, int $limit = -1) - + +

+ + RedisCluster|int|false zlexcount(string $key, string $min, string $max)

@@ -13266,37 +18162,29 @@

Parameters

- - - - - - - - - - - - + + - - + +
- Redis::xrevrange + +Redis::zintercard
int$maxlen
bool$approx
bool$minidstring$min
int$limitstring$max
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -13304,7 +18192,8 @@

See also

@@ -13316,11 +18205,10 @@

See also

-

- - RedisCluster|int|false - zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems) - + +

+ + RedisCluster|bool|array zpopmax(string $key, int|null $value = null)

@@ -13340,27 +18228,24 @@

Parameters

- - - - - - - + +
- Redis::xtrim + +Redis::zLexCount
array|float$score_or_options
mixed...$more_scores_and_memsint|null$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool|array
+

See also

@@ -13368,7 +18253,8 @@

See also

@@ -13380,11 +18266,10 @@

See also

-

- - RedisCluster|int|false - zcard(string $key) - + +

+ + RedisCluster|bool|array zpopmin(string $key, int|null $value = null)

@@ -13402,19 +18287,26 @@

Parameters

+ + + + +
- Redis::zadd + +Redis::zPopMax
string $key
int|null$value
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool|array
+

See also

@@ -13422,7 +18314,8 @@

See also

@@ -13434,11 +18327,10 @@

See also

-

- - RedisCluster|int|false - zcount(string $key, string $start, string $end) - + +

+ + RedisCluster|array|bool zrange(string $key, mixed $start, mixed $end, array|bool|null $options = null)

@@ -13458,27 +18350,34 @@

Parameters

- + - + + + + + +
- Redis::zcard + +Redis::zPopMin
stringmixed $start
stringmixed $end
array|bool|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|bool
+

See also

@@ -13486,7 +18385,8 @@

See also

@@ -13498,11 +18398,10 @@

See also

-

- - RedisCluster|float|false - zincrby(string $key, float $value, string $member) - + +

+ + RedisCluster|int|false zrangestore(string $dstkey, string $srckey, int $start, int $end, array|bool|null $options = null)

@@ -13518,31 +18417,43 @@

Parameters

- Redis::zcount + +Redis::zRange
- + - - + + - - + + + + + + + + + + + +
string$key$dstkey
float$valuestring$srckey
string$memberint$start
int$end
array|bool|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|float|falseRedisCluster|int|false
+

See also

@@ -13550,7 +18461,8 @@

See also

@@ -13562,11 +18474,10 @@

See also

-

- - RedisCluster|int|false - zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null) - + +

+ + RedisCluster|string|array zrandmember(string $key, array|null $options = null)

@@ -13582,36 +18493,28 @@

Parameters

- Redis::zincrby + +Redis::zrangestore
- - - - - - + - - - - - - +
string$dst
array$keys$key
array|null$weights
string|null$aggregate$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|string|array
+

See also

@@ -13619,7 +18522,7 @@

See also

@@ -13631,11 +18534,10 @@

See also

-

- - RedisCluster|int|false - zintercard(array $keys, int $limit = -1) - + +

+ + RedisCluster|array|false zrangebylex(string $key, string $min, string $max, int $offset = -1, int $count = -1)

@@ -13650,27 +18552,44 @@

Parameters

- Redis::zinterstore + https://redis.io/commands/zrandmember
- - + + + + + + + + + + + + - + + + + + +
array$keysstring$key
string$min
string$max
int$limit$offset
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|false
+

See also

@@ -13678,7 +18597,8 @@

See also

@@ -13690,11 +18610,10 @@

See also

-

- - RedisCluster|int|false - zlexcount(string $key, string $min, string $max) - + +

+ + RedisCluster|array|false zrangebyscore(string $key, string $start, string $end, array $options = [])

@@ -13715,26 +18634,33 @@

Parameters

- + - + + + + + +
- Redis::zintercard + +Redis::zRangeByLex
string$min$start
string$max$end
array$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|array|false
+

See also

@@ -13742,7 +18668,8 @@

See also

@@ -13754,11 +18681,10 @@

See also

-

- - RedisCluster|bool|array - zpopmax(string $key, int $value = null) - + +

+ + RedisCluster|int|false zrank(string $key, mixed $member)

@@ -13778,22 +18704,24 @@

Parameters

- - + +
- Redis::zlexcount + +Redis::zRangeByScore
int$valuemixed$member
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|int|false
+

See also

@@ -13801,7 +18729,8 @@

See also

@@ -13813,11 +18742,10 @@

See also

-

- - RedisCluster|bool|array - zpopmin(string $key, int $value = null) - + +

+ + RedisCluster|int|false zrem(string $key, string $value, string ...$other_values)

@@ -13837,22 +18765,29 @@

Parameters

- - + + + + + + +
- Redis::zpopmax + +Redis::zRank
int$valuestring$value
string...$other_values
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|int|false
+

See also

@@ -13860,7 +18795,8 @@

See also

@@ -13872,11 +18808,10 @@

See also

-

- - RedisCluster|array|bool - zrange(string $key, mixed $start, mixed $end, array|bool|null $options = null) - + +

+ + RedisCluster|int|false zremrangebylex(string $key, string $min, string $max)

@@ -13896,32 +18831,29 @@

Parameters

- - - - - - - + + - - + +
- Redis::zpopmin + +Redis::zRem
mixed$start
mixed$endstring$min
array|bool|null$optionsstring$max
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|boolRedisCluster|int|false
+

See also

@@ -13929,7 +18861,8 @@

See also

@@ -13941,11 +18874,10 @@

See also

-

- - RedisCluster|int|false - zrangestore(string $dstkey, string $srckey, int $start, int $end, array|bool|null $options = null) - + +

+ + RedisCluster|int|false zremrangebyrank(string $key, string $min, string $max)

@@ -13961,41 +18893,33 @@

Parameters

- Redis::zrange + +Redis::zRemRangeByLex
- + - - - - - - - - - - - + - - + +
string$dstkey$key
string$srckey
int$start
int$end$min
array|bool|null$optionsstring$max
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -14003,7 +18927,8 @@

See also

@@ -14015,11 +18940,10 @@

See also

-

- - RedisCluster|array|false - zrangebylex(string $key, string $min, string $max, int $offset = -1, int $count = -1) - + +

+ + RedisCluster|int|false zremrangebyscore(string $key, string $min, string $max)

@@ -14047,29 +18971,21 @@

Parameters

- - - - - - - - - -
- Redis::zrangestore + +Redis::zRemRangeByRank
string $max
int$offset
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|int|false
+

See also

@@ -14077,7 +18993,8 @@

See also

@@ -14089,11 +19006,10 @@

See also

-

- - RedisCluster|array|false - zrangebyscore(string $key, string $start, string $end, array $options = []) - + +

+ + RedisCluster|bool|array zrevrange(string $key, string $min, string $max, array|null $options = null)

@@ -14114,31 +19030,33 @@

Parameters

- + - + - +
- Redis::zrangebylex + +Redis::zRemRangeByScore
string$start$min
string$end$max
arrayarray|null $options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|array|falseRedisCluster|bool|array
+

See also

@@ -14146,7 +19064,8 @@

See also

@@ -14158,11 +19077,10 @@

See also

-

- - RedisCluster|int|false - zrank(string $key, mixed $member) - + +

+ + RedisCluster|bool|array zrevrangebylex(string $key, string $min, string $max, array|null $options = null)

@@ -14182,22 +19100,34 @@

Parameters

- - + + + + + + + + + + + +
- Redis::zrangebyscore + +Redis::zRevRange
mixed$memberstring$min
string$max
array|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool|array
+

See also

@@ -14205,7 +19135,8 @@

See also

@@ -14217,11 +19148,10 @@

See also

-

- - RedisCluster|int|false - zrem(string $key, string $value, string ...$other_values) - + +

+ + RedisCluster|bool|array zrevrangebyscore(string $key, string $min, string $max, array|null $options = null)

@@ -14242,26 +19172,33 @@

Parameters

- + - + + + + + +
- Redis::zrank + +Redis::zRevRangeByLex
string$value$min
string...$other_values$max
array|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool|array
+

See also

@@ -14269,7 +19206,8 @@

See also

@@ -14281,11 +19219,10 @@

See also

-

- - RedisCluster|int|false - zremrangebylex(string $key, string $min, string $max) - + +

+ + RedisCluster|int|false zrevrank(string $key, mixed $member)

@@ -14305,27 +19242,24 @@

Parameters

- - - - - - - + +
- Redis::zrem + +Redis::zRevRangeByScore
string$min
string$maxmixed$member
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -14333,7 +19267,8 @@

See also

@@ -14345,11 +19280,10 @@

See also

-

- - RedisCluster|int|false - zremrangebyrank(string $key, string $min, string $max) - + +

+ + RedisCluster|bool|array zscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)

@@ -14369,27 +19303,34 @@

Parameters

- - + + - - + + + + + + +
- Redis::zremrangebylex + +Redis::zRevRank
string$minnull|int|string$iterator
string$maxstring|null$pattern
int$count
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|bool|array
+

See also

@@ -14397,7 +19338,8 @@

See also

@@ -14409,11 +19351,10 @@

See also

-

- - RedisCluster|int|false - zremrangebyscore(string $key, string $min, string $max) - + +

+ + RedisCluster|float|false zscore(string $key, mixed $member)

@@ -14433,27 +19374,24 @@

Parameters

- - - - - - - + +
- Redis::zremrangebyrank + +Redis::zscan
string$min
string$maxmixed$member
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|float|false
+

See also

@@ -14461,7 +19399,8 @@

See also

@@ -14473,11 +19412,10 @@

See also

-

- - RedisCluster|bool|array - zrevrange(string $key, string $min, string $max, array $options = null) - + +

+ + RedisCluster|array|false zmscore(string $key, mixed $member, mixed ...$other_members)

@@ -14497,32 +19435,29 @@

Parameters

- - - - - - - + + - - + +
- Redis::zremrangebyscore + +Redis::zScore
string$min
string$maxmixed$member
array$optionsmixed...$other_members
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|array|false
+

See also

@@ -14530,7 +19465,7 @@

See also

@@ -14542,11 +19477,10 @@

See also

-

- - RedisCluster|bool|array - zrevrangebylex(string $key, string $min, string $max, array $options = null) - + +

+ + RedisCluster|int|false zunionstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)

@@ -14562,36 +19496,38 @@

Parameters

- Redis::zrevrange + https://redis.io/commands/zmscore
- + - - + + - - + + - - + +
string$key$dst
string$minarray$keys
string$maxarray|null$weights
array$optionsstring|null$aggregate
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|int|false
+

See also

@@ -14599,7 +19535,8 @@

See also

@@ -14611,11 +19548,10 @@

See also

-

- - RedisCluster|bool|array - zrevrangebyscore(string $key, string $min, string $max, array $options = null) - + +

+ + RedisCluster|array|false zinter(array $keys, array|null $weights = null, array|null $options = null)

@@ -14630,37 +19566,34 @@

Parameters

- Redis::zrevrangebylex + +Redis::zunionstore
- - - - - - - + + - - + + - +
string$key
string$minarray$keys
string$maxarray|null$weights
arrayarray|null $options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|array|false
+

See also

@@ -14668,7 +19601,7 @@

See also

@@ -14680,11 +19613,10 @@

See also

-

- - RedisCluster|int|false - zrevrank(string $key, mixed $member) - + +

+ + RedisCluster|int|false zdiffstore(string $dst, array $keys)

@@ -14700,26 +19632,28 @@

Parameters

- Redis::zrevrangebyscore + https://redis.io/commands/zinter
- + - - + +
string$key$dst
mixed$memberarray$keys
-

Return Value

+

Return Value

- +
+
RedisCluster|int|false
+

See also

@@ -14727,7 +19661,7 @@

See also

@@ -14739,11 +19673,10 @@

See also

-

- - RedisCluster|bool|array - zscan(string $key, int|null $iterator, string|null $pattern = null, int $count = 0) - + +

+ + RedisCluster|array|false zunion(array $keys, array|null $weights = null, array|null $options = null)

@@ -14758,37 +19691,34 @@

Parameters

- Redis::zrevrank + https://redis.io/commands/zdiffstore
- - - - - - - + + - - + + - - + +
string$key
int|null$iteratorarray$keys
string|null$patternarray|null$weights
int$countarray|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|bool|arrayRedisCluster|array|false
+

See also

@@ -14796,7 +19726,7 @@

See also

@@ -14808,11 +19738,10 @@

See also

-

- - RedisCluster|float|false - zscore(string $key, mixed $member) - + +

+ + RedisCluster|array|false zdiff(array $keys, array|null $options = null)

@@ -14827,27 +19756,29 @@

Parameters

- Redis::zscan + https://redis.io/commands/zunion
- - + + - - + +
string$keyarray$keys
mixed$memberarray|null$options
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|float|falseRedisCluster|array|false
+

See also

@@ -14855,7 +19786,7 @@

See also

@@ -14867,11 +19798,10 @@

See also

-

- - RedisCluster|int|false - zunionstore(string $dst, array $keys, array|null $weights = NULL, string|null $aggregate = NULL) - + +

+ + RedisCluster|string|false digest(string $key)

@@ -14887,36 +19817,23 @@

Parameters

- Redis::zscore + https://redis.io/commands/zdiff
- - - - - - - - - - - - - - - - +
string$dst
array$keys
array|null$weights
string|null$aggregate$key
-

Return Value

+

Return Value

- +
+
- +
RedisCluster|int|falseRedisCluster|string|false
+

See also

@@ -14924,7 +19841,7 @@

See also

diff --git a/docs/RedisClusterException.html b/docs/RedisClusterException.html index aeda6a4c86..ad2467c649 100644 --- a/docs/RedisClusterException.html +++ b/docs/RedisClusterException.html @@ -5,7 +5,7 @@ RedisClusterException | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> @@ -83,7 +472,7 @@

RedisClusterException

class - RedisClusterException extends RuntimeException (View source) + RedisClusterException extends RuntimeException (View source)

diff --git a/docs/RedisException.html b/docs/RedisException.html index 66c373b690..45ddaad8fa 100644 --- a/docs/RedisException.html +++ b/docs/RedisException.html @@ -5,7 +5,7 @@ RedisException | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> @@ -83,7 +472,7 @@

RedisException

class - RedisException extends RuntimeException (View source) + RedisException extends RuntimeException (View source)

diff --git a/docs/RedisSentinel.html b/docs/RedisSentinel.html index ac95dd5c28..98f66de172 100644 --- a/docs/RedisSentinel.html +++ b/docs/RedisSentinel.html @@ -5,7 +5,7 @@ RedisSentinel | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> @@ -83,7 +472,7 @@

RedisSentinel

class - RedisSentinel (View source) + RedisSentinel (View source)

@@ -102,7 +491,7 @@

Methods

- __construct(string $host, int $port = 26379, float $timeout = 0, mixed $persistent = null, int $retry_interval = 0, float $read_timeout = 0, mixed $auth = null, array $context = null) + __construct(array|null $options = null)

No description

@@ -198,7 +587,7 @@

Methods

reset(string $pattern) @@ -236,11 +625,10 @@

Details

-

- - - __construct(string $host, int $port = 26379, float $timeout = 0, mixed $persistent = null, int $retry_interval = 0, float $read_timeout = 0, mixed $auth = null, array $context = null) - + +

+ + __construct(array|null $options = null)

@@ -255,43 +643,8 @@

Parameters

- Redis::zunionstore + https://redis.io/commands/digest
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
string$host
int$port
float$timeout
mixed$persistent
int$retry_interval
float$read_timeout
mixed$auth
array$contextarray|null$options
@@ -305,11 +658,10 @@

Parameters

-

- - bool|RedisSentinel - ckquorum(string $master) - + +

+ + bool|RedisSentinel ckquorum(string $master)

@@ -331,15 +683,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
bool|RedisSentinel
+
@@ -348,11 +702,10 @@

Return Value

-

- - bool|RedisSentinel - failover(string $master) - + +

+ + bool|RedisSentinel failover(string $master)

@@ -374,15 +727,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
bool|RedisSentinel
+
@@ -391,11 +746,10 @@

Return Value

-

- - bool|RedisSentinel - flushconfig() - + +

+ + bool|RedisSentinel flushconfig()

@@ -407,15 +761,17 @@

-

Return Value

+

Return Value

- +
+
bool|RedisSentinel
+
@@ -424,11 +780,10 @@

Return Value

-

- - array|bool|RedisSentinel - getMasterAddrByName(string $master) - + +

+ + array|bool|RedisSentinel getMasterAddrByName(string $master)

@@ -450,15 +805,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
array|bool|RedisSentinel
+
@@ -467,11 +824,10 @@

Return Value

-

- - array|bool|RedisSentinel - master(string $master) - + +

+ + array|bool|RedisSentinel master(string $master)

@@ -493,15 +849,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
array|bool|RedisSentinel
+
@@ -510,11 +868,10 @@

Return Value

-

- - array|bool|RedisSentinel - masters() - + +

+ + array|bool|RedisSentinel masters()

@@ -526,15 +883,17 @@

-

Return Value

+

Return Value

- +
+
array|bool|RedisSentinel
+
@@ -543,11 +902,10 @@

Return Value

-

- - string - myid() - + +

+ + string myid()

@@ -559,15 +917,17 @@

-

Return Value

+

Return Value

- +
+
string
+
@@ -576,11 +936,10 @@

Return Value

-

- - bool|RedisSentinel - ping() - + +

+ + bool|RedisSentinel ping()

@@ -592,15 +951,17 @@

-

Return Value

+

Return Value

- +
+
bool|RedisSentinel
+
@@ -609,11 +970,10 @@

Return Value

-

- - bool|RedisSentinel - reset(string $pattern) - + +

+ + int|RedisSentinel reset(string $pattern)

@@ -635,15 +995,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
- +
bool|RedisSentinelint|RedisSentinel
+
@@ -652,11 +1014,10 @@

Return Value

-

- - array|bool|RedisSentinel - sentinels(string $master) - + +

+ + array|bool|RedisSentinel sentinels(string $master)

@@ -678,15 +1039,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
array|bool|RedisSentinel
+
@@ -695,11 +1058,10 @@

Return Value

-

- - array|bool|RedisSentinel - slaves(string $master) - + +

+ + array|bool|RedisSentinel slaves(string $master)

@@ -721,15 +1083,17 @@

Parameters

-

Return Value

+

Return Value

- +
+
array|bool|RedisSentinel
+
diff --git a/docs/[Global_Namespace].html b/docs/[Global_Namespace].html index b30c8eb2e2..1993f6549a 100644 --- a/docs/[Global_Namespace].html +++ b/docs/[Global_Namespace].html @@ -5,7 +5,7 @@ [Global Namespace] | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> diff --git a/docs/classes.html b/docs/classes.html index f281726e73..99aeb1151b 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -5,7 +5,7 @@ All Classes | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> diff --git a/docs/css/highlight-github.min.css b/docs/css/highlight-github.min.css new file mode 100644 index 0000000000..7a9730c0dc --- /dev/null +++ b/docs/css/highlight-github.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub + Description: Light theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-light + Current colors taken from GitHub's CSS +*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#22863a}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0} diff --git a/docs/doc-index.html b/docs/doc-index.html index 8dad86c345..905a5b9b56 100644 --- a/docs/doc-index.html +++ b/docs/doc-index.html @@ -5,7 +5,7 @@ Index | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> @@ -102,7 +491,7 @@

Index

  • S
  • T
  • U
  • -
  • V
  • +
  • V
  • W
  • X
  • Y
  • @@ -112,11 +501,17 @@

    Index

    A

    Redis::acl() — Method in class Redis
    -
    +

    Execute Redis ACL subcommands.

    Redis::append() — Method in class Redis

    Append data to a Redis STRING key.

    Redis::auth() — Method in class Redis
    -

    Authenticate a Redis connection after its been established.

    +

    Authenticate a Redis connection after its been established.

    +RedisArray::acl() — Method in class RedisArray
    +
    +RedisArray::append() — Method in class RedisArray
    +
    +RedisArray::auth() — Method in class RedisArray
    +
    RedisCluster::acl() — Method in class RedisCluster
    RedisCluster::append() — Method in class RedisCluster
    @@ -151,8 +546,34 @@

    A

    when no elements are available.

    Redis::blmpop() — Method in class Redis

    Pop one or more elements from one or more Redis LISTs, blocking up to a specified timeout when -no elements are available.

    +no elements are available.

    +Redis::blmove() — Method in class Redis
    +
    RedisArray::bgsave() — Method in class RedisArray
    +
    +RedisArray::bgrewriteaof() — Method in class RedisArray
    +
    +RedisArray::bitcount() — Method in class RedisArray
    +
    +RedisArray::bitop() — Method in class RedisArray
    +
    +RedisArray::bitpos() — Method in class RedisArray
    +
    +RedisArray::blPop() — Method in class RedisArray
    +
    +RedisArray::brPop() — Method in class RedisArray
    +
    +RedisArray::brpoplpush() — Method in class RedisArray
    +
    +RedisArray::bzPopMax() — Method in class RedisArray
    +
    +RedisArray::bzPopMin() — Method in class RedisArray
    +
    +RedisArray::bzmpop() — Method in class RedisArray
    +
    +RedisArray::blmpop() — Method in class RedisArray
    +
    +RedisArray::blmove() — Method in class RedisArray
    RedisCluster::bgrewriteaof() — Method in class RedisCluster
    @@ -165,11 +586,13 @@

    A

    RedisCluster::bitpos
    () — Method in class RedisCluster

    Return the position of the first bit set to 0 or 1 in a string.

    RedisCluster::blpop() — Method in class RedisCluster
    -

    See Redis::blpop()

    +
    RedisCluster::brpop() — Method in class RedisCluster
    -

    See Redis::brpop()

    +
    RedisCluster::brpoplpush() — Method in class RedisCluster
    -

    See Redis::brpoplpush()

    +
    +RedisCluster::blmove() — Method in class RedisCluster
    +

    Move an element from one list to another, blocking up to a timeout until an element is available.

    RedisCluster::bzpopmax() — Method in class RedisCluster
    RedisCluster::bzpopmin() — Method in class RedisCluster
    @@ -182,17 +605,33 @@

    A

    Redis::clearLastError() — Method in class Redis

    Reset any last error on the connection to NULL

    Redis::client() — Method in class Redis
    -
    +

    Execute Redis CLIENT subcommands.

    Redis::close() — Method in class Redis
    -
    +

    Closes the connection to Redis

    Redis::command() — Method in class Redis
    -
    +

    Execute Redis COMMAND subcommands.

    Redis::config() — Method in class Redis

    Execute the Redis CONFIG command in a variety of ways.

    Redis::connect() — Method in class Redis
    -
    +

    Connect to a Redis server

    Redis::copy() — Method in class Redis
    -

    Make a copy of a key.

    +

    Make a copy of a key.

    +Redis::clearTransferredBytes() — Method in class Redis
    +

    Reset the number of bytes sent and received on the socket.

    +RedisArray::clearLastError() — Method in class RedisArray
    +
    +RedisArray::client() — Method in class RedisArray
    +
    +RedisArray::close() — Method in class RedisArray
    +
    +RedisArray::command() — Method in class RedisArray
    +
    +RedisArray::config() — Method in class RedisArray
    +
    +RedisArray::copy() — Method in class RedisArray
    +
    +RedisArray::clearTransferredBytes() — Method in class RedisArray
    +
    RedisCluster::clearlasterror() — Method in class RedisCluster
    RedisCluster::client() — Method in class RedisCluster
    @@ -204,6 +643,10 @@

    A

    RedisCluster::command() — Method in class RedisCluster
    RedisCluster::config() — Method in class RedisCluster
    +
    +RedisCluster::copy() — Method in class RedisCluster
    +
    +RedisCluster::cleartransferredbytes() — Method in class RedisCluster
    RedisSentinel::ckquorum() — Method in class RedisSentinel

    D

    @@ -211,22 +654,49 @@

    A

    Redis::dbSize() — Method in class Redis

    Return the number of keys in the currently selected Redis database.

    Redis::debug() — Method in class Redis
    -
    +

    Execute the Redis DEBUG command. Note that this is disabled by default +and can be very dangerous, even allowing you to crash the server. Use +with caution

    Redis::decr() — Method in class Redis

    Decrement a Redis integer by 1 or a provided value.

    Redis::decrBy() — Method in class Redis

    Decrement a redis integer by a value

    Redis::del() — Method in class Redis
    -

    Delete one or more keys from Redis.

    +

    Delete one or more keys from Redis.

    +Redis::delex() — Method in class Redis
    +

    Delete a key conditionally based on its value or hash digest

    +Redis::delifeq() — Method in class Redis
    +

    Delete a key if it's equal to the specified value. This command is +specific to Valkey >= 9.0

    Redis::delete() — Method in class Redis
    Redis::discard() — Method in class Redis

    Discard a transaction currently in progress.

    Redis::dump() — Method in class Redis
    -

    Dump Redis' internal binary representation of a key.

    +

    Dump Redis' internal binary representation of a key.

    +Redis::digest() — Method in class Redis
    +

    Ask the server for the XXH3 digest of a given key's value

    RedisArray::del() — Method in class RedisArray
    RedisArray::discard() — Method in class RedisArray
    +
    +RedisArray::dbSize() — Method in class RedisArray
    +
    +RedisArray::debug() — Method in class RedisArray
    +
    +RedisArray::decr() — Method in class RedisArray
    +
    +RedisArray::decrBy() — Method in class RedisArray
    +
    +RedisArray::delex() — Method in class RedisArray
    +
    +RedisArray::delifeq() — Method in class RedisArray
    +
    +RedisArray::delete() — Method in class RedisArray
    +
    +RedisArray::dump() — Method in class RedisArray
    +
    +RedisArray::digest() — Method in class RedisArray
    RedisCluster::dbsize() — Method in class RedisCluster
    @@ -237,10 +707,17 @@

    A

    RedisCluster::decrbyfloat
    () — Method in class RedisCluster
    RedisCluster::del() — Method in class RedisCluster
    -
    +
    +RedisCluster::delex() — Method in class RedisCluster
    +

    Delete a key conditionally based on its value or hash digest

    +RedisCluster::delifeq() — Method in class RedisCluster
    +

    Delete a key if it's equal to the specified value. This command is +specific to Valkey >= 9.0

    RedisCluster::discard() — Method in class RedisCluster
    RedisCluster::dump() — Method in class RedisCluster
    +
    +RedisCluster::digest() — Method in class RedisCluster

    E

    Redis::echo() — Method in class Redis
    @@ -267,8 +744,34 @@

    A

    Redis::expireAt() — Method in class Redis

    Set a key to expire at an exact unix timestamp.

    Redis::expiretime() — Method in class Redis
    -

    Get the expiration of a given key as a unix timestamp

    +

    Get the expiration of a given key as a unix timestamp

    +Redis::expiremember() — Method in class Redis
    +

    Set an expiration on a key member (KeyDB only).

    +Redis::expirememberat() — Method in class Redis
    +

    Set an expiration on a key membert to a specific unix timestamp (KeyDB only).

    RedisArray::exec() — Method in class RedisArray
    +
    +RedisArray::echo() — Method in class RedisArray
    +
    +RedisArray::eval() — Method in class RedisArray
    +
    +RedisArray::eval_ro() — Method in class RedisArray
    +
    +RedisArray::evalsha() — Method in class RedisArray
    +
    +RedisArray::evalsha_ro() — Method in class RedisArray
    +
    +RedisArray::exists() — Method in class RedisArray
    +
    +RedisArray::expire() — Method in class RedisArray
    +
    +RedisArray::expireAt() — Method in class RedisArray
    +
    +RedisArray::expiretime() — Method in class RedisArray
    +
    +RedisArray::expiremember() — Method in class RedisArray
    +
    +RedisArray::expirememberat() — Method in class RedisArray
    RedisCluster::echo() — Method in class RedisCluster
    @@ -289,17 +792,35 @@

    A

    RedisCluster::expireat
    () — Method in class RedisCluster
    RedisCluster::expiretime() — Method in class RedisCluster
    +
    +RedisCluster::expiremember() — Method in class RedisCluster
    +
    +RedisCluster::expirememberat() — Method in class RedisCluster

    F

    Redis::failover() — Method in class Redis
    -
    +
    +Redis::fcall() — Method in class Redis
    +

    Invoke a function.

    +Redis::fcall_ro() — Method in class Redis
    +

    This is a read-only variant of the FCALL command that cannot execute commands that modify data.

    Redis::flushAll() — Method in class Redis

    Deletes every key in all Redis databases

    Redis::flushDB() — Method in class Redis
    -

    Deletes all the keys of the currently selected database.

    +

    Deletes all the keys of the currently selected database.

    +Redis::function() — Method in class Redis
    +

    Functions is an API for managing code to be executed on the server.

    RedisArray::flushall() — Method in class RedisArray
    RedisArray::flushdb() — Method in class RedisArray
    +
    +RedisArray::failover() — Method in class RedisArray
    +
    +RedisArray::fcall() — Method in class RedisArray
    +
    +RedisArray::fcall_ro() — Method in class RedisArray
    +
    +RedisArray::function() — Method in class RedisArray
    RedisCluster::flushall() — Method in class RedisCluster
    @@ -332,7 +853,9 @@

    A

    Search a geospacial sorted set for members within a given area or range, storing the results into a new set.

    Redis::get() — Method in class Redis
    -

    Retrieve a string keys value.

    +

    Retrieve a string keys value.

    +Redis::getWithMeta() — Method in class Redis
    +

    Retrieve a value and metadata of key.

    Redis::getAuth() — Method in class Redis

    Get the authentication information on the connection, if any.

    Redis::getBit() — Method in class Redis
    @@ -364,8 +887,64 @@

    A

    Redis::getTimeout() — Method in class Redis

    Retrieve any set connection timeout

    Redis::getTransferredBytes() — Method in class Redis
    -
    +

    Get the number of bytes sent and received on the socket.

    +Redis::gcra() — Method in class Redis
    +

    Get rate limiting information

    RedisArray::getOption() — Method in class RedisArray
    +
    +RedisArray::geoadd() — Method in class RedisArray
    +
    +RedisArray::geodist() — Method in class RedisArray
    +
    +RedisArray::geohash() — Method in class RedisArray
    +
    +RedisArray::geopos() — Method in class RedisArray
    +
    +RedisArray::georadius() — Method in class RedisArray
    +
    +RedisArray::georadius_ro() — Method in class RedisArray
    +
    +RedisArray::georadiusbymember() — Method in class RedisArray
    +
    +RedisArray::georadiusbymember_ro() — Method in class RedisArray
    +
    +RedisArray::geosearch() — Method in class RedisArray
    +
    +RedisArray::geosearchstore() — Method in class RedisArray
    +
    +RedisArray::get() — Method in class RedisArray
    +
    +RedisArray::getWithMeta() — Method in class RedisArray
    +
    +RedisArray::getAuth() — Method in class RedisArray
    +
    +RedisArray::getBit() — Method in class RedisArray
    +
    +RedisArray::getEx() — Method in class RedisArray
    +
    +RedisArray::getDBNum() — Method in class RedisArray
    +
    +RedisArray::getDel() — Method in class RedisArray
    +
    +RedisArray::getHost() — Method in class RedisArray
    +
    +RedisArray::getLastError() — Method in class RedisArray
    +
    +RedisArray::getMode() — Method in class RedisArray
    +
    +RedisArray::getPersistentID() — Method in class RedisArray
    +
    +RedisArray::getPort() — Method in class RedisArray
    +
    +RedisArray::getRange() — Method in class RedisArray
    +
    +RedisArray::getReadTimeout() — Method in class RedisArray
    +
    +RedisArray::getset() — Method in class RedisArray
    +
    +RedisArray::getTimeout() — Method in class RedisArray
    +
    +RedisArray::getTransferredBytes() — Method in class RedisArray
    RedisCluster::geoadd() — Method in class RedisCluster
    @@ -382,8 +961,18 @@

    A

    RedisCluster::georadiusbymember
    () — Method in class RedisCluster
    RedisCluster::georadiusbymember_ro() — Method in class RedisCluster
    +
    +RedisCluster::geosearch() — Method in class RedisCluster
    +
    +RedisCluster::geosearchstore() — Method in class RedisCluster
    RedisCluster::get() — Method in class RedisCluster
    +
    +RedisCluster::getdel() — Method in class RedisCluster
    +
    +RedisCluster::getWithMeta() — Method in class RedisCluster
    +
    +RedisCluster::getex() — Method in class RedisCluster
    RedisCluster::getbit() — Method in class RedisCluster
    @@ -398,6 +987,8 @@

    A

    RedisCluster::getset
    () — Method in class RedisCluster
    RedisCluster::gettransferredbytes() — Method in class RedisCluster
    +
    +RedisCluster::gcra() — Method in class RedisCluster
    RedisSentinel::getMasterAddrByName() — Method in class RedisSentinel

    H

    @@ -409,7 +1000,9 @@

    A

    Redis::hGet() — Method in class Redis
    Redis::hGetAll() — Method in class Redis
    -

    Read every field and value from a hash.

    +

    Read every field and value from a hash.

    +Redis::hGetWithMeta() — Method in class Redis
    +

    Retrieve a value and metadata of hash field.

    Redis::hIncrBy() — Method in class Redis

    Increment a hash field's value by an integer

    Redis::hIncrByFloat() — Method in class Redis
    @@ -419,22 +1012,95 @@

    A

    Redis::hLen() — Method in class Redis

    Get the number of fields in a hash.

    Redis::hMget() — Method in class Redis
    -

    Get one or more fields from a hash.

    +

    Get one or more fields from a hash.

    +Redis::hgetex() — Method in class Redis
    +

    Get one or more fields of a hash while optionally setting expiration +information

    +Redis::hsetex() — Method in class Redis
    +

    Set one or more fields in a hash with optional expiration information.

    +Redis::hgetdel() — Method in class Redis
    +

    Get one or more fields and delete them

    Redis::hMset() — Method in class Redis

    Add or update one or more hash fields and values

    Redis::hRandField() — Method in class Redis

    Get one or more random field from a hash.

    Redis::hSet() — Method in class Redis
    -
    +

    Add or update one or more hash fields and values.

    Redis::hSetNx() — Method in class Redis

    Set a hash field and value, but only if that field does not exist

    Redis::hStrLen() — Method in class Redis

    Get the string length of a hash field

    Redis::hVals() — Method in class Redis
    -

    Get all of the values from a hash.

    +

    Get all of the values from a hash.

    +Redis::hexpire() — Method in class Redis
    +

    Set the expiration on one or more fields in a hash.

    +Redis::hpexpire() — Method in class Redis
    +

    Set the expiration on one or more fields in a hash in milliseconds.

    +Redis::hexpireat() — Method in class Redis
    +

    Set the expiration time on one or more fields of a hash.

    +Redis::hpexpireat() — Method in class Redis
    +

    Set the expiration time on one or more fields of a hash in milliseconds.

    +Redis::httl() — Method in class Redis
    +

    Get the TTL of one or more fields in a hash

    +Redis::hpttl() — Method in class Redis
    +

    Get the millisecond TTL of one or more fields in a hash

    +Redis::hexpiretime() — Method in class Redis
    +

    Get the expiration time of one or more fields in a hash

    +Redis::hpexpiretime() — Method in class Redis
    +

    Get the expiration time in milliseconds of one or more fields in a hash

    +Redis::hpersist() — Method in class Redis
    +

    Persist one or more hash fields

    Redis::hscan() — Method in class Redis

    Iterate over the fields and values of a hash in an incremental fashion.

    RedisArray::hscan() — Method in class RedisArray
    +
    +RedisArray::hDel() — Method in class RedisArray
    +
    +RedisArray::hExists() — Method in class RedisArray
    +
    +RedisArray::hGet() — Method in class RedisArray
    +
    +RedisArray::hGetAll() — Method in class RedisArray
    +
    +RedisArray::hGetWithMeta() — Method in class RedisArray
    +
    +RedisArray::hIncrBy() — Method in class RedisArray
    +
    +RedisArray::hIncrByFloat() — Method in class RedisArray
    +
    +RedisArray::hKeys() — Method in class RedisArray
    +
    +RedisArray::hLen() — Method in class RedisArray
    +
    +RedisArray::hMget() — Method in class RedisArray
    +
    +RedisArray::hgetex() — Method in class RedisArray
    +
    +RedisArray::hsetex() — Method in class RedisArray
    +
    +RedisArray::hgetdel() — Method in class RedisArray
    +
    +RedisArray::hMset() — Method in class RedisArray
    +
    +RedisArray::hRandField() — Method in class RedisArray
    +
    +RedisArray::hSet() — Method in class RedisArray
    +
    +RedisArray::hSetNx() — Method in class RedisArray
    +
    +RedisArray::hStrLen() — Method in class RedisArray
    +
    +RedisArray::hVals() — Method in class RedisArray
    +
    +RedisArray::httl() — Method in class RedisArray
    +
    +RedisArray::hpttl() — Method in class RedisArray
    +
    +RedisArray::hexpiretime() — Method in class RedisArray
    +
    +RedisArray::hpexpiretime() — Method in class RedisArray
    +
    +RedisArray::hpersist() — Method in class RedisArray
    RedisCluster::hdel() — Method in class RedisCluster
    @@ -443,6 +1109,8 @@

    A

    RedisCluster::hget
    () — Method in class RedisCluster
    RedisCluster::hgetall() — Method in class RedisCluster
    +
    +RedisCluster::hgetWithMeta() — Method in class RedisCluster
    RedisCluster::hincrby() — Method in class RedisCluster
    @@ -453,16 +1121,42 @@

    A

    RedisCluster::hlen
    () — Method in class RedisCluster
    RedisCluster::hmget() — Method in class RedisCluster
    +
    +RedisCluster::hgetex() — Method in class RedisCluster
    +
    +RedisCluster::hsetex() — Method in class RedisCluster
    +
    +RedisCluster::hgetdel() — Method in class RedisCluster
    RedisCluster::hmset() — Method in class RedisCluster
    RedisCluster::hscan() — Method in class RedisCluster
    +
    +RedisCluster::hrandfield() — Method in class RedisCluster
    RedisCluster::hset() — Method in class RedisCluster
    RedisCluster::hsetnx() — Method in class RedisCluster
    RedisCluster::hstrlen() — Method in class RedisCluster
    +
    +RedisCluster::hexpire() — Method in class RedisCluster
    +
    +RedisCluster::hpexpire() — Method in class RedisCluster
    +
    +RedisCluster::hexpireat() — Method in class RedisCluster
    +
    +RedisCluster::hpexpireat() — Method in class RedisCluster
    +
    +RedisCluster::httl() — Method in class RedisCluster
    +
    +RedisCluster::hpttl() — Method in class RedisCluster
    +
    +RedisCluster::hexpiretime() — Method in class RedisCluster
    +
    +RedisCluster::hpexpiretime() — Method in class RedisCluster
    +
    +RedisCluster::hpersist() — Method in class RedisCluster
    RedisCluster::hvals() — Method in class RedisCluster

    I

    @@ -481,6 +1175,14 @@

    A

    Redis::isConnected() — Method in class Redis

    Check if we are currently connected to a Redis instance.

    RedisArray::info() — Method in class RedisArray
    +
    +RedisArray::incr() — Method in class RedisArray
    +
    +RedisArray::incrBy() — Method in class RedisArray
    +
    +RedisArray::incrByFloat() — Method in class RedisArray
    +
    +RedisArray::isConnected() — Method in class RedisArray
    RedisCluster::incr() — Method in class RedisCluster
    @@ -530,7 +1232,39 @@

    A

    Redis::lrem
    () — Method in class Redis

    Remove one or more matching elements from a list.

    Redis::ltrim() — Method in class Redis
    -

    Trim a list to a subrange of elements.

    +

    Trim a list to a subrange of elements.

    +RedisArray::lmpop() — Method in class RedisArray
    +
    +RedisArray::lcs() — Method in class RedisArray
    +
    +RedisArray::lInsert() — Method in class RedisArray
    +
    +RedisArray::lLen() — Method in class RedisArray
    +
    +RedisArray::lMove() — Method in class RedisArray
    +
    +RedisArray::lPop() — Method in class RedisArray
    +
    +RedisArray::lPos() — Method in class RedisArray
    +
    +RedisArray::lPush() — Method in class RedisArray
    +
    +RedisArray::lPushx() — Method in class RedisArray
    +
    +RedisArray::lSet() — Method in class RedisArray
    +
    +RedisArray::lastSave() — Method in class RedisArray
    +
    +RedisArray::lindex() — Method in class RedisArray
    +
    +RedisArray::lrange() — Method in class RedisArray
    +
    +RedisArray::lrem() — Method in class RedisArray
    +
    +RedisArray::ltrim() — Method in class RedisArray
    +
    +RedisCluster::lmove() — Method in class RedisCluster
    +

    Move an element from one list into another.

    RedisCluster::lmpop() — Method in class RedisCluster
    RedisCluster::lcs() — Method in class RedisCluster
    @@ -546,6 +1280,8 @@

    A

    RedisCluster::llen() — Method in class RedisCluster
    RedisCluster::lpop() — Method in class RedisCluster
    +
    +RedisCluster::lpos() — Method in class RedisCluster
    RedisCluster::lpush() — Method in class RedisCluster
    @@ -561,15 +1297,17 @@

    A

    M

    Redis::mget() — Method in class Redis
    -

    Get one ore more string keys.

    +

    Get one or more string keys.

    Redis::migrate() — Method in class Redis
    -
    +

    Proxy for the Redis MIGRATE command.

    Redis::move() — Method in class Redis

    Move a key to a different database on the same redis instance.

    Redis::mset() — Method in class Redis
    -

    Set one ore more string keys.

    +

    Set one or more string keys.

    +Redis::msetex() — Method in class Redis
    +

    Set one or more keys and values with optional expiry information.

    Redis::msetnx() — Method in class Redis
    -

    Set one ore more string keys but only if none of the key exist.

    +

    Set one or more string keys but only if none of the key exist.

    Redis::multi() — Method in class Redis

    Begin a transaction.

    RedisArray::mget() — Method in class RedisArray
    @@ -577,12 +1315,20 @@

    A

    RedisArray::mset() — Method in class RedisArray
    RedisArray::multi() — Method in class RedisArray
    +
    +RedisArray::move() — Method in class RedisArray
    +
    +RedisArray::msetex() — Method in class RedisArray
    +
    +RedisArray::msetnx() — Method in class RedisArray
    RedisCluster::mget() — Method in class RedisCluster
    RedisCluster::mset() — Method in class RedisCluster
    RedisCluster::msetnx() — Method in class RedisCluster
    +
    +RedisCluster::msetex() — Method in class RedisCluster
    RedisCluster::multi() — Method in class RedisCluster
    @@ -594,8 +1340,12 @@

    A

    O

    Redis::object() — Method in class Redis
    -
    +

    Get encoding and other information about a key.

    Redis::open() — Method in class Redis
    +
    +RedisArray::object() — Method in class RedisArray
    +
    +RedisArray::open() — Method in class RedisArray
    RedisCluster::object() — Method in class RedisCluster

    P

    @@ -603,7 +1353,7 @@

    A

    Redis::pexpiretime() — Method in class Redis

    Get the expiration timestamp of a given Redis key but in milliseconds.

    Redis::pconnect() — Method in class Redis
    -
    +

    Connects to a Redis server creating or reusing a persistent connection.

    Redis::persist() — Method in class Redis

    Remove the expiration from a key.

    Redis::pexpire() — Method in class Redis
    @@ -633,10 +1383,42 @@

    A

    Redis::publish() — Method in class Redis

    Publish a message to a pubsub channel

    Redis::pubsub() — Method in class Redis
    -
    +

    Interact with the Redis PubSub subsystem.

    Redis::punsubscribe() — Method in class Redis

    Unsubscribe from one or more channels by pattern

    RedisArray::ping() — Method in class RedisArray
    +
    +RedisArray::pexpiretime() — Method in class RedisArray
    +
    +RedisArray::pconnect() — Method in class RedisArray
    +
    +RedisArray::persist() — Method in class RedisArray
    +
    +RedisArray::pexpire() — Method in class RedisArray
    +
    +RedisArray::pexpireAt() — Method in class RedisArray
    +
    +RedisArray::pfadd() — Method in class RedisArray
    +
    +RedisArray::pfcount() — Method in class RedisArray
    +
    +RedisArray::pfmerge() — Method in class RedisArray
    +
    +RedisArray::pipeline() — Method in class RedisArray
    +
    +RedisArray::popen() — Method in class RedisArray
    +
    +RedisArray::psetex() — Method in class RedisArray
    +
    +RedisArray::psubscribe() — Method in class RedisArray
    +
    +RedisArray::pttl() — Method in class RedisArray
    +
    +RedisArray::publish() — Method in class RedisArray
    +
    +RedisArray::pubsub() — Method in class RedisArray
    +
    +RedisArray::punsubscribe() — Method in class RedisArray
    RedisCluster::pexpiretime() — Method in class RedisCluster
    @@ -696,6 +1478,30 @@

    A

    Redis::replicaof
    () — Method in class Redis

    Used to turn a Redis instance into a replica of another, or to remove replica status promoting the instance to a primary.

    RedisArray
    +
    +RedisArray::rPush() — Method in class RedisArray
    +
    +RedisArray::rPushx() — Method in class RedisArray
    +
    +RedisArray::rPop() — Method in class RedisArray
    +
    +RedisArray::randomKey() — Method in class RedisArray
    +
    +RedisArray::rawcommand() — Method in class RedisArray
    +
    +RedisArray::rename() — Method in class RedisArray
    +
    +RedisArray::renameNx() — Method in class RedisArray
    +
    +RedisArray::reset() — Method in class RedisArray
    +
    +RedisArray::restore() — Method in class RedisArray
    +
    +RedisArray::role() — Method in class RedisArray
    +
    +RedisArray::rpoplpush() — Method in class RedisArray
    +
    +RedisArray::replicaof() — Method in class RedisArray
    RedisCluster
    RedisCluster::randomkey() — Method in class RedisCluster
    @@ -723,11 +1529,15 @@

    A

    RedisSentinel::reset() — Method in class RedisSentinel

    S

    -
    +
    +Redis::serverName() — Method in class Redis
    +

    Get the server name as reported by the HELLO response.

    +Redis::serverVersion() — Method in class Redis
    +

    Get the server version as reported by the HELLO response.

    Redis::sAdd() — Method in class Redis

    Add one or more values to a Redis SET key.

    Redis::sAddArray() — Method in class Redis
    -

    Add one ore more values to a Redis SET key. This is an alternative to Redis::sadd() but +

    Add one or more values to a Redis SET key. This is an alternative to Redis::sadd() but instead of being variadic, takes a single array of values.

    Redis::sDiff() — Method in class Redis

    Given one or more Redis SETS, this command returns all of the members from the first @@ -804,11 +1614,16 @@

    A

    Redis::srem() — Method in class Redis

    Remove one or more values from a Redis SET key.

    Redis::sscan() — Method in class Redis
    -

    Scan the members of a redis SET key.

    +

    Scan the members of a redis SET key.

    +Redis::ssubscribe() — Method in class Redis
    +

    Subscribes the client to the specified shard channels.

    Redis::strlen() — Method in class Redis

    Retrieve the length of a Redis STRING key.

    Redis::subscribe() — Method in class Redis
    -

    Subscribe to one or more Redis pubsub channels.

    +

    Subscribe to one or more Redis pubsub channels.

    +Redis::sunsubscribe() — Method in class Redis
    +

    Unsubscribes the client from the given shard channels, +or from all of them if none is given.

    Redis::swapdb() — Method in class Redis

    Atomically swap two Redis databases so that all of the keys in the source database will now be in the destination database and vice-versa.

    @@ -821,6 +1636,82 @@

    A

    RedisArray::setOption
    () — Method in class RedisArray
    RedisArray::sscan() — Method in class RedisArray
    +
    +RedisArray::serverName() — Method in class RedisArray
    +
    +RedisArray::serverVersion() — Method in class RedisArray
    +
    +RedisArray::sAdd() — Method in class RedisArray
    +
    +RedisArray::sAddArray() — Method in class RedisArray
    +
    +RedisArray::sDiff() — Method in class RedisArray
    +
    +RedisArray::sDiffStore() — Method in class RedisArray
    +
    +RedisArray::sInter() — Method in class RedisArray
    +
    +RedisArray::sintercard() — Method in class RedisArray
    +
    +RedisArray::sInterStore() — Method in class RedisArray
    +
    +RedisArray::sMembers() — Method in class RedisArray
    +
    +RedisArray::sMisMember() — Method in class RedisArray
    +
    +RedisArray::sMove() — Method in class RedisArray
    +
    +RedisArray::sPop() — Method in class RedisArray
    +
    +RedisArray::sRandMember() — Method in class RedisArray
    +
    +RedisArray::sUnion() — Method in class RedisArray
    +
    +RedisArray::sUnionStore() — Method in class RedisArray
    +
    +RedisArray::scard() — Method in class RedisArray
    +
    +RedisArray::script() — Method in class RedisArray
    +
    +RedisArray::set() — Method in class RedisArray
    +
    +RedisArray::setBit() — Method in class RedisArray
    +
    +RedisArray::setRange() — Method in class RedisArray
    +
    +RedisArray::setex() — Method in class RedisArray
    +
    +RedisArray::setnx() — Method in class RedisArray
    +
    +RedisArray::sismember() — Method in class RedisArray
    +
    +RedisArray::slaveof() — Method in class RedisArray
    +
    +RedisArray::slowlog() — Method in class RedisArray
    +
    +RedisArray::sort() — Method in class RedisArray
    +
    +RedisArray::sort_ro() — Method in class RedisArray
    +
    +RedisArray::sortAsc() — Method in class RedisArray
    +
    +RedisArray::sortAscAlpha() — Method in class RedisArray
    +
    +RedisArray::sortDesc() — Method in class RedisArray
    +
    +RedisArray::sortDescAlpha() — Method in class RedisArray
    +
    +RedisArray::srem() — Method in class RedisArray
    +
    +RedisArray::ssubscribe() — Method in class RedisArray
    +
    +RedisArray::strlen() — Method in class RedisArray
    +
    +RedisArray::subscribe() — Method in class RedisArray
    +
    +RedisArray::sunsubscribe() — Method in class RedisArray
    +
    +RedisArray::swapdb() — Method in class RedisArray
    RedisCluster::sadd() — Method in class RedisCluster
    @@ -857,6 +1748,8 @@

    A

    RedisCluster::sinterstore
    () — Method in class RedisCluster
    RedisCluster::sismember() — Method in class RedisCluster
    +
    +RedisCluster::smismember() — Method in class RedisCluster
    RedisCluster::slowlog() — Method in class RedisCluster
    @@ -896,7 +1789,15 @@

    A

    Redis::ttl
    () — Method in class Redis

    Get the amount of time a Redis key has before it will expire, in seconds.

    Redis::type() — Method in class Redis
    -

    Get the type of a given Redis key.

    +

    Get the type of a given Redis key.

    +RedisArray::touch() — Method in class RedisArray
    +
    +RedisArray::time() — Method in class RedisArray
    +
    +RedisArray::ttl() — Method in class RedisArray
    +
    +RedisArray::type() — Method in class RedisArray
    +
    RedisCluster::touch() — Method in class RedisCluster
    RedisCluster::time() — Method in class RedisCluster
    @@ -917,24 +1818,117 @@

    A

    RedisArray::unlink() — Method in class RedisArray
    RedisArray::unwatch() — Method in class RedisArray
    +
    +RedisArray::unsubscribe() — Method in class RedisArray
    RedisCluster::unsubscribe() — Method in class RedisCluster
    RedisCluster::unlink() — Method in class RedisCluster
    RedisCluster::unwatch() — Method in class RedisCluster
    +

    V

    +
    +Redis::vadd() — Method in class Redis
    +

    Add to a vector set

    +Redis::vsim() — Method in class Redis
    +

    Query similarity of a vector by element or scores

    +Redis::vcard() — Method in class Redis
    +

    Get the length of a vector set

    +Redis::vdim() — Method in class Redis
    +

    Get the dimensions of a vector set

    +Redis::vinfo() — Method in class Redis
    +

    Get various bits of information about a vector set

    +Redis::vismember() — Method in class Redis
    +

    Check if an element is a member of a vectorset

    +Redis::vemb() — Method in class Redis
    +

    Get the embeddings for a specific member

    +Redis::vrandmember() — Method in class Redis
    +

    Get one or more random members from a vector set

    +Redis::vrange() — Method in class Redis
    +

    Retreive a lexographical range of elements from a vector set

    +Redis::vrem() — Method in class Redis
    +

    Remove an element from a vector set

    +Redis::vsetattr() — Method in class Redis
    +

    Set the attributes of a vector set element

    +Redis::vgetattr() — Method in class Redis
    +

    Get the attributes of a vector set element

    +Redis::vlinks() — Method in class Redis
    +

    Get any adajcent values for a member of a vector set.

    +RedisArray::vadd() — Method in class RedisArray
    +
    +RedisArray::vsim() — Method in class RedisArray
    +
    +RedisArray::vcard() — Method in class RedisArray
    +
    +RedisArray::vdim() — Method in class RedisArray
    +
    +RedisArray::vinfo() — Method in class RedisArray
    +
    +RedisArray::vismember() — Method in class RedisArray
    +
    +RedisArray::vemb() — Method in class RedisArray
    +
    +RedisArray::vrandmember() — Method in class RedisArray
    +
    +RedisArray::vrange() — Method in class RedisArray
    +
    +RedisArray::vrem() — Method in class RedisArray
    +
    +RedisArray::vsetattr() — Method in class RedisArray
    +
    +RedisArray::vgetattr() — Method in class RedisArray
    +
    +RedisArray::vlinks() — Method in class RedisArray
    +
    +RedisCluster::vadd() — Method in class RedisCluster
    +
    +RedisCluster::vsim() — Method in class RedisCluster
    +
    +RedisCluster::vcard() — Method in class RedisCluster
    +
    +RedisCluster::vdim() — Method in class RedisCluster
    +
    +RedisCluster::vinfo() — Method in class RedisCluster
    +
    +RedisCluster::vismember() — Method in class RedisCluster
    +

    Check if an element is a member of a vectorset

    +RedisCluster::vemb() — Method in class RedisCluster
    +
    +RedisCluster::vrandmember() — Method in class RedisCluster
    +
    +RedisCluster::vrange() — Method in class RedisCluster
    +

    Retreive a lexographical range of elements from a vector set

    +RedisCluster::vrem() — Method in class RedisCluster
    +
    +RedisCluster::vlinks() — Method in class RedisCluster
    +
    +RedisCluster::vgetattr() — Method in class RedisCluster
    +
    +RedisCluster::vsetattr() — Method in class RedisCluster

    W

    -
    +
    +Redis::waitaof() — Method in class Redis
    +
    Redis::watch() — Method in class Redis

    Watch one or more keys for conditional execution of a transaction.

    Redis::wait() — Method in class Redis

    Block the client up to the provided timeout until a certain number of replicas have confirmed -receiving them.

    +receiving them.

    +RedisArray::waitaof() — Method in class RedisArray
    +
    +RedisArray::watch() — Method in class RedisArray
    +
    +RedisArray::wait() — Method in class RedisArray
    +
    +RedisCluster::wait() — Method in class RedisCluster
    +
    +RedisCluster::waitaof() — Method in class RedisCluster
    +
    RedisCluster::watch() — Method in class RedisCluster

    X

    Redis::xack() — Method in class Redis
    -

    Acknowledge one ore more messages that are pending (have been consumed using XREADGROUP but +

    Acknowledge one or more messages that are pending (have been consumed using XREADGROUP but not yet acknowledged by XACK.)

    Redis::xadd() — Method in class Redis

    Append a message to a stream.

    @@ -944,7 +1938,9 @@

    A

    This method allows a consumer to take ownership of pending stream entries, by ID. Another command that does much the same thing but does not require passing specific IDs is Redis::xAutoClaim.

    Redis::xdel() — Method in class Redis
    -

    Remove one or more specific IDs from a stream.

    +

    Remove one or more specific IDs from a stream.

    +Redis::xdelex() — Method in class Redis
    +

    Remove one or more IDs from a stream with extended options.

    Redis::xgroup() — Method in class Redis
    XGROUP
    Redis::xinfo() — Method in class Redis
    @@ -963,7 +1959,35 @@

    A

    Redis::xrevrange() — Method in class Redis

    Get a range of entries from a STREAM key in reverse chronological order.

    Redis::xtrim() — Method in class Redis
    -

    Truncate a STREAM key in various ways.

    +

    Truncate a STREAM key in various ways.

    +RedisArray::xack() — Method in class RedisArray
    +
    +RedisArray::xadd() — Method in class RedisArray
    +
    +RedisArray::xautoclaim() — Method in class RedisArray
    +
    +RedisArray::xclaim() — Method in class RedisArray
    +
    +RedisArray::xdel() — Method in class RedisArray
    +
    +RedisArray::xdelex() — Method in class RedisArray
    +
    +RedisArray::xinfo() — Method in class RedisArray
    +
    +RedisArray::xlen() — Method in class RedisArray
    +
    +RedisArray::xpending() — Method in class RedisArray
    +
    +RedisArray::xrange() — Method in class RedisArray
    +
    +RedisArray::xread() — Method in class RedisArray
    +
    +RedisArray::xreadgroup() — Method in class RedisArray
    +
    +RedisArray::xrevrange() — Method in class RedisArray
    +
    +RedisArray::xtrim() — Method in class RedisArray
    +
    RedisCluster::xack() — Method in class RedisCluster
    RedisCluster::xadd() — Method in class RedisCluster
    @@ -971,6 +1995,8 @@

    A

    RedisCluster::xclaim() — Method in class RedisCluster
    RedisCluster::xdel() — Method in class RedisCluster
    +
    +RedisCluster::xdelex() — Method in class RedisCluster
    RedisCluster::xgroup() — Method in class RedisCluster
    @@ -1054,7 +2080,7 @@

    A

    Similar to ZINTER but instead of returning the intersected values, this command returns the cardinality of the intersected set.

    Redis::zinterstore() — Method in class Redis
    -

    Compute the intersection of one ore more sorted sets storing the result in a new sorted set.

    +

    Compute the intersection of one or more sorted sets storing the result in a new sorted set.

    Redis::zscan() — Method in class Redis

    Scan the members of a sorted set incrementally, using a cursor

    Redis::zunion() — Method in class Redis
    @@ -1062,6 +2088,66 @@

    A

    Redis::zunionstore() — Method in class Redis

    Perform a union on one or more Redis sets and store the result in a destination sorted set.

    RedisArray::zscan() — Method in class RedisArray
    +
    +RedisArray::zmpop() — Method in class RedisArray
    +
    +RedisArray::zAdd() — Method in class RedisArray
    +
    +RedisArray::zCard() — Method in class RedisArray
    +
    +RedisArray::zCount() — Method in class RedisArray
    +
    +RedisArray::zIncrBy() — Method in class RedisArray
    +
    +RedisArray::zLexCount() — Method in class RedisArray
    +
    +RedisArray::zMscore() — Method in class RedisArray
    +
    +RedisArray::zPopMax() — Method in class RedisArray
    +
    +RedisArray::zPopMin() — Method in class RedisArray
    +
    +RedisArray::zRange() — Method in class RedisArray
    +
    +RedisArray::zRangeByLex() — Method in class RedisArray
    +
    +RedisArray::zRangeByScore() — Method in class RedisArray
    +
    +RedisArray::zRandMember() — Method in class RedisArray
    +
    +RedisArray::zRank() — Method in class RedisArray
    +
    +RedisArray::zRem() — Method in class RedisArray
    +
    +RedisArray::zRemRangeByLex() — Method in class RedisArray
    +
    +RedisArray::zRemRangeByRank() — Method in class RedisArray
    +
    +RedisArray::zRemRangeByScore() — Method in class RedisArray
    +
    +RedisArray::zRevRange() — Method in class RedisArray
    +
    +RedisArray::zRevRangeByLex() — Method in class RedisArray
    +
    +RedisArray::zRevRangeByScore() — Method in class RedisArray
    +
    +RedisArray::zRevRank() — Method in class RedisArray
    +
    +RedisArray::zScore() — Method in class RedisArray
    +
    +RedisArray::zdiff() — Method in class RedisArray
    +
    +RedisArray::zdiffstore() — Method in class RedisArray
    +
    +RedisArray::zinter() — Method in class RedisArray
    +
    +RedisArray::zintercard() — Method in class RedisArray
    +
    +RedisArray::zinterstore() — Method in class RedisArray
    +
    +RedisArray::zunion() — Method in class RedisArray
    +
    +RedisArray::zunionstore() — Method in class RedisArray
    RedisCluster::zmpop() — Method in class RedisCluster
    @@ -1086,6 +2172,8 @@

    A

    RedisCluster::zrange
    () — Method in class RedisCluster
    RedisCluster::zrangestore() — Method in class RedisCluster
    +
    +RedisCluster::zrandmember() — Method in class RedisCluster
    RedisCluster::zrangebylex() — Method in class RedisCluster
    @@ -1112,8 +2200,18 @@

    A

    RedisCluster::zscan
    () — Method in class RedisCluster
    RedisCluster::zscore() — Method in class RedisCluster
    +
    +RedisCluster::zmscore() — Method in class RedisCluster
    RedisCluster::zunionstore() — Method in class RedisCluster
    +
    +RedisCluster::zinter() — Method in class RedisCluster
    +
    +RedisCluster::zdiffstore() — Method in class RedisCluster
    +
    +RedisCluster::zunion() — Method in class RedisCluster
    +
    +RedisCluster::zdiff() — Method in class RedisCluster

    _

    Redis::__construct() — Method in class Redis
    @@ -1121,13 +2219,13 @@

    A

    options array it is also possible to connect to an instance at the same time.

    Redis::__destruct() — Method in class Redis
    -
    +

    Destructor to clean up the Redis object.

    Redis::_compress() — Method in class Redis
    -

    Compress a value with the currently configured compressor as set with -Redis::setOption().

    +

    Compress a value with the currently configured compressor (Redis::OPT_COMPRESSION) +exactly the same way PhpRedis does before sending data to Redis.

    Redis::_uncompress() — Method in class Redis
    -

    Uncompress the provided argument that has been compressed with the -currently configured compressor as set with Redis::setOption().

    +

    Uncompress the provided argument using the compressor configured via +Redis::setOption() (Redis::OPT_COMPRESSION).

    Redis::_prefix() — Method in class Redis

    Prefix the passed argument with the currently set key prefix as set with Redis::setOption().

    @@ -1138,11 +2236,16 @@

    A

    Unserialize the passed argument with the currently set serializer as set with Redis::setOption().

    Redis::_pack() — Method in class Redis
    -

    Pack the provided value with the configured serializer and compressor -as set with Redis::setOption().

    +

    Pack the provided value by first serializing it (if Redis::OPT_SERIALIZER is set) +and then compressing the serialized payload (if Redis::OPT_COMPRESSION is set), +mirroring exactly what PhpRedis transmits to Redis.

    +Redis::_digest() — Method in class Redis
    +

    Compute the XXH3 digest of a PHP value after it has been _packed, producing +the same digest Redis' DIGEST command would return for the stored value.

    Redis::_unpack() — Method in class Redis
    -

    Unpack the provided value with the configured compressor and serializer -as set with Redis::setOption().

    +

    Unpack the provided value by first uncompressing it (if Redis::OPT_COMPRESSION +is set) and then unserializing it (if Redis::OPT_SERIALIZER is set) to recover +the original PHP value.

    RedisArray::__call() — Method in class RedisArray
    RedisArray::__construct() — Method in class RedisArray
    @@ -1164,7 +2267,7 @@

    A

    RedisCluster::__construct() — Method in class RedisCluster
    RedisCluster::_compress() — Method in class RedisCluster
    -
    +

    {\Redis::_compress()}

    RedisCluster::_uncompress() — Method in class RedisCluster
    RedisCluster::_serialize() — Method in class RedisCluster
    @@ -1172,6 +2275,8 @@

    A

    RedisCluster::_unserialize() — Method in class RedisCluster
    RedisCluster::_pack() — Method in class RedisCluster
    +
    +RedisCluster::_digest() — Method in class RedisCluster
    RedisCluster::_unpack() — Method in class RedisCluster
    diff --git a/docs/doctum-search.json b/docs/doctum-search.json index 20e66a1b42..1d0ec60f4b 100644 --- a/docs/doctum-search.json +++ b/docs/doctum-search.json @@ -1 +1 @@ -{"items":[{"t":"C","n":"Redis","p":"Redis.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisArray","p":"RedisArray.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisCluster","p":"RedisCluster.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisClusterException","p":"RedisClusterException.html","d":null,"f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisException","p":"RedisException.html","d":null,"f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisSentinel","p":"RedisSentinel.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"M","n":"Redis::__construct","p":"Redis.html#method___construct","d":"

    Create a new Redis instance. If passed sufficient information in the\noptions array it is also possible to connect to an instance at the same\ntime.

    "},{"t":"M","n":"Redis::__destruct","p":"Redis.html#method___destruct","d":null},{"t":"M","n":"Redis::_compress","p":"Redis.html#method__compress","d":"

    Compress a value with the currently configured compressor as set with\nRedis::setOption().

    "},{"t":"M","n":"Redis::_uncompress","p":"Redis.html#method__uncompress","d":"

    Uncompress the provided argument that has been compressed with the\ncurrently configured compressor as set with Redis::setOption().

    "},{"t":"M","n":"Redis::_prefix","p":"Redis.html#method__prefix","d":"

    Prefix the passed argument with the currently set key prefix as set\nwith Redis::setOption().

    "},{"t":"M","n":"Redis::_serialize","p":"Redis.html#method__serialize","d":"

    Serialize the provided value with the currently set serializer as set\nwith Redis::setOption().

    "},{"t":"M","n":"Redis::_unserialize","p":"Redis.html#method__unserialize","d":"

    Unserialize the passed argument with the currently set serializer as set\nwith Redis::setOption().

    "},{"t":"M","n":"Redis::_pack","p":"Redis.html#method__pack","d":"

    Pack the provided value with the configured serializer and compressor\nas set with Redis::setOption().

    "},{"t":"M","n":"Redis::_unpack","p":"Redis.html#method__unpack","d":"

    Unpack the provided value with the configured compressor and serializer\nas set with Redis::setOption().

    "},{"t":"M","n":"Redis::acl","p":"Redis.html#method_acl","d":null},{"t":"M","n":"Redis::append","p":"Redis.html#method_append","d":"

    Append data to a Redis STRING key.

    "},{"t":"M","n":"Redis::auth","p":"Redis.html#method_auth","d":"

    Authenticate a Redis connection after its been established.

    "},{"t":"M","n":"Redis::bgSave","p":"Redis.html#method_bgSave","d":"

    Execute a save of the Redis database in the background.

    "},{"t":"M","n":"Redis::bgrewriteaof","p":"Redis.html#method_bgrewriteaof","d":"

    Asynchronously rewrite Redis' append-only file

    "},{"t":"M","n":"Redis::bitcount","p":"Redis.html#method_bitcount","d":"

    Count the number of set bits in a Redis string.

    "},{"t":"M","n":"Redis::bitop","p":"Redis.html#method_bitop","d":null},{"t":"M","n":"Redis::bitpos","p":"Redis.html#method_bitpos","d":"

    Return the position of the first bit set to 0 or 1 in a string.

    "},{"t":"M","n":"Redis::blPop","p":"Redis.html#method_blPop","d":"

    Pop an element off the beginning of a Redis list or lists, potentially blocking up to a specified\ntimeout. This method may be called in two distinct ways, of which examples are provided below.

    "},{"t":"M","n":"Redis::brPop","p":"Redis.html#method_brPop","d":"

    Pop an element off of the end of a Redis list or lists, potentially blocking up to a specified timeout.

    "},{"t":"M","n":"Redis::brpoplpush","p":"Redis.html#method_brpoplpush","d":"

    Pop an element from the end of a Redis list, pushing it to the beginning of another Redis list,\noptionally blocking up to a specified timeout.

    "},{"t":"M","n":"Redis::bzPopMax","p":"Redis.html#method_bzPopMax","d":"

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

    "},{"t":"M","n":"Redis::bzPopMin","p":"Redis.html#method_bzPopMin","d":"

    POP the minimum scoring element off of one or more sorted sets, blocking up to a specified timeout\nif no elements are available

    "},{"t":"M","n":"Redis::bzmpop","p":"Redis.html#method_bzmpop","d":"

    POP one or more elements from one or more sorted sets, blocking up to a specified amount of time\nwhen no elements are available.

    "},{"t":"M","n":"Redis::zmpop","p":"Redis.html#method_zmpop","d":"

    POP one or more of the highest or lowest scoring elements from one or more sorted sets.

    "},{"t":"M","n":"Redis::blmpop","p":"Redis.html#method_blmpop","d":"

    Pop one or more elements from one or more Redis LISTs, blocking up to a specified timeout when\nno elements are available.

    "},{"t":"M","n":"Redis::lmpop","p":"Redis.html#method_lmpop","d":"

    Pop one or more elements off of one or more Redis LISTs.

    "},{"t":"M","n":"Redis::clearLastError","p":"Redis.html#method_clearLastError","d":"

    Reset any last error on the connection to NULL

    "},{"t":"M","n":"Redis::client","p":"Redis.html#method_client","d":null},{"t":"M","n":"Redis::close","p":"Redis.html#method_close","d":null},{"t":"M","n":"Redis::command","p":"Redis.html#method_command","d":null},{"t":"M","n":"Redis::config","p":"Redis.html#method_config","d":"

    Execute the Redis CONFIG command in a variety of ways.

    "},{"t":"M","n":"Redis::connect","p":"Redis.html#method_connect","d":null},{"t":"M","n":"Redis::copy","p":"Redis.html#method_copy","d":"

    Make a copy of a key.

    "},{"t":"M","n":"Redis::dbSize","p":"Redis.html#method_dbSize","d":"

    Return the number of keys in the currently selected Redis database.

    "},{"t":"M","n":"Redis::debug","p":"Redis.html#method_debug","d":null},{"t":"M","n":"Redis::decr","p":"Redis.html#method_decr","d":"

    Decrement a Redis integer by 1 or a provided value.

    "},{"t":"M","n":"Redis::decrBy","p":"Redis.html#method_decrBy","d":"

    Decrement a redis integer by a value

    "},{"t":"M","n":"Redis::del","p":"Redis.html#method_del","d":"

    Delete one or more keys from Redis.

    "},{"t":"M","n":"Redis::delete","p":"Redis.html#method_delete","d":""},{"t":"M","n":"Redis::discard","p":"Redis.html#method_discard","d":"

    Discard a transaction currently in progress.

    "},{"t":"M","n":"Redis::dump","p":"Redis.html#method_dump","d":"

    Dump Redis' internal binary representation of a key.

    "},{"t":"M","n":"Redis::echo","p":"Redis.html#method_echo","d":"

    Have Redis repeat back an arbitrary string to the client.

    "},{"t":"M","n":"Redis::eval","p":"Redis.html#method_eval","d":"

    Execute a LUA script on the redis server.

    "},{"t":"M","n":"Redis::eval_ro","p":"Redis.html#method_eval_ro","d":"

    This is simply the read-only variant of eval, meaning the underlying script\nmay not modify data in redis.

    "},{"t":"M","n":"Redis::evalsha","p":"Redis.html#method_evalsha","d":"

    Execute a LUA script on the server but instead of sending the script, send\nthe SHA1 hash of the script.

    "},{"t":"M","n":"Redis::evalsha_ro","p":"Redis.html#method_evalsha_ro","d":"

    This is simply the read-only variant of evalsha, meaning the underlying script\nmay not modify data in redis.

    "},{"t":"M","n":"Redis::exec","p":"Redis.html#method_exec","d":"

    Execute either a MULTI or PIPELINE block and return the array of replies.

    "},{"t":"M","n":"Redis::exists","p":"Redis.html#method_exists","d":"

    Test if one or more keys exist.

    "},{"t":"M","n":"Redis::expire","p":"Redis.html#method_expire","d":"

    Sets an expiration in seconds on the key in question. If connected to\nredis-server >= 7.0.0 you may send an additional "mode" argument which\nmodifies how the command will execute.

    "},{"t":"M","n":"Redis::expireAt","p":"Redis.html#method_expireAt","d":"

    Set a key to expire at an exact unix timestamp.

    "},{"t":"M","n":"Redis::failover","p":"Redis.html#method_failover","d":null},{"t":"M","n":"Redis::expiretime","p":"Redis.html#method_expiretime","d":"

    Get the expiration of a given key as a unix timestamp

    "},{"t":"M","n":"Redis::pexpiretime","p":"Redis.html#method_pexpiretime","d":"

    Get the expriation timestamp of a given Redis key but in milliseconds.

    "},{"t":"M","n":"Redis::flushAll","p":"Redis.html#method_flushAll","d":"

    Deletes every key in all Redis databases

    "},{"t":"M","n":"Redis::flushDB","p":"Redis.html#method_flushDB","d":"

    Deletes all the keys of the currently selected database.

    "},{"t":"M","n":"Redis::geoadd","p":"Redis.html#method_geoadd","d":"

    Add one or more members to a geospacial sorted set

    "},{"t":"M","n":"Redis::geodist","p":"Redis.html#method_geodist","d":"

    Get the distance between two members of a geospacially encoded sorted set.

    "},{"t":"M","n":"Redis::geohash","p":"Redis.html#method_geohash","d":"

    Retrieve one or more GeoHash encoded strings for members of the set.

    "},{"t":"M","n":"Redis::geopos","p":"Redis.html#method_geopos","d":"

    Return the longitude and lattitude for one or more members of a geospacially encoded sorted set.

    "},{"t":"M","n":"Redis::georadius","p":"Redis.html#method_georadius","d":"

    Retrieve members of a geospacially sorted set that are within a certain radius of a location.

    "},{"t":"M","n":"Redis::georadius_ro","p":"Redis.html#method_georadius_ro","d":"

    A readonly variant of GEORADIUS that may be executed on replicas.

    "},{"t":"M","n":"Redis::georadiusbymember","p":"Redis.html#method_georadiusbymember","d":"

    Similar to GEORADIUS except it uses a member as the center of the query.

    "},{"t":"M","n":"Redis::georadiusbymember_ro","p":"Redis.html#method_georadiusbymember_ro","d":"

    This is the read-only variant of GEORADIUSBYMEMBER that can be run on replicas.

    "},{"t":"M","n":"Redis::geosearch","p":"Redis.html#method_geosearch","d":"

    Search a geospacial sorted set for members in various ways.

    "},{"t":"M","n":"Redis::geosearchstore","p":"Redis.html#method_geosearchstore","d":"

    Search a geospacial sorted set for members within a given area or range, storing the results into\na new set.

    "},{"t":"M","n":"Redis::get","p":"Redis.html#method_get","d":"

    Retrieve a string keys value.

    "},{"t":"M","n":"Redis::getAuth","p":"Redis.html#method_getAuth","d":"

    Get the authentication information on the connection, if any.

    "},{"t":"M","n":"Redis::getBit","p":"Redis.html#method_getBit","d":"

    Get the bit at a given index in a string key.

    "},{"t":"M","n":"Redis::getEx","p":"Redis.html#method_getEx","d":"

    Get the value of a key and optionally set it's expiration.

    "},{"t":"M","n":"Redis::getDBNum","p":"Redis.html#method_getDBNum","d":"

    Get the database number PhpRedis thinks we're connected to.

    "},{"t":"M","n":"Redis::getDel","p":"Redis.html#method_getDel","d":"

    Get a key from Redis and delete it in an atomic operation.

    "},{"t":"M","n":"Redis::getHost","p":"Redis.html#method_getHost","d":"

    Return the host or Unix socket we are connected to.

    "},{"t":"M","n":"Redis::getLastError","p":"Redis.html#method_getLastError","d":"

    Get the last error returned to us from Redis, if any.

    "},{"t":"M","n":"Redis::getMode","p":"Redis.html#method_getMode","d":"

    Returns whether the connection is in ATOMIC, MULTI, or PIPELINE mode

    "},{"t":"M","n":"Redis::getOption","p":"Redis.html#method_getOption","d":"

    Retrieve the value of a configuration setting as set by Redis::setOption()

    "},{"t":"M","n":"Redis::getPersistentID","p":"Redis.html#method_getPersistentID","d":"

    Get the persistent connection ID, if there is one.

    "},{"t":"M","n":"Redis::getPort","p":"Redis.html#method_getPort","d":"

    Get the port we are connected to. This number will be zero if we are connected to a unix socket.

    "},{"t":"M","n":"Redis::getRange","p":"Redis.html#method_getRange","d":"

    Retrieve a substring of a string by index.

    "},{"t":"M","n":"Redis::lcs","p":"Redis.html#method_lcs","d":"

    Get the longest common subsequence between two string keys.

    "},{"t":"M","n":"Redis::getReadTimeout","p":"Redis.html#method_getReadTimeout","d":"

    Get the currently set read timeout on the connection.

    "},{"t":"M","n":"Redis::getset","p":"Redis.html#method_getset","d":"

    Sets a key and returns any previously set value, if the key already existed.

    "},{"t":"M","n":"Redis::getTimeout","p":"Redis.html#method_getTimeout","d":"

    Retrieve any set connection timeout

    "},{"t":"M","n":"Redis::getTransferredBytes","p":"Redis.html#method_getTransferredBytes","d":null},{"t":"M","n":"Redis::hDel","p":"Redis.html#method_hDel","d":"

    Remove one or more fields from a hash.

    "},{"t":"M","n":"Redis::hExists","p":"Redis.html#method_hExists","d":"

    Checks whether a field exists in a hash.

    "},{"t":"M","n":"Redis::hGet","p":"Redis.html#method_hGet","d":null},{"t":"M","n":"Redis::hGetAll","p":"Redis.html#method_hGetAll","d":"

    Read every field and value from a hash.

    "},{"t":"M","n":"Redis::hIncrBy","p":"Redis.html#method_hIncrBy","d":"

    Increment a hash field's value by an integer

    "},{"t":"M","n":"Redis::hIncrByFloat","p":"Redis.html#method_hIncrByFloat","d":"

    Increment a hash field by a floating point value

    "},{"t":"M","n":"Redis::hKeys","p":"Redis.html#method_hKeys","d":"

    Retrieve all of the fields of a hash.

    "},{"t":"M","n":"Redis::hLen","p":"Redis.html#method_hLen","d":"

    Get the number of fields in a hash.

    "},{"t":"M","n":"Redis::hMget","p":"Redis.html#method_hMget","d":"

    Get one or more fields from a hash.

    "},{"t":"M","n":"Redis::hMset","p":"Redis.html#method_hMset","d":"

    Add or update one or more hash fields and values

    "},{"t":"M","n":"Redis::hRandField","p":"Redis.html#method_hRandField","d":"

    Get one or more random field from a hash.

    "},{"t":"M","n":"Redis::hSet","p":"Redis.html#method_hSet","d":null},{"t":"M","n":"Redis::hSetNx","p":"Redis.html#method_hSetNx","d":"

    Set a hash field and value, but only if that field does not exist

    "},{"t":"M","n":"Redis::hStrLen","p":"Redis.html#method_hStrLen","d":"

    Get the string length of a hash field

    "},{"t":"M","n":"Redis::hVals","p":"Redis.html#method_hVals","d":"

    Get all of the values from a hash.

    "},{"t":"M","n":"Redis::hscan","p":"Redis.html#method_hscan","d":"

    Iterate over the fields and values of a hash in an incremental fashion.

    "},{"t":"M","n":"Redis::incr","p":"Redis.html#method_incr","d":"

    Increment a key's value, optionally by a specifc amount.

    "},{"t":"M","n":"Redis::incrBy","p":"Redis.html#method_incrBy","d":"

    Increment a key by a specific integer value

    "},{"t":"M","n":"Redis::incrByFloat","p":"Redis.html#method_incrByFloat","d":"

    Increment a numeric key by a floating point value.

    "},{"t":"M","n":"Redis::info","p":"Redis.html#method_info","d":"

    Retrieve information about the connected redis-server. If no arguments are passed to\nthis function, redis will return every info field. Alternatively you may pass a specific\nsection you want returned (e.g. 'server', or 'memory') to receive only information pertaining\nto that section.

    "},{"t":"M","n":"Redis::isConnected","p":"Redis.html#method_isConnected","d":"

    Check if we are currently connected to a Redis instance.

    "},{"t":"M","n":"Redis::keys","p":"Redis.html#method_keys","d":""},{"t":"M","n":"Redis::lInsert","p":"Redis.html#method_lInsert","d":""},{"t":"M","n":"Redis::lLen","p":"Redis.html#method_lLen","d":"

    Retrieve the lenght of a list.

    "},{"t":"M","n":"Redis::lMove","p":"Redis.html#method_lMove","d":"

    Move an element from one list into another.

    "},{"t":"M","n":"Redis::lPop","p":"Redis.html#method_lPop","d":"

    Pop one or more elements off a list.

    "},{"t":"M","n":"Redis::lPos","p":"Redis.html#method_lPos","d":"

    Retrieve the index of an element in a list.

    "},{"t":"M","n":"Redis::lPush","p":"Redis.html#method_lPush","d":"

    Prepend one or more elements to a list.

    "},{"t":"M","n":"Redis::rPush","p":"Redis.html#method_rPush","d":"

    Append one or more elements to a list.

    "},{"t":"M","n":"Redis::lPushx","p":"Redis.html#method_lPushx","d":"

    Prepend an element to a list but only if the list exists

    "},{"t":"M","n":"Redis::rPushx","p":"Redis.html#method_rPushx","d":"

    Append an element to a list but only if the list exists

    "},{"t":"M","n":"Redis::lSet","p":"Redis.html#method_lSet","d":"

    Set a list element at an index to a specific value.

    "},{"t":"M","n":"Redis::lastSave","p":"Redis.html#method_lastSave","d":"

    Retrieve the last time Redis' database was persisted to disk.

    "},{"t":"M","n":"Redis::lindex","p":"Redis.html#method_lindex","d":"

    Get the element of a list by its index.

    "},{"t":"M","n":"Redis::lrange","p":"Redis.html#method_lrange","d":"

    Retrieve elements from a list.

    "},{"t":"M","n":"Redis::lrem","p":"Redis.html#method_lrem","d":"

    Remove one or more matching elements from a list.

    "},{"t":"M","n":"Redis::ltrim","p":"Redis.html#method_ltrim","d":"

    Trim a list to a subrange of elements.

    "},{"t":"M","n":"Redis::mget","p":"Redis.html#method_mget","d":"

    Get one ore more string keys.

    "},{"t":"M","n":"Redis::migrate","p":"Redis.html#method_migrate","d":null},{"t":"M","n":"Redis::move","p":"Redis.html#method_move","d":"

    Move a key to a different database on the same redis instance.

    "},{"t":"M","n":"Redis::mset","p":"Redis.html#method_mset","d":"

    Set one ore more string keys.

    "},{"t":"M","n":"Redis::msetnx","p":"Redis.html#method_msetnx","d":"

    Set one ore more string keys but only if none of the key exist.

    "},{"t":"M","n":"Redis::multi","p":"Redis.html#method_multi","d":"

    Begin a transaction.

    "},{"t":"M","n":"Redis::object","p":"Redis.html#method_object","d":null},{"t":"M","n":"Redis::open","p":"Redis.html#method_open","d":""},{"t":"M","n":"Redis::pconnect","p":"Redis.html#method_pconnect","d":null},{"t":"M","n":"Redis::persist","p":"Redis.html#method_persist","d":"

    Remove the expiration from a key.

    "},{"t":"M","n":"Redis::pexpire","p":"Redis.html#method_pexpire","d":"

    Sets an expiration in milliseconds on a given key. If connected to Redis >= 7.0.0\nyou can pass an optional mode argument that modifies how the command will execute.

    "},{"t":"M","n":"Redis::pexpireAt","p":"Redis.html#method_pexpireAt","d":"

    Set a key's expiration to a specific Unix Timestamp in milliseconds. If connected to\nRedis >= 7.0.0 you can pass an optional 'mode' argument.

    "},{"t":"M","n":"Redis::pfadd","p":"Redis.html#method_pfadd","d":"

    Add one or more elements to a Redis HyperLogLog key

    "},{"t":"M","n":"Redis::pfcount","p":"Redis.html#method_pfcount","d":"

    Retrieve the cardinality of a Redis HyperLogLog key.

    "},{"t":"M","n":"Redis::pfmerge","p":"Redis.html#method_pfmerge","d":"

    Merge one or more source HyperLogLog sets into a destination set.

    "},{"t":"M","n":"Redis::ping","p":"Redis.html#method_ping","d":"

    PING the redis server with an optional string argument.

    "},{"t":"M","n":"Redis::pipeline","p":"Redis.html#method_pipeline","d":"

    Enter into pipeline mode.

    "},{"t":"M","n":"Redis::popen","p":"Redis.html#method_popen","d":""},{"t":"M","n":"Redis::psetex","p":"Redis.html#method_psetex","d":"

    Set a key with an expiration time in milliseconds

    "},{"t":"M","n":"Redis::psubscribe","p":"Redis.html#method_psubscribe","d":"

    Subscribe to one or more glob-style patterns

    "},{"t":"M","n":"Redis::pttl","p":"Redis.html#method_pttl","d":"

    Get a keys time to live in milliseconds.

    "},{"t":"M","n":"Redis::publish","p":"Redis.html#method_publish","d":"

    Publish a message to a pubsub channel

    "},{"t":"M","n":"Redis::pubsub","p":"Redis.html#method_pubsub","d":null},{"t":"M","n":"Redis::punsubscribe","p":"Redis.html#method_punsubscribe","d":"

    Unsubscribe from one or more channels by pattern

    "},{"t":"M","n":"Redis::rPop","p":"Redis.html#method_rPop","d":"

    Pop one or more elements from the end of a list.

    "},{"t":"M","n":"Redis::randomKey","p":"Redis.html#method_randomKey","d":"

    Return a random key from the current database

    "},{"t":"M","n":"Redis::rawcommand","p":"Redis.html#method_rawcommand","d":"

    Execute any arbitrary Redis command by name.

    "},{"t":"M","n":"Redis::rename","p":"Redis.html#method_rename","d":"

    Unconditionally rename a key from $old_name to $new_name

    "},{"t":"M","n":"Redis::renameNx","p":"Redis.html#method_renameNx","d":"

    Renames $key_src to $key_dst but only if newkey does not exist.

    "},{"t":"M","n":"Redis::reset","p":"Redis.html#method_reset","d":"

    Reset the state of the connection.

    "},{"t":"M","n":"Redis::restore","p":"Redis.html#method_restore","d":"

    Restore a key by the binary payload generated by the DUMP command.

    "},{"t":"M","n":"Redis::role","p":"Redis.html#method_role","d":"

    Query whether the connected instance is a primary or replica

    "},{"t":"M","n":"Redis::rpoplpush","p":"Redis.html#method_rpoplpush","d":"

    Atomically pop an element off the end of a Redis LIST and push it to the beginning of\nanother.

    "},{"t":"M","n":"Redis::sAdd","p":"Redis.html#method_sAdd","d":"

    Add one or more values to a Redis SET key.

    "},{"t":"M","n":"Redis::sAddArray","p":"Redis.html#method_sAddArray","d":"

    Add one ore more values to a Redis SET key. This is an alternative to Redis::sadd() but\ninstead of being variadic, takes a single array of values.

    "},{"t":"M","n":"Redis::sDiff","p":"Redis.html#method_sDiff","d":"

    Given one or more Redis SETS, this command returns all of the members from the first\nset that are not in any subsequent set.

    "},{"t":"M","n":"Redis::sDiffStore","p":"Redis.html#method_sDiffStore","d":"

    This method performs the same operation as SDIFF except it stores the resulting diff\nvalues in a specified destination key.

    "},{"t":"M","n":"Redis::sInter","p":"Redis.html#method_sInter","d":"

    Given one or more Redis SET keys, this command will return all of the elements that are\nin every one.

    "},{"t":"M","n":"Redis::sintercard","p":"Redis.html#method_sintercard","d":"

    Compute the intersection of one or more sets and return the cardinality of the result.

    "},{"t":"M","n":"Redis::sInterStore","p":"Redis.html#method_sInterStore","d":"

    Perform the intersection of one or more Redis SETs, storing the result in a destination\nkey, rather than returning them.

    "},{"t":"M","n":"Redis::sMembers","p":"Redis.html#method_sMembers","d":"

    Retrieve every member from a set key.

    "},{"t":"M","n":"Redis::sMisMember","p":"Redis.html#method_sMisMember","d":"

    Check if one or more values are members of a set.

    "},{"t":"M","n":"Redis::sMove","p":"Redis.html#method_sMove","d":"

    Pop a member from one set and push it onto another. This command will create the\ndestination set if it does not currently exist.

    "},{"t":"M","n":"Redis::sPop","p":"Redis.html#method_sPop","d":"

    Remove one or more elements from a set.

    "},{"t":"M","n":"Redis::sRandMember","p":"Redis.html#method_sRandMember","d":"

    Retrieve one or more random members of a set.

    "},{"t":"M","n":"Redis::sUnion","p":"Redis.html#method_sUnion","d":"

    Returns the union of one or more Redis SET keys.

    "},{"t":"M","n":"Redis::sUnionStore","p":"Redis.html#method_sUnionStore","d":"

    Perform a union of one or more Redis SET keys and store the result in a new set

    "},{"t":"M","n":"Redis::save","p":"Redis.html#method_save","d":"

    Persist the Redis database to disk. This command will block the server until the save is\ncompleted. For a nonblocking alternative, see Redis::bgsave().

    "},{"t":"M","n":"Redis::scan","p":"Redis.html#method_scan","d":"

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

    "},{"t":"M","n":"Redis::scard","p":"Redis.html#method_scard","d":"

    Retrieve the number of members in a Redis set.

    "},{"t":"M","n":"Redis::script","p":"Redis.html#method_script","d":"

    An administrative command used to interact with LUA scripts stored on the server.

    "},{"t":"M","n":"Redis::select","p":"Redis.html#method_select","d":"

    Select a specific Redis database.

    "},{"t":"M","n":"Redis::set","p":"Redis.html#method_set","d":"

    Create or set a Redis STRING key to a value.

    "},{"t":"M","n":"Redis::setBit","p":"Redis.html#method_setBit","d":"

    Set a specific bit in a Redis string to zero or one

    "},{"t":"M","n":"Redis::setRange","p":"Redis.html#method_setRange","d":"

    Update or append to a Redis string at a specific starting index

    "},{"t":"M","n":"Redis::setOption","p":"Redis.html#method_setOption","d":"

    Set a configurable option on the Redis object.

    "},{"t":"M","n":"Redis::setex","p":"Redis.html#method_setex","d":"

    Set a Redis STRING key with a specific expiration in seconds.

    "},{"t":"M","n":"Redis::setnx","p":"Redis.html#method_setnx","d":"

    Set a key to a value, but only if that key does not already exist.

    "},{"t":"M","n":"Redis::sismember","p":"Redis.html#method_sismember","d":"

    Check whether a given value is the member of a Redis SET.

    "},{"t":"M","n":"Redis::slaveof","p":"Redis.html#method_slaveof","d":"

    Turn a redis instance into a replica of another or promote a replica\nto a primary.

    "},{"t":"M","n":"Redis::replicaof","p":"Redis.html#method_replicaof","d":"

    Used to turn a Redis instance into a replica of another, or to remove\nreplica status promoting the instance to a primary.

    "},{"t":"M","n":"Redis::touch","p":"Redis.html#method_touch","d":"

    Update one or more keys last modified metadata.

    "},{"t":"M","n":"Redis::slowlog","p":"Redis.html#method_slowlog","d":"

    Interact with Redis' slowlog functionality in various ways, depending\non the value of 'operation'.

    "},{"t":"M","n":"Redis::sort","p":"Redis.html#method_sort","d":"

    Sort the contents of a Redis key in various ways.

    "},{"t":"M","n":"Redis::sort_ro","p":"Redis.html#method_sort_ro","d":"

    This is simply a read-only variant of the sort command

    "},{"t":"M","n":"Redis::sortAsc","p":"Redis.html#method_sortAsc","d":""},{"t":"M","n":"Redis::sortAscAlpha","p":"Redis.html#method_sortAscAlpha","d":""},{"t":"M","n":"Redis::sortDesc","p":"Redis.html#method_sortDesc","d":""},{"t":"M","n":"Redis::sortDescAlpha","p":"Redis.html#method_sortDescAlpha","d":""},{"t":"M","n":"Redis::srem","p":"Redis.html#method_srem","d":"

    Remove one or more values from a Redis SET key.

    "},{"t":"M","n":"Redis::sscan","p":"Redis.html#method_sscan","d":"

    Scan the members of a redis SET key.

    "},{"t":"M","n":"Redis::strlen","p":"Redis.html#method_strlen","d":"

    Retrieve the length of a Redis STRING key.

    "},{"t":"M","n":"Redis::subscribe","p":"Redis.html#method_subscribe","d":"

    Subscribe to one or more Redis pubsub channels.

    "},{"t":"M","n":"Redis::swapdb","p":"Redis.html#method_swapdb","d":"

    Atomically swap two Redis databases so that all of the keys in the source database will\nnow be in the destination database and vice-versa.

    "},{"t":"M","n":"Redis::time","p":"Redis.html#method_time","d":"

    Retrieve the server time from the connected Redis instance.

    "},{"t":"M","n":"Redis::ttl","p":"Redis.html#method_ttl","d":"

    Get the amount of time a Redis key has before it will expire, in seconds.

    "},{"t":"M","n":"Redis::type","p":"Redis.html#method_type","d":"

    Get the type of a given Redis key.

    "},{"t":"M","n":"Redis::unlink","p":"Redis.html#method_unlink","d":"

    Delete one or more keys from the Redis database. Unlike this operation, the actual\ndeletion is asynchronous, meaning it is safe to delete large keys without fear of\nRedis blocking for a long period of time.

    "},{"t":"M","n":"Redis::unsubscribe","p":"Redis.html#method_unsubscribe","d":"

    Unsubscribe from one or more subscribed channels.

    "},{"t":"M","n":"Redis::unwatch","p":"Redis.html#method_unwatch","d":"

    Remove any previously WATCH'ed keys in a transaction.

    "},{"t":"M","n":"Redis::watch","p":"Redis.html#method_watch","d":"

    Watch one or more keys for conditional execution of a transaction.

    "},{"t":"M","n":"Redis::wait","p":"Redis.html#method_wait","d":"

    Block the client up to the provided timeout until a certain number of replicas have confirmed\nrecieving them.

    "},{"t":"M","n":"Redis::xack","p":"Redis.html#method_xack","d":"

    Acknowledge one ore more messages that are pending (have been consumed using XREADGROUP but\nnot yet acknowledged by XACK.)

    "},{"t":"M","n":"Redis::xadd","p":"Redis.html#method_xadd","d":"

    Append a message to a stream.

    "},{"t":"M","n":"Redis::xautoclaim","p":"Redis.html#method_xautoclaim","d":"

    This command allows a consumer to claim pending messages that have been idle for a specified period of time.

    "},{"t":"M","n":"Redis::xclaim","p":"Redis.html#method_xclaim","d":"

    This method allows a consumer to take ownership of pending stream entries, by ID. Another\ncommand that does much the same thing but does not require passing specific IDs is Redis::xAutoClaim.

    "},{"t":"M","n":"Redis::xdel","p":"Redis.html#method_xdel","d":"

    Remove one or more specific IDs from a stream.

    "},{"t":"M","n":"Redis::xgroup","p":"Redis.html#method_xgroup","d":"XGROUP"},{"t":"M","n":"Redis::xinfo","p":"Redis.html#method_xinfo","d":"

    Retrieve information about a stream key.

    "},{"t":"M","n":"Redis::xlen","p":"Redis.html#method_xlen","d":"

    Get the number of messages in a Redis STREAM key.

    "},{"t":"M","n":"Redis::xpending","p":"Redis.html#method_xpending","d":"

    Interact with stream messages that have been consumed by a consumer group but not yet\nacknowledged with XACK.

    "},{"t":"M","n":"Redis::xrange","p":"Redis.html#method_xrange","d":"

    Get a range of entries from a STREAM key.

    "},{"t":"M","n":"Redis::xread","p":"Redis.html#method_xread","d":"

    Consume one or more unconsumed elements in one or more streams.

    "},{"t":"M","n":"Redis::xreadgroup","p":"Redis.html#method_xreadgroup","d":"

    Read one or more messages using a consumer group.

    "},{"t":"M","n":"Redis::xrevrange","p":"Redis.html#method_xrevrange","d":"

    Get a range of entries from a STREAM ke in reverse cronological order.

    "},{"t":"M","n":"Redis::xtrim","p":"Redis.html#method_xtrim","d":"

    Truncate a STREAM key in various ways.

    "},{"t":"M","n":"Redis::zAdd","p":"Redis.html#method_zAdd","d":"

    Add one or more elements and scores to a Redis sorted set.

    "},{"t":"M","n":"Redis::zCard","p":"Redis.html#method_zCard","d":"

    Return the number of elements in a sorted set.

    "},{"t":"M","n":"Redis::zCount","p":"Redis.html#method_zCount","d":"

    Count the number of members in a sorted set with scores inside a provided range.

    "},{"t":"M","n":"Redis::zIncrBy","p":"Redis.html#method_zIncrBy","d":"

    Create or increment the score of a member in a Redis sorted set

    "},{"t":"M","n":"Redis::zLexCount","p":"Redis.html#method_zLexCount","d":"

    Count the number of elements in a sorted set whos members fall within the provided\nlexographical range.

    "},{"t":"M","n":"Redis::zMscore","p":"Redis.html#method_zMscore","d":"

    Retrieve the score of one or more members in a sorted set.

    "},{"t":"M","n":"Redis::zPopMax","p":"Redis.html#method_zPopMax","d":"

    Pop one or more of the highest scoring elements from a sorted set.

    "},{"t":"M","n":"Redis::zPopMin","p":"Redis.html#method_zPopMin","d":"

    Pop one or more of the lowest scoring elements from a sorted set.

    "},{"t":"M","n":"Redis::zRange","p":"Redis.html#method_zRange","d":"

    Retrieve a range of elements of a sorted set between a start and end point.

    "},{"t":"M","n":"Redis::zRangeByLex","p":"Redis.html#method_zRangeByLex","d":"

    Retrieve a range of elements from a sorted set by legographical range.

    "},{"t":"M","n":"Redis::zRangeByScore","p":"Redis.html#method_zRangeByScore","d":"

    Retrieve a range of members from a sorted set by their score.

    "},{"t":"M","n":"Redis::zrangestore","p":"Redis.html#method_zrangestore","d":"

    This command is similar to ZRANGE except that instead of returning the values directly\nit will store them in a destination key provided by the user

    "},{"t":"M","n":"Redis::zRandMember","p":"Redis.html#method_zRandMember","d":"

    Retrieve one or more random members from a Redis sorted set.

    "},{"t":"M","n":"Redis::zRank","p":"Redis.html#method_zRank","d":"

    Get the rank of a member of a sorted set, by score.

    "},{"t":"M","n":"Redis::zRem","p":"Redis.html#method_zRem","d":"

    Remove one or more members from a Redis sorted set.

    "},{"t":"M","n":"Redis::zRemRangeByLex","p":"Redis.html#method_zRemRangeByLex","d":"

    Remove zero or more elements from a Redis sorted set by legographical range.

    "},{"t":"M","n":"Redis::zRemRangeByRank","p":"Redis.html#method_zRemRangeByRank","d":"

    Remove one or more members of a sorted set by their rank.

    "},{"t":"M","n":"Redis::zRemRangeByScore","p":"Redis.html#method_zRemRangeByScore","d":"

    Remove one or more members of a sorted set by their score.

    "},{"t":"M","n":"Redis::zRevRange","p":"Redis.html#method_zRevRange","d":"

    List the members of a Redis sorted set in reverse order

    "},{"t":"M","n":"Redis::zRevRangeByLex","p":"Redis.html#method_zRevRangeByLex","d":"

    List members of a Redis sorted set within a legographical range, in reverse order.

    "},{"t":"M","n":"Redis::zRevRangeByScore","p":"Redis.html#method_zRevRangeByScore","d":"

    List elements from a Redis sorted set by score, highest to lowest

    "},{"t":"M","n":"Redis::zRevRank","p":"Redis.html#method_zRevRank","d":"

    Retrieve a member of a sorted set by reverse rank.

    "},{"t":"M","n":"Redis::zScore","p":"Redis.html#method_zScore","d":"

    Get the score of a member of a sorted set.

    "},{"t":"M","n":"Redis::zdiff","p":"Redis.html#method_zdiff","d":"

    Given one or more sorted set key names, return every element that is in the first\nset but not any of the others.

    "},{"t":"M","n":"Redis::zdiffstore","p":"Redis.html#method_zdiffstore","d":"

    Store the difference of one or more sorted sets in a destination sorted set.

    "},{"t":"M","n":"Redis::zinter","p":"Redis.html#method_zinter","d":"

    Compute the intersection of one or more sorted sets and return the members

    "},{"t":"M","n":"Redis::zintercard","p":"Redis.html#method_zintercard","d":"

    Similar to ZINTER but instead of returning the intersected values, this command returns the\ncardinality of the intersected set.

    "},{"t":"M","n":"Redis::zinterstore","p":"Redis.html#method_zinterstore","d":"

    Compute the intersection of one ore more sorted sets storing the result in a new sorted set.

    "},{"t":"M","n":"Redis::zscan","p":"Redis.html#method_zscan","d":"

    Scan the members of a sorted set incrementally, using a cursor

    "},{"t":"M","n":"Redis::zunion","p":"Redis.html#method_zunion","d":"

    Retrieve the union of one or more sorted sets

    "},{"t":"M","n":"Redis::zunionstore","p":"Redis.html#method_zunionstore","d":"

    Perform a union on one or more Redis sets and store the result in a destination sorted set.

    "},{"t":"M","n":"RedisArray::__call","p":"RedisArray.html#method___call","d":null},{"t":"M","n":"RedisArray::__construct","p":"RedisArray.html#method___construct","d":null},{"t":"M","n":"RedisArray::_continuum","p":"RedisArray.html#method__continuum","d":null},{"t":"M","n":"RedisArray::_distributor","p":"RedisArray.html#method__distributor","d":null},{"t":"M","n":"RedisArray::_function","p":"RedisArray.html#method__function","d":null},{"t":"M","n":"RedisArray::_hosts","p":"RedisArray.html#method__hosts","d":null},{"t":"M","n":"RedisArray::_instance","p":"RedisArray.html#method__instance","d":null},{"t":"M","n":"RedisArray::_rehash","p":"RedisArray.html#method__rehash","d":null},{"t":"M","n":"RedisArray::_target","p":"RedisArray.html#method__target","d":null},{"t":"M","n":"RedisArray::bgsave","p":"RedisArray.html#method_bgsave","d":null},{"t":"M","n":"RedisArray::del","p":"RedisArray.html#method_del","d":null},{"t":"M","n":"RedisArray::discard","p":"RedisArray.html#method_discard","d":null},{"t":"M","n":"RedisArray::exec","p":"RedisArray.html#method_exec","d":null},{"t":"M","n":"RedisArray::flushall","p":"RedisArray.html#method_flushall","d":null},{"t":"M","n":"RedisArray::flushdb","p":"RedisArray.html#method_flushdb","d":null},{"t":"M","n":"RedisArray::getOption","p":"RedisArray.html#method_getOption","d":null},{"t":"M","n":"RedisArray::hscan","p":"RedisArray.html#method_hscan","d":null},{"t":"M","n":"RedisArray::info","p":"RedisArray.html#method_info","d":null},{"t":"M","n":"RedisArray::keys","p":"RedisArray.html#method_keys","d":null},{"t":"M","n":"RedisArray::mget","p":"RedisArray.html#method_mget","d":null},{"t":"M","n":"RedisArray::mset","p":"RedisArray.html#method_mset","d":null},{"t":"M","n":"RedisArray::multi","p":"RedisArray.html#method_multi","d":null},{"t":"M","n":"RedisArray::ping","p":"RedisArray.html#method_ping","d":null},{"t":"M","n":"RedisArray::save","p":"RedisArray.html#method_save","d":null},{"t":"M","n":"RedisArray::scan","p":"RedisArray.html#method_scan","d":null},{"t":"M","n":"RedisArray::select","p":"RedisArray.html#method_select","d":null},{"t":"M","n":"RedisArray::setOption","p":"RedisArray.html#method_setOption","d":null},{"t":"M","n":"RedisArray::sscan","p":"RedisArray.html#method_sscan","d":null},{"t":"M","n":"RedisArray::unlink","p":"RedisArray.html#method_unlink","d":null},{"t":"M","n":"RedisArray::unwatch","p":"RedisArray.html#method_unwatch","d":null},{"t":"M","n":"RedisArray::zscan","p":"RedisArray.html#method_zscan","d":null},{"t":"M","n":"RedisCluster::__construct","p":"RedisCluster.html#method___construct","d":null},{"t":"M","n":"RedisCluster::_compress","p":"RedisCluster.html#method__compress","d":""},{"t":"M","n":"RedisCluster::_uncompress","p":"RedisCluster.html#method__uncompress","d":""},{"t":"M","n":"RedisCluster::_serialize","p":"RedisCluster.html#method__serialize","d":""},{"t":"M","n":"RedisCluster::_unserialize","p":"RedisCluster.html#method__unserialize","d":""},{"t":"M","n":"RedisCluster::_pack","p":"RedisCluster.html#method__pack","d":""},{"t":"M","n":"RedisCluster::_unpack","p":"RedisCluster.html#method__unpack","d":""},{"t":"M","n":"RedisCluster::_prefix","p":"RedisCluster.html#method__prefix","d":""},{"t":"M","n":"RedisCluster::_masters","p":"RedisCluster.html#method__masters","d":null},{"t":"M","n":"RedisCluster::_redir","p":"RedisCluster.html#method__redir","d":null},{"t":"M","n":"RedisCluster::acl","p":"RedisCluster.html#method_acl","d":""},{"t":"M","n":"RedisCluster::append","p":"RedisCluster.html#method_append","d":""},{"t":"M","n":"RedisCluster::bgrewriteaof","p":"RedisCluster.html#method_bgrewriteaof","d":""},{"t":"M","n":"RedisCluster::bgsave","p":"RedisCluster.html#method_bgsave","d":""},{"t":"M","n":"RedisCluster::bitcount","p":"RedisCluster.html#method_bitcount","d":""},{"t":"M","n":"RedisCluster::bitop","p":"RedisCluster.html#method_bitop","d":""},{"t":"M","n":"RedisCluster::bitpos","p":"RedisCluster.html#method_bitpos","d":"

    Return the position of the first bit set to 0 or 1 in a string.

    "},{"t":"M","n":"RedisCluster::blpop","p":"RedisCluster.html#method_blpop","d":"

    See Redis::blpop()

    "},{"t":"M","n":"RedisCluster::brpop","p":"RedisCluster.html#method_brpop","d":"

    See Redis::brpop()

    "},{"t":"M","n":"RedisCluster::brpoplpush","p":"RedisCluster.html#method_brpoplpush","d":"

    See Redis::brpoplpush()

    "},{"t":"M","n":"RedisCluster::bzpopmax","p":"RedisCluster.html#method_bzpopmax","d":""},{"t":"M","n":"RedisCluster::bzpopmin","p":"RedisCluster.html#method_bzpopmin","d":""},{"t":"M","n":"RedisCluster::bzmpop","p":"RedisCluster.html#method_bzmpop","d":""},{"t":"M","n":"RedisCluster::zmpop","p":"RedisCluster.html#method_zmpop","d":""},{"t":"M","n":"RedisCluster::blmpop","p":"RedisCluster.html#method_blmpop","d":""},{"t":"M","n":"RedisCluster::lmpop","p":"RedisCluster.html#method_lmpop","d":""},{"t":"M","n":"RedisCluster::clearlasterror","p":"RedisCluster.html#method_clearlasterror","d":""},{"t":"M","n":"RedisCluster::client","p":"RedisCluster.html#method_client","d":""},{"t":"M","n":"RedisCluster::close","p":"RedisCluster.html#method_close","d":""},{"t":"M","n":"RedisCluster::cluster","p":"RedisCluster.html#method_cluster","d":""},{"t":"M","n":"RedisCluster::command","p":"RedisCluster.html#method_command","d":""},{"t":"M","n":"RedisCluster::config","p":"RedisCluster.html#method_config","d":""},{"t":"M","n":"RedisCluster::dbsize","p":"RedisCluster.html#method_dbsize","d":""},{"t":"M","n":"RedisCluster::decr","p":"RedisCluster.html#method_decr","d":""},{"t":"M","n":"RedisCluster::decrby","p":"RedisCluster.html#method_decrby","d":""},{"t":"M","n":"RedisCluster::decrbyfloat","p":"RedisCluster.html#method_decrbyfloat","d":""},{"t":"M","n":"RedisCluster::del","p":"RedisCluster.html#method_del","d":""},{"t":"M","n":"RedisCluster::discard","p":"RedisCluster.html#method_discard","d":""},{"t":"M","n":"RedisCluster::dump","p":"RedisCluster.html#method_dump","d":""},{"t":"M","n":"RedisCluster::echo","p":"RedisCluster.html#method_echo","d":""},{"t":"M","n":"RedisCluster::eval","p":"RedisCluster.html#method_eval","d":""},{"t":"M","n":"RedisCluster::eval_ro","p":"RedisCluster.html#method_eval_ro","d":""},{"t":"M","n":"RedisCluster::evalsha","p":"RedisCluster.html#method_evalsha","d":""},{"t":"M","n":"RedisCluster::evalsha_ro","p":"RedisCluster.html#method_evalsha_ro","d":""},{"t":"M","n":"RedisCluster::exec","p":"RedisCluster.html#method_exec","d":""},{"t":"M","n":"RedisCluster::exists","p":"RedisCluster.html#method_exists","d":""},{"t":"M","n":"RedisCluster::touch","p":"RedisCluster.html#method_touch","d":""},{"t":"M","n":"RedisCluster::expire","p":"RedisCluster.html#method_expire","d":""},{"t":"M","n":"RedisCluster::expireat","p":"RedisCluster.html#method_expireat","d":""},{"t":"M","n":"RedisCluster::expiretime","p":"RedisCluster.html#method_expiretime","d":""},{"t":"M","n":"RedisCluster::pexpiretime","p":"RedisCluster.html#method_pexpiretime","d":""},{"t":"M","n":"RedisCluster::flushall","p":"RedisCluster.html#method_flushall","d":""},{"t":"M","n":"RedisCluster::flushdb","p":"RedisCluster.html#method_flushdb","d":""},{"t":"M","n":"RedisCluster::geoadd","p":"RedisCluster.html#method_geoadd","d":""},{"t":"M","n":"RedisCluster::geodist","p":"RedisCluster.html#method_geodist","d":""},{"t":"M","n":"RedisCluster::geohash","p":"RedisCluster.html#method_geohash","d":""},{"t":"M","n":"RedisCluster::geopos","p":"RedisCluster.html#method_geopos","d":""},{"t":"M","n":"RedisCluster::georadius","p":"RedisCluster.html#method_georadius","d":""},{"t":"M","n":"RedisCluster::georadius_ro","p":"RedisCluster.html#method_georadius_ro","d":""},{"t":"M","n":"RedisCluster::georadiusbymember","p":"RedisCluster.html#method_georadiusbymember","d":""},{"t":"M","n":"RedisCluster::georadiusbymember_ro","p":"RedisCluster.html#method_georadiusbymember_ro","d":""},{"t":"M","n":"RedisCluster::get","p":"RedisCluster.html#method_get","d":""},{"t":"M","n":"RedisCluster::getbit","p":"RedisCluster.html#method_getbit","d":""},{"t":"M","n":"RedisCluster::getlasterror","p":"RedisCluster.html#method_getlasterror","d":""},{"t":"M","n":"RedisCluster::getmode","p":"RedisCluster.html#method_getmode","d":""},{"t":"M","n":"RedisCluster::getoption","p":"RedisCluster.html#method_getoption","d":""},{"t":"M","n":"RedisCluster::getrange","p":"RedisCluster.html#method_getrange","d":""},{"t":"M","n":"RedisCluster::lcs","p":"RedisCluster.html#method_lcs","d":""},{"t":"M","n":"RedisCluster::getset","p":"RedisCluster.html#method_getset","d":""},{"t":"M","n":"RedisCluster::gettransferredbytes","p":"RedisCluster.html#method_gettransferredbytes","d":""},{"t":"M","n":"RedisCluster::hdel","p":"RedisCluster.html#method_hdel","d":""},{"t":"M","n":"RedisCluster::hexists","p":"RedisCluster.html#method_hexists","d":""},{"t":"M","n":"RedisCluster::hget","p":"RedisCluster.html#method_hget","d":""},{"t":"M","n":"RedisCluster::hgetall","p":"RedisCluster.html#method_hgetall","d":""},{"t":"M","n":"RedisCluster::hincrby","p":"RedisCluster.html#method_hincrby","d":""},{"t":"M","n":"RedisCluster::hincrbyfloat","p":"RedisCluster.html#method_hincrbyfloat","d":""},{"t":"M","n":"RedisCluster::hkeys","p":"RedisCluster.html#method_hkeys","d":""},{"t":"M","n":"RedisCluster::hlen","p":"RedisCluster.html#method_hlen","d":""},{"t":"M","n":"RedisCluster::hmget","p":"RedisCluster.html#method_hmget","d":""},{"t":"M","n":"RedisCluster::hmset","p":"RedisCluster.html#method_hmset","d":""},{"t":"M","n":"RedisCluster::hscan","p":"RedisCluster.html#method_hscan","d":""},{"t":"M","n":"RedisCluster::hset","p":"RedisCluster.html#method_hset","d":""},{"t":"M","n":"RedisCluster::hsetnx","p":"RedisCluster.html#method_hsetnx","d":""},{"t":"M","n":"RedisCluster::hstrlen","p":"RedisCluster.html#method_hstrlen","d":""},{"t":"M","n":"RedisCluster::hvals","p":"RedisCluster.html#method_hvals","d":""},{"t":"M","n":"RedisCluster::incr","p":"RedisCluster.html#method_incr","d":""},{"t":"M","n":"RedisCluster::incrby","p":"RedisCluster.html#method_incrby","d":""},{"t":"M","n":"RedisCluster::incrbyfloat","p":"RedisCluster.html#method_incrbyfloat","d":""},{"t":"M","n":"RedisCluster::info","p":"RedisCluster.html#method_info","d":"

    Retrieve information about the connected redis-server. If no arguments are passed to\nthis function, redis will return every info field. Alternatively you may pass a specific\nsection you want returned (e.g. 'server', or 'memory') to receive only information pertaining\nto that section.

    "},{"t":"M","n":"RedisCluster::keys","p":"RedisCluster.html#method_keys","d":""},{"t":"M","n":"RedisCluster::lastsave","p":"RedisCluster.html#method_lastsave","d":""},{"t":"M","n":"RedisCluster::lget","p":"RedisCluster.html#method_lget","d":""},{"t":"M","n":"RedisCluster::lindex","p":"RedisCluster.html#method_lindex","d":""},{"t":"M","n":"RedisCluster::linsert","p":"RedisCluster.html#method_linsert","d":""},{"t":"M","n":"RedisCluster::llen","p":"RedisCluster.html#method_llen","d":""},{"t":"M","n":"RedisCluster::lpop","p":"RedisCluster.html#method_lpop","d":""},{"t":"M","n":"RedisCluster::lpush","p":"RedisCluster.html#method_lpush","d":""},{"t":"M","n":"RedisCluster::lpushx","p":"RedisCluster.html#method_lpushx","d":""},{"t":"M","n":"RedisCluster::lrange","p":"RedisCluster.html#method_lrange","d":""},{"t":"M","n":"RedisCluster::lrem","p":"RedisCluster.html#method_lrem","d":""},{"t":"M","n":"RedisCluster::lset","p":"RedisCluster.html#method_lset","d":""},{"t":"M","n":"RedisCluster::ltrim","p":"RedisCluster.html#method_ltrim","d":""},{"t":"M","n":"RedisCluster::mget","p":"RedisCluster.html#method_mget","d":""},{"t":"M","n":"RedisCluster::mset","p":"RedisCluster.html#method_mset","d":""},{"t":"M","n":"RedisCluster::msetnx","p":"RedisCluster.html#method_msetnx","d":""},{"t":"M","n":"RedisCluster::multi","p":"RedisCluster.html#method_multi","d":null},{"t":"M","n":"RedisCluster::object","p":"RedisCluster.html#method_object","d":""},{"t":"M","n":"RedisCluster::persist","p":"RedisCluster.html#method_persist","d":""},{"t":"M","n":"RedisCluster::pexpire","p":"RedisCluster.html#method_pexpire","d":""},{"t":"M","n":"RedisCluster::pexpireat","p":"RedisCluster.html#method_pexpireat","d":""},{"t":"M","n":"RedisCluster::pfadd","p":"RedisCluster.html#method_pfadd","d":""},{"t":"M","n":"RedisCluster::pfcount","p":"RedisCluster.html#method_pfcount","d":""},{"t":"M","n":"RedisCluster::pfmerge","p":"RedisCluster.html#method_pfmerge","d":""},{"t":"M","n":"RedisCluster::ping","p":"RedisCluster.html#method_ping","d":"

    PING an instance in the redis cluster.

    "},{"t":"M","n":"RedisCluster::psetex","p":"RedisCluster.html#method_psetex","d":""},{"t":"M","n":"RedisCluster::psubscribe","p":"RedisCluster.html#method_psubscribe","d":""},{"t":"M","n":"RedisCluster::pttl","p":"RedisCluster.html#method_pttl","d":""},{"t":"M","n":"RedisCluster::publish","p":"RedisCluster.html#method_publish","d":""},{"t":"M","n":"RedisCluster::pubsub","p":"RedisCluster.html#method_pubsub","d":""},{"t":"M","n":"RedisCluster::punsubscribe","p":"RedisCluster.html#method_punsubscribe","d":""},{"t":"M","n":"RedisCluster::randomkey","p":"RedisCluster.html#method_randomkey","d":""},{"t":"M","n":"RedisCluster::rawcommand","p":"RedisCluster.html#method_rawcommand","d":""},{"t":"M","n":"RedisCluster::rename","p":"RedisCluster.html#method_rename","d":""},{"t":"M","n":"RedisCluster::renamenx","p":"RedisCluster.html#method_renamenx","d":""},{"t":"M","n":"RedisCluster::restore","p":"RedisCluster.html#method_restore","d":""},{"t":"M","n":"RedisCluster::role","p":"RedisCluster.html#method_role","d":""},{"t":"M","n":"RedisCluster::rpop","p":"RedisCluster.html#method_rpop","d":""},{"t":"M","n":"RedisCluster::rpoplpush","p":"RedisCluster.html#method_rpoplpush","d":""},{"t":"M","n":"RedisCluster::rpush","p":"RedisCluster.html#method_rpush","d":""},{"t":"M","n":"RedisCluster::rpushx","p":"RedisCluster.html#method_rpushx","d":""},{"t":"M","n":"RedisCluster::sadd","p":"RedisCluster.html#method_sadd","d":""},{"t":"M","n":"RedisCluster::saddarray","p":"RedisCluster.html#method_saddarray","d":""},{"t":"M","n":"RedisCluster::save","p":"RedisCluster.html#method_save","d":""},{"t":"M","n":"RedisCluster::scan","p":"RedisCluster.html#method_scan","d":""},{"t":"M","n":"RedisCluster::scard","p":"RedisCluster.html#method_scard","d":""},{"t":"M","n":"RedisCluster::script","p":"RedisCluster.html#method_script","d":""},{"t":"M","n":"RedisCluster::sdiff","p":"RedisCluster.html#method_sdiff","d":""},{"t":"M","n":"RedisCluster::sdiffstore","p":"RedisCluster.html#method_sdiffstore","d":""},{"t":"M","n":"RedisCluster::set","p":"RedisCluster.html#method_set","d":""},{"t":"M","n":"RedisCluster::setbit","p":"RedisCluster.html#method_setbit","d":""},{"t":"M","n":"RedisCluster::setex","p":"RedisCluster.html#method_setex","d":""},{"t":"M","n":"RedisCluster::setnx","p":"RedisCluster.html#method_setnx","d":""},{"t":"M","n":"RedisCluster::setoption","p":"RedisCluster.html#method_setoption","d":""},{"t":"M","n":"RedisCluster::setrange","p":"RedisCluster.html#method_setrange","d":""},{"t":"M","n":"RedisCluster::sinter","p":"RedisCluster.html#method_sinter","d":""},{"t":"M","n":"RedisCluster::sintercard","p":"RedisCluster.html#method_sintercard","d":""},{"t":"M","n":"RedisCluster::sinterstore","p":"RedisCluster.html#method_sinterstore","d":""},{"t":"M","n":"RedisCluster::sismember","p":"RedisCluster.html#method_sismember","d":""},{"t":"M","n":"RedisCluster::slowlog","p":"RedisCluster.html#method_slowlog","d":""},{"t":"M","n":"RedisCluster::smembers","p":"RedisCluster.html#method_smembers","d":""},{"t":"M","n":"RedisCluster::smove","p":"RedisCluster.html#method_smove","d":""},{"t":"M","n":"RedisCluster::sort","p":"RedisCluster.html#method_sort","d":""},{"t":"M","n":"RedisCluster::sort_ro","p":"RedisCluster.html#method_sort_ro","d":""},{"t":"M","n":"RedisCluster::spop","p":"RedisCluster.html#method_spop","d":""},{"t":"M","n":"RedisCluster::srandmember","p":"RedisCluster.html#method_srandmember","d":""},{"t":"M","n":"RedisCluster::srem","p":"RedisCluster.html#method_srem","d":""},{"t":"M","n":"RedisCluster::sscan","p":"RedisCluster.html#method_sscan","d":""},{"t":"M","n":"RedisCluster::strlen","p":"RedisCluster.html#method_strlen","d":""},{"t":"M","n":"RedisCluster::subscribe","p":"RedisCluster.html#method_subscribe","d":""},{"t":"M","n":"RedisCluster::sunion","p":"RedisCluster.html#method_sunion","d":""},{"t":"M","n":"RedisCluster::sunionstore","p":"RedisCluster.html#method_sunionstore","d":""},{"t":"M","n":"RedisCluster::time","p":"RedisCluster.html#method_time","d":""},{"t":"M","n":"RedisCluster::ttl","p":"RedisCluster.html#method_ttl","d":""},{"t":"M","n":"RedisCluster::type","p":"RedisCluster.html#method_type","d":""},{"t":"M","n":"RedisCluster::unsubscribe","p":"RedisCluster.html#method_unsubscribe","d":""},{"t":"M","n":"RedisCluster::unlink","p":"RedisCluster.html#method_unlink","d":""},{"t":"M","n":"RedisCluster::unwatch","p":"RedisCluster.html#method_unwatch","d":""},{"t":"M","n":"RedisCluster::watch","p":"RedisCluster.html#method_watch","d":""},{"t":"M","n":"RedisCluster::xack","p":"RedisCluster.html#method_xack","d":""},{"t":"M","n":"RedisCluster::xadd","p":"RedisCluster.html#method_xadd","d":""},{"t":"M","n":"RedisCluster::xclaim","p":"RedisCluster.html#method_xclaim","d":""},{"t":"M","n":"RedisCluster::xdel","p":"RedisCluster.html#method_xdel","d":""},{"t":"M","n":"RedisCluster::xgroup","p":"RedisCluster.html#method_xgroup","d":""},{"t":"M","n":"RedisCluster::xautoclaim","p":"RedisCluster.html#method_xautoclaim","d":""},{"t":"M","n":"RedisCluster::xinfo","p":"RedisCluster.html#method_xinfo","d":""},{"t":"M","n":"RedisCluster::xlen","p":"RedisCluster.html#method_xlen","d":""},{"t":"M","n":"RedisCluster::xpending","p":"RedisCluster.html#method_xpending","d":""},{"t":"M","n":"RedisCluster::xrange","p":"RedisCluster.html#method_xrange","d":""},{"t":"M","n":"RedisCluster::xread","p":"RedisCluster.html#method_xread","d":""},{"t":"M","n":"RedisCluster::xreadgroup","p":"RedisCluster.html#method_xreadgroup","d":""},{"t":"M","n":"RedisCluster::xrevrange","p":"RedisCluster.html#method_xrevrange","d":""},{"t":"M","n":"RedisCluster::xtrim","p":"RedisCluster.html#method_xtrim","d":""},{"t":"M","n":"RedisCluster::zadd","p":"RedisCluster.html#method_zadd","d":""},{"t":"M","n":"RedisCluster::zcard","p":"RedisCluster.html#method_zcard","d":""},{"t":"M","n":"RedisCluster::zcount","p":"RedisCluster.html#method_zcount","d":""},{"t":"M","n":"RedisCluster::zincrby","p":"RedisCluster.html#method_zincrby","d":""},{"t":"M","n":"RedisCluster::zinterstore","p":"RedisCluster.html#method_zinterstore","d":""},{"t":"M","n":"RedisCluster::zintercard","p":"RedisCluster.html#method_zintercard","d":""},{"t":"M","n":"RedisCluster::zlexcount","p":"RedisCluster.html#method_zlexcount","d":""},{"t":"M","n":"RedisCluster::zpopmax","p":"RedisCluster.html#method_zpopmax","d":""},{"t":"M","n":"RedisCluster::zpopmin","p":"RedisCluster.html#method_zpopmin","d":""},{"t":"M","n":"RedisCluster::zrange","p":"RedisCluster.html#method_zrange","d":""},{"t":"M","n":"RedisCluster::zrangestore","p":"RedisCluster.html#method_zrangestore","d":""},{"t":"M","n":"RedisCluster::zrangebylex","p":"RedisCluster.html#method_zrangebylex","d":""},{"t":"M","n":"RedisCluster::zrangebyscore","p":"RedisCluster.html#method_zrangebyscore","d":""},{"t":"M","n":"RedisCluster::zrank","p":"RedisCluster.html#method_zrank","d":""},{"t":"M","n":"RedisCluster::zrem","p":"RedisCluster.html#method_zrem","d":""},{"t":"M","n":"RedisCluster::zremrangebylex","p":"RedisCluster.html#method_zremrangebylex","d":""},{"t":"M","n":"RedisCluster::zremrangebyrank","p":"RedisCluster.html#method_zremrangebyrank","d":""},{"t":"M","n":"RedisCluster::zremrangebyscore","p":"RedisCluster.html#method_zremrangebyscore","d":""},{"t":"M","n":"RedisCluster::zrevrange","p":"RedisCluster.html#method_zrevrange","d":""},{"t":"M","n":"RedisCluster::zrevrangebylex","p":"RedisCluster.html#method_zrevrangebylex","d":""},{"t":"M","n":"RedisCluster::zrevrangebyscore","p":"RedisCluster.html#method_zrevrangebyscore","d":""},{"t":"M","n":"RedisCluster::zrevrank","p":"RedisCluster.html#method_zrevrank","d":""},{"t":"M","n":"RedisCluster::zscan","p":"RedisCluster.html#method_zscan","d":""},{"t":"M","n":"RedisCluster::zscore","p":"RedisCluster.html#method_zscore","d":""},{"t":"M","n":"RedisCluster::zunionstore","p":"RedisCluster.html#method_zunionstore","d":""},{"t":"M","n":"RedisSentinel::__construct","p":"RedisSentinel.html#method___construct","d":null},{"t":"M","n":"RedisSentinel::ckquorum","p":"RedisSentinel.html#method_ckquorum","d":""},{"t":"M","n":"RedisSentinel::failover","p":"RedisSentinel.html#method_failover","d":""},{"t":"M","n":"RedisSentinel::flushconfig","p":"RedisSentinel.html#method_flushconfig","d":""},{"t":"M","n":"RedisSentinel::getMasterAddrByName","p":"RedisSentinel.html#method_getMasterAddrByName","d":""},{"t":"M","n":"RedisSentinel::master","p":"RedisSentinel.html#method_master","d":""},{"t":"M","n":"RedisSentinel::masters","p":"RedisSentinel.html#method_masters","d":""},{"t":"M","n":"RedisSentinel::myid","p":"RedisSentinel.html#method_myid","d":null},{"t":"M","n":"RedisSentinel::ping","p":"RedisSentinel.html#method_ping","d":""},{"t":"M","n":"RedisSentinel::reset","p":"RedisSentinel.html#method_reset","d":""},{"t":"M","n":"RedisSentinel::sentinels","p":"RedisSentinel.html#method_sentinels","d":""},{"t":"M","n":"RedisSentinel::slaves","p":"RedisSentinel.html#method_slaves","d":""},{"t":"N","n":"","p":"[Global_Namespace].html"}]} +{"items":[{"t":"C","n":"Redis","p":"Redis.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisArray","p":"RedisArray.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisCluster","p":"RedisCluster.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisClusterException","p":"RedisClusterException.html","d":null,"f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisException","p":"RedisException.html","d":null,"f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"C","n":"RedisSentinel","p":"RedisSentinel.html","d":"","f":{"n":"[Global Namespace]","p":"[Global_Namespace].html"}},{"t":"M","n":"Redis::__construct","p":"Redis.html#method___construct","d":"

    Create a new Redis instance. If passed sufficient information in the\noptions array it is also possible to connect to an instance at the same\ntime.

    "},{"t":"M","n":"Redis::__destruct","p":"Redis.html#method___destruct","d":"

    Destructor to clean up the Redis object.

    "},{"t":"M","n":"Redis::_compress","p":"Redis.html#method__compress","d":"

    Compress a value with the currently configured compressor (Redis::OPT_COMPRESSION)\nexactly the same way PhpRedis does before sending data to Redis.

    "},{"t":"M","n":"Redis::_uncompress","p":"Redis.html#method__uncompress","d":"

    Uncompress the provided argument using the compressor configured via\nRedis::setOption() (Redis::OPT_COMPRESSION).

    "},{"t":"M","n":"Redis::_prefix","p":"Redis.html#method__prefix","d":"

    Prefix the passed argument with the currently set key prefix as set\nwith Redis::setOption().

    "},{"t":"M","n":"Redis::_serialize","p":"Redis.html#method__serialize","d":"

    Serialize the provided value with the currently set serializer as set\nwith Redis::setOption().

    "},{"t":"M","n":"Redis::_unserialize","p":"Redis.html#method__unserialize","d":"

    Unserialize the passed argument with the currently set serializer as set\nwith Redis::setOption().

    "},{"t":"M","n":"Redis::_pack","p":"Redis.html#method__pack","d":"

    Pack the provided value by first serializing it (if Redis::OPT_SERIALIZER is set)\nand then compressing the serialized payload (if Redis::OPT_COMPRESSION is set),\nmirroring exactly what PhpRedis transmits to Redis.

    "},{"t":"M","n":"Redis::_digest","p":"Redis.html#method__digest","d":"

    Compute the XXH3 digest of a PHP value after it has been _packed, producing\nthe same digest Redis' DIGEST command would return for the stored value.

    "},{"t":"M","n":"Redis::_unpack","p":"Redis.html#method__unpack","d":"

    Unpack the provided value by first uncompressing it (if Redis::OPT_COMPRESSION\nis set) and then unserializing it (if Redis::OPT_SERIALIZER is set) to recover\nthe original PHP value.

    "},{"t":"M","n":"Redis::acl","p":"Redis.html#method_acl","d":"

    Execute Redis ACL subcommands.

    "},{"t":"M","n":"Redis::append","p":"Redis.html#method_append","d":"

    Append data to a Redis STRING key.

    "},{"t":"M","n":"Redis::auth","p":"Redis.html#method_auth","d":"

    Authenticate a Redis connection after its been established.

    "},{"t":"M","n":"Redis::bgSave","p":"Redis.html#method_bgSave","d":"

    Execute a save of the Redis database in the background.

    "},{"t":"M","n":"Redis::bgrewriteaof","p":"Redis.html#method_bgrewriteaof","d":"

    Asynchronously rewrite Redis' append-only file

    "},{"t":"M","n":"Redis::waitaof","p":"Redis.html#method_waitaof","d":""},{"t":"M","n":"Redis::bitcount","p":"Redis.html#method_bitcount","d":"

    Count the number of set bits in a Redis string.

    "},{"t":"M","n":"Redis::bitop","p":"Redis.html#method_bitop","d":null},{"t":"M","n":"Redis::bitpos","p":"Redis.html#method_bitpos","d":"

    Return the position of the first bit set to 0 or 1 in a string.

    "},{"t":"M","n":"Redis::blPop","p":"Redis.html#method_blPop","d":"

    Pop an element off the beginning of a Redis list or lists, potentially blocking up to a specified\ntimeout. This method may be called in two distinct ways, of which examples are provided below.

    "},{"t":"M","n":"Redis::brPop","p":"Redis.html#method_brPop","d":"

    Pop an element off of the end of a Redis list or lists, potentially blocking up to a specified timeout.

    "},{"t":"M","n":"Redis::brpoplpush","p":"Redis.html#method_brpoplpush","d":"

    Pop an element from the end of a Redis list, pushing it to the beginning of another Redis list,\noptionally blocking up to a specified timeout.

    "},{"t":"M","n":"Redis::bzPopMax","p":"Redis.html#method_bzPopMax","d":"

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

    "},{"t":"M","n":"Redis::bzPopMin","p":"Redis.html#method_bzPopMin","d":"

    POP the minimum scoring element off of one or more sorted sets, blocking up to a specified timeout\nif no elements are available

    "},{"t":"M","n":"Redis::bzmpop","p":"Redis.html#method_bzmpop","d":"

    POP one or more elements from one or more sorted sets, blocking up to a specified amount of time\nwhen no elements are available.

    "},{"t":"M","n":"Redis::zmpop","p":"Redis.html#method_zmpop","d":"

    POP one or more of the highest or lowest scoring elements from one or more sorted sets.

    "},{"t":"M","n":"Redis::blmpop","p":"Redis.html#method_blmpop","d":"

    Pop one or more elements from one or more Redis LISTs, blocking up to a specified timeout when\nno elements are available.

    "},{"t":"M","n":"Redis::lmpop","p":"Redis.html#method_lmpop","d":"

    Pop one or more elements off of one or more Redis LISTs.

    "},{"t":"M","n":"Redis::clearLastError","p":"Redis.html#method_clearLastError","d":"

    Reset any last error on the connection to NULL

    "},{"t":"M","n":"Redis::client","p":"Redis.html#method_client","d":"

    Execute Redis CLIENT subcommands.

    "},{"t":"M","n":"Redis::close","p":"Redis.html#method_close","d":"

    Closes the connection to Redis

    "},{"t":"M","n":"Redis::command","p":"Redis.html#method_command","d":"

    Execute Redis COMMAND subcommands.

    "},{"t":"M","n":"Redis::config","p":"Redis.html#method_config","d":"

    Execute the Redis CONFIG command in a variety of ways.

    "},{"t":"M","n":"Redis::connect","p":"Redis.html#method_connect","d":"

    Connect to a Redis server

    "},{"t":"M","n":"Redis::copy","p":"Redis.html#method_copy","d":"

    Make a copy of a key.

    "},{"t":"M","n":"Redis::dbSize","p":"Redis.html#method_dbSize","d":"

    Return the number of keys in the currently selected Redis database.

    "},{"t":"M","n":"Redis::debug","p":"Redis.html#method_debug","d":"

    Execute the Redis DEBUG command. Note that this is disabled by default\nand can be very dangerous, even allowing you to crash the server. Use\nwith caution

    "},{"t":"M","n":"Redis::decr","p":"Redis.html#method_decr","d":"

    Decrement a Redis integer by 1 or a provided value.

    "},{"t":"M","n":"Redis::decrBy","p":"Redis.html#method_decrBy","d":"

    Decrement a redis integer by a value

    "},{"t":"M","n":"Redis::del","p":"Redis.html#method_del","d":"

    Delete one or more keys from Redis.

    "},{"t":"M","n":"Redis::delex","p":"Redis.html#method_delex","d":"

    Delete a key conditionally based on its value or hash digest

    "},{"t":"M","n":"Redis::delifeq","p":"Redis.html#method_delifeq","d":"

    Delete a key if it's equal to the specified value. This command is\nspecific to Valkey >= 9.0

    "},{"t":"M","n":"Redis::delete","p":"Redis.html#method_delete","d":""},{"t":"M","n":"Redis::discard","p":"Redis.html#method_discard","d":"

    Discard a transaction currently in progress.

    "},{"t":"M","n":"Redis::dump","p":"Redis.html#method_dump","d":"

    Dump Redis' internal binary representation of a key.

    "},{"t":"M","n":"Redis::echo","p":"Redis.html#method_echo","d":"

    Have Redis repeat back an arbitrary string to the client.

    "},{"t":"M","n":"Redis::eval","p":"Redis.html#method_eval","d":"

    Execute a LUA script on the redis server.

    "},{"t":"M","n":"Redis::eval_ro","p":"Redis.html#method_eval_ro","d":"

    This is simply the read-only variant of eval, meaning the underlying script\nmay not modify data in redis.

    "},{"t":"M","n":"Redis::evalsha","p":"Redis.html#method_evalsha","d":"

    Execute a LUA script on the server but instead of sending the script, send\nthe SHA1 hash of the script.

    "},{"t":"M","n":"Redis::evalsha_ro","p":"Redis.html#method_evalsha_ro","d":"

    This is simply the read-only variant of evalsha, meaning the underlying script\nmay not modify data in redis.

    "},{"t":"M","n":"Redis::exec","p":"Redis.html#method_exec","d":"

    Execute either a MULTI or PIPELINE block and return the array of replies.

    "},{"t":"M","n":"Redis::exists","p":"Redis.html#method_exists","d":"

    Test if one or more keys exist.

    "},{"t":"M","n":"Redis::expire","p":"Redis.html#method_expire","d":"

    Sets an expiration in seconds on the key in question. If connected to\nredis-server >= 7.0.0 you may send an additional "mode" argument which\nmodifies how the command will execute.

    "},{"t":"M","n":"Redis::expireAt","p":"Redis.html#method_expireAt","d":"

    Set a key to expire at an exact unix timestamp.

    "},{"t":"M","n":"Redis::failover","p":"Redis.html#method_failover","d":null},{"t":"M","n":"Redis::expiretime","p":"Redis.html#method_expiretime","d":"

    Get the expiration of a given key as a unix timestamp

    "},{"t":"M","n":"Redis::pexpiretime","p":"Redis.html#method_pexpiretime","d":"

    Get the expiration timestamp of a given Redis key but in milliseconds.

    "},{"t":"M","n":"Redis::fcall","p":"Redis.html#method_fcall","d":"

    Invoke a function.

    "},{"t":"M","n":"Redis::fcall_ro","p":"Redis.html#method_fcall_ro","d":"

    This is a read-only variant of the FCALL command that cannot execute commands that modify data.

    "},{"t":"M","n":"Redis::flushAll","p":"Redis.html#method_flushAll","d":"

    Deletes every key in all Redis databases

    "},{"t":"M","n":"Redis::flushDB","p":"Redis.html#method_flushDB","d":"

    Deletes all the keys of the currently selected database.

    "},{"t":"M","n":"Redis::function","p":"Redis.html#method_function","d":"

    Functions is an API for managing code to be executed on the server.

    "},{"t":"M","n":"Redis::geoadd","p":"Redis.html#method_geoadd","d":"

    Add one or more members to a geospacial sorted set

    "},{"t":"M","n":"Redis::geodist","p":"Redis.html#method_geodist","d":"

    Get the distance between two members of a geospacially encoded sorted set.

    "},{"t":"M","n":"Redis::geohash","p":"Redis.html#method_geohash","d":"

    Retrieve one or more GeoHash encoded strings for members of the set.

    "},{"t":"M","n":"Redis::geopos","p":"Redis.html#method_geopos","d":"

    Return the longitude and latitude for one or more members of a geospacially encoded sorted set.

    "},{"t":"M","n":"Redis::georadius","p":"Redis.html#method_georadius","d":"

    Retrieve members of a geospacially sorted set that are within a certain radius of a location.

    "},{"t":"M","n":"Redis::georadius_ro","p":"Redis.html#method_georadius_ro","d":"

    A readonly variant of GEORADIUS that may be executed on replicas.

    "},{"t":"M","n":"Redis::georadiusbymember","p":"Redis.html#method_georadiusbymember","d":"

    Similar to GEORADIUS except it uses a member as the center of the query.

    "},{"t":"M","n":"Redis::georadiusbymember_ro","p":"Redis.html#method_georadiusbymember_ro","d":"

    This is the read-only variant of GEORADIUSBYMEMBER that can be run on replicas.

    "},{"t":"M","n":"Redis::geosearch","p":"Redis.html#method_geosearch","d":"

    Search a geospacial sorted set for members in various ways.

    "},{"t":"M","n":"Redis::geosearchstore","p":"Redis.html#method_geosearchstore","d":"

    Search a geospacial sorted set for members within a given area or range, storing the results into\na new set.

    "},{"t":"M","n":"Redis::get","p":"Redis.html#method_get","d":"

    Retrieve a string keys value.

    "},{"t":"M","n":"Redis::getWithMeta","p":"Redis.html#method_getWithMeta","d":"

    Retrieve a value and metadata of key.

    "},{"t":"M","n":"Redis::getAuth","p":"Redis.html#method_getAuth","d":"

    Get the authentication information on the connection, if any.

    "},{"t":"M","n":"Redis::getBit","p":"Redis.html#method_getBit","d":"

    Get the bit at a given index in a string key.

    "},{"t":"M","n":"Redis::getEx","p":"Redis.html#method_getEx","d":"

    Get the value of a key and optionally set it's expiration.

    "},{"t":"M","n":"Redis::getDBNum","p":"Redis.html#method_getDBNum","d":"

    Get the database number PhpRedis thinks we're connected to.

    "},{"t":"M","n":"Redis::getDel","p":"Redis.html#method_getDel","d":"

    Get a key from Redis and delete it in an atomic operation.

    "},{"t":"M","n":"Redis::getHost","p":"Redis.html#method_getHost","d":"

    Return the host or Unix socket we are connected to.

    "},{"t":"M","n":"Redis::getLastError","p":"Redis.html#method_getLastError","d":"

    Get the last error returned to us from Redis, if any.

    "},{"t":"M","n":"Redis::getMode","p":"Redis.html#method_getMode","d":"

    Returns whether the connection is in ATOMIC, MULTI, or PIPELINE mode

    "},{"t":"M","n":"Redis::getOption","p":"Redis.html#method_getOption","d":"

    Retrieve the value of a configuration setting as set by Redis::setOption()

    "},{"t":"M","n":"Redis::getPersistentID","p":"Redis.html#method_getPersistentID","d":"

    Get the persistent connection ID, if there is one.

    "},{"t":"M","n":"Redis::getPort","p":"Redis.html#method_getPort","d":"

    Get the port we are connected to. This number will be zero if we are connected to a unix socket.

    "},{"t":"M","n":"Redis::serverName","p":"Redis.html#method_serverName","d":"

    Get the server name as reported by the HELLO response.

    "},{"t":"M","n":"Redis::serverVersion","p":"Redis.html#method_serverVersion","d":"

    Get the server version as reported by the HELLO response.

    "},{"t":"M","n":"Redis::getRange","p":"Redis.html#method_getRange","d":"

    Retrieve a substring of a string by index.

    "},{"t":"M","n":"Redis::lcs","p":"Redis.html#method_lcs","d":"

    Get the longest common subsequence between two string keys.

    "},{"t":"M","n":"Redis::getReadTimeout","p":"Redis.html#method_getReadTimeout","d":"

    Get the currently set read timeout on the connection.

    "},{"t":"M","n":"Redis::getset","p":"Redis.html#method_getset","d":"

    Sets a key and returns any previously set value, if the key already existed.

    "},{"t":"M","n":"Redis::getTimeout","p":"Redis.html#method_getTimeout","d":"

    Retrieve any set connection timeout

    "},{"t":"M","n":"Redis::getTransferredBytes","p":"Redis.html#method_getTransferredBytes","d":"

    Get the number of bytes sent and received on the socket.

    "},{"t":"M","n":"Redis::clearTransferredBytes","p":"Redis.html#method_clearTransferredBytes","d":"

    Reset the number of bytes sent and received on the socket.

    "},{"t":"M","n":"Redis::hDel","p":"Redis.html#method_hDel","d":"

    Remove one or more fields from a hash.

    "},{"t":"M","n":"Redis::hExists","p":"Redis.html#method_hExists","d":"

    Checks whether a field exists in a hash.

    "},{"t":"M","n":"Redis::hGet","p":"Redis.html#method_hGet","d":null},{"t":"M","n":"Redis::hGetAll","p":"Redis.html#method_hGetAll","d":"

    Read every field and value from a hash.

    "},{"t":"M","n":"Redis::hGetWithMeta","p":"Redis.html#method_hGetWithMeta","d":"

    Retrieve a value and metadata of hash field.

    "},{"t":"M","n":"Redis::hIncrBy","p":"Redis.html#method_hIncrBy","d":"

    Increment a hash field's value by an integer

    "},{"t":"M","n":"Redis::hIncrByFloat","p":"Redis.html#method_hIncrByFloat","d":"

    Increment a hash field by a floating point value

    "},{"t":"M","n":"Redis::hKeys","p":"Redis.html#method_hKeys","d":"

    Retrieve all of the fields of a hash.

    "},{"t":"M","n":"Redis::hLen","p":"Redis.html#method_hLen","d":"

    Get the number of fields in a hash.

    "},{"t":"M","n":"Redis::hMget","p":"Redis.html#method_hMget","d":"

    Get one or more fields from a hash.

    "},{"t":"M","n":"Redis::hgetex","p":"Redis.html#method_hgetex","d":"

    Get one or more fields of a hash while optionally setting expiration\ninformation

    "},{"t":"M","n":"Redis::hsetex","p":"Redis.html#method_hsetex","d":"

    Set one or more fields in a hash with optional expiration information.

    "},{"t":"M","n":"Redis::hgetdel","p":"Redis.html#method_hgetdel","d":"

    Get one or more fields and delete them

    "},{"t":"M","n":"Redis::hMset","p":"Redis.html#method_hMset","d":"

    Add or update one or more hash fields and values

    "},{"t":"M","n":"Redis::hRandField","p":"Redis.html#method_hRandField","d":"

    Get one or more random field from a hash.

    "},{"t":"M","n":"Redis::hSet","p":"Redis.html#method_hSet","d":"

    Add or update one or more hash fields and values.

    "},{"t":"M","n":"Redis::hSetNx","p":"Redis.html#method_hSetNx","d":"

    Set a hash field and value, but only if that field does not exist

    "},{"t":"M","n":"Redis::hStrLen","p":"Redis.html#method_hStrLen","d":"

    Get the string length of a hash field

    "},{"t":"M","n":"Redis::hVals","p":"Redis.html#method_hVals","d":"

    Get all of the values from a hash.

    "},{"t":"M","n":"Redis::hexpire","p":"Redis.html#method_hexpire","d":"

    Set the expiration on one or more fields in a hash.

    "},{"t":"M","n":"Redis::hpexpire","p":"Redis.html#method_hpexpire","d":"

    Set the expiration on one or more fields in a hash in milliseconds.

    "},{"t":"M","n":"Redis::hexpireat","p":"Redis.html#method_hexpireat","d":"

    Set the expiration time on one or more fields of a hash.

    "},{"t":"M","n":"Redis::hpexpireat","p":"Redis.html#method_hpexpireat","d":"

    Set the expiration time on one or more fields of a hash in milliseconds.

    "},{"t":"M","n":"Redis::httl","p":"Redis.html#method_httl","d":"

    Get the TTL of one or more fields in a hash

    "},{"t":"M","n":"Redis::hpttl","p":"Redis.html#method_hpttl","d":"

    Get the millisecond TTL of one or more fields in a hash

    "},{"t":"M","n":"Redis::hexpiretime","p":"Redis.html#method_hexpiretime","d":"

    Get the expiration time of one or more fields in a hash

    "},{"t":"M","n":"Redis::hpexpiretime","p":"Redis.html#method_hpexpiretime","d":"

    Get the expiration time in milliseconds of one or more fields in a hash

    "},{"t":"M","n":"Redis::hpersist","p":"Redis.html#method_hpersist","d":"

    Persist one or more hash fields

    "},{"t":"M","n":"Redis::hscan","p":"Redis.html#method_hscan","d":"

    Iterate over the fields and values of a hash in an incremental fashion.

    "},{"t":"M","n":"Redis::expiremember","p":"Redis.html#method_expiremember","d":"

    Set an expiration on a key member (KeyDB only).

    "},{"t":"M","n":"Redis::expirememberat","p":"Redis.html#method_expirememberat","d":"

    Set an expiration on a key membert to a specific unix timestamp (KeyDB only).

    "},{"t":"M","n":"Redis::incr","p":"Redis.html#method_incr","d":"

    Increment a key's value, optionally by a specific amount.

    "},{"t":"M","n":"Redis::incrBy","p":"Redis.html#method_incrBy","d":"

    Increment a key by a specific integer value

    "},{"t":"M","n":"Redis::incrByFloat","p":"Redis.html#method_incrByFloat","d":"

    Increment a numeric key by a floating point value.

    "},{"t":"M","n":"Redis::info","p":"Redis.html#method_info","d":"

    Retrieve information about the connected redis-server. If no arguments are passed to\nthis function, redis will return every info field. Alternatively you may pass a specific\nsection you want returned (e.g. 'server', or 'memory') to receive only information pertaining\nto that section.

    "},{"t":"M","n":"Redis::isConnected","p":"Redis.html#method_isConnected","d":"

    Check if we are currently connected to a Redis instance.

    "},{"t":"M","n":"Redis::keys","p":"Redis.html#method_keys","d":""},{"t":"M","n":"Redis::lInsert","p":"Redis.html#method_lInsert","d":""},{"t":"M","n":"Redis::lLen","p":"Redis.html#method_lLen","d":"

    Retrieve the length of a list.

    "},{"t":"M","n":"Redis::lMove","p":"Redis.html#method_lMove","d":"

    Move an element from one list into another.

    "},{"t":"M","n":"Redis::blmove","p":"Redis.html#method_blmove","d":null},{"t":"M","n":"Redis::lPop","p":"Redis.html#method_lPop","d":"

    Pop one or more elements off a list.

    "},{"t":"M","n":"Redis::lPos","p":"Redis.html#method_lPos","d":"

    Retrieve the index of an element in a list.

    "},{"t":"M","n":"Redis::lPush","p":"Redis.html#method_lPush","d":"

    Prepend one or more elements to a list.

    "},{"t":"M","n":"Redis::rPush","p":"Redis.html#method_rPush","d":"

    Append one or more elements to a list.

    "},{"t":"M","n":"Redis::lPushx","p":"Redis.html#method_lPushx","d":"

    Prepend an element to a list but only if the list exists

    "},{"t":"M","n":"Redis::rPushx","p":"Redis.html#method_rPushx","d":"

    Append an element to a list but only if the list exists

    "},{"t":"M","n":"Redis::lSet","p":"Redis.html#method_lSet","d":"

    Set a list element at an index to a specific value.

    "},{"t":"M","n":"Redis::lastSave","p":"Redis.html#method_lastSave","d":"

    Retrieve the last time Redis' database was persisted to disk.

    "},{"t":"M","n":"Redis::lindex","p":"Redis.html#method_lindex","d":"

    Get the element of a list by its index.

    "},{"t":"M","n":"Redis::lrange","p":"Redis.html#method_lrange","d":"

    Retrieve elements from a list.

    "},{"t":"M","n":"Redis::lrem","p":"Redis.html#method_lrem","d":"

    Remove one or more matching elements from a list.

    "},{"t":"M","n":"Redis::ltrim","p":"Redis.html#method_ltrim","d":"

    Trim a list to a subrange of elements.

    "},{"t":"M","n":"Redis::mget","p":"Redis.html#method_mget","d":"

    Get one or more string keys.

    "},{"t":"M","n":"Redis::migrate","p":"Redis.html#method_migrate","d":"

    Proxy for the Redis MIGRATE command.

    "},{"t":"M","n":"Redis::move","p":"Redis.html#method_move","d":"

    Move a key to a different database on the same redis instance.

    "},{"t":"M","n":"Redis::mset","p":"Redis.html#method_mset","d":"

    Set one or more string keys.

    "},{"t":"M","n":"Redis::msetex","p":"Redis.html#method_msetex","d":"

    Set one or more keys and values with optional expiry information.

    "},{"t":"M","n":"Redis::msetnx","p":"Redis.html#method_msetnx","d":"

    Set one or more string keys but only if none of the key exist.

    "},{"t":"M","n":"Redis::multi","p":"Redis.html#method_multi","d":"

    Begin a transaction.

    "},{"t":"M","n":"Redis::object","p":"Redis.html#method_object","d":"

    Get encoding and other information about a key.

    "},{"t":"M","n":"Redis::open","p":"Redis.html#method_open","d":""},{"t":"M","n":"Redis::pconnect","p":"Redis.html#method_pconnect","d":"

    Connects to a Redis server creating or reusing a persistent connection.

    "},{"t":"M","n":"Redis::persist","p":"Redis.html#method_persist","d":"

    Remove the expiration from a key.

    "},{"t":"M","n":"Redis::pexpire","p":"Redis.html#method_pexpire","d":"

    Sets an expiration in milliseconds on a given key. If connected to Redis >= 7.0.0\nyou can pass an optional mode argument that modifies how the command will execute.

    "},{"t":"M","n":"Redis::pexpireAt","p":"Redis.html#method_pexpireAt","d":"

    Set a key's expiration to a specific Unix Timestamp in milliseconds. If connected to\nRedis >= 7.0.0 you can pass an optional 'mode' argument.

    "},{"t":"M","n":"Redis::pfadd","p":"Redis.html#method_pfadd","d":"

    Add one or more elements to a Redis HyperLogLog key

    "},{"t":"M","n":"Redis::pfcount","p":"Redis.html#method_pfcount","d":"

    Retrieve the cardinality of a Redis HyperLogLog key.

    "},{"t":"M","n":"Redis::pfmerge","p":"Redis.html#method_pfmerge","d":"

    Merge one or more source HyperLogLog sets into a destination set.

    "},{"t":"M","n":"Redis::ping","p":"Redis.html#method_ping","d":"

    PING the redis server with an optional string argument.

    "},{"t":"M","n":"Redis::pipeline","p":"Redis.html#method_pipeline","d":"

    Enter into pipeline mode.

    "},{"t":"M","n":"Redis::popen","p":"Redis.html#method_popen","d":""},{"t":"M","n":"Redis::psetex","p":"Redis.html#method_psetex","d":"

    Set a key with an expiration time in milliseconds

    "},{"t":"M","n":"Redis::psubscribe","p":"Redis.html#method_psubscribe","d":"

    Subscribe to one or more glob-style patterns

    "},{"t":"M","n":"Redis::pttl","p":"Redis.html#method_pttl","d":"

    Get a keys time to live in milliseconds.

    "},{"t":"M","n":"Redis::publish","p":"Redis.html#method_publish","d":"

    Publish a message to a pubsub channel

    "},{"t":"M","n":"Redis::pubsub","p":"Redis.html#method_pubsub","d":"

    Interact with the Redis PubSub subsystem.

    "},{"t":"M","n":"Redis::punsubscribe","p":"Redis.html#method_punsubscribe","d":"

    Unsubscribe from one or more channels by pattern

    "},{"t":"M","n":"Redis::rPop","p":"Redis.html#method_rPop","d":"

    Pop one or more elements from the end of a list.

    "},{"t":"M","n":"Redis::randomKey","p":"Redis.html#method_randomKey","d":"

    Return a random key from the current database

    "},{"t":"M","n":"Redis::rawcommand","p":"Redis.html#method_rawcommand","d":"

    Execute any arbitrary Redis command by name.

    "},{"t":"M","n":"Redis::rename","p":"Redis.html#method_rename","d":"

    Unconditionally rename a key from $old_name to $new_name

    "},{"t":"M","n":"Redis::renameNx","p":"Redis.html#method_renameNx","d":"

    Renames $key_src to $key_dst but only if newkey does not exist.

    "},{"t":"M","n":"Redis::reset","p":"Redis.html#method_reset","d":"

    Reset the state of the connection.

    "},{"t":"M","n":"Redis::restore","p":"Redis.html#method_restore","d":"

    Restore a key by the binary payload generated by the DUMP command.

    "},{"t":"M","n":"Redis::role","p":"Redis.html#method_role","d":"

    Query whether the connected instance is a primary or replica

    "},{"t":"M","n":"Redis::rpoplpush","p":"Redis.html#method_rpoplpush","d":"

    Atomically pop an element off the end of a Redis LIST and push it to the beginning of\nanother.

    "},{"t":"M","n":"Redis::sAdd","p":"Redis.html#method_sAdd","d":"

    Add one or more values to a Redis SET key.

    "},{"t":"M","n":"Redis::sAddArray","p":"Redis.html#method_sAddArray","d":"

    Add one or more values to a Redis SET key. This is an alternative to Redis::sadd() but\ninstead of being variadic, takes a single array of values.

    "},{"t":"M","n":"Redis::sDiff","p":"Redis.html#method_sDiff","d":"

    Given one or more Redis SETS, this command returns all of the members from the first\nset that are not in any subsequent set.

    "},{"t":"M","n":"Redis::sDiffStore","p":"Redis.html#method_sDiffStore","d":"

    This method performs the same operation as SDIFF except it stores the resulting diff\nvalues in a specified destination key.

    "},{"t":"M","n":"Redis::sInter","p":"Redis.html#method_sInter","d":"

    Given one or more Redis SET keys, this command will return all of the elements that are\nin every one.

    "},{"t":"M","n":"Redis::sintercard","p":"Redis.html#method_sintercard","d":"

    Compute the intersection of one or more sets and return the cardinality of the result.

    "},{"t":"M","n":"Redis::sInterStore","p":"Redis.html#method_sInterStore","d":"

    Perform the intersection of one or more Redis SETs, storing the result in a destination\nkey, rather than returning them.

    "},{"t":"M","n":"Redis::sMembers","p":"Redis.html#method_sMembers","d":"

    Retrieve every member from a set key.

    "},{"t":"M","n":"Redis::sMisMember","p":"Redis.html#method_sMisMember","d":"

    Check if one or more values are members of a set.

    "},{"t":"M","n":"Redis::sMove","p":"Redis.html#method_sMove","d":"

    Pop a member from one set and push it onto another. This command will create the\ndestination set if it does not currently exist.

    "},{"t":"M","n":"Redis::sPop","p":"Redis.html#method_sPop","d":"

    Remove one or more elements from a set.

    "},{"t":"M","n":"Redis::sRandMember","p":"Redis.html#method_sRandMember","d":"

    Retrieve one or more random members of a set.

    "},{"t":"M","n":"Redis::sUnion","p":"Redis.html#method_sUnion","d":"

    Returns the union of one or more Redis SET keys.

    "},{"t":"M","n":"Redis::sUnionStore","p":"Redis.html#method_sUnionStore","d":"

    Perform a union of one or more Redis SET keys and store the result in a new set

    "},{"t":"M","n":"Redis::save","p":"Redis.html#method_save","d":"

    Persist the Redis database to disk. This command will block the server until the save is\ncompleted. For a nonblocking alternative, see Redis::bgsave().

    "},{"t":"M","n":"Redis::scan","p":"Redis.html#method_scan","d":"

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

    "},{"t":"M","n":"Redis::scard","p":"Redis.html#method_scard","d":"

    Retrieve the number of members in a Redis set.

    "},{"t":"M","n":"Redis::script","p":"Redis.html#method_script","d":"

    An administrative command used to interact with LUA scripts stored on the server.

    "},{"t":"M","n":"Redis::select","p":"Redis.html#method_select","d":"

    Select a specific Redis database.

    "},{"t":"M","n":"Redis::set","p":"Redis.html#method_set","d":"

    Create or set a Redis STRING key to a value.

    "},{"t":"M","n":"Redis::setBit","p":"Redis.html#method_setBit","d":"

    Set a specific bit in a Redis string to zero or one

    "},{"t":"M","n":"Redis::setRange","p":"Redis.html#method_setRange","d":"

    Update or append to a Redis string at a specific starting index

    "},{"t":"M","n":"Redis::setOption","p":"Redis.html#method_setOption","d":"

    Set a configurable option on the Redis object.

    "},{"t":"M","n":"Redis::setex","p":"Redis.html#method_setex","d":"

    Set a Redis STRING key with a specific expiration in seconds.

    "},{"t":"M","n":"Redis::setnx","p":"Redis.html#method_setnx","d":"

    Set a key to a value, but only if that key does not already exist.

    "},{"t":"M","n":"Redis::sismember","p":"Redis.html#method_sismember","d":"

    Check whether a given value is the member of a Redis SET.

    "},{"t":"M","n":"Redis::slaveof","p":"Redis.html#method_slaveof","d":"

    Turn a redis instance into a replica of another or promote a replica\nto a primary.

    "},{"t":"M","n":"Redis::replicaof","p":"Redis.html#method_replicaof","d":"

    Used to turn a Redis instance into a replica of another, or to remove\nreplica status promoting the instance to a primary.

    "},{"t":"M","n":"Redis::touch","p":"Redis.html#method_touch","d":"

    Update one or more keys last modified metadata.

    "},{"t":"M","n":"Redis::slowlog","p":"Redis.html#method_slowlog","d":"

    Interact with Redis' slowlog functionality in various ways, depending\non the value of 'operation'.

    "},{"t":"M","n":"Redis::sort","p":"Redis.html#method_sort","d":"

    Sort the contents of a Redis key in various ways.

    "},{"t":"M","n":"Redis::sort_ro","p":"Redis.html#method_sort_ro","d":"

    This is simply a read-only variant of the sort command

    "},{"t":"M","n":"Redis::sortAsc","p":"Redis.html#method_sortAsc","d":""},{"t":"M","n":"Redis::sortAscAlpha","p":"Redis.html#method_sortAscAlpha","d":""},{"t":"M","n":"Redis::sortDesc","p":"Redis.html#method_sortDesc","d":""},{"t":"M","n":"Redis::sortDescAlpha","p":"Redis.html#method_sortDescAlpha","d":""},{"t":"M","n":"Redis::srem","p":"Redis.html#method_srem","d":"

    Remove one or more values from a Redis SET key.

    "},{"t":"M","n":"Redis::sscan","p":"Redis.html#method_sscan","d":"

    Scan the members of a redis SET key.

    "},{"t":"M","n":"Redis::ssubscribe","p":"Redis.html#method_ssubscribe","d":"

    Subscribes the client to the specified shard channels.

    "},{"t":"M","n":"Redis::strlen","p":"Redis.html#method_strlen","d":"

    Retrieve the length of a Redis STRING key.

    "},{"t":"M","n":"Redis::subscribe","p":"Redis.html#method_subscribe","d":"

    Subscribe to one or more Redis pubsub channels.

    "},{"t":"M","n":"Redis::sunsubscribe","p":"Redis.html#method_sunsubscribe","d":"

    Unsubscribes the client from the given shard channels,\nor from all of them if none is given.

    "},{"t":"M","n":"Redis::swapdb","p":"Redis.html#method_swapdb","d":"

    Atomically swap two Redis databases so that all of the keys in the source database will\nnow be in the destination database and vice-versa.

    "},{"t":"M","n":"Redis::time","p":"Redis.html#method_time","d":"

    Retrieve the server time from the connected Redis instance.

    "},{"t":"M","n":"Redis::ttl","p":"Redis.html#method_ttl","d":"

    Get the amount of time a Redis key has before it will expire, in seconds.

    "},{"t":"M","n":"Redis::type","p":"Redis.html#method_type","d":"

    Get the type of a given Redis key.

    "},{"t":"M","n":"Redis::unlink","p":"Redis.html#method_unlink","d":"

    Delete one or more keys from the Redis database. Unlike this operation, the actual\ndeletion is asynchronous, meaning it is safe to delete large keys without fear of\nRedis blocking for a long period of time.

    "},{"t":"M","n":"Redis::unsubscribe","p":"Redis.html#method_unsubscribe","d":"

    Unsubscribe from one or more subscribed channels.

    "},{"t":"M","n":"Redis::unwatch","p":"Redis.html#method_unwatch","d":"

    Remove any previously WATCH'ed keys in a transaction.

    "},{"t":"M","n":"Redis::watch","p":"Redis.html#method_watch","d":"

    Watch one or more keys for conditional execution of a transaction.

    "},{"t":"M","n":"Redis::wait","p":"Redis.html#method_wait","d":"

    Block the client up to the provided timeout until a certain number of replicas have confirmed\nreceiving them.

    "},{"t":"M","n":"Redis::xack","p":"Redis.html#method_xack","d":"

    Acknowledge one or more messages that are pending (have been consumed using XREADGROUP but\nnot yet acknowledged by XACK.)

    "},{"t":"M","n":"Redis::xadd","p":"Redis.html#method_xadd","d":"

    Append a message to a stream.

    "},{"t":"M","n":"Redis::xautoclaim","p":"Redis.html#method_xautoclaim","d":"

    This command allows a consumer to claim pending messages that have been idle for a specified period of time.

    "},{"t":"M","n":"Redis::xclaim","p":"Redis.html#method_xclaim","d":"

    This method allows a consumer to take ownership of pending stream entries, by ID. Another\ncommand that does much the same thing but does not require passing specific IDs is Redis::xAutoClaim.

    "},{"t":"M","n":"Redis::xdel","p":"Redis.html#method_xdel","d":"

    Remove one or more specific IDs from a stream.

    "},{"t":"M","n":"Redis::xdelex","p":"Redis.html#method_xdelex","d":"

    Remove one or more IDs from a stream with extended options.

    "},{"t":"M","n":"Redis::xgroup","p":"Redis.html#method_xgroup","d":"XGROUP"},{"t":"M","n":"Redis::xinfo","p":"Redis.html#method_xinfo","d":"

    Retrieve information about a stream key.

    "},{"t":"M","n":"Redis::xlen","p":"Redis.html#method_xlen","d":"

    Get the number of messages in a Redis STREAM key.

    "},{"t":"M","n":"Redis::xpending","p":"Redis.html#method_xpending","d":"

    Interact with stream messages that have been consumed by a consumer group but not yet\nacknowledged with XACK.

    "},{"t":"M","n":"Redis::xrange","p":"Redis.html#method_xrange","d":"

    Get a range of entries from a STREAM key.

    "},{"t":"M","n":"Redis::xread","p":"Redis.html#method_xread","d":"

    Consume one or more unconsumed elements in one or more streams.

    "},{"t":"M","n":"Redis::xreadgroup","p":"Redis.html#method_xreadgroup","d":"

    Read one or more messages using a consumer group.

    "},{"t":"M","n":"Redis::xrevrange","p":"Redis.html#method_xrevrange","d":"

    Get a range of entries from a STREAM key in reverse chronological order.

    "},{"t":"M","n":"Redis::vadd","p":"Redis.html#method_vadd","d":"

    Add to a vector set

    "},{"t":"M","n":"Redis::vsim","p":"Redis.html#method_vsim","d":"

    Query similarity of a vector by element or scores

    "},{"t":"M","n":"Redis::vcard","p":"Redis.html#method_vcard","d":"

    Get the length of a vector set

    "},{"t":"M","n":"Redis::vdim","p":"Redis.html#method_vdim","d":"

    Get the dimensions of a vector set

    "},{"t":"M","n":"Redis::vinfo","p":"Redis.html#method_vinfo","d":"

    Get various bits of information about a vector set

    "},{"t":"M","n":"Redis::vismember","p":"Redis.html#method_vismember","d":"

    Check if an element is a member of a vectorset

    "},{"t":"M","n":"Redis::vemb","p":"Redis.html#method_vemb","d":"

    Get the embeddings for a specific member

    "},{"t":"M","n":"Redis::vrandmember","p":"Redis.html#method_vrandmember","d":"

    Get one or more random members from a vector set

    "},{"t":"M","n":"Redis::vrange","p":"Redis.html#method_vrange","d":"

    Retreive a lexographical range of elements from a vector set

    "},{"t":"M","n":"Redis::vrem","p":"Redis.html#method_vrem","d":"

    Remove an element from a vector set

    "},{"t":"M","n":"Redis::vsetattr","p":"Redis.html#method_vsetattr","d":"

    Set the attributes of a vector set element

    "},{"t":"M","n":"Redis::vgetattr","p":"Redis.html#method_vgetattr","d":"

    Get the attributes of a vector set element

    "},{"t":"M","n":"Redis::vlinks","p":"Redis.html#method_vlinks","d":"

    Get any adajcent values for a member of a vector set.

    "},{"t":"M","n":"Redis::gcra","p":"Redis.html#method_gcra","d":"

    Get rate limiting information

    "},{"t":"M","n":"Redis::xtrim","p":"Redis.html#method_xtrim","d":"

    Truncate a STREAM key in various ways.

    "},{"t":"M","n":"Redis::zAdd","p":"Redis.html#method_zAdd","d":"

    Add one or more elements and scores to a Redis sorted set.

    "},{"t":"M","n":"Redis::zCard","p":"Redis.html#method_zCard","d":"

    Return the number of elements in a sorted set.

    "},{"t":"M","n":"Redis::zCount","p":"Redis.html#method_zCount","d":"

    Count the number of members in a sorted set with scores inside a provided range.

    "},{"t":"M","n":"Redis::zIncrBy","p":"Redis.html#method_zIncrBy","d":"

    Create or increment the score of a member in a Redis sorted set

    "},{"t":"M","n":"Redis::zLexCount","p":"Redis.html#method_zLexCount","d":"

    Count the number of elements in a sorted set whose members fall within the provided\nlexographical range.

    "},{"t":"M","n":"Redis::zMscore","p":"Redis.html#method_zMscore","d":"

    Retrieve the score of one or more members in a sorted set.

    "},{"t":"M","n":"Redis::zPopMax","p":"Redis.html#method_zPopMax","d":"

    Pop one or more of the highest scoring elements from a sorted set.

    "},{"t":"M","n":"Redis::zPopMin","p":"Redis.html#method_zPopMin","d":"

    Pop one or more of the lowest scoring elements from a sorted set.

    "},{"t":"M","n":"Redis::zRange","p":"Redis.html#method_zRange","d":"

    Retrieve a range of elements of a sorted set between a start and end point.

    "},{"t":"M","n":"Redis::zRangeByLex","p":"Redis.html#method_zRangeByLex","d":"

    Retrieve a range of elements from a sorted set by legographical range.

    "},{"t":"M","n":"Redis::zRangeByScore","p":"Redis.html#method_zRangeByScore","d":"

    Retrieve a range of members from a sorted set by their score.

    "},{"t":"M","n":"Redis::zrangestore","p":"Redis.html#method_zrangestore","d":"

    This command is similar to ZRANGE except that instead of returning the values directly\nit will store them in a destination key provided by the user

    "},{"t":"M","n":"Redis::zRandMember","p":"Redis.html#method_zRandMember","d":"

    Retrieve one or more random members from a Redis sorted set.

    "},{"t":"M","n":"Redis::zRank","p":"Redis.html#method_zRank","d":"

    Get the rank of a member of a sorted set, by score.

    "},{"t":"M","n":"Redis::zRem","p":"Redis.html#method_zRem","d":"

    Remove one or more members from a Redis sorted set.

    "},{"t":"M","n":"Redis::zRemRangeByLex","p":"Redis.html#method_zRemRangeByLex","d":"

    Remove zero or more elements from a Redis sorted set by legographical range.

    "},{"t":"M","n":"Redis::zRemRangeByRank","p":"Redis.html#method_zRemRangeByRank","d":"

    Remove one or more members of a sorted set by their rank.

    "},{"t":"M","n":"Redis::zRemRangeByScore","p":"Redis.html#method_zRemRangeByScore","d":"

    Remove one or more members of a sorted set by their score.

    "},{"t":"M","n":"Redis::zRevRange","p":"Redis.html#method_zRevRange","d":"

    List the members of a Redis sorted set in reverse order

    "},{"t":"M","n":"Redis::zRevRangeByLex","p":"Redis.html#method_zRevRangeByLex","d":"

    List members of a Redis sorted set within a legographical range, in reverse order.

    "},{"t":"M","n":"Redis::zRevRangeByScore","p":"Redis.html#method_zRevRangeByScore","d":"

    List elements from a Redis sorted set by score, highest to lowest

    "},{"t":"M","n":"Redis::zRevRank","p":"Redis.html#method_zRevRank","d":"

    Retrieve a member of a sorted set by reverse rank.

    "},{"t":"M","n":"Redis::zScore","p":"Redis.html#method_zScore","d":"

    Get the score of a member of a sorted set.

    "},{"t":"M","n":"Redis::zdiff","p":"Redis.html#method_zdiff","d":"

    Given one or more sorted set key names, return every element that is in the first\nset but not any of the others.

    "},{"t":"M","n":"Redis::zdiffstore","p":"Redis.html#method_zdiffstore","d":"

    Store the difference of one or more sorted sets in a destination sorted set.

    "},{"t":"M","n":"Redis::zinter","p":"Redis.html#method_zinter","d":"

    Compute the intersection of one or more sorted sets and return the members

    "},{"t":"M","n":"Redis::zintercard","p":"Redis.html#method_zintercard","d":"

    Similar to ZINTER but instead of returning the intersected values, this command returns the\ncardinality of the intersected set.

    "},{"t":"M","n":"Redis::zinterstore","p":"Redis.html#method_zinterstore","d":"

    Compute the intersection of one or more sorted sets storing the result in a new sorted set.

    "},{"t":"M","n":"Redis::zscan","p":"Redis.html#method_zscan","d":"

    Scan the members of a sorted set incrementally, using a cursor

    "},{"t":"M","n":"Redis::zunion","p":"Redis.html#method_zunion","d":"

    Retrieve the union of one or more sorted sets

    "},{"t":"M","n":"Redis::zunionstore","p":"Redis.html#method_zunionstore","d":"

    Perform a union on one or more Redis sets and store the result in a destination sorted set.

    "},{"t":"M","n":"Redis::digest","p":"Redis.html#method_digest","d":"

    Ask the server for the XXH3 digest of a given key's value

    "},{"t":"M","n":"RedisArray::__call","p":"RedisArray.html#method___call","d":null},{"t":"M","n":"RedisArray::__construct","p":"RedisArray.html#method___construct","d":null},{"t":"M","n":"RedisArray::_continuum","p":"RedisArray.html#method__continuum","d":null},{"t":"M","n":"RedisArray::_distributor","p":"RedisArray.html#method__distributor","d":null},{"t":"M","n":"RedisArray::_function","p":"RedisArray.html#method__function","d":null},{"t":"M","n":"RedisArray::_hosts","p":"RedisArray.html#method__hosts","d":null},{"t":"M","n":"RedisArray::_instance","p":"RedisArray.html#method__instance","d":null},{"t":"M","n":"RedisArray::_rehash","p":"RedisArray.html#method__rehash","d":null},{"t":"M","n":"RedisArray::_target","p":"RedisArray.html#method__target","d":null},{"t":"M","n":"RedisArray::bgsave","p":"RedisArray.html#method_bgsave","d":null},{"t":"M","n":"RedisArray::del","p":"RedisArray.html#method_del","d":null},{"t":"M","n":"RedisArray::discard","p":"RedisArray.html#method_discard","d":null},{"t":"M","n":"RedisArray::exec","p":"RedisArray.html#method_exec","d":null},{"t":"M","n":"RedisArray::flushall","p":"RedisArray.html#method_flushall","d":null},{"t":"M","n":"RedisArray::flushdb","p":"RedisArray.html#method_flushdb","d":null},{"t":"M","n":"RedisArray::getOption","p":"RedisArray.html#method_getOption","d":null},{"t":"M","n":"RedisArray::hscan","p":"RedisArray.html#method_hscan","d":null},{"t":"M","n":"RedisArray::info","p":"RedisArray.html#method_info","d":null},{"t":"M","n":"RedisArray::keys","p":"RedisArray.html#method_keys","d":null},{"t":"M","n":"RedisArray::mget","p":"RedisArray.html#method_mget","d":null},{"t":"M","n":"RedisArray::mset","p":"RedisArray.html#method_mset","d":null},{"t":"M","n":"RedisArray::multi","p":"RedisArray.html#method_multi","d":null},{"t":"M","n":"RedisArray::ping","p":"RedisArray.html#method_ping","d":null},{"t":"M","n":"RedisArray::save","p":"RedisArray.html#method_save","d":null},{"t":"M","n":"RedisArray::scan","p":"RedisArray.html#method_scan","d":null},{"t":"M","n":"RedisArray::select","p":"RedisArray.html#method_select","d":null},{"t":"M","n":"RedisArray::setOption","p":"RedisArray.html#method_setOption","d":null},{"t":"M","n":"RedisArray::sscan","p":"RedisArray.html#method_sscan","d":null},{"t":"M","n":"RedisArray::unlink","p":"RedisArray.html#method_unlink","d":null},{"t":"M","n":"RedisArray::unwatch","p":"RedisArray.html#method_unwatch","d":null},{"t":"M","n":"RedisArray::zscan","p":"RedisArray.html#method_zscan","d":null},{"t":"M","n":"RedisArray::acl","p":"RedisArray.html#method_acl","d":""},{"t":"M","n":"RedisArray::append","p":"RedisArray.html#method_append","d":""},{"t":"M","n":"RedisArray::auth","p":"RedisArray.html#method_auth","d":""},{"t":"M","n":"RedisArray::bgrewriteaof","p":"RedisArray.html#method_bgrewriteaof","d":""},{"t":"M","n":"RedisArray::waitaof","p":"RedisArray.html#method_waitaof","d":""},{"t":"M","n":"RedisArray::bitcount","p":"RedisArray.html#method_bitcount","d":""},{"t":"M","n":"RedisArray::bitop","p":"RedisArray.html#method_bitop","d":""},{"t":"M","n":"RedisArray::bitpos","p":"RedisArray.html#method_bitpos","d":""},{"t":"M","n":"RedisArray::blPop","p":"RedisArray.html#method_blPop","d":""},{"t":"M","n":"RedisArray::brPop","p":"RedisArray.html#method_brPop","d":""},{"t":"M","n":"RedisArray::brpoplpush","p":"RedisArray.html#method_brpoplpush","d":""},{"t":"M","n":"RedisArray::bzPopMax","p":"RedisArray.html#method_bzPopMax","d":""},{"t":"M","n":"RedisArray::bzPopMin","p":"RedisArray.html#method_bzPopMin","d":""},{"t":"M","n":"RedisArray::bzmpop","p":"RedisArray.html#method_bzmpop","d":""},{"t":"M","n":"RedisArray::zmpop","p":"RedisArray.html#method_zmpop","d":""},{"t":"M","n":"RedisArray::blmpop","p":"RedisArray.html#method_blmpop","d":""},{"t":"M","n":"RedisArray::lmpop","p":"RedisArray.html#method_lmpop","d":""},{"t":"M","n":"RedisArray::clearLastError","p":"RedisArray.html#method_clearLastError","d":""},{"t":"M","n":"RedisArray::client","p":"RedisArray.html#method_client","d":""},{"t":"M","n":"RedisArray::close","p":"RedisArray.html#method_close","d":""},{"t":"M","n":"RedisArray::command","p":"RedisArray.html#method_command","d":""},{"t":"M","n":"RedisArray::config","p":"RedisArray.html#method_config","d":""},{"t":"M","n":"RedisArray::copy","p":"RedisArray.html#method_copy","d":""},{"t":"M","n":"RedisArray::dbSize","p":"RedisArray.html#method_dbSize","d":""},{"t":"M","n":"RedisArray::debug","p":"RedisArray.html#method_debug","d":""},{"t":"M","n":"RedisArray::decr","p":"RedisArray.html#method_decr","d":""},{"t":"M","n":"RedisArray::decrBy","p":"RedisArray.html#method_decrBy","d":""},{"t":"M","n":"RedisArray::delex","p":"RedisArray.html#method_delex","d":""},{"t":"M","n":"RedisArray::delifeq","p":"RedisArray.html#method_delifeq","d":""},{"t":"M","n":"RedisArray::delete","p":"RedisArray.html#method_delete","d":""},{"t":"M","n":"RedisArray::dump","p":"RedisArray.html#method_dump","d":""},{"t":"M","n":"RedisArray::echo","p":"RedisArray.html#method_echo","d":""},{"t":"M","n":"RedisArray::eval","p":"RedisArray.html#method_eval","d":""},{"t":"M","n":"RedisArray::eval_ro","p":"RedisArray.html#method_eval_ro","d":""},{"t":"M","n":"RedisArray::evalsha","p":"RedisArray.html#method_evalsha","d":""},{"t":"M","n":"RedisArray::evalsha_ro","p":"RedisArray.html#method_evalsha_ro","d":""},{"t":"M","n":"RedisArray::exists","p":"RedisArray.html#method_exists","d":""},{"t":"M","n":"RedisArray::expire","p":"RedisArray.html#method_expire","d":""},{"t":"M","n":"RedisArray::expireAt","p":"RedisArray.html#method_expireAt","d":""},{"t":"M","n":"RedisArray::failover","p":"RedisArray.html#method_failover","d":""},{"t":"M","n":"RedisArray::expiretime","p":"RedisArray.html#method_expiretime","d":""},{"t":"M","n":"RedisArray::pexpiretime","p":"RedisArray.html#method_pexpiretime","d":""},{"t":"M","n":"RedisArray::fcall","p":"RedisArray.html#method_fcall","d":""},{"t":"M","n":"RedisArray::fcall_ro","p":"RedisArray.html#method_fcall_ro","d":""},{"t":"M","n":"RedisArray::function","p":"RedisArray.html#method_function","d":""},{"t":"M","n":"RedisArray::geoadd","p":"RedisArray.html#method_geoadd","d":""},{"t":"M","n":"RedisArray::geodist","p":"RedisArray.html#method_geodist","d":""},{"t":"M","n":"RedisArray::geohash","p":"RedisArray.html#method_geohash","d":""},{"t":"M","n":"RedisArray::geopos","p":"RedisArray.html#method_geopos","d":""},{"t":"M","n":"RedisArray::georadius","p":"RedisArray.html#method_georadius","d":""},{"t":"M","n":"RedisArray::georadius_ro","p":"RedisArray.html#method_georadius_ro","d":""},{"t":"M","n":"RedisArray::georadiusbymember","p":"RedisArray.html#method_georadiusbymember","d":""},{"t":"M","n":"RedisArray::georadiusbymember_ro","p":"RedisArray.html#method_georadiusbymember_ro","d":""},{"t":"M","n":"RedisArray::geosearch","p":"RedisArray.html#method_geosearch","d":""},{"t":"M","n":"RedisArray::geosearchstore","p":"RedisArray.html#method_geosearchstore","d":""},{"t":"M","n":"RedisArray::get","p":"RedisArray.html#method_get","d":""},{"t":"M","n":"RedisArray::getWithMeta","p":"RedisArray.html#method_getWithMeta","d":""},{"t":"M","n":"RedisArray::getAuth","p":"RedisArray.html#method_getAuth","d":""},{"t":"M","n":"RedisArray::getBit","p":"RedisArray.html#method_getBit","d":""},{"t":"M","n":"RedisArray::getEx","p":"RedisArray.html#method_getEx","d":""},{"t":"M","n":"RedisArray::getDBNum","p":"RedisArray.html#method_getDBNum","d":""},{"t":"M","n":"RedisArray::getDel","p":"RedisArray.html#method_getDel","d":""},{"t":"M","n":"RedisArray::getHost","p":"RedisArray.html#method_getHost","d":""},{"t":"M","n":"RedisArray::getLastError","p":"RedisArray.html#method_getLastError","d":""},{"t":"M","n":"RedisArray::getMode","p":"RedisArray.html#method_getMode","d":""},{"t":"M","n":"RedisArray::getPersistentID","p":"RedisArray.html#method_getPersistentID","d":""},{"t":"M","n":"RedisArray::getPort","p":"RedisArray.html#method_getPort","d":""},{"t":"M","n":"RedisArray::serverName","p":"RedisArray.html#method_serverName","d":""},{"t":"M","n":"RedisArray::serverVersion","p":"RedisArray.html#method_serverVersion","d":""},{"t":"M","n":"RedisArray::getRange","p":"RedisArray.html#method_getRange","d":""},{"t":"M","n":"RedisArray::lcs","p":"RedisArray.html#method_lcs","d":""},{"t":"M","n":"RedisArray::getReadTimeout","p":"RedisArray.html#method_getReadTimeout","d":""},{"t":"M","n":"RedisArray::getset","p":"RedisArray.html#method_getset","d":""},{"t":"M","n":"RedisArray::getTimeout","p":"RedisArray.html#method_getTimeout","d":""},{"t":"M","n":"RedisArray::getTransferredBytes","p":"RedisArray.html#method_getTransferredBytes","d":""},{"t":"M","n":"RedisArray::clearTransferredBytes","p":"RedisArray.html#method_clearTransferredBytes","d":""},{"t":"M","n":"RedisArray::hDel","p":"RedisArray.html#method_hDel","d":""},{"t":"M","n":"RedisArray::hExists","p":"RedisArray.html#method_hExists","d":""},{"t":"M","n":"RedisArray::hGet","p":"RedisArray.html#method_hGet","d":""},{"t":"M","n":"RedisArray::hGetAll","p":"RedisArray.html#method_hGetAll","d":""},{"t":"M","n":"RedisArray::hGetWithMeta","p":"RedisArray.html#method_hGetWithMeta","d":""},{"t":"M","n":"RedisArray::hIncrBy","p":"RedisArray.html#method_hIncrBy","d":""},{"t":"M","n":"RedisArray::hIncrByFloat","p":"RedisArray.html#method_hIncrByFloat","d":""},{"t":"M","n":"RedisArray::hKeys","p":"RedisArray.html#method_hKeys","d":""},{"t":"M","n":"RedisArray::hLen","p":"RedisArray.html#method_hLen","d":""},{"t":"M","n":"RedisArray::hMget","p":"RedisArray.html#method_hMget","d":""},{"t":"M","n":"RedisArray::hgetex","p":"RedisArray.html#method_hgetex","d":""},{"t":"M","n":"RedisArray::hsetex","p":"RedisArray.html#method_hsetex","d":""},{"t":"M","n":"RedisArray::hgetdel","p":"RedisArray.html#method_hgetdel","d":""},{"t":"M","n":"RedisArray::hMset","p":"RedisArray.html#method_hMset","d":""},{"t":"M","n":"RedisArray::hRandField","p":"RedisArray.html#method_hRandField","d":""},{"t":"M","n":"RedisArray::hSet","p":"RedisArray.html#method_hSet","d":""},{"t":"M","n":"RedisArray::hSetNx","p":"RedisArray.html#method_hSetNx","d":""},{"t":"M","n":"RedisArray::hStrLen","p":"RedisArray.html#method_hStrLen","d":""},{"t":"M","n":"RedisArray::hVals","p":"RedisArray.html#method_hVals","d":""},{"t":"M","n":"RedisArray::httl","p":"RedisArray.html#method_httl","d":""},{"t":"M","n":"RedisArray::hpttl","p":"RedisArray.html#method_hpttl","d":""},{"t":"M","n":"RedisArray::hexpiretime","p":"RedisArray.html#method_hexpiretime","d":""},{"t":"M","n":"RedisArray::hpexpiretime","p":"RedisArray.html#method_hpexpiretime","d":""},{"t":"M","n":"RedisArray::hpersist","p":"RedisArray.html#method_hpersist","d":""},{"t":"M","n":"RedisArray::expiremember","p":"RedisArray.html#method_expiremember","d":""},{"t":"M","n":"RedisArray::expirememberat","p":"RedisArray.html#method_expirememberat","d":""},{"t":"M","n":"RedisArray::incr","p":"RedisArray.html#method_incr","d":""},{"t":"M","n":"RedisArray::incrBy","p":"RedisArray.html#method_incrBy","d":""},{"t":"M","n":"RedisArray::incrByFloat","p":"RedisArray.html#method_incrByFloat","d":""},{"t":"M","n":"RedisArray::isConnected","p":"RedisArray.html#method_isConnected","d":""},{"t":"M","n":"RedisArray::lInsert","p":"RedisArray.html#method_lInsert","d":""},{"t":"M","n":"RedisArray::lLen","p":"RedisArray.html#method_lLen","d":""},{"t":"M","n":"RedisArray::lMove","p":"RedisArray.html#method_lMove","d":""},{"t":"M","n":"RedisArray::blmove","p":"RedisArray.html#method_blmove","d":""},{"t":"M","n":"RedisArray::lPop","p":"RedisArray.html#method_lPop","d":""},{"t":"M","n":"RedisArray::lPos","p":"RedisArray.html#method_lPos","d":""},{"t":"M","n":"RedisArray::lPush","p":"RedisArray.html#method_lPush","d":""},{"t":"M","n":"RedisArray::rPush","p":"RedisArray.html#method_rPush","d":""},{"t":"M","n":"RedisArray::lPushx","p":"RedisArray.html#method_lPushx","d":""},{"t":"M","n":"RedisArray::rPushx","p":"RedisArray.html#method_rPushx","d":""},{"t":"M","n":"RedisArray::lSet","p":"RedisArray.html#method_lSet","d":""},{"t":"M","n":"RedisArray::lastSave","p":"RedisArray.html#method_lastSave","d":""},{"t":"M","n":"RedisArray::lindex","p":"RedisArray.html#method_lindex","d":""},{"t":"M","n":"RedisArray::lrange","p":"RedisArray.html#method_lrange","d":""},{"t":"M","n":"RedisArray::lrem","p":"RedisArray.html#method_lrem","d":""},{"t":"M","n":"RedisArray::ltrim","p":"RedisArray.html#method_ltrim","d":""},{"t":"M","n":"RedisArray::move","p":"RedisArray.html#method_move","d":""},{"t":"M","n":"RedisArray::msetex","p":"RedisArray.html#method_msetex","d":""},{"t":"M","n":"RedisArray::msetnx","p":"RedisArray.html#method_msetnx","d":""},{"t":"M","n":"RedisArray::object","p":"RedisArray.html#method_object","d":""},{"t":"M","n":"RedisArray::open","p":"RedisArray.html#method_open","d":""},{"t":"M","n":"RedisArray::pconnect","p":"RedisArray.html#method_pconnect","d":""},{"t":"M","n":"RedisArray::persist","p":"RedisArray.html#method_persist","d":""},{"t":"M","n":"RedisArray::pexpire","p":"RedisArray.html#method_pexpire","d":""},{"t":"M","n":"RedisArray::pexpireAt","p":"RedisArray.html#method_pexpireAt","d":""},{"t":"M","n":"RedisArray::pfadd","p":"RedisArray.html#method_pfadd","d":""},{"t":"M","n":"RedisArray::pfcount","p":"RedisArray.html#method_pfcount","d":""},{"t":"M","n":"RedisArray::pfmerge","p":"RedisArray.html#method_pfmerge","d":""},{"t":"M","n":"RedisArray::pipeline","p":"RedisArray.html#method_pipeline","d":""},{"t":"M","n":"RedisArray::popen","p":"RedisArray.html#method_popen","d":""},{"t":"M","n":"RedisArray::psetex","p":"RedisArray.html#method_psetex","d":""},{"t":"M","n":"RedisArray::psubscribe","p":"RedisArray.html#method_psubscribe","d":""},{"t":"M","n":"RedisArray::pttl","p":"RedisArray.html#method_pttl","d":""},{"t":"M","n":"RedisArray::publish","p":"RedisArray.html#method_publish","d":""},{"t":"M","n":"RedisArray::pubsub","p":"RedisArray.html#method_pubsub","d":""},{"t":"M","n":"RedisArray::punsubscribe","p":"RedisArray.html#method_punsubscribe","d":""},{"t":"M","n":"RedisArray::rPop","p":"RedisArray.html#method_rPop","d":""},{"t":"M","n":"RedisArray::randomKey","p":"RedisArray.html#method_randomKey","d":""},{"t":"M","n":"RedisArray::rawcommand","p":"RedisArray.html#method_rawcommand","d":""},{"t":"M","n":"RedisArray::rename","p":"RedisArray.html#method_rename","d":""},{"t":"M","n":"RedisArray::renameNx","p":"RedisArray.html#method_renameNx","d":""},{"t":"M","n":"RedisArray::reset","p":"RedisArray.html#method_reset","d":""},{"t":"M","n":"RedisArray::restore","p":"RedisArray.html#method_restore","d":""},{"t":"M","n":"RedisArray::role","p":"RedisArray.html#method_role","d":""},{"t":"M","n":"RedisArray::rpoplpush","p":"RedisArray.html#method_rpoplpush","d":""},{"t":"M","n":"RedisArray::sAdd","p":"RedisArray.html#method_sAdd","d":""},{"t":"M","n":"RedisArray::sAddArray","p":"RedisArray.html#method_sAddArray","d":""},{"t":"M","n":"RedisArray::sDiff","p":"RedisArray.html#method_sDiff","d":""},{"t":"M","n":"RedisArray::sDiffStore","p":"RedisArray.html#method_sDiffStore","d":""},{"t":"M","n":"RedisArray::sInter","p":"RedisArray.html#method_sInter","d":""},{"t":"M","n":"RedisArray::sintercard","p":"RedisArray.html#method_sintercard","d":""},{"t":"M","n":"RedisArray::sInterStore","p":"RedisArray.html#method_sInterStore","d":""},{"t":"M","n":"RedisArray::sMembers","p":"RedisArray.html#method_sMembers","d":""},{"t":"M","n":"RedisArray::sMisMember","p":"RedisArray.html#method_sMisMember","d":""},{"t":"M","n":"RedisArray::sMove","p":"RedisArray.html#method_sMove","d":""},{"t":"M","n":"RedisArray::sPop","p":"RedisArray.html#method_sPop","d":""},{"t":"M","n":"RedisArray::sRandMember","p":"RedisArray.html#method_sRandMember","d":""},{"t":"M","n":"RedisArray::sUnion","p":"RedisArray.html#method_sUnion","d":""},{"t":"M","n":"RedisArray::sUnionStore","p":"RedisArray.html#method_sUnionStore","d":""},{"t":"M","n":"RedisArray::scard","p":"RedisArray.html#method_scard","d":""},{"t":"M","n":"RedisArray::script","p":"RedisArray.html#method_script","d":""},{"t":"M","n":"RedisArray::set","p":"RedisArray.html#method_set","d":""},{"t":"M","n":"RedisArray::setBit","p":"RedisArray.html#method_setBit","d":""},{"t":"M","n":"RedisArray::setRange","p":"RedisArray.html#method_setRange","d":""},{"t":"M","n":"RedisArray::setex","p":"RedisArray.html#method_setex","d":""},{"t":"M","n":"RedisArray::setnx","p":"RedisArray.html#method_setnx","d":""},{"t":"M","n":"RedisArray::sismember","p":"RedisArray.html#method_sismember","d":""},{"t":"M","n":"RedisArray::slaveof","p":"RedisArray.html#method_slaveof","d":""},{"t":"M","n":"RedisArray::replicaof","p":"RedisArray.html#method_replicaof","d":""},{"t":"M","n":"RedisArray::touch","p":"RedisArray.html#method_touch","d":""},{"t":"M","n":"RedisArray::slowlog","p":"RedisArray.html#method_slowlog","d":""},{"t":"M","n":"RedisArray::sort","p":"RedisArray.html#method_sort","d":""},{"t":"M","n":"RedisArray::sort_ro","p":"RedisArray.html#method_sort_ro","d":""},{"t":"M","n":"RedisArray::sortAsc","p":"RedisArray.html#method_sortAsc","d":""},{"t":"M","n":"RedisArray::sortAscAlpha","p":"RedisArray.html#method_sortAscAlpha","d":""},{"t":"M","n":"RedisArray::sortDesc","p":"RedisArray.html#method_sortDesc","d":""},{"t":"M","n":"RedisArray::sortDescAlpha","p":"RedisArray.html#method_sortDescAlpha","d":""},{"t":"M","n":"RedisArray::srem","p":"RedisArray.html#method_srem","d":""},{"t":"M","n":"RedisArray::ssubscribe","p":"RedisArray.html#method_ssubscribe","d":""},{"t":"M","n":"RedisArray::strlen","p":"RedisArray.html#method_strlen","d":""},{"t":"M","n":"RedisArray::subscribe","p":"RedisArray.html#method_subscribe","d":""},{"t":"M","n":"RedisArray::sunsubscribe","p":"RedisArray.html#method_sunsubscribe","d":""},{"t":"M","n":"RedisArray::swapdb","p":"RedisArray.html#method_swapdb","d":""},{"t":"M","n":"RedisArray::time","p":"RedisArray.html#method_time","d":""},{"t":"M","n":"RedisArray::ttl","p":"RedisArray.html#method_ttl","d":""},{"t":"M","n":"RedisArray::type","p":"RedisArray.html#method_type","d":""},{"t":"M","n":"RedisArray::unsubscribe","p":"RedisArray.html#method_unsubscribe","d":""},{"t":"M","n":"RedisArray::watch","p":"RedisArray.html#method_watch","d":""},{"t":"M","n":"RedisArray::wait","p":"RedisArray.html#method_wait","d":""},{"t":"M","n":"RedisArray::xack","p":"RedisArray.html#method_xack","d":""},{"t":"M","n":"RedisArray::xadd","p":"RedisArray.html#method_xadd","d":""},{"t":"M","n":"RedisArray::xautoclaim","p":"RedisArray.html#method_xautoclaim","d":""},{"t":"M","n":"RedisArray::xclaim","p":"RedisArray.html#method_xclaim","d":""},{"t":"M","n":"RedisArray::xdel","p":"RedisArray.html#method_xdel","d":""},{"t":"M","n":"RedisArray::xdelex","p":"RedisArray.html#method_xdelex","d":""},{"t":"M","n":"RedisArray::xinfo","p":"RedisArray.html#method_xinfo","d":""},{"t":"M","n":"RedisArray::xlen","p":"RedisArray.html#method_xlen","d":""},{"t":"M","n":"RedisArray::xpending","p":"RedisArray.html#method_xpending","d":""},{"t":"M","n":"RedisArray::xrange","p":"RedisArray.html#method_xrange","d":""},{"t":"M","n":"RedisArray::xread","p":"RedisArray.html#method_xread","d":""},{"t":"M","n":"RedisArray::xreadgroup","p":"RedisArray.html#method_xreadgroup","d":""},{"t":"M","n":"RedisArray::xrevrange","p":"RedisArray.html#method_xrevrange","d":""},{"t":"M","n":"RedisArray::vadd","p":"RedisArray.html#method_vadd","d":""},{"t":"M","n":"RedisArray::vsim","p":"RedisArray.html#method_vsim","d":""},{"t":"M","n":"RedisArray::vcard","p":"RedisArray.html#method_vcard","d":""},{"t":"M","n":"RedisArray::vdim","p":"RedisArray.html#method_vdim","d":""},{"t":"M","n":"RedisArray::vinfo","p":"RedisArray.html#method_vinfo","d":""},{"t":"M","n":"RedisArray::vismember","p":"RedisArray.html#method_vismember","d":""},{"t":"M","n":"RedisArray::vemb","p":"RedisArray.html#method_vemb","d":""},{"t":"M","n":"RedisArray::vrandmember","p":"RedisArray.html#method_vrandmember","d":""},{"t":"M","n":"RedisArray::vrange","p":"RedisArray.html#method_vrange","d":""},{"t":"M","n":"RedisArray::vrem","p":"RedisArray.html#method_vrem","d":""},{"t":"M","n":"RedisArray::vsetattr","p":"RedisArray.html#method_vsetattr","d":""},{"t":"M","n":"RedisArray::vgetattr","p":"RedisArray.html#method_vgetattr","d":""},{"t":"M","n":"RedisArray::vlinks","p":"RedisArray.html#method_vlinks","d":""},{"t":"M","n":"RedisArray::xtrim","p":"RedisArray.html#method_xtrim","d":""},{"t":"M","n":"RedisArray::zAdd","p":"RedisArray.html#method_zAdd","d":""},{"t":"M","n":"RedisArray::zCard","p":"RedisArray.html#method_zCard","d":""},{"t":"M","n":"RedisArray::zCount","p":"RedisArray.html#method_zCount","d":""},{"t":"M","n":"RedisArray::zIncrBy","p":"RedisArray.html#method_zIncrBy","d":""},{"t":"M","n":"RedisArray::zLexCount","p":"RedisArray.html#method_zLexCount","d":""},{"t":"M","n":"RedisArray::zMscore","p":"RedisArray.html#method_zMscore","d":""},{"t":"M","n":"RedisArray::zPopMax","p":"RedisArray.html#method_zPopMax","d":""},{"t":"M","n":"RedisArray::zPopMin","p":"RedisArray.html#method_zPopMin","d":""},{"t":"M","n":"RedisArray::zRange","p":"RedisArray.html#method_zRange","d":""},{"t":"M","n":"RedisArray::zRangeByLex","p":"RedisArray.html#method_zRangeByLex","d":""},{"t":"M","n":"RedisArray::zRangeByScore","p":"RedisArray.html#method_zRangeByScore","d":""},{"t":"M","n":"RedisArray::zRandMember","p":"RedisArray.html#method_zRandMember","d":""},{"t":"M","n":"RedisArray::zRank","p":"RedisArray.html#method_zRank","d":""},{"t":"M","n":"RedisArray::zRem","p":"RedisArray.html#method_zRem","d":""},{"t":"M","n":"RedisArray::zRemRangeByLex","p":"RedisArray.html#method_zRemRangeByLex","d":""},{"t":"M","n":"RedisArray::zRemRangeByRank","p":"RedisArray.html#method_zRemRangeByRank","d":""},{"t":"M","n":"RedisArray::zRemRangeByScore","p":"RedisArray.html#method_zRemRangeByScore","d":""},{"t":"M","n":"RedisArray::zRevRange","p":"RedisArray.html#method_zRevRange","d":""},{"t":"M","n":"RedisArray::zRevRangeByLex","p":"RedisArray.html#method_zRevRangeByLex","d":""},{"t":"M","n":"RedisArray::zRevRangeByScore","p":"RedisArray.html#method_zRevRangeByScore","d":""},{"t":"M","n":"RedisArray::zRevRank","p":"RedisArray.html#method_zRevRank","d":""},{"t":"M","n":"RedisArray::zScore","p":"RedisArray.html#method_zScore","d":""},{"t":"M","n":"RedisArray::zdiff","p":"RedisArray.html#method_zdiff","d":""},{"t":"M","n":"RedisArray::zdiffstore","p":"RedisArray.html#method_zdiffstore","d":""},{"t":"M","n":"RedisArray::zinter","p":"RedisArray.html#method_zinter","d":""},{"t":"M","n":"RedisArray::zintercard","p":"RedisArray.html#method_zintercard","d":""},{"t":"M","n":"RedisArray::zinterstore","p":"RedisArray.html#method_zinterstore","d":""},{"t":"M","n":"RedisArray::zunion","p":"RedisArray.html#method_zunion","d":""},{"t":"M","n":"RedisArray::zunionstore","p":"RedisArray.html#method_zunionstore","d":""},{"t":"M","n":"RedisArray::digest","p":"RedisArray.html#method_digest","d":""},{"t":"M","n":"RedisCluster::__construct","p":"RedisCluster.html#method___construct","d":null},{"t":"M","n":"RedisCluster::_compress","p":"RedisCluster.html#method__compress","d":"{\\Redis::_compress()}"},{"t":"M","n":"RedisCluster::_uncompress","p":"RedisCluster.html#method__uncompress","d":""},{"t":"M","n":"RedisCluster::_serialize","p":"RedisCluster.html#method__serialize","d":""},{"t":"M","n":"RedisCluster::_unserialize","p":"RedisCluster.html#method__unserialize","d":""},{"t":"M","n":"RedisCluster::_pack","p":"RedisCluster.html#method__pack","d":""},{"t":"M","n":"RedisCluster::_digest","p":"RedisCluster.html#method__digest","d":""},{"t":"M","n":"RedisCluster::_unpack","p":"RedisCluster.html#method__unpack","d":""},{"t":"M","n":"RedisCluster::_prefix","p":"RedisCluster.html#method__prefix","d":""},{"t":"M","n":"RedisCluster::_masters","p":"RedisCluster.html#method__masters","d":null},{"t":"M","n":"RedisCluster::_redir","p":"RedisCluster.html#method__redir","d":null},{"t":"M","n":"RedisCluster::acl","p":"RedisCluster.html#method_acl","d":""},{"t":"M","n":"RedisCluster::append","p":"RedisCluster.html#method_append","d":""},{"t":"M","n":"RedisCluster::bgrewriteaof","p":"RedisCluster.html#method_bgrewriteaof","d":""},{"t":"M","n":"RedisCluster::wait","p":"RedisCluster.html#method_wait","d":""},{"t":"M","n":"RedisCluster::waitaof","p":"RedisCluster.html#method_waitaof","d":""},{"t":"M","n":"RedisCluster::bgsave","p":"RedisCluster.html#method_bgsave","d":""},{"t":"M","n":"RedisCluster::bitcount","p":"RedisCluster.html#method_bitcount","d":""},{"t":"M","n":"RedisCluster::bitop","p":"RedisCluster.html#method_bitop","d":""},{"t":"M","n":"RedisCluster::bitpos","p":"RedisCluster.html#method_bitpos","d":"

    Return the position of the first bit set to 0 or 1 in a string.

    "},{"t":"M","n":"RedisCluster::blpop","p":"RedisCluster.html#method_blpop","d":""},{"t":"M","n":"RedisCluster::brpop","p":"RedisCluster.html#method_brpop","d":""},{"t":"M","n":"RedisCluster::brpoplpush","p":"RedisCluster.html#method_brpoplpush","d":""},{"t":"M","n":"RedisCluster::lmove","p":"RedisCluster.html#method_lmove","d":"

    Move an element from one list into another.

    "},{"t":"M","n":"RedisCluster::blmove","p":"RedisCluster.html#method_blmove","d":"

    Move an element from one list to another, blocking up to a timeout until an element is available.

    "},{"t":"M","n":"RedisCluster::bzpopmax","p":"RedisCluster.html#method_bzpopmax","d":""},{"t":"M","n":"RedisCluster::bzpopmin","p":"RedisCluster.html#method_bzpopmin","d":""},{"t":"M","n":"RedisCluster::bzmpop","p":"RedisCluster.html#method_bzmpop","d":""},{"t":"M","n":"RedisCluster::zmpop","p":"RedisCluster.html#method_zmpop","d":""},{"t":"M","n":"RedisCluster::blmpop","p":"RedisCluster.html#method_blmpop","d":""},{"t":"M","n":"RedisCluster::lmpop","p":"RedisCluster.html#method_lmpop","d":""},{"t":"M","n":"RedisCluster::clearlasterror","p":"RedisCluster.html#method_clearlasterror","d":""},{"t":"M","n":"RedisCluster::client","p":"RedisCluster.html#method_client","d":""},{"t":"M","n":"RedisCluster::close","p":"RedisCluster.html#method_close","d":""},{"t":"M","n":"RedisCluster::cluster","p":"RedisCluster.html#method_cluster","d":""},{"t":"M","n":"RedisCluster::command","p":"RedisCluster.html#method_command","d":""},{"t":"M","n":"RedisCluster::config","p":"RedisCluster.html#method_config","d":""},{"t":"M","n":"RedisCluster::dbsize","p":"RedisCluster.html#method_dbsize","d":""},{"t":"M","n":"RedisCluster::copy","p":"RedisCluster.html#method_copy","d":""},{"t":"M","n":"RedisCluster::decr","p":"RedisCluster.html#method_decr","d":""},{"t":"M","n":"RedisCluster::decrby","p":"RedisCluster.html#method_decrby","d":""},{"t":"M","n":"RedisCluster::decrbyfloat","p":"RedisCluster.html#method_decrbyfloat","d":""},{"t":"M","n":"RedisCluster::del","p":"RedisCluster.html#method_del","d":""},{"t":"M","n":"RedisCluster::delex","p":"RedisCluster.html#method_delex","d":"

    Delete a key conditionally based on its value or hash digest

    "},{"t":"M","n":"RedisCluster::delifeq","p":"RedisCluster.html#method_delifeq","d":"

    Delete a key if it's equal to the specified value. This command is\nspecific to Valkey >= 9.0

    "},{"t":"M","n":"RedisCluster::discard","p":"RedisCluster.html#method_discard","d":""},{"t":"M","n":"RedisCluster::dump","p":"RedisCluster.html#method_dump","d":""},{"t":"M","n":"RedisCluster::echo","p":"RedisCluster.html#method_echo","d":""},{"t":"M","n":"RedisCluster::eval","p":"RedisCluster.html#method_eval","d":""},{"t":"M","n":"RedisCluster::eval_ro","p":"RedisCluster.html#method_eval_ro","d":""},{"t":"M","n":"RedisCluster::evalsha","p":"RedisCluster.html#method_evalsha","d":""},{"t":"M","n":"RedisCluster::evalsha_ro","p":"RedisCluster.html#method_evalsha_ro","d":""},{"t":"M","n":"RedisCluster::exec","p":"RedisCluster.html#method_exec","d":""},{"t":"M","n":"RedisCluster::exists","p":"RedisCluster.html#method_exists","d":""},{"t":"M","n":"RedisCluster::touch","p":"RedisCluster.html#method_touch","d":""},{"t":"M","n":"RedisCluster::expire","p":"RedisCluster.html#method_expire","d":""},{"t":"M","n":"RedisCluster::expireat","p":"RedisCluster.html#method_expireat","d":""},{"t":"M","n":"RedisCluster::expiretime","p":"RedisCluster.html#method_expiretime","d":""},{"t":"M","n":"RedisCluster::pexpiretime","p":"RedisCluster.html#method_pexpiretime","d":""},{"t":"M","n":"RedisCluster::flushall","p":"RedisCluster.html#method_flushall","d":""},{"t":"M","n":"RedisCluster::flushdb","p":"RedisCluster.html#method_flushdb","d":""},{"t":"M","n":"RedisCluster::geoadd","p":"RedisCluster.html#method_geoadd","d":""},{"t":"M","n":"RedisCluster::geodist","p":"RedisCluster.html#method_geodist","d":""},{"t":"M","n":"RedisCluster::geohash","p":"RedisCluster.html#method_geohash","d":""},{"t":"M","n":"RedisCluster::geopos","p":"RedisCluster.html#method_geopos","d":""},{"t":"M","n":"RedisCluster::georadius","p":"RedisCluster.html#method_georadius","d":""},{"t":"M","n":"RedisCluster::georadius_ro","p":"RedisCluster.html#method_georadius_ro","d":""},{"t":"M","n":"RedisCluster::georadiusbymember","p":"RedisCluster.html#method_georadiusbymember","d":""},{"t":"M","n":"RedisCluster::georadiusbymember_ro","p":"RedisCluster.html#method_georadiusbymember_ro","d":""},{"t":"M","n":"RedisCluster::geosearch","p":"RedisCluster.html#method_geosearch","d":""},{"t":"M","n":"RedisCluster::geosearchstore","p":"RedisCluster.html#method_geosearchstore","d":""},{"t":"M","n":"RedisCluster::get","p":"RedisCluster.html#method_get","d":""},{"t":"M","n":"RedisCluster::getdel","p":"RedisCluster.html#method_getdel","d":""},{"t":"M","n":"RedisCluster::getWithMeta","p":"RedisCluster.html#method_getWithMeta","d":""},{"t":"M","n":"RedisCluster::getex","p":"RedisCluster.html#method_getex","d":""},{"t":"M","n":"RedisCluster::getbit","p":"RedisCluster.html#method_getbit","d":""},{"t":"M","n":"RedisCluster::getlasterror","p":"RedisCluster.html#method_getlasterror","d":""},{"t":"M","n":"RedisCluster::getmode","p":"RedisCluster.html#method_getmode","d":""},{"t":"M","n":"RedisCluster::getoption","p":"RedisCluster.html#method_getoption","d":""},{"t":"M","n":"RedisCluster::getrange","p":"RedisCluster.html#method_getrange","d":""},{"t":"M","n":"RedisCluster::lcs","p":"RedisCluster.html#method_lcs","d":""},{"t":"M","n":"RedisCluster::getset","p":"RedisCluster.html#method_getset","d":""},{"t":"M","n":"RedisCluster::gettransferredbytes","p":"RedisCluster.html#method_gettransferredbytes","d":""},{"t":"M","n":"RedisCluster::cleartransferredbytes","p":"RedisCluster.html#method_cleartransferredbytes","d":""},{"t":"M","n":"RedisCluster::hdel","p":"RedisCluster.html#method_hdel","d":""},{"t":"M","n":"RedisCluster::hexists","p":"RedisCluster.html#method_hexists","d":""},{"t":"M","n":"RedisCluster::hget","p":"RedisCluster.html#method_hget","d":""},{"t":"M","n":"RedisCluster::hgetall","p":"RedisCluster.html#method_hgetall","d":""},{"t":"M","n":"RedisCluster::hgetWithMeta","p":"RedisCluster.html#method_hgetWithMeta","d":""},{"t":"M","n":"RedisCluster::hincrby","p":"RedisCluster.html#method_hincrby","d":""},{"t":"M","n":"RedisCluster::hincrbyfloat","p":"RedisCluster.html#method_hincrbyfloat","d":""},{"t":"M","n":"RedisCluster::hkeys","p":"RedisCluster.html#method_hkeys","d":""},{"t":"M","n":"RedisCluster::hlen","p":"RedisCluster.html#method_hlen","d":""},{"t":"M","n":"RedisCluster::hmget","p":"RedisCluster.html#method_hmget","d":""},{"t":"M","n":"RedisCluster::hgetex","p":"RedisCluster.html#method_hgetex","d":""},{"t":"M","n":"RedisCluster::hsetex","p":"RedisCluster.html#method_hsetex","d":""},{"t":"M","n":"RedisCluster::hgetdel","p":"RedisCluster.html#method_hgetdel","d":""},{"t":"M","n":"RedisCluster::hmset","p":"RedisCluster.html#method_hmset","d":""},{"t":"M","n":"RedisCluster::hscan","p":"RedisCluster.html#method_hscan","d":""},{"t":"M","n":"RedisCluster::expiremember","p":"RedisCluster.html#method_expiremember","d":""},{"t":"M","n":"RedisCluster::expirememberat","p":"RedisCluster.html#method_expirememberat","d":""},{"t":"M","n":"RedisCluster::hrandfield","p":"RedisCluster.html#method_hrandfield","d":""},{"t":"M","n":"RedisCluster::hset","p":"RedisCluster.html#method_hset","d":""},{"t":"M","n":"RedisCluster::hsetnx","p":"RedisCluster.html#method_hsetnx","d":""},{"t":"M","n":"RedisCluster::hstrlen","p":"RedisCluster.html#method_hstrlen","d":""},{"t":"M","n":"RedisCluster::hexpire","p":"RedisCluster.html#method_hexpire","d":""},{"t":"M","n":"RedisCluster::hpexpire","p":"RedisCluster.html#method_hpexpire","d":""},{"t":"M","n":"RedisCluster::hexpireat","p":"RedisCluster.html#method_hexpireat","d":""},{"t":"M","n":"RedisCluster::hpexpireat","p":"RedisCluster.html#method_hpexpireat","d":""},{"t":"M","n":"RedisCluster::httl","p":"RedisCluster.html#method_httl","d":""},{"t":"M","n":"RedisCluster::hpttl","p":"RedisCluster.html#method_hpttl","d":""},{"t":"M","n":"RedisCluster::hexpiretime","p":"RedisCluster.html#method_hexpiretime","d":""},{"t":"M","n":"RedisCluster::hpexpiretime","p":"RedisCluster.html#method_hpexpiretime","d":""},{"t":"M","n":"RedisCluster::hpersist","p":"RedisCluster.html#method_hpersist","d":""},{"t":"M","n":"RedisCluster::hvals","p":"RedisCluster.html#method_hvals","d":""},{"t":"M","n":"RedisCluster::incr","p":"RedisCluster.html#method_incr","d":""},{"t":"M","n":"RedisCluster::incrby","p":"RedisCluster.html#method_incrby","d":""},{"t":"M","n":"RedisCluster::incrbyfloat","p":"RedisCluster.html#method_incrbyfloat","d":""},{"t":"M","n":"RedisCluster::info","p":"RedisCluster.html#method_info","d":"

    Retrieve information about the connected redis-server. If no arguments are passed to\nthis function, redis will return every info field. Alternatively you may pass a specific\nsection you want returned (e.g. 'server', or 'memory') to receive only information pertaining\nto that section.

    "},{"t":"M","n":"RedisCluster::keys","p":"RedisCluster.html#method_keys","d":""},{"t":"M","n":"RedisCluster::lastsave","p":"RedisCluster.html#method_lastsave","d":""},{"t":"M","n":"RedisCluster::lget","p":"RedisCluster.html#method_lget","d":""},{"t":"M","n":"RedisCluster::lindex","p":"RedisCluster.html#method_lindex","d":""},{"t":"M","n":"RedisCluster::linsert","p":"RedisCluster.html#method_linsert","d":""},{"t":"M","n":"RedisCluster::llen","p":"RedisCluster.html#method_llen","d":""},{"t":"M","n":"RedisCluster::lpop","p":"RedisCluster.html#method_lpop","d":""},{"t":"M","n":"RedisCluster::lpos","p":"RedisCluster.html#method_lpos","d":""},{"t":"M","n":"RedisCluster::lpush","p":"RedisCluster.html#method_lpush","d":""},{"t":"M","n":"RedisCluster::lpushx","p":"RedisCluster.html#method_lpushx","d":""},{"t":"M","n":"RedisCluster::lrange","p":"RedisCluster.html#method_lrange","d":""},{"t":"M","n":"RedisCluster::lrem","p":"RedisCluster.html#method_lrem","d":""},{"t":"M","n":"RedisCluster::lset","p":"RedisCluster.html#method_lset","d":""},{"t":"M","n":"RedisCluster::ltrim","p":"RedisCluster.html#method_ltrim","d":""},{"t":"M","n":"RedisCluster::mget","p":"RedisCluster.html#method_mget","d":""},{"t":"M","n":"RedisCluster::mset","p":"RedisCluster.html#method_mset","d":""},{"t":"M","n":"RedisCluster::msetnx","p":"RedisCluster.html#method_msetnx","d":""},{"t":"M","n":"RedisCluster::msetex","p":"RedisCluster.html#method_msetex","d":""},{"t":"M","n":"RedisCluster::multi","p":"RedisCluster.html#method_multi","d":null},{"t":"M","n":"RedisCluster::object","p":"RedisCluster.html#method_object","d":""},{"t":"M","n":"RedisCluster::persist","p":"RedisCluster.html#method_persist","d":""},{"t":"M","n":"RedisCluster::pexpire","p":"RedisCluster.html#method_pexpire","d":""},{"t":"M","n":"RedisCluster::pexpireat","p":"RedisCluster.html#method_pexpireat","d":""},{"t":"M","n":"RedisCluster::pfadd","p":"RedisCluster.html#method_pfadd","d":""},{"t":"M","n":"RedisCluster::pfcount","p":"RedisCluster.html#method_pfcount","d":""},{"t":"M","n":"RedisCluster::pfmerge","p":"RedisCluster.html#method_pfmerge","d":""},{"t":"M","n":"RedisCluster::ping","p":"RedisCluster.html#method_ping","d":"

    PING an instance in the redis cluster.

    "},{"t":"M","n":"RedisCluster::psetex","p":"RedisCluster.html#method_psetex","d":""},{"t":"M","n":"RedisCluster::psubscribe","p":"RedisCluster.html#method_psubscribe","d":""},{"t":"M","n":"RedisCluster::pttl","p":"RedisCluster.html#method_pttl","d":""},{"t":"M","n":"RedisCluster::publish","p":"RedisCluster.html#method_publish","d":""},{"t":"M","n":"RedisCluster::pubsub","p":"RedisCluster.html#method_pubsub","d":""},{"t":"M","n":"RedisCluster::punsubscribe","p":"RedisCluster.html#method_punsubscribe","d":""},{"t":"M","n":"RedisCluster::randomkey","p":"RedisCluster.html#method_randomkey","d":""},{"t":"M","n":"RedisCluster::rawcommand","p":"RedisCluster.html#method_rawcommand","d":""},{"t":"M","n":"RedisCluster::rename","p":"RedisCluster.html#method_rename","d":""},{"t":"M","n":"RedisCluster::renamenx","p":"RedisCluster.html#method_renamenx","d":""},{"t":"M","n":"RedisCluster::restore","p":"RedisCluster.html#method_restore","d":""},{"t":"M","n":"RedisCluster::role","p":"RedisCluster.html#method_role","d":""},{"t":"M","n":"RedisCluster::rpop","p":"RedisCluster.html#method_rpop","d":""},{"t":"M","n":"RedisCluster::rpoplpush","p":"RedisCluster.html#method_rpoplpush","d":""},{"t":"M","n":"RedisCluster::rpush","p":"RedisCluster.html#method_rpush","d":""},{"t":"M","n":"RedisCluster::rpushx","p":"RedisCluster.html#method_rpushx","d":""},{"t":"M","n":"RedisCluster::sadd","p":"RedisCluster.html#method_sadd","d":""},{"t":"M","n":"RedisCluster::saddarray","p":"RedisCluster.html#method_saddarray","d":""},{"t":"M","n":"RedisCluster::save","p":"RedisCluster.html#method_save","d":""},{"t":"M","n":"RedisCluster::scan","p":"RedisCluster.html#method_scan","d":""},{"t":"M","n":"RedisCluster::scard","p":"RedisCluster.html#method_scard","d":""},{"t":"M","n":"RedisCluster::script","p":"RedisCluster.html#method_script","d":""},{"t":"M","n":"RedisCluster::sdiff","p":"RedisCluster.html#method_sdiff","d":""},{"t":"M","n":"RedisCluster::sdiffstore","p":"RedisCluster.html#method_sdiffstore","d":""},{"t":"M","n":"RedisCluster::set","p":"RedisCluster.html#method_set","d":""},{"t":"M","n":"RedisCluster::setbit","p":"RedisCluster.html#method_setbit","d":""},{"t":"M","n":"RedisCluster::setex","p":"RedisCluster.html#method_setex","d":""},{"t":"M","n":"RedisCluster::setnx","p":"RedisCluster.html#method_setnx","d":""},{"t":"M","n":"RedisCluster::setoption","p":"RedisCluster.html#method_setoption","d":""},{"t":"M","n":"RedisCluster::setrange","p":"RedisCluster.html#method_setrange","d":""},{"t":"M","n":"RedisCluster::sinter","p":"RedisCluster.html#method_sinter","d":""},{"t":"M","n":"RedisCluster::sintercard","p":"RedisCluster.html#method_sintercard","d":""},{"t":"M","n":"RedisCluster::sinterstore","p":"RedisCluster.html#method_sinterstore","d":""},{"t":"M","n":"RedisCluster::sismember","p":"RedisCluster.html#method_sismember","d":""},{"t":"M","n":"RedisCluster::smismember","p":"RedisCluster.html#method_smismember","d":""},{"t":"M","n":"RedisCluster::slowlog","p":"RedisCluster.html#method_slowlog","d":""},{"t":"M","n":"RedisCluster::smembers","p":"RedisCluster.html#method_smembers","d":""},{"t":"M","n":"RedisCluster::smove","p":"RedisCluster.html#method_smove","d":""},{"t":"M","n":"RedisCluster::sort","p":"RedisCluster.html#method_sort","d":""},{"t":"M","n":"RedisCluster::sort_ro","p":"RedisCluster.html#method_sort_ro","d":""},{"t":"M","n":"RedisCluster::spop","p":"RedisCluster.html#method_spop","d":""},{"t":"M","n":"RedisCluster::srandmember","p":"RedisCluster.html#method_srandmember","d":""},{"t":"M","n":"RedisCluster::srem","p":"RedisCluster.html#method_srem","d":""},{"t":"M","n":"RedisCluster::sscan","p":"RedisCluster.html#method_sscan","d":""},{"t":"M","n":"RedisCluster::strlen","p":"RedisCluster.html#method_strlen","d":""},{"t":"M","n":"RedisCluster::subscribe","p":"RedisCluster.html#method_subscribe","d":""},{"t":"M","n":"RedisCluster::sunion","p":"RedisCluster.html#method_sunion","d":""},{"t":"M","n":"RedisCluster::sunionstore","p":"RedisCluster.html#method_sunionstore","d":""},{"t":"M","n":"RedisCluster::time","p":"RedisCluster.html#method_time","d":""},{"t":"M","n":"RedisCluster::ttl","p":"RedisCluster.html#method_ttl","d":""},{"t":"M","n":"RedisCluster::type","p":"RedisCluster.html#method_type","d":""},{"t":"M","n":"RedisCluster::unsubscribe","p":"RedisCluster.html#method_unsubscribe","d":""},{"t":"M","n":"RedisCluster::unlink","p":"RedisCluster.html#method_unlink","d":""},{"t":"M","n":"RedisCluster::unwatch","p":"RedisCluster.html#method_unwatch","d":""},{"t":"M","n":"RedisCluster::watch","p":"RedisCluster.html#method_watch","d":""},{"t":"M","n":"RedisCluster::vadd","p":"RedisCluster.html#method_vadd","d":""},{"t":"M","n":"RedisCluster::vsim","p":"RedisCluster.html#method_vsim","d":""},{"t":"M","n":"RedisCluster::vcard","p":"RedisCluster.html#method_vcard","d":""},{"t":"M","n":"RedisCluster::vdim","p":"RedisCluster.html#method_vdim","d":""},{"t":"M","n":"RedisCluster::vinfo","p":"RedisCluster.html#method_vinfo","d":""},{"t":"M","n":"RedisCluster::vismember","p":"RedisCluster.html#method_vismember","d":"

    Check if an element is a member of a vectorset

    "},{"t":"M","n":"RedisCluster::vemb","p":"RedisCluster.html#method_vemb","d":""},{"t":"M","n":"RedisCluster::vrandmember","p":"RedisCluster.html#method_vrandmember","d":""},{"t":"M","n":"RedisCluster::vrange","p":"RedisCluster.html#method_vrange","d":"

    Retreive a lexographical range of elements from a vector set

    "},{"t":"M","n":"RedisCluster::vrem","p":"RedisCluster.html#method_vrem","d":""},{"t":"M","n":"RedisCluster::vlinks","p":"RedisCluster.html#method_vlinks","d":""},{"t":"M","n":"RedisCluster::vgetattr","p":"RedisCluster.html#method_vgetattr","d":""},{"t":"M","n":"RedisCluster::vsetattr","p":"RedisCluster.html#method_vsetattr","d":""},{"t":"M","n":"RedisCluster::gcra","p":"RedisCluster.html#method_gcra","d":""},{"t":"M","n":"RedisCluster::xack","p":"RedisCluster.html#method_xack","d":""},{"t":"M","n":"RedisCluster::xadd","p":"RedisCluster.html#method_xadd","d":""},{"t":"M","n":"RedisCluster::xclaim","p":"RedisCluster.html#method_xclaim","d":""},{"t":"M","n":"RedisCluster::xdel","p":"RedisCluster.html#method_xdel","d":""},{"t":"M","n":"RedisCluster::xdelex","p":"RedisCluster.html#method_xdelex","d":""},{"t":"M","n":"RedisCluster::xgroup","p":"RedisCluster.html#method_xgroup","d":""},{"t":"M","n":"RedisCluster::xautoclaim","p":"RedisCluster.html#method_xautoclaim","d":""},{"t":"M","n":"RedisCluster::xinfo","p":"RedisCluster.html#method_xinfo","d":""},{"t":"M","n":"RedisCluster::xlen","p":"RedisCluster.html#method_xlen","d":""},{"t":"M","n":"RedisCluster::xpending","p":"RedisCluster.html#method_xpending","d":""},{"t":"M","n":"RedisCluster::xrange","p":"RedisCluster.html#method_xrange","d":""},{"t":"M","n":"RedisCluster::xread","p":"RedisCluster.html#method_xread","d":""},{"t":"M","n":"RedisCluster::xreadgroup","p":"RedisCluster.html#method_xreadgroup","d":""},{"t":"M","n":"RedisCluster::xrevrange","p":"RedisCluster.html#method_xrevrange","d":""},{"t":"M","n":"RedisCluster::xtrim","p":"RedisCluster.html#method_xtrim","d":""},{"t":"M","n":"RedisCluster::zadd","p":"RedisCluster.html#method_zadd","d":""},{"t":"M","n":"RedisCluster::zcard","p":"RedisCluster.html#method_zcard","d":""},{"t":"M","n":"RedisCluster::zcount","p":"RedisCluster.html#method_zcount","d":""},{"t":"M","n":"RedisCluster::zincrby","p":"RedisCluster.html#method_zincrby","d":""},{"t":"M","n":"RedisCluster::zinterstore","p":"RedisCluster.html#method_zinterstore","d":""},{"t":"M","n":"RedisCluster::zintercard","p":"RedisCluster.html#method_zintercard","d":""},{"t":"M","n":"RedisCluster::zlexcount","p":"RedisCluster.html#method_zlexcount","d":""},{"t":"M","n":"RedisCluster::zpopmax","p":"RedisCluster.html#method_zpopmax","d":""},{"t":"M","n":"RedisCluster::zpopmin","p":"RedisCluster.html#method_zpopmin","d":""},{"t":"M","n":"RedisCluster::zrange","p":"RedisCluster.html#method_zrange","d":""},{"t":"M","n":"RedisCluster::zrangestore","p":"RedisCluster.html#method_zrangestore","d":""},{"t":"M","n":"RedisCluster::zrandmember","p":"RedisCluster.html#method_zrandmember","d":""},{"t":"M","n":"RedisCluster::zrangebylex","p":"RedisCluster.html#method_zrangebylex","d":""},{"t":"M","n":"RedisCluster::zrangebyscore","p":"RedisCluster.html#method_zrangebyscore","d":""},{"t":"M","n":"RedisCluster::zrank","p":"RedisCluster.html#method_zrank","d":""},{"t":"M","n":"RedisCluster::zrem","p":"RedisCluster.html#method_zrem","d":""},{"t":"M","n":"RedisCluster::zremrangebylex","p":"RedisCluster.html#method_zremrangebylex","d":""},{"t":"M","n":"RedisCluster::zremrangebyrank","p":"RedisCluster.html#method_zremrangebyrank","d":""},{"t":"M","n":"RedisCluster::zremrangebyscore","p":"RedisCluster.html#method_zremrangebyscore","d":""},{"t":"M","n":"RedisCluster::zrevrange","p":"RedisCluster.html#method_zrevrange","d":""},{"t":"M","n":"RedisCluster::zrevrangebylex","p":"RedisCluster.html#method_zrevrangebylex","d":""},{"t":"M","n":"RedisCluster::zrevrangebyscore","p":"RedisCluster.html#method_zrevrangebyscore","d":""},{"t":"M","n":"RedisCluster::zrevrank","p":"RedisCluster.html#method_zrevrank","d":""},{"t":"M","n":"RedisCluster::zscan","p":"RedisCluster.html#method_zscan","d":""},{"t":"M","n":"RedisCluster::zscore","p":"RedisCluster.html#method_zscore","d":""},{"t":"M","n":"RedisCluster::zmscore","p":"RedisCluster.html#method_zmscore","d":""},{"t":"M","n":"RedisCluster::zunionstore","p":"RedisCluster.html#method_zunionstore","d":""},{"t":"M","n":"RedisCluster::zinter","p":"RedisCluster.html#method_zinter","d":""},{"t":"M","n":"RedisCluster::zdiffstore","p":"RedisCluster.html#method_zdiffstore","d":""},{"t":"M","n":"RedisCluster::zunion","p":"RedisCluster.html#method_zunion","d":""},{"t":"M","n":"RedisCluster::zdiff","p":"RedisCluster.html#method_zdiff","d":""},{"t":"M","n":"RedisCluster::digest","p":"RedisCluster.html#method_digest","d":""},{"t":"M","n":"RedisSentinel::__construct","p":"RedisSentinel.html#method___construct","d":null},{"t":"M","n":"RedisSentinel::ckquorum","p":"RedisSentinel.html#method_ckquorum","d":""},{"t":"M","n":"RedisSentinel::failover","p":"RedisSentinel.html#method_failover","d":""},{"t":"M","n":"RedisSentinel::flushconfig","p":"RedisSentinel.html#method_flushconfig","d":""},{"t":"M","n":"RedisSentinel::getMasterAddrByName","p":"RedisSentinel.html#method_getMasterAddrByName","d":""},{"t":"M","n":"RedisSentinel::master","p":"RedisSentinel.html#method_master","d":""},{"t":"M","n":"RedisSentinel::masters","p":"RedisSentinel.html#method_masters","d":""},{"t":"M","n":"RedisSentinel::myid","p":"RedisSentinel.html#method_myid","d":null},{"t":"M","n":"RedisSentinel::ping","p":"RedisSentinel.html#method_ping","d":""},{"t":"M","n":"RedisSentinel::reset","p":"RedisSentinel.html#method_reset","d":""},{"t":"M","n":"RedisSentinel::sentinels","p":"RedisSentinel.html#method_sentinels","d":""},{"t":"M","n":"RedisSentinel::slaves","p":"RedisSentinel.html#method_slaves","d":""},{"t":"N","n":"","p":"[Global_Namespace].html"}]} diff --git a/docs/doctum.js b/docs/doctum.js index dc773facd1..59bc208247 100644 --- a/docs/doctum.js +++ b/docs/doctum.js @@ -168,7 +168,7 @@ var Doctum = { DoctumSearch.doctumSearchPageAutoCompleteProgressBar.className = 'progress-bar'; } }, - makeProgress: function () { + makeProgess: function () { Doctum.makeProgressOnProgressBar( Doctum.doctumSearchAutoCompleteProgressBarPercent, Doctum.doctumSearchAutoCompleteProgressBar @@ -209,7 +209,7 @@ var Doctum = { oReq.onprogress = function (pe) { if (pe.lengthComputable) { Doctum.doctumSearchAutoCompleteProgressBarPercent = parseInt(pe.loaded / pe.total * 100, 10); - Doctum.makeProgress(); + Doctum.makeProgess(); } }; oReq.onloadend = function (_) { @@ -261,10 +261,13 @@ var Doctum = { /** * Clean the search query * - * @param string query + * @param string|null query * @return string */ cleanSearchQuery: function (query) { + if (typeof query !== 'string') { + return ''; + } // replace any chars that could lead to injecting code in our regex // remove start or end spaces // replace backslashes by an escaped version, use case in search: \myRootFunction diff --git a/docs/index.html b/docs/index.html index e0ee6367d8..80508d60a0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,7 +5,7 @@ All Classes | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> diff --git a/docs/interfaces.html b/docs/interfaces.html index 5497f56840..a66c01db17 100644 --- a/docs/interfaces.html +++ b/docs/interfaces.html @@ -5,7 +5,7 @@ Interfaces | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> diff --git a/docs/js/highlight.min.js b/docs/js/highlight.min.js new file mode 100644 index 0000000000..5d699ae6a4 --- /dev/null +++ b/docs/js/highlight.min.js @@ -0,0 +1,1213 @@ +/*! + Highlight.js v11.9.0 (git: f47103d4f1) + (c) 2006-2023 undefined and other contributors + License: BSD-3-Clause + */ +var hljs=function(){"use strict";function e(n){ +return n instanceof Map?n.clear=n.delete=n.set=()=>{ +throw Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((t=>{ +const a=n[t],i=typeof a;"object"!==i&&"function"!==i||Object.isFrozen(a)||e(a) +})),n}class n{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function t(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function a(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n] +;return n.forEach((e=>{for(const n in e)t[n]=e[n]})),t}const i=e=>!!e.scope +;class r{constructor(e,n){ +this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){ +this.buffer+=t(e)}openNode(e){if(!i(e))return;const n=((e,{prefix:n})=>{ +if(e.startsWith("language:"))return e.replace("language:","language-") +;if(e.includes(".")){const t=e.split(".") +;return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ") +}return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)} +closeNode(e){i(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ +this.buffer+=``}}const s=(e={})=>{const n={children:[]} +;return Object.assign(n,e),n};class o{constructor(){ +this.rootNode=s(),this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const n=s({scope:e}) +;this.add(n),this.stack.push(n)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){ +return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n), +n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +o._collapse(e)})))}}class l extends o{constructor(e){super(),this.options=e} +addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){ +this.closeNode()}__addSublanguage(e,n){const t=e.root +;n&&(t.scope="language:"+n),this.add(t)}toHTML(){ +return new r(this,this.options).value()}finalize(){ +return this.closeAllNodes(),!0}}function c(e){ +return e?"string"==typeof e?e:e.source:null}function d(e){return b("(?=",e,")")} +function g(e){return b("(?:",e,")*")}function u(e){return b("(?:",e,")?")} +function b(...e){return e.map((e=>c(e))).join("")}function m(...e){const n=(e=>{ +const n=e[e.length-1] +;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} +})(e);return"("+(n.capture?"":"?:")+e.map((e=>c(e))).join("|")+")"} +function p(e){return RegExp(e.toString()+"|").exec("").length-1} +const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ +;function h(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t +;let a=c(e),i="";for(;a.length>0;){const e=_.exec(a);if(!e){i+=a;break} +i+=a.substring(0,e.index), +a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0], +"("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)} +const f="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",w="\\b(0b[01]+)",v={ +begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'", +illegal:"\\n",contains:[v]},k={scope:"string",begin:'"',end:'"',illegal:"\\n", +contains:[v]},x=(e,n,t={})=>{const i=a({scope:"comment",begin:e,end:n, +contains:[]},t);i.contains.push({scope:"doctag", +begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", +end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) +;const r=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) +;return i.contains.push({begin:b(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i +},M=x("//","$"),S=x("/\\*","\\*/"),A=x("#","$");var C=Object.freeze({ +__proto__:null,APOS_STRING_MODE:O,BACKSLASH_ESCAPE:v,BINARY_NUMBER_MODE:{ +scope:"number",begin:w,relevance:0},BINARY_NUMBER_RE:w,COMMENT:x, +C_BLOCK_COMMENT_MODE:S,C_LINE_COMMENT_MODE:M,C_NUMBER_MODE:{scope:"number", +begin:N,relevance:0},C_NUMBER_RE:N,END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{ +n.data._beginMatch!==e[1]&&n.ignoreMatch()}}),HASH_COMMENT_MODE:A,IDENT_RE:f, +MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+E,relevance:0}, +NUMBER_MODE:{scope:"number",begin:y,relevance:0},NUMBER_RE:y, +PHRASAL_WORDS_MODE:{ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},QUOTE_STRING_MODE:k,REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/, +end:/\/[gimuy]*/,contains:[v,{begin:/\[/,end:/\]/,relevance:0,contains:[v]}]}, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const n=/^#![ ]*\// +;return e.binary&&(e.begin=b(n,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:n, +end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)}, +TITLE_MODE:{scope:"title",begin:f,relevance:0},UNDERSCORE_IDENT_RE:E, +UNDERSCORE_TITLE_MODE:{scope:"title",begin:E,relevance:0}});function T(e,n){ +"."===e.input[e.index-1]&&n.ignoreMatch()}function R(e,n){ +void 0!==e.className&&(e.scope=e.className,delete e.className)}function D(e,n){ +n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=T,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function I(e,n){ +Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function L(e,n){ +if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function B(e,n){ +void 0===e.relevance&&(e.relevance=1)}const $=(e,n)=>{if(!e.beforeMatch)return +;if(e.starts)throw Error("beforeMatch cannot be used with starts") +;const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n] +})),e.keywords=t.keywords,e.begin=b(t.beforeMatch,d(t.begin)),e.starts={ +relevance:0,contains:[Object.assign(t,{endsParent:!0})] +},e.relevance=0,delete t.beforeMatch +},z=["of","and","for","in","not","or","if","then","parent","list","value"],F="keyword" +;function U(e,n,t=F){const a=Object.create(null) +;return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((t=>{ +Object.assign(a,U(e[t],n,t))})),a;function i(e,t){ +n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((n=>{const t=n.split("|") +;a[t[0]]=[e,j(t[0],t[1])]}))}}function j(e,n){ +return n?Number(n):(e=>z.includes(e.toLowerCase()))(e)?0:1}const P={},K=e=>{ +console.error(e)},H=(e,...n)=>{console.log("WARN: "+e,...n)},q=(e,n)=>{ +P[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),P[`${e}/${n}`]=!0) +},G=Error();function Z(e,n,{key:t}){let a=0;const i=e[t],r={},s={} +;for(let e=1;e<=n.length;e++)s[e+a]=i[e],r[e+a]=!0,a+=p(n[e-1]) +;e[t]=s,e[t]._emit=r,e[t]._multi=!0}function W(e){(e=>{ +e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, +delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ +_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope +}),(e=>{if(Array.isArray(e.begin)){ +if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), +G +;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"), +G;Z(e,e.begin,{key:"beginScope"}),e.begin=h(e.begin,{joinWith:""})}})(e),(e=>{ +if(Array.isArray(e.end)){ +if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"), +G +;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"), +G;Z(e,e.end,{key:"endScope"}),e.end=h(e.end,{joinWith:""})}})(e)}function Q(e){ +function n(n,t){ +return RegExp(c(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":"")) +}class t{constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,n){ +n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]), +this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(h(e,{joinWith:"|" +}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex +;const n=this.matcherRe.exec(e);if(!n)return null +;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t] +;return n.splice(0,t),Object.assign(n,a)}}class i{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t +;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))), +n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){ +this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){ +const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex +;let t=n.exec(e) +;if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{ +const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)} +return t&&(this.regexIndex+=t.position+1, +this.regexIndex===this.count&&this.considerAll()),t}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=a(e.classNameAliases||{}),function t(r,s){const o=r +;if(r.isCompiled)return o +;[R,L,W,$].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))), +r.__beforeBegin=null,[D,I,B].forEach((e=>e(r,s))),r.isCompiled=!0;let l=null +;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), +l=r.keywords.$pattern, +delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=U(r.keywords,e.case_insensitive)), +o.keywordPatternRe=n(l,!0), +s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=n(o.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), +r.end&&(o.endRe=n(o.end)), +o.terminatorEnd=c(o.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)), +r.illegal&&(o.illegalRe=n(r.illegal)), +r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((n=>a(e,{ +variants:null},n)))),e.cachedVariants?e.cachedVariants:X(e)?a(e,{ +starts:e.starts?a(e.starts):null +}):Object.isFrozen(e)?a(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{t(e,o) +})),r.starts&&t(r.starts,s),o.matcher=(e=>{const n=new i +;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function X(e){ +return!!e&&(e.endsWithParent||X(e.starts))}class V extends Error{ +constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}} +const J=t,Y=a,ee=Symbol("nomatch"),ne=t=>{ +const a=Object.create(null),i=Object.create(null),r=[];let s=!0 +;const o="Could not find the language '{}', did you forget to load/include a language module?",c={ +disableAutodetect:!0,name:"Plain text",contains:[]};let p={ +ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +cssSelector:"pre code",languages:null,__emitter:l};function _(e){ +return p.noHighlightRe.test(e)}function h(e,n,t){let a="",i="" +;"object"==typeof n?(a=e, +t=n.ignoreIllegals,i=n.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."), +q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};x("before:highlight",r) +;const s=r.result?r.result:f(r.language,r.code,t) +;return s.code=r.code,x("after:highlight",s),s}function f(e,t,i,r){ +const l=Object.create(null);function c(){if(!x.keywords)return void S.addText(A) +;let e=0;x.keywordPatternRe.lastIndex=0;let n=x.keywordPatternRe.exec(A),t="" +;for(;n;){t+=A.substring(e,n.index) +;const i=w.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,x.keywords[a]);if(r){ +const[e,a]=r +;if(S.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(C+=a),e.startsWith("_"))t+=n[0];else{ +const t=w.classNameAliases[e]||e;g(n[0],t)}}else t+=n[0] +;e=x.keywordPatternRe.lastIndex,n=x.keywordPatternRe.exec(A)}var a +;t+=A.substring(e),S.addText(t)}function d(){null!=x.subLanguage?(()=>{ +if(""===A)return;let e=null;if("string"==typeof x.subLanguage){ +if(!a[x.subLanguage])return void S.addText(A) +;e=f(x.subLanguage,A,!0,M[x.subLanguage]),M[x.subLanguage]=e._top +}else e=E(A,x.subLanguage.length?x.subLanguage:null) +;x.relevance>0&&(C+=e.relevance),S.__addSublanguage(e._emitter,e.language) +})():c(),A=""}function g(e,n){ +""!==e&&(S.startScope(n),S.addText(e),S.endScope())}function u(e,n){let t=1 +;const a=n.length-1;for(;t<=a;){if(!e._emit[t]){t++;continue} +const a=w.classNameAliases[e[t]]||e[t],i=n[t];a?g(i,a):(A=i,c(),A=""),t++}} +function b(e,n){ +return e.scope&&"string"==typeof e.scope&&S.openNode(w.classNameAliases[e.scope]||e.scope), +e.beginScope&&(e.beginScope._wrap?(g(A,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), +A=""):e.beginScope._multi&&(u(e.beginScope,n),A="")),x=Object.create(e,{parent:{ +value:x}}),x}function m(e,t,a){let i=((e,n)=>{const t=e&&e.exec(n) +;return t&&0===t.index})(e.endRe,a);if(i){if(e["on:end"]){const a=new n(e) +;e["on:end"](t,a),a.isMatchIgnored&&(i=!1)}if(i){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return m(e.parent,t,a)}function _(e){ +return 0===x.matcher.regexIndex?(A+=e[0],1):(D=!0,0)}function h(e){ +const n=e[0],a=t.substring(e.index),i=m(x,e,a);if(!i)return ee;const r=x +;x.endScope&&x.endScope._wrap?(d(), +g(n,x.endScope._wrap)):x.endScope&&x.endScope._multi?(d(), +u(x.endScope,e)):r.skip?A+=n:(r.returnEnd||r.excludeEnd||(A+=n), +d(),r.excludeEnd&&(A=n));do{ +x.scope&&S.closeNode(),x.skip||x.subLanguage||(C+=x.relevance),x=x.parent +}while(x!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:n.length} +let y={};function N(a,r){const o=r&&r[0];if(A+=a,null==o)return d(),0 +;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===o){ +if(A+=t.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`) +;throw n.languageName=e,n.badRule=y.rule,n}return 1} +if(y=r,"begin"===r.type)return(e=>{ +const t=e[0],a=e.rule,i=new n(a),r=[a.__beforeBegin,a["on:begin"]] +;for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return _(t) +;return a.skip?A+=t:(a.excludeBegin&&(A+=t), +d(),a.returnBegin||a.excludeBegin||(A=t)),b(a,e),a.returnBegin?0:t.length})(r) +;if("illegal"===r.type&&!i){ +const e=Error('Illegal lexeme "'+o+'" for mode "'+(x.scope||"")+'"') +;throw e.mode=x,e}if("end"===r.type){const e=h(r);if(e!==ee)return e} +if("illegal"===r.type&&""===o)return 1 +;if(R>1e5&&R>3*r.index)throw Error("potential infinite loop, way more iterations than matches") +;return A+=o,o.length}const w=v(e) +;if(!w)throw K(o.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const O=Q(w);let k="",x=r||O;const M={},S=new p.__emitter(p);(()=>{const e=[] +;for(let n=x;n!==w;n=n.parent)n.scope&&e.unshift(n.scope) +;e.forEach((e=>S.openNode(e)))})();let A="",C=0,T=0,R=0,D=!1;try{ +if(w.__emitTokens)w.__emitTokens(t,S);else{for(x.matcher.considerAll();;){ +R++,D?D=!1:x.matcher.considerAll(),x.matcher.lastIndex=T +;const e=x.matcher.exec(t);if(!e)break;const n=N(t.substring(T,e.index),e) +;T=e.index+n}N(t.substring(T))}return S.finalize(),k=S.toHTML(),{language:e, +value:k,relevance:C,illegal:!1,_emitter:S,_top:x}}catch(n){ +if(n.message&&n.message.includes("Illegal"))return{language:e,value:J(t), +illegal:!0,relevance:0,_illegalBy:{message:n.message,index:T, +context:t.slice(T-100,T+100),mode:n.mode,resultSoFar:k},_emitter:S};if(s)return{ +language:e,value:J(t),illegal:!1,relevance:0,errorRaised:n,_emitter:S,_top:x} +;throw n}}function E(e,n){n=n||p.languages||Object.keys(a);const t=(e=>{ +const n={value:J(e),illegal:!1,relevance:0,_top:c,_emitter:new p.__emitter(p)} +;return n._emitter.addText(e),n})(e),i=n.filter(v).filter(k).map((n=>f(n,e,!1))) +;i.unshift(t);const r=i.sort(((e,n)=>{ +if(e.relevance!==n.relevance)return n.relevance-e.relevance +;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1 +;if(v(n.language).supersetOf===e.language)return-1}return 0})),[s,o]=r,l=s +;return l.secondBest=o,l}function y(e){let n=null;const t=(e=>{ +let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"" +;const t=p.languageDetectRe.exec(n);if(t){const n=v(t[1]) +;return n||(H(o.replace("{}",t[1])), +H("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"} +return n.split(/\s+/).find((e=>_(e)||v(e)))})(e);if(_(t))return +;if(x("before:highlightElement",{el:e,language:t +}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) +;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), +console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), +console.warn("The element with unescaped HTML:"), +console.warn(e)),p.throwUnescapedHTML))throw new V("One of your code blocks includes unescaped HTML.",e.innerHTML) +;n=e;const a=n.textContent,r=t?h(a,{language:t,ignoreIllegals:!0}):E(a) +;e.innerHTML=r.value,e.dataset.highlighted="yes",((e,n,t)=>{const a=n&&i[n]||t +;e.classList.add("hljs"),e.classList.add("language-"+a) +})(e,t,r.language),e.result={language:r.language,re:r.relevance, +relevance:r.relevance},r.secondBest&&(e.secondBest={ +language:r.secondBest.language,relevance:r.secondBest.relevance +}),x("after:highlightElement",{el:e,result:r,text:a})}let N=!1;function w(){ +"loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(y):N=!0 +}function v(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]} +function O(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +i[e.toLowerCase()]=n}))}function k(e){const n=v(e) +;return n&&!n.disableAutodetect}function x(e,n){const t=e;r.forEach((e=>{ +e[t]&&e[t](n)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +N&&w()}),!1),Object.assign(t,{highlight:h,highlightAuto:E,highlightAll:w, +highlightElement:y, +highlightBlock:e=>(q("10.7.0","highlightBlock will be removed entirely in v12.0"), +q("10.7.0","Please use highlightElement now."),y(e)),configure:e=>{p=Y(p,e)}, +initHighlighting:()=>{ +w(),q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, +initHighlightingOnLoad:()=>{ +w(),q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") +},registerLanguage:(e,n)=>{let i=null;try{i=n(t)}catch(n){ +if(K("Language definition for '{}' could not be registered.".replace("{}",e)), +!s)throw n;K(n),i=c} +i.name||(i.name=e),a[e]=i,i.rawDefinition=n.bind(null,t),i.aliases&&O(i.aliases,{ +languageName:e})},unregisterLanguage:e=>{delete a[e] +;for(const n of Object.keys(i))i[n]===e&&delete i[n]}, +listLanguages:()=>Object.keys(a),getLanguage:v,registerAliases:O, +autoDetection:k,inherit:Y,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{ +e["before:highlightBlock"](Object.assign({block:n.el},n)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{ +e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),r.push(e)}, +removePlugin:e=>{const n=r.indexOf(e);-1!==n&&r.splice(n,1)}}),t.debugMode=()=>{ +s=!1},t.safeMode=()=>{s=!0},t.versionString="11.9.0",t.regex={concat:b, +lookahead:d,either:m,optional:u,anyNumberOfTimes:g} +;for(const n in C)"object"==typeof C[n]&&e(C[n]);return Object.assign(t,C),t +},te=ne({});te.newInstance=()=>ne({});var ae=te;const ie=e=>({IMPORTANT:{ +scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{ +scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/}, +FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/}, +ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", +contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ +scope:"number", +begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", +relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/} +}),re=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],se=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],oe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],le=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ce=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),de=oe.concat(le) +;var ge="[0-9](_*[0-9])*",ue=`\\.(${ge})`,be="[0-9a-fA-F](_*[0-9a-fA-F])*",me={ +className:"number",variants:[{ +begin:`(\\b(${ge})((${ue})|\\.)?|(${ue}))[eE][+-]?(${ge})[fFdD]?\\b`},{ +begin:`\\b(${ge})((${ue})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ +begin:`(${ue})[fFdD]?\\b`},{begin:`\\b(${ge})[fFdD]\\b`},{ +begin:`\\b0[xX]((${be})\\.?|(${be})?\\.(${be}))[pP][+-]?(${ge})[fFdD]?\\b`},{ +begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${be})[lL]?\\b`},{ +begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], +relevance:0};function pe(e,n,t){return-1===t?"":e.replace(n,(a=>pe(e,n,t-1)))} +const _e="[A-Za-z$_][0-9A-Za-z$_]*",he=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],fe=["true","false","null","undefined","NaN","Infinity"],Ee=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ye=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ne=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],we=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ve=[].concat(Ne,Ee,ye) +;function Oe(e){const n=e.regex,t=_e,a={begin:/<[A-Za-z0-9\\._:-]+/, +end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ +const t=e[0].length+e.index,a=e.input[t] +;if("<"===a||","===a)return void n.ignoreMatch();let i +;">"===a&&(((e,{after:n})=>{const t="",M={ +match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(x)], +keywords:"async",className:{1:"keyword",3:"title.function"},contains:[f]} +;return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{ +PARAMS_CONTAINS:h,CLASS_REFERENCE:y},illegal:/#(?![$_A-z])/, +contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ +label:"use_strict",className:"meta",relevance:10, +begin:/^\s*['"]use (strict|asm)['"]/ +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,g,u,b,m,{match:/\$\d+/},l,y,{ +className:"attr",begin:t+n.lookahead(":"),relevance:0},M,{ +begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", +keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{ +className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{ +className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{ +className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, +excludeEnd:!0,keywords:i,contains:h}]}]},{begin:/,/,relevance:0},{match:/\s+/, +relevance:0},{variants:[{begin:"<>",end:""},{ +match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin, +"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{ +begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},N,{ +beginKeywords:"while if switch catch for"},{ +begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,label:"func.def",contains:[f,e.inherit(e.TITLE_MODE,{begin:t, +className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$"+t, +relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, +contains:[f]},w,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},E,k,{match:/\$[(.]/}]}} +const ke=e=>b(/\b/,e,/\w$/.test(e)?/\b/:/\B/),xe=["Protocol","Type"].map(ke),Me=["init","self"].map(ke),Se=["Any","Self"],Ae=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Ce=["false","nil","true"],Te=["assignment","associativity","higherThan","left","lowerThan","none","right"],Re=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],De=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ie=m(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Le=m(Ie,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Be=b(Ie,Le,"*"),$e=m(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),ze=m($e,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Fe=b($e,ze,"*"),Ue=b(/[A-Z]/,ze,"*"),je=["attached","autoclosure",b(/convention\(/,m("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",b(/objc\(/,Fe,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Pe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"] +;var Ke=Object.freeze({__proto__:null,grmr_bash:e=>{const n=e.regex,t={},a={ +begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]} +;Object.assign(t,{className:"variable",variants:[{ +begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const i={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(s);const o={begin:/\$?\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] +},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, +contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ +name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/, +keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"], +literal:["true","false"], +built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"] +},contains:[l,e.SHEBANG(),c,o,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},s,{ +match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},t]}}, +grmr_c:e=>{const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}] +}),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",r="("+a+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={ +className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{ +match:/\batomic_[a-z]{3,6}\b/}]},o={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={ +className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0 +},g=n.optional(i)+e.IDENT_RE+"\\s*\\(",u={ +keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], +type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"], +literal:"true false NULL", +built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" +},b=[c,s,t,e.C_BLOCK_COMMENT_MODE,l,o],m={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:u,contains:b.concat([{begin:/\(/,end:/\)/,keywords:u, +contains:b.concat(["self"]),relevance:0}]),relevance:0},p={ +begin:"("+r+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:u,relevance:0},{ +begin:g,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})], +relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/, +keywords:u,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,o,l,s,{begin:/\(/, +end:/\)/,keywords:u,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,l,s] +}]},s,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u, +disableAutodetect:!0,illegal:"=]/,contains:[{ +beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c, +strings:o,keywords:u}}},grmr_cpp:e=>{const n=e.regex,t=e.COMMENT("//","$",{ +contains:[{begin:/\\\n/}] +}),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",r="(?!struct)("+a+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={ +className:"type",begin:"\\b[a-z\\d_]*_t\\b"},o={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={ +className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0 +},g=n.optional(i)+e.IDENT_RE+"\\s*\\(",u={ +type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"], +keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"], +literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"], +_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"] +},b={className:"function.dispatch",relevance:0,keywords:{ +_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"] +}, +begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/)) +},m=[b,c,s,t,e.C_BLOCK_COMMENT_MODE,l,o],p={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:u,contains:m.concat([{begin:/\(/,end:/\)/,keywords:u, +contains:m.concat(["self"]),relevance:0}]),relevance:0},_={className:"function", +begin:"("+r+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:u,relevance:0},{ +begin:g,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{ +begin:/:/,endsWithParent:!0,contains:[o,l]},{relevance:0,match:/,/},{ +className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0, +contains:[t,e.C_BLOCK_COMMENT_MODE,o,l,s,{begin:/\(/,end:/\)/,keywords:u, +relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,l,s]}] +},s,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++", +aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"",keywords:u,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:u},{ +match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/], +className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const n={ +keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), +built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], +literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{ +begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{ +begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] +},r=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/, +keywords:n},o=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/, +end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ +},e.BACKSLASH_ESCAPE,o]},c={className:"string",begin:/\$@"/,end:'"',contains:[{ +begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/, +contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]}) +;s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE], +o.contains=[d,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{ +illegal:/\n/})];const g={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},t] +},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={ +begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], +keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, +contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ +begin:"\x3c!--|--\x3e"},{begin:""}]}] +}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", +end:"$",keywords:{ +keyword:"if else elif endif define undef warning error line region endregion pragma checksum" +}},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, +illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" +},t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", +relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", +begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ +className:"string",begin:/"/,end:/"/}]},{ +beginKeywords:"new return throw await else",relevance:0},{className:"function", +begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ +beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", +relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params", +begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, +contains:[g,a,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},grmr_css:e=>{ +const n=e.regex,t=ie(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{ +name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{ +keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"}, +contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ +},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 +},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 +},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ +begin:":("+oe.join("|")+")"},{begin:":(:)?("+le.join("|")+")"}] +},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ce.join("|")+")\\b"},{ +begin:/:/,end:/[;}{]/, +contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{ +begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" +},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0, +excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]", +relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/ +},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{ +$pattern:/[a-z-]+/,keyword:"and or not only",attribute:se.join(" ")},contains:[{ +begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{ +className:"selector-tag",begin:"\\b("+re.join("|")+")\\b"}]}},grmr_diff:e=>{ +const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{ +className:"meta",relevance:10, +match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/) +},{className:"comment",variants:[{ +begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/), +end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{ +className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/, +end:/$/}]}},grmr_go:e=>{const n={ +keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"], +type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"], +literal:["true","false","iota","nil"], +built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"] +};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{const n=e.regex;return{name:"GraphQL",aliases:["gql"], +case_insensitive:!0,disableAutodetect:!1,keywords:{ +keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"], +literal:["true","false","null"]}, +contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{ +scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation", +begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/, +end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{ +scope:"symbol",begin:n.concat(/[_A-Za-z][_0-9A-Za-z]*/,n.lookahead(/\s*:/)), +relevance:0}],illegal:[/[;<']/,/BEGIN/]}},grmr_ini:e=>{const n=e.regex,t={ +className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{ +begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/, +end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{ +begin:/\$\{(.*?)\}/}]},r={className:"literal", +begin:/\bon|off|true|false|yes|no\b/},s={className:"string", +contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{ +begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}] +},o={begin:/\[/,end:/\]/,contains:[a,r,i,s,t,"self"],relevance:0 +},l=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{ +name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/, +contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{ +begin:n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/)), +className:"attr",starts:{end:/$/,contains:[a,o,r,i,s,t]}}]}},grmr_java:e=>{ +const n=e.regex,t="[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*",a=t+pe("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),i={ +keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"], +literal:["false","true","null"], +type:["char","boolean","long","float","int","byte","short","double"], +built_in:["super","this"]},r={className:"meta",begin:"@"+t,contains:[{ +begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0} +;return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/, +relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{ +begin:/import java\.[a-z]+\./,keywords:"import",relevance:2 +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/, +className:"string",contains:[e.BACKSLASH_ESCAPE] +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{ +match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{ +1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{ +begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type", +3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword", +3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"new throw return else",relevance:0},{ +begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{ +2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0, +contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,me,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},me,r]}},grmr_javascript:Oe, +grmr_json:e=>{const n=["true","false","null"],t={scope:"literal", +beginKeywords:n.join(" ")};return{name:"JSON",keywords:{literal:n},contains:[{ +className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{ +match:/[{}[\],:]/,className:"punctuation",relevance:0 +},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE], +illegal:"\\S"}},grmr_kotlin:e=>{const n={ +keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual", +built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing", +literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@" +},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={ +className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string", +variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'", +illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/, +contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(r);const s={ +className:"meta", +begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?" +},o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/, +end:/\)/,contains:[e.inherit(r,{className:"string"}),"self"]}] +},l=me,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={ +variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/, +contains:[]}]},g=d;return g.variants[1].contains=[d],d.variants[1].contains=[g], +{name:"Kotlin",aliases:["kt","kts"],keywords:n, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag", +begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword", +begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol", +begin:/@\w+/}]}},t,s,o,{className:"function",beginKeywords:"fun",end:"[(]|$", +returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{ +begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, +contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://, +keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/, +endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/, +endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0 +},e.C_LINE_COMMENT_MODE,c,s,o,r,e.C_NUMBER_MODE]},c]},{ +begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{ +3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0, +illegal:"extends implements",contains:[{ +beginKeywords:"public protected internal private constructor" +},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0, +excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/, +excludeBegin:!0,returnEnd:!0},s,o]},r,{className:"meta",begin:"^#!/usr/bin/env", +end:"$",illegal:"\n"},l]}},grmr_less:e=>{ +const n=ie(e),t=de,a="[\\w-]+",i="("+a+"|@\\{"+a+"\\})",r=[],s=[],o=e=>({ +className:"string",begin:"~?"+e+".*?"+e}),l=(e,n,t)=>({className:e,begin:n, +relevance:t}),c={$pattern:/[a-z-]+/,keyword:"and or not only", +attribute:se.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:c, +relevance:0} +;s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o("'"),o('"'),n.CSS_NUMBER_MODE,{ +begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", +excludeEnd:!0} +},n.HEXCOLOR,d,l("variable","@@?"+a,10),l("variable","@\\{"+a+"\\}"),l("built_in","~?`[^`]*?`"),{ +className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0 +},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const g=s.concat({ +begin:/\{/,end:/\}/,contains:r}),u={beginKeywords:"when",endsWithParent:!0, +contains:[{beginKeywords:"and not"}].concat(s)},b={begin:i+"\\s*:", +returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/ +},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ce.join("|")+")\\b", +end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}] +},m={className:"keyword", +begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", +starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},p={ +className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a +}],starts:{end:"[;}]",returnEnd:!0,contains:g}},_={variants:[{ +begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0, +returnEnd:!0,illegal:"[<='$\"]",relevance:0, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+a+"\\}"),{ +begin:"\\b("+re.join("|")+")\\b",className:"selector-tag" +},n.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{ +className:"selector-pseudo",begin:":("+oe.join("|")+")"},{ +className:"selector-pseudo",begin:":(:)?("+le.join("|")+")"},{begin:/\(/, +end:/\)/,relevance:0,contains:g},{begin:"!important"},n.FUNCTION_DISPATCH]},h={ +begin:a+":(:)?"+`(${t.join("|")})`,returnBegin:!0,contains:[_]} +;return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,p,h,b,_,u,n.FUNCTION_DISPATCH), +{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}}, +grmr_lua:e=>{const n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"] +},i=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,t,{contains:[a],relevance:10 +})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE, +literal:"true false nil", +keyword:"and break do else elseif end for goto if in local not or repeat return then until while", +built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove" +},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)", +contains:[e.inherit(e.TITLE_MODE,{ +begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params", +begin:"\\(",endsWithParent:!0,contains:i}].concat(i) +},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string", +begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{const n={ +className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{ +const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},t={ +variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{ +begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, +relevance:2},{ +begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), +relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ +begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/ +},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, +returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", +excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", +end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[], +variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}] +},i={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{ +begin:/_(?![_\s])/,end:/_/,relevance:0}]},r=e.inherit(a,{contains:[] +}),s=e.inherit(i,{contains:[]});a.contains.push(s),i.contains.push(r) +;let o=[n,t];return[a,i,r,s].forEach((e=>{e.contains=e.contains.concat(o) +})),o=o.concat(a,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ +className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:o},{ +begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", +contains:o}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", +end:"\\s+",excludeEnd:!0},a,i,{className:"quote",begin:"^>\\s+",contains:o, +end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ +begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ +begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", +contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ +begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ +className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ +className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{ +const n=/[a-zA-Z@][a-zA-Z0-9_]*/,t={$pattern:n, +keyword:["@interface","@class","@protocol","@implementation"]};return{ +name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"], +keywords:{"variable.language":["this","super"],$pattern:n, +keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"], +literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"], +built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"], +type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"] +},illegal:"/,end:/$/,illegal:"\\n" +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class", +begin:"("+t.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:t, +contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE, +relevance:0}]}},grmr_perl:e=>{const n=e.regex,t=/[dualxmsipngr]{0,12}/,a={ +$pattern:/[\w.]+/, +keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0" +},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},r={begin:/->\{/, +end:/\}/},s={variants:[{begin:/\$\d/},{ +begin:n.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])") +},{begin:/[$%@][^\s\w{]/,relevance:0}] +},o=[e.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,a,i="\\1")=>{ +const r="\\1"===i?i:n.concat(i,a) +;return n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,r,/(?:\\.|[^\\\/])*?/,i,t) +},d=(e,a,i)=>n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,i,t),g=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{ +endsWithParent:!0}),r,{className:"string",contains:o,variants:[{ +begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[", +end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{ +begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">", +relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'", +contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{ +begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number", +begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", +relevance:0},{ +begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*", +keywords:"split return print reverse grep",relevance:0, +contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{ +begin:c("s|tr|y",n.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{ +begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{ +className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{ +begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",n.either(...l,{capture:!0 +}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{ +begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub", +end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{ +begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$", +subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}] +}];return i.contains=g,r.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:a, +contains:g}},grmr_php:e=>{ +const n=e.regex,t=/(?![A-Za-z0-9])(?![$])/,a=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),i=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),r={ +scope:"variable",match:"\\$+"+a},s={scope:"subst",variants:[{begin:/\$\w+/},{ +begin:/\{\$/,end:/\}/}]},o=e.inherit(e.APOS_STRING_MODE,{illegal:null +}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{ +illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),o,{ +begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/, +contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,n)=>{ +n.data._beginMatch=e[1]||e[2]},"on:end":(e,n)=>{ +n.data._beginMatch!==e[1]&&n.ignoreMatch()}},e.END_SAME_AS_BEGIN({ +begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},d={scope:"number",variants:[{ +begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{ +begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{ +begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?" +}],relevance:0 +},g=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={ +keyword:u,literal:(e=>{const n=[];return e.forEach((e=>{ +n.push(e),e.toLowerCase()===e?n.push(e.toUpperCase()):n.push(e.toLowerCase()) +})),n})(g),built_in:b},p=e=>e.map((e=>e.replace(/\|\d+$/,""))),_={variants:[{ +match:[/new/,n.concat(l,"+"),n.concat("(?!",p(b).join("\\b|"),"\\b)"),i],scope:{ +1:"keyword",4:"title.class"}}]},h=n.concat(a,"\\b(?!\\()"),f={variants:[{ +match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{2:"variable.constant" +}},{match:[/::/,/class/],scope:{2:"variable.language"}},{ +match:[i,n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{1:"title.class", +3:"variable.constant"}},{match:[i,n.concat("::",n.lookahead(/(?!class\b)/))], +scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class", +3:"variable.language"}}]},E={scope:"attr", +match:n.concat(a,n.lookahead(":"),n.lookahead(/(?!::)/))},y={relevance:0, +begin:/\(/,end:/\)/,keywords:m,contains:[E,r,f,e.C_BLOCK_COMMENT_MODE,c,d,_] +},N={relevance:0, +match:[/\b/,n.concat("(?!fn\\b|function\\b|",p(u).join("\\b|"),"|",p(b).join("\\b|"),"\\b)"),a,n.concat(l,"*"),n.lookahead(/(?=\()/)], +scope:{3:"title.function.invoke"},contains:[y]};y.contains.push(N) +;const w=[E,f,e.C_BLOCK_COMMENT_MODE,c,d,_];return{case_insensitive:!1, +keywords:m,contains:[{begin:n.concat(/#\[\s*/,i),beginScope:"meta",end:/]/, +endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{ +begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]}, +contains:["self",...w]},...w,{scope:"meta",match:i}] +},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{ +scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/, +keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE, +contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{ +begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{ +begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},r,N,f,{ +match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},_,{ +scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/, +excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use" +},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params", +begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m, +contains:["self",r,f,e.C_BLOCK_COMMENT_MODE,c,d]}]},{scope:"class",variants:[{ +beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", +illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ +beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ +beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, +contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{ +beginKeywords:"use",relevance:0,end:";",contains:[{ +match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,d]} +},grmr_php_template:e=>({name:"PHP template",subLanguage:"xml",contains:[{ +begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*", +end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0 +},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null, +skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null, +contains:null,skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text", +aliases:["text","txt"],disableAutodetect:!0}),grmr_python:e=>{ +const n=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={ +$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a, +built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], +literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], +type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] +},r={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/, +end:/\}/,keywords:i,illegal:/#/},o={begin:/\{\{/,relevance:0},l={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,o,s]},{begin:/([uU]|[rR])'/,end:/'/, +relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ +begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, +end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, +contains:[e.BACKSLASH_ESCAPE,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,o,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,g="\\b|"+a.join("|"),u={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${g})`},{begin:`(${d})[jJ]?`},{ +begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{ +begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})` +},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${c})[jJ](?=${g})` +}]},b={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:i, +contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ +className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, +end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i, +contains:["self",r,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,r],{ +name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i, +illegal:/(<\/|\?)|=>/,contains:[r,u,{begin:/\bself\b/},{beginKeywords:"if", +relevance:0},l,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{ +1:"keyword",3:"title.function"},contains:[m]},{variants:[{ +match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}], +scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ +className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,m,l]}]}}, +grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta.prompt", +starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{ +begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{ +const n=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/) +;return{name:"R",keywords:{$pattern:t, +keyword:"function if in break next repeat else for while", +literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", +built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" +},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/, +starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)), +endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{ +scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0 +}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}] +}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE], +variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', +relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{ +1:"operator",2:"number"},match:[i,a]},{scope:{1:"operator",2:"number"}, +match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[r,a]},{scope:{ +2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"}, +match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{ +match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`", +contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{ +const n=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=n.concat(a,/(::\w+)*/),r={ +"variable.constant":["__FILE__","__LINE__","__ENCODING__"], +"variable.language":["self","super"], +keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"], +built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"], +literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},o={ +begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s] +}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10 +}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/, +end:/\}/,keywords:r},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c], +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{ +begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{ +begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//, +end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{ +begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{ +begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ +begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ +begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ +begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)), +contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, +contains:[e.BACKSLASH_ESCAPE,c]})]}]},g="[0-9](_?[0-9])*",u={className:"number", +relevance:0,variants:[{ +begin:`\\b([1-9](_?[0-9])*|0)(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{ +begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" +},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ +begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ +begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{ +className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0, +keywords:r}]},m=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{ +match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class", +4:"title.class.inherited"},keywords:r},{match:[/(include|extend)\s+/,i],scope:{ +2:"title.class"},keywords:r},{relevance:0,match:[i,/\.new[. (]/],scope:{ +1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{ +match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[b]},{ +begin:e.IDENT_RE+"::"},{className:"symbol", +begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", +begin:":(?!\\s)",contains:[d,{begin:t}],relevance:0},u,{className:"variable", +begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ +className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0, +relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*", +keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c], +illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{ +begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[", +end:"\\][a-z]*"}]}].concat(o,l),relevance:0}].concat(o,l) +;c.contains=m,b.contains=m;const p=[{begin:/^\s*=>/,starts:{end:"$",contains:m} +},{className:"meta.prompt", +begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", +starts:{end:"$",keywords:r,contains:m}}];return l.unshift(o),{name:"Ruby", +aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/, +contains:[e.SHEBANG({binary:"ruby"})].concat(p).concat(l).concat(m)}}, +grmr_rust:e=>{const n=e.regex,t={className:"title.function.invoke",relevance:0, +begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,n.lookahead(/\s*\(/)) +},a="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],r=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"] +;return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:r, +keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"], +literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:""},t]}}, +grmr_scss:e=>{const n=ie(e),t=le,a=oe,i="@[a-z-]+",r={className:"variable", +begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS", +case_insensitive:!0,illegal:"[=/|']", +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n.CSS_NUMBER_MODE,{ +className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{ +className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0 +},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag", +begin:"\\b("+re.join("|")+")\\b",relevance:0},{className:"selector-pseudo", +begin:":("+a.join("|")+")"},{className:"selector-pseudo", +begin:":(:)?("+t.join("|")+")"},r,{begin:/\(/,end:/\)/, +contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute", +begin:"\\b("+ce.join("|")+")\\b"},{ +begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" +},{begin:/:/,end:/[;}{]/,relevance:0, +contains:[n.BLOCK_COMMENT,r,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH] +},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{ +begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/, +keyword:"and or not only",attribute:se.join(" ")},contains:[{begin:i, +className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute" +},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE] +},n.FUNCTION_DISPATCH]}},grmr_shell:e=>({name:"Shell Session", +aliases:["console","shellsession"],contains:[{className:"meta.prompt", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]}),grmr_sql:e=>{ +const n=e.regex,t=e.COMMENT("--","$"),a=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=r,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!r.includes(e))),c={ +begin:n.concat(/\b/,n.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}} +;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ +$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:n,when:t}={})=>{const a=t +;return n=n||[],e.map((e=>e.match(/\|\d+$/)||n.includes(e)?e:a(e)?e+"|0":e)) +})(l,{when:e=>e.length<3}),literal:a,type:i, +built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] +},contains:[{begin:n.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, +keyword:l.concat(s),literal:a,type:i}},{className:"type", +begin:n.either("double precision","large object","with timezone","without timezone") +},c,{className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},{className:"string", +variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/, +contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{ +className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/, +relevance:0}]}},grmr_swift:e=>{const n={match:/\s+/,relevance:0 +},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,t],i={ +match:[/\./,m(...xe,...Me)],className:{2:"keyword"}},r={match:b(/\./,m(...Ae)), +relevance:0},s=Ae.filter((e=>"string"==typeof e)).concat(["_|0"]),o={variants:[{ +className:"keyword", +match:m(...Ae.filter((e=>"string"!=typeof e)).concat(Se).map(ke),...Me)}]},l={ +$pattern:m(/\b\w+/,/#\w+/),keyword:s.concat(Re),literal:Ce},c=[i,r,o],g=[{ +match:b(/\./,m(...De)),relevance:0},{className:"built_in", +match:b(/\b/,m(...De),/(?=\()/)}],u={match:/->/,relevance:0},p=[u,{ +className:"operator",relevance:0,variants:[{match:Be},{match:`\\.(\\.|${Le})+`}] +}],_="([0-9]_*)+",h="([0-9a-fA-F]_*)+",f={className:"number",relevance:0, +variants:[{match:`\\b(${_})(\\.(${_}))?([eE][+-]?(${_}))?\\b`},{ +match:`\\b0x(${h})(\\.(${h}))?([pP][+-]?(${_}))?\\b`},{match:/\b0o([0-7]_*)+\b/ +},{match:/\b0b([01]_*)+\b/}]},E=(e="")=>({className:"subst",variants:[{ +match:b(/\\/,e,/[0\\tnr"']/)},{match:b(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}] +}),y=(e="")=>({className:"subst",match:b(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/) +}),N=(e="")=>({className:"subst",label:"interpol",begin:b(/\\/,e,/\(/),end:/\)/ +}),w=(e="")=>({begin:b(e,/"""/),end:b(/"""/,e),contains:[E(e),y(e),N(e)] +}),v=(e="")=>({begin:b(e,/"/),end:b(/"/,e),contains:[E(e),N(e)]}),O={ +className:"string", +variants:[w(),w("#"),w("##"),w("###"),v(),v("#"),v("##"),v("###")] +},k=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0, +contains:[e.BACKSLASH_ESCAPE]}],x={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//, +contains:k},M=e=>{const n=b(e,/\//),t=b(/\//,e);return{begin:n,end:t, +contains:[...k,{scope:"comment",begin:`#(?!.*${t})`,end:/$/}]}},S={ +scope:"regexp",variants:[M("###"),M("##"),M("#"),x]},A={match:b(/`/,Fe,/`/) +},C=[A,{className:"variable",match:/\$\d+/},{className:"variable", +match:`\\$${ze}+`}],T=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{ +contains:[{begin:/\(/,end:/\)/,keywords:Pe,contains:[...p,f,O]}]}},{ +scope:"keyword",match:b(/@/,m(...je))},{scope:"meta",match:b(/@/,Fe)}],R={ +match:d(/\b[A-Z]/),relevance:0,contains:[{className:"type", +match:b(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ze,"+") +},{className:"type",match:Ue,relevance:0},{match:/[?!]+/,relevance:0},{ +match:/\.\.\./,relevance:0},{match:b(/\s+&\s+/,d(Ue)),relevance:0}]},D={ +begin://,keywords:l,contains:[...a,...c,...T,u,R]};R.contains.push(D) +;const I={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{ +match:b(Fe,/\s*:/),keywords:"_|0",relevance:0 +},...a,S,...c,...g,...p,f,O,...C,...T,R]},L={begin://, +keywords:"repeat each",contains:[...a,R]},B={begin:/\(/,end:/\)/,keywords:l, +contains:[{begin:m(d(b(Fe,/\s*:/)),d(b(Fe,/\s+/,Fe,/\s*:/))),end:/:/, +relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params", +match:Fe}]},...a,...c,...p,f,O,...T,R,I],endsParent:!0,illegal:/["']/},$={ +match:[/(func|macro)/,/\s+/,m(A.match,Fe,Be)],className:{1:"keyword", +3:"title.function"},contains:[L,B,n],illegal:[/\[/,/%/]},z={ +match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"}, +contains:[L,B,n],illegal:/\[|%/},F={match:[/operator/,/\s+/,Be],className:{ +1:"keyword",3:"title"}},U={begin:[/precedencegroup/,/\s+/,Ue],className:{ +1:"keyword",3:"title"},contains:[R],keywords:[...Te,...Ce],end:/}/} +;for(const e of O.variants){const n=e.contains.find((e=>"interpol"===e.label)) +;n.keywords=l;const t=[...c,...g,...p,f,O,...C];n.contains=[...t,{begin:/\(/, +end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:l, +contains:[...a,$,z,{beginKeywords:"struct protocol class extension enum actor", +end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{ +className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c] +},F,U,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0 +},S,...c,...g,...p,f,O,...C,...T,R,I]}},grmr_typescript:e=>{ +const n=Oe(e),t=_e,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={ +beginKeywords:"namespace",end:/\{/,excludeEnd:!0, +contains:[n.exports.CLASS_REFERENCE]},r={beginKeywords:"interface",end:/\{/, +excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a}, +contains:[n.exports.CLASS_REFERENCE]},s={$pattern:_e, +keyword:he.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]), +literal:fe,built_in:ve.concat(a),"variable.language":we},o={className:"meta", +begin:"@"+t},l=(e,n,t)=>{const a=e.contains.findIndex((e=>e.label===n)) +;if(-1===a)throw Error("can not find mode to replace");e.contains.splice(a,1,t)} +;return Object.assign(n.keywords,s), +n.exports.PARAMS_CONTAINS.push(o),n.contains=n.contains.concat([o,i,r]), +l(n,"shebang",e.SHEBANG()),l(n,"use_strict",{className:"meta",relevance:10, +begin:/^\s*['"]use strict['"]/ +}),n.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(n,{ +name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n},grmr_vbnet:e=>{ +const n=e.regex,t=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,s={ +className:"literal",variants:[{begin:n.concat(/# */,n.either(a,t),/ *#/)},{ +begin:n.concat(/# */,r,/ *#/)},{begin:n.concat(/# */,i,/ *#/)},{ +begin:n.concat(/# */,n.either(a,t),/ +/,n.either(i,r),/ *#/)}] +},o=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}] +}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]}) +;return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0, +classNameAliases:{label:"symbol"},keywords:{ +keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", +built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", +type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", +literal:"true false nothing"}, +illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ +className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, +end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0, +variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ +},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ +begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ +className:"label",begin:/^\w+:/},o,l,{className:"meta", +begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, +end:/$/,keywords:{ +keyword:"const disable else elseif enable end externalsource if region then"}, +contains:[l]}]}},grmr_wasm:e=>{e.regex;const n=e.COMMENT(/\(;/,/;\)/) +;return n.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/, +keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"] +},contains:[e.COMMENT(/;;/,/$/),n,{match:[/(?:offset|align)/,/\s*/,/=/], +className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{ +match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{ +begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword", +3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/, +className:"type"},{className:"keyword", +match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/ +},{className:"number",relevance:0, +match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/ +}]}},grmr_xml:e=>{ +const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={ +className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/, +contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] +},r=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{ +className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={ +endsWithParent:!0,illegal:/`]+/}]}]}]};return{ +name:"HTML, XML", +aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], +case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,o,s,r,{begin:/\[/,end:/\]/,contains:[{ +className:"meta",begin://,contains:[i,r,o,s]}]}] +},e.COMMENT(//,{relevance:10}),{begin://, +relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/, +relevance:10,contains:[o]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{ +end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{ +end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ +className:"tag",begin:/<>|<\/>/},{className:"tag", +begin:n.concat(//,/>/,/\s/)))), +end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{ +className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{ +className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]} +},grmr_yaml:e=>{ +const n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={ +className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ +},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", +variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(a,{ +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),r={ +end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},s={begin:/\{/, +end:/\}/,contains:[r],illegal:"\\n",relevance:0},o={begin:"\\[",end:"\\]", +contains:[r],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{ +begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ +begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", +relevance:10},{className:"string", +begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ +begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, +relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type", +begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t +},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", +begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", +relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ +className:"number", +begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" +},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,o,a],c=[...l] +;return c.pop(),c.push(i),r.contains=c,{name:"YAML",case_insensitive:!0, +aliases:["yml"],contains:l}}});const He=ae;for(const e of Object.keys(Ke)){ +const n=e.replace("grmr_","").replace("_","-");He.registerLanguage(n,Ke[e])} +return He}() +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); \ No newline at end of file diff --git a/docs/namespaces.html b/docs/namespaces.html index 8863bd8627..6c6ec9ed60 100644 --- a/docs/namespaces.html +++ b/docs/namespaces.html @@ -5,7 +5,7 @@ Namespaces | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> diff --git a/docs/opensearch.xml b/docs/opensearch.xml index 73c0fe9792..d51e04039a 100644 --- a/docs/opensearch.xml +++ b/docs/opensearch.xml @@ -1,7 +1,7 @@ - PhpRedis API (main) - Searches PhpRedis API (main) + PhpRedis API (develop) + Searches PhpRedis API (develop) PhpRedis API UTF-8 diff --git a/docs/renderer.index b/docs/renderer.index index 616851d61a..addbc8c22a 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:"39efb36886d0e29b476aa5ccb2e551c2a37fc7cb";s:10:"RedisArray";s:40:"fb17c785beccf1dbeedaa48afb4aa7d48fd8b655";s:12:"RedisCluster";s:40:"2f2132e45b1d60011f8ef9298cb35b7ba2b247d5";s:21:"RedisClusterException";s:40:"2f2132e45b1d60011f8ef9298cb35b7ba2b247d5";s:14:"RedisException";s:40:"39efb36886d0e29b476aa5ccb2e551c2a37fc7cb";s:13:"RedisSentinel";s:40:"4055ace9f1cf20bef89bdb5d3219470b4c8915e6";}i:1;a:1:{i:0;s:4:"main";}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:"3ee3118802fef67d6bd7176f2a72f0568d962c8b";s:10:"RedisArray";s:40:"1293a0ccef1e700da87d9ace76c3a05d91c0ffc7";s:12:"RedisCluster";s:40:"6c7a87611b3bc9039650a3cf2e3c4d4f916611b0";s:21:"RedisClusterException";s:40:"6c7a87611b3bc9039650a3cf2e3c4d4f916611b0";s:14:"RedisException";s:40:"3ee3118802fef67d6bd7176f2a72f0568d962c8b";s:13:"RedisSentinel";s:40:"ca40579af888c5bb0661cd0201d840297474479a";}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/docs/search.html b/docs/search.html index c6ab501268..6dcda341d0 100644 --- a/docs/search.html +++ b/docs/search.html @@ -5,7 +5,7 @@ Search | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> diff --git a/docs/traits.html b/docs/traits.html index 4c73c7a8fa..b376801cb7 100644 --- a/docs/traits.html +++ b/docs/traits.html @@ -5,7 +5,7 @@ Traits | PhpRedis API - + @@ -16,11 +16,400 @@ + + + + + title="PhpRedis API (develop)" /> diff --git a/doctum-config.php b/doctum-config.php index 4dd445ef4a..03315073d3 100644 --- a/doctum-config.php +++ b/doctum-config.php @@ -1,28 +1,30 @@ files() ->name('*.stub.php') ->in($root); -//$versions = GitVersionCollection::create($root) -// ->add('develop', 'develop'); - return new Doctum($iterator, [ 'title' => 'PhpRedis API', 'language' => 'en', 'source_dir' => $root, - 'build_dir' => "{$root}/docs", - 'cache_dir' => "{$root}/docs/.cache", + 'build_dir' => $root . '/docs', + 'cache_dir' => $root . '/docs/.cache', + 'theme' => 'phpredis', + 'template_dirs' => [ + $root . '/doctum-theme', + ], 'base_url' => 'https://phpredis.github.io/', -// 'versions' => $versions, - 'remote_repository' => new GitHubRemoteRepository('phpredis/phpredis', $root), + 'remote_repository' => new GitHubRemoteRepository( + 'phpredis/phpredis', + $root + ), ]); diff --git a/doctum-theme/class.twig b/doctum-theme/class.twig new file mode 100644 index 0000000000..a6c0104606 --- /dev/null +++ b/doctum-theme/class.twig @@ -0,0 +1,70 @@ +{% extends 'default/class.twig' %} +{% from "macros.twig" import method_link, method_source_link, deprecations, internals, todos %} + +{% block method %} + {% set signature_plain = block('method_signature')|striptags %} + {% set signature_plain = signature_plain|replace({' ': ' ', "\n": ' ', "\t": ' '})|trim %} + {% for i in 1..5 %} + {% set signature_plain = signature_plain|replace({' ': ' '}) %} + {% endfor %} + +

    +
    {% if method.class is not same as(class) %}{{ 'in %s'|trans|format(method_link(method, false, true))|raw }} {% endif %}{{ method_source_link(method) }}
    + {{ signature_plain }} +

    +
    + {%- if method.hasSince() -%} + {{ 'Since:'|trans }} {{ method.getSince() }} +
    + {%- endif -%} + {{ deprecations(method) }} + {{ internals(method) }} + +
    + {% if not method.shortdesc and not method.longdesc %} +

    {% trans 'No description' %}

    + {% else %} + {% if method.shortdesc -%} +

    {{ method.shortdesc|desc(class)|md_to_html }}

    + {%- endif %} + {% if method.longdesc -%} +

    {{ method.longdesc|desc(class)|md_to_html }}

    + {%- endif %} + {%- endif %} + {{- todos(method) -}} +
    +
    + {% if method.parameters %} +

    {% trans 'Parameters' %}

    + + {{ block('parameters') }} + {% endif %} + + {% if method.hintDesc or method.hint %} +

    {% trans 'Return Value' %}

    + +
    + {{ block('return') }} +
    + {% endif %} + + {% if method.exceptions %} +

    {% trans 'Exceptions' %}

    + + {{ block('exceptions') }} + {% endif %} + + {% if method.tags('see') %} +

    {% trans 'See also' %}

    + + {{ block('see') }} + {% endif %} + + {% if method.hasExamples() %} +

    {% trans 'Examples' %}

    + + {{ block('examples') }} + {% endif %} +
    +
    +{% endblock %} diff --git a/doctum-theme/css/highlight-github.min.css b/doctum-theme/css/highlight-github.min.css new file mode 100644 index 0000000000..7a9730c0dc --- /dev/null +++ b/doctum-theme/css/highlight-github.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub + Description: Light theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-light + Current colors taken from GitHub's CSS +*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#22863a}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0} diff --git a/doctum-theme/js/highlight.min.js b/doctum-theme/js/highlight.min.js new file mode 100644 index 0000000000..5d699ae6a4 --- /dev/null +++ b/doctum-theme/js/highlight.min.js @@ -0,0 +1,1213 @@ +/*! + Highlight.js v11.9.0 (git: f47103d4f1) + (c) 2006-2023 undefined and other contributors + License: BSD-3-Clause + */ +var hljs=function(){"use strict";function e(n){ +return n instanceof Map?n.clear=n.delete=n.set=()=>{ +throw Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((t=>{ +const a=n[t],i=typeof a;"object"!==i&&"function"!==i||Object.isFrozen(a)||e(a) +})),n}class n{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function t(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function a(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n] +;return n.forEach((e=>{for(const n in e)t[n]=e[n]})),t}const i=e=>!!e.scope +;class r{constructor(e,n){ +this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){ +this.buffer+=t(e)}openNode(e){if(!i(e))return;const n=((e,{prefix:n})=>{ +if(e.startsWith("language:"))return e.replace("language:","language-") +;if(e.includes(".")){const t=e.split(".") +;return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ") +}return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)} +closeNode(e){i(e)&&(this.buffer+="
    ")}value(){return this.buffer}span(e){ +this.buffer+=``}}const s=(e={})=>{const n={children:[]} +;return Object.assign(n,e),n};class o{constructor(){ +this.rootNode=s(),this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const n=s({scope:e}) +;this.add(n),this.stack.push(n)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){ +return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n), +n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +o._collapse(e)})))}}class l extends o{constructor(e){super(),this.options=e} +addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){ +this.closeNode()}__addSublanguage(e,n){const t=e.root +;n&&(t.scope="language:"+n),this.add(t)}toHTML(){ +return new r(this,this.options).value()}finalize(){ +return this.closeAllNodes(),!0}}function c(e){ +return e?"string"==typeof e?e:e.source:null}function d(e){return b("(?=",e,")")} +function g(e){return b("(?:",e,")*")}function u(e){return b("(?:",e,")?")} +function b(...e){return e.map((e=>c(e))).join("")}function m(...e){const n=(e=>{ +const n=e[e.length-1] +;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} +})(e);return"("+(n.capture?"":"?:")+e.map((e=>c(e))).join("|")+")"} +function p(e){return RegExp(e.toString()+"|").exec("").length-1} +const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ +;function h(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t +;let a=c(e),i="";for(;a.length>0;){const e=_.exec(a);if(!e){i+=a;break} +i+=a.substring(0,e.index), +a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0], +"("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)} +const f="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",w="\\b(0b[01]+)",v={ +begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'", +illegal:"\\n",contains:[v]},k={scope:"string",begin:'"',end:'"',illegal:"\\n", +contains:[v]},x=(e,n,t={})=>{const i=a({scope:"comment",begin:e,end:n, +contains:[]},t);i.contains.push({scope:"doctag", +begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", +end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) +;const r=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) +;return i.contains.push({begin:b(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i +},M=x("//","$"),S=x("/\\*","\\*/"),A=x("#","$");var C=Object.freeze({ +__proto__:null,APOS_STRING_MODE:O,BACKSLASH_ESCAPE:v,BINARY_NUMBER_MODE:{ +scope:"number",begin:w,relevance:0},BINARY_NUMBER_RE:w,COMMENT:x, +C_BLOCK_COMMENT_MODE:S,C_LINE_COMMENT_MODE:M,C_NUMBER_MODE:{scope:"number", +begin:N,relevance:0},C_NUMBER_RE:N,END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{ +n.data._beginMatch!==e[1]&&n.ignoreMatch()}}),HASH_COMMENT_MODE:A,IDENT_RE:f, +MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+E,relevance:0}, +NUMBER_MODE:{scope:"number",begin:y,relevance:0},NUMBER_RE:y, +PHRASAL_WORDS_MODE:{ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},QUOTE_STRING_MODE:k,REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/, +end:/\/[gimuy]*/,contains:[v,{begin:/\[/,end:/\]/,relevance:0,contains:[v]}]}, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const n=/^#![ ]*\// +;return e.binary&&(e.begin=b(n,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:n, +end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)}, +TITLE_MODE:{scope:"title",begin:f,relevance:0},UNDERSCORE_IDENT_RE:E, +UNDERSCORE_TITLE_MODE:{scope:"title",begin:E,relevance:0}});function T(e,n){ +"."===e.input[e.index-1]&&n.ignoreMatch()}function R(e,n){ +void 0!==e.className&&(e.scope=e.className,delete e.className)}function D(e,n){ +n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=T,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function I(e,n){ +Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function L(e,n){ +if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function B(e,n){ +void 0===e.relevance&&(e.relevance=1)}const $=(e,n)=>{if(!e.beforeMatch)return +;if(e.starts)throw Error("beforeMatch cannot be used with starts") +;const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n] +})),e.keywords=t.keywords,e.begin=b(t.beforeMatch,d(t.begin)),e.starts={ +relevance:0,contains:[Object.assign(t,{endsParent:!0})] +},e.relevance=0,delete t.beforeMatch +},z=["of","and","for","in","not","or","if","then","parent","list","value"],F="keyword" +;function U(e,n,t=F){const a=Object.create(null) +;return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((t=>{ +Object.assign(a,U(e[t],n,t))})),a;function i(e,t){ +n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((n=>{const t=n.split("|") +;a[t[0]]=[e,j(t[0],t[1])]}))}}function j(e,n){ +return n?Number(n):(e=>z.includes(e.toLowerCase()))(e)?0:1}const P={},K=e=>{ +console.error(e)},H=(e,...n)=>{console.log("WARN: "+e,...n)},q=(e,n)=>{ +P[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),P[`${e}/${n}`]=!0) +},G=Error();function Z(e,n,{key:t}){let a=0;const i=e[t],r={},s={} +;for(let e=1;e<=n.length;e++)s[e+a]=i[e],r[e+a]=!0,a+=p(n[e-1]) +;e[t]=s,e[t]._emit=r,e[t]._multi=!0}function W(e){(e=>{ +e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, +delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ +_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope +}),(e=>{if(Array.isArray(e.begin)){ +if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), +G +;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"), +G;Z(e,e.begin,{key:"beginScope"}),e.begin=h(e.begin,{joinWith:""})}})(e),(e=>{ +if(Array.isArray(e.end)){ +if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"), +G +;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"), +G;Z(e,e.end,{key:"endScope"}),e.end=h(e.end,{joinWith:""})}})(e)}function Q(e){ +function n(n,t){ +return RegExp(c(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":"")) +}class t{constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,n){ +n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]), +this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(h(e,{joinWith:"|" +}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex +;const n=this.matcherRe.exec(e);if(!n)return null +;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t] +;return n.splice(0,t),Object.assign(n,a)}}class i{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t +;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))), +n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){ +this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){ +const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex +;let t=n.exec(e) +;if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{ +const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)} +return t&&(this.regexIndex+=t.position+1, +this.regexIndex===this.count&&this.considerAll()),t}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=a(e.classNameAliases||{}),function t(r,s){const o=r +;if(r.isCompiled)return o +;[R,L,W,$].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))), +r.__beforeBegin=null,[D,I,B].forEach((e=>e(r,s))),r.isCompiled=!0;let l=null +;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), +l=r.keywords.$pattern, +delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=U(r.keywords,e.case_insensitive)), +o.keywordPatternRe=n(l,!0), +s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=n(o.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), +r.end&&(o.endRe=n(o.end)), +o.terminatorEnd=c(o.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)), +r.illegal&&(o.illegalRe=n(r.illegal)), +r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((n=>a(e,{ +variants:null},n)))),e.cachedVariants?e.cachedVariants:X(e)?a(e,{ +starts:e.starts?a(e.starts):null +}):Object.isFrozen(e)?a(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{t(e,o) +})),r.starts&&t(r.starts,s),o.matcher=(e=>{const n=new i +;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function X(e){ +return!!e&&(e.endsWithParent||X(e.starts))}class V extends Error{ +constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}} +const J=t,Y=a,ee=Symbol("nomatch"),ne=t=>{ +const a=Object.create(null),i=Object.create(null),r=[];let s=!0 +;const o="Could not find the language '{}', did you forget to load/include a language module?",c={ +disableAutodetect:!0,name:"Plain text",contains:[]};let p={ +ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +cssSelector:"pre code",languages:null,__emitter:l};function _(e){ +return p.noHighlightRe.test(e)}function h(e,n,t){let a="",i="" +;"object"==typeof n?(a=e, +t=n.ignoreIllegals,i=n.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."), +q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};x("before:highlight",r) +;const s=r.result?r.result:f(r.language,r.code,t) +;return s.code=r.code,x("after:highlight",s),s}function f(e,t,i,r){ +const l=Object.create(null);function c(){if(!x.keywords)return void S.addText(A) +;let e=0;x.keywordPatternRe.lastIndex=0;let n=x.keywordPatternRe.exec(A),t="" +;for(;n;){t+=A.substring(e,n.index) +;const i=w.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,x.keywords[a]);if(r){ +const[e,a]=r +;if(S.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(C+=a),e.startsWith("_"))t+=n[0];else{ +const t=w.classNameAliases[e]||e;g(n[0],t)}}else t+=n[0] +;e=x.keywordPatternRe.lastIndex,n=x.keywordPatternRe.exec(A)}var a +;t+=A.substring(e),S.addText(t)}function d(){null!=x.subLanguage?(()=>{ +if(""===A)return;let e=null;if("string"==typeof x.subLanguage){ +if(!a[x.subLanguage])return void S.addText(A) +;e=f(x.subLanguage,A,!0,M[x.subLanguage]),M[x.subLanguage]=e._top +}else e=E(A,x.subLanguage.length?x.subLanguage:null) +;x.relevance>0&&(C+=e.relevance),S.__addSublanguage(e._emitter,e.language) +})():c(),A=""}function g(e,n){ +""!==e&&(S.startScope(n),S.addText(e),S.endScope())}function u(e,n){let t=1 +;const a=n.length-1;for(;t<=a;){if(!e._emit[t]){t++;continue} +const a=w.classNameAliases[e[t]]||e[t],i=n[t];a?g(i,a):(A=i,c(),A=""),t++}} +function b(e,n){ +return e.scope&&"string"==typeof e.scope&&S.openNode(w.classNameAliases[e.scope]||e.scope), +e.beginScope&&(e.beginScope._wrap?(g(A,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), +A=""):e.beginScope._multi&&(u(e.beginScope,n),A="")),x=Object.create(e,{parent:{ +value:x}}),x}function m(e,t,a){let i=((e,n)=>{const t=e&&e.exec(n) +;return t&&0===t.index})(e.endRe,a);if(i){if(e["on:end"]){const a=new n(e) +;e["on:end"](t,a),a.isMatchIgnored&&(i=!1)}if(i){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return m(e.parent,t,a)}function _(e){ +return 0===x.matcher.regexIndex?(A+=e[0],1):(D=!0,0)}function h(e){ +const n=e[0],a=t.substring(e.index),i=m(x,e,a);if(!i)return ee;const r=x +;x.endScope&&x.endScope._wrap?(d(), +g(n,x.endScope._wrap)):x.endScope&&x.endScope._multi?(d(), +u(x.endScope,e)):r.skip?A+=n:(r.returnEnd||r.excludeEnd||(A+=n), +d(),r.excludeEnd&&(A=n));do{ +x.scope&&S.closeNode(),x.skip||x.subLanguage||(C+=x.relevance),x=x.parent +}while(x!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:n.length} +let y={};function N(a,r){const o=r&&r[0];if(A+=a,null==o)return d(),0 +;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===o){ +if(A+=t.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`) +;throw n.languageName=e,n.badRule=y.rule,n}return 1} +if(y=r,"begin"===r.type)return(e=>{ +const t=e[0],a=e.rule,i=new n(a),r=[a.__beforeBegin,a["on:begin"]] +;for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return _(t) +;return a.skip?A+=t:(a.excludeBegin&&(A+=t), +d(),a.returnBegin||a.excludeBegin||(A=t)),b(a,e),a.returnBegin?0:t.length})(r) +;if("illegal"===r.type&&!i){ +const e=Error('Illegal lexeme "'+o+'" for mode "'+(x.scope||"")+'"') +;throw e.mode=x,e}if("end"===r.type){const e=h(r);if(e!==ee)return e} +if("illegal"===r.type&&""===o)return 1 +;if(R>1e5&&R>3*r.index)throw Error("potential infinite loop, way more iterations than matches") +;return A+=o,o.length}const w=v(e) +;if(!w)throw K(o.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const O=Q(w);let k="",x=r||O;const M={},S=new p.__emitter(p);(()=>{const e=[] +;for(let n=x;n!==w;n=n.parent)n.scope&&e.unshift(n.scope) +;e.forEach((e=>S.openNode(e)))})();let A="",C=0,T=0,R=0,D=!1;try{ +if(w.__emitTokens)w.__emitTokens(t,S);else{for(x.matcher.considerAll();;){ +R++,D?D=!1:x.matcher.considerAll(),x.matcher.lastIndex=T +;const e=x.matcher.exec(t);if(!e)break;const n=N(t.substring(T,e.index),e) +;T=e.index+n}N(t.substring(T))}return S.finalize(),k=S.toHTML(),{language:e, +value:k,relevance:C,illegal:!1,_emitter:S,_top:x}}catch(n){ +if(n.message&&n.message.includes("Illegal"))return{language:e,value:J(t), +illegal:!0,relevance:0,_illegalBy:{message:n.message,index:T, +context:t.slice(T-100,T+100),mode:n.mode,resultSoFar:k},_emitter:S};if(s)return{ +language:e,value:J(t),illegal:!1,relevance:0,errorRaised:n,_emitter:S,_top:x} +;throw n}}function E(e,n){n=n||p.languages||Object.keys(a);const t=(e=>{ +const n={value:J(e),illegal:!1,relevance:0,_top:c,_emitter:new p.__emitter(p)} +;return n._emitter.addText(e),n})(e),i=n.filter(v).filter(k).map((n=>f(n,e,!1))) +;i.unshift(t);const r=i.sort(((e,n)=>{ +if(e.relevance!==n.relevance)return n.relevance-e.relevance +;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1 +;if(v(n.language).supersetOf===e.language)return-1}return 0})),[s,o]=r,l=s +;return l.secondBest=o,l}function y(e){let n=null;const t=(e=>{ +let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"" +;const t=p.languageDetectRe.exec(n);if(t){const n=v(t[1]) +;return n||(H(o.replace("{}",t[1])), +H("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"} +return n.split(/\s+/).find((e=>_(e)||v(e)))})(e);if(_(t))return +;if(x("before:highlightElement",{el:e,language:t +}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) +;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), +console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), +console.warn("The element with unescaped HTML:"), +console.warn(e)),p.throwUnescapedHTML))throw new V("One of your code blocks includes unescaped HTML.",e.innerHTML) +;n=e;const a=n.textContent,r=t?h(a,{language:t,ignoreIllegals:!0}):E(a) +;e.innerHTML=r.value,e.dataset.highlighted="yes",((e,n,t)=>{const a=n&&i[n]||t +;e.classList.add("hljs"),e.classList.add("language-"+a) +})(e,t,r.language),e.result={language:r.language,re:r.relevance, +relevance:r.relevance},r.secondBest&&(e.secondBest={ +language:r.secondBest.language,relevance:r.secondBest.relevance +}),x("after:highlightElement",{el:e,result:r,text:a})}let N=!1;function w(){ +"loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(y):N=!0 +}function v(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]} +function O(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +i[e.toLowerCase()]=n}))}function k(e){const n=v(e) +;return n&&!n.disableAutodetect}function x(e,n){const t=e;r.forEach((e=>{ +e[t]&&e[t](n)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +N&&w()}),!1),Object.assign(t,{highlight:h,highlightAuto:E,highlightAll:w, +highlightElement:y, +highlightBlock:e=>(q("10.7.0","highlightBlock will be removed entirely in v12.0"), +q("10.7.0","Please use highlightElement now."),y(e)),configure:e=>{p=Y(p,e)}, +initHighlighting:()=>{ +w(),q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, +initHighlightingOnLoad:()=>{ +w(),q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") +},registerLanguage:(e,n)=>{let i=null;try{i=n(t)}catch(n){ +if(K("Language definition for '{}' could not be registered.".replace("{}",e)), +!s)throw n;K(n),i=c} +i.name||(i.name=e),a[e]=i,i.rawDefinition=n.bind(null,t),i.aliases&&O(i.aliases,{ +languageName:e})},unregisterLanguage:e=>{delete a[e] +;for(const n of Object.keys(i))i[n]===e&&delete i[n]}, +listLanguages:()=>Object.keys(a),getLanguage:v,registerAliases:O, +autoDetection:k,inherit:Y,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{ +e["before:highlightBlock"](Object.assign({block:n.el},n)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{ +e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),r.push(e)}, +removePlugin:e=>{const n=r.indexOf(e);-1!==n&&r.splice(n,1)}}),t.debugMode=()=>{ +s=!1},t.safeMode=()=>{s=!0},t.versionString="11.9.0",t.regex={concat:b, +lookahead:d,either:m,optional:u,anyNumberOfTimes:g} +;for(const n in C)"object"==typeof C[n]&&e(C[n]);return Object.assign(t,C),t +},te=ne({});te.newInstance=()=>ne({});var ae=te;const ie=e=>({IMPORTANT:{ +scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{ +scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/}, +FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/}, +ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", +contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ +scope:"number", +begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", +relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/} +}),re=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],se=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],oe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],le=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ce=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),de=oe.concat(le) +;var ge="[0-9](_*[0-9])*",ue=`\\.(${ge})`,be="[0-9a-fA-F](_*[0-9a-fA-F])*",me={ +className:"number",variants:[{ +begin:`(\\b(${ge})((${ue})|\\.)?|(${ue}))[eE][+-]?(${ge})[fFdD]?\\b`},{ +begin:`\\b(${ge})((${ue})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ +begin:`(${ue})[fFdD]?\\b`},{begin:`\\b(${ge})[fFdD]\\b`},{ +begin:`\\b0[xX]((${be})\\.?|(${be})?\\.(${be}))[pP][+-]?(${ge})[fFdD]?\\b`},{ +begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${be})[lL]?\\b`},{ +begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], +relevance:0};function pe(e,n,t){return-1===t?"":e.replace(n,(a=>pe(e,n,t-1)))} +const _e="[A-Za-z$_][0-9A-Za-z$_]*",he=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],fe=["true","false","null","undefined","NaN","Infinity"],Ee=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ye=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ne=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],we=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ve=[].concat(Ne,Ee,ye) +;function Oe(e){const n=e.regex,t=_e,a={begin:/<[A-Za-z0-9\\._:-]+/, +end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ +const t=e[0].length+e.index,a=e.input[t] +;if("<"===a||","===a)return void n.ignoreMatch();let i +;">"===a&&(((e,{after:n})=>{const t="",M={ +match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(x)], +keywords:"async",className:{1:"keyword",3:"title.function"},contains:[f]} +;return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{ +PARAMS_CONTAINS:h,CLASS_REFERENCE:y},illegal:/#(?![$_A-z])/, +contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ +label:"use_strict",className:"meta",relevance:10, +begin:/^\s*['"]use (strict|asm)['"]/ +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,g,u,b,m,{match:/\$\d+/},l,y,{ +className:"attr",begin:t+n.lookahead(":"),relevance:0},M,{ +begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", +keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{ +className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{ +className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{ +className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, +excludeEnd:!0,keywords:i,contains:h}]}]},{begin:/,/,relevance:0},{match:/\s+/, +relevance:0},{variants:[{begin:"<>",end:""},{ +match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin, +"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{ +begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},N,{ +beginKeywords:"while if switch catch for"},{ +begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,label:"func.def",contains:[f,e.inherit(e.TITLE_MODE,{begin:t, +className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$"+t, +relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, +contains:[f]},w,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},E,k,{match:/\$[(.]/}]}} +const ke=e=>b(/\b/,e,/\w$/.test(e)?/\b/:/\B/),xe=["Protocol","Type"].map(ke),Me=["init","self"].map(ke),Se=["Any","Self"],Ae=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Ce=["false","nil","true"],Te=["assignment","associativity","higherThan","left","lowerThan","none","right"],Re=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],De=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ie=m(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Le=m(Ie,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Be=b(Ie,Le,"*"),$e=m(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),ze=m($e,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Fe=b($e,ze,"*"),Ue=b(/[A-Z]/,ze,"*"),je=["attached","autoclosure",b(/convention\(/,m("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",b(/objc\(/,Fe,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Pe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"] +;var Ke=Object.freeze({__proto__:null,grmr_bash:e=>{const n=e.regex,t={},a={ +begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]} +;Object.assign(t,{className:"variable",variants:[{ +begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const i={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(s);const o={begin:/\$?\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] +},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, +contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ +name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/, +keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"], +literal:["true","false"], +built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"] +},contains:[l,e.SHEBANG(),c,o,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},s,{ +match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},t]}}, +grmr_c:e=>{const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}] +}),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",r="("+a+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={ +className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{ +match:/\batomic_[a-z]{3,6}\b/}]},o={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={ +className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0 +},g=n.optional(i)+e.IDENT_RE+"\\s*\\(",u={ +keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], +type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"], +literal:"true false NULL", +built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" +},b=[c,s,t,e.C_BLOCK_COMMENT_MODE,l,o],m={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:u,contains:b.concat([{begin:/\(/,end:/\)/,keywords:u, +contains:b.concat(["self"]),relevance:0}]),relevance:0},p={ +begin:"("+r+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:u,relevance:0},{ +begin:g,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})], +relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/, +keywords:u,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,o,l,s,{begin:/\(/, +end:/\)/,keywords:u,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,l,s] +}]},s,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u, +disableAutodetect:!0,illegal:"=]/,contains:[{ +beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c, +strings:o,keywords:u}}},grmr_cpp:e=>{const n=e.regex,t=e.COMMENT("//","$",{ +contains:[{begin:/\\\n/}] +}),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",r="(?!struct)("+a+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={ +className:"type",begin:"\\b[a-z\\d_]*_t\\b"},o={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={ +className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0 +},g=n.optional(i)+e.IDENT_RE+"\\s*\\(",u={ +type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"], +keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"], +literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"], +_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"] +},b={className:"function.dispatch",relevance:0,keywords:{ +_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"] +}, +begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/)) +},m=[b,c,s,t,e.C_BLOCK_COMMENT_MODE,l,o],p={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:u,contains:m.concat([{begin:/\(/,end:/\)/,keywords:u, +contains:m.concat(["self"]),relevance:0}]),relevance:0},_={className:"function", +begin:"("+r+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:u,relevance:0},{ +begin:g,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{ +begin:/:/,endsWithParent:!0,contains:[o,l]},{relevance:0,match:/,/},{ +className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0, +contains:[t,e.C_BLOCK_COMMENT_MODE,o,l,s,{begin:/\(/,end:/\)/,keywords:u, +relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,l,s]}] +},s,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++", +aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"",keywords:u,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:u},{ +match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/], +className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const n={ +keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), +built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], +literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{ +begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{ +begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] +},r=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/, +keywords:n},o=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/, +end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ +},e.BACKSLASH_ESCAPE,o]},c={className:"string",begin:/\$@"/,end:'"',contains:[{ +begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/, +contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]}) +;s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE], +o.contains=[d,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{ +illegal:/\n/})];const g={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},t] +},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={ +begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], +keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, +contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ +begin:"\x3c!--|--\x3e"},{begin:""}]}] +}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", +end:"$",keywords:{ +keyword:"if else elif endif define undef warning error line region endregion pragma checksum" +}},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, +illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" +},t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", +relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", +begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ +className:"string",begin:/"/,end:/"/}]},{ +beginKeywords:"new return throw await else",relevance:0},{className:"function", +begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ +beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", +relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params", +begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, +contains:[g,a,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},grmr_css:e=>{ +const n=e.regex,t=ie(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{ +name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{ +keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"}, +contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ +},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 +},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 +},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ +begin:":("+oe.join("|")+")"},{begin:":(:)?("+le.join("|")+")"}] +},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ce.join("|")+")\\b"},{ +begin:/:/,end:/[;}{]/, +contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{ +begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" +},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0, +excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]", +relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/ +},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{ +$pattern:/[a-z-]+/,keyword:"and or not only",attribute:se.join(" ")},contains:[{ +begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{ +className:"selector-tag",begin:"\\b("+re.join("|")+")\\b"}]}},grmr_diff:e=>{ +const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{ +className:"meta",relevance:10, +match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/) +},{className:"comment",variants:[{ +begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/), +end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{ +className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/, +end:/$/}]}},grmr_go:e=>{const n={ +keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"], +type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"], +literal:["true","false","iota","nil"], +built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"] +};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{const n=e.regex;return{name:"GraphQL",aliases:["gql"], +case_insensitive:!0,disableAutodetect:!1,keywords:{ +keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"], +literal:["true","false","null"]}, +contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{ +scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation", +begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/, +end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{ +scope:"symbol",begin:n.concat(/[_A-Za-z][_0-9A-Za-z]*/,n.lookahead(/\s*:/)), +relevance:0}],illegal:[/[;<']/,/BEGIN/]}},grmr_ini:e=>{const n=e.regex,t={ +className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{ +begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/, +end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{ +begin:/\$\{(.*?)\}/}]},r={className:"literal", +begin:/\bon|off|true|false|yes|no\b/},s={className:"string", +contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{ +begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}] +},o={begin:/\[/,end:/\]/,contains:[a,r,i,s,t,"self"],relevance:0 +},l=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{ +name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/, +contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{ +begin:n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/)), +className:"attr",starts:{end:/$/,contains:[a,o,r,i,s,t]}}]}},grmr_java:e=>{ +const n=e.regex,t="[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*",a=t+pe("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),i={ +keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"], +literal:["false","true","null"], +type:["char","boolean","long","float","int","byte","short","double"], +built_in:["super","this"]},r={className:"meta",begin:"@"+t,contains:[{ +begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0} +;return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/, +relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{ +begin:/import java\.[a-z]+\./,keywords:"import",relevance:2 +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/, +className:"string",contains:[e.BACKSLASH_ESCAPE] +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{ +match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{ +1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{ +begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type", +3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword", +3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"new throw return else",relevance:0},{ +begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{ +2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0, +contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,me,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},me,r]}},grmr_javascript:Oe, +grmr_json:e=>{const n=["true","false","null"],t={scope:"literal", +beginKeywords:n.join(" ")};return{name:"JSON",keywords:{literal:n},contains:[{ +className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{ +match:/[{}[\],:]/,className:"punctuation",relevance:0 +},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE], +illegal:"\\S"}},grmr_kotlin:e=>{const n={ +keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual", +built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing", +literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@" +},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={ +className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string", +variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'", +illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/, +contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(r);const s={ +className:"meta", +begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?" +},o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/, +end:/\)/,contains:[e.inherit(r,{className:"string"}),"self"]}] +},l=me,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={ +variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/, +contains:[]}]},g=d;return g.variants[1].contains=[d],d.variants[1].contains=[g], +{name:"Kotlin",aliases:["kt","kts"],keywords:n, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag", +begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword", +begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol", +begin:/@\w+/}]}},t,s,o,{className:"function",beginKeywords:"fun",end:"[(]|$", +returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{ +begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, +contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://, +keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/, +endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/, +endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0 +},e.C_LINE_COMMENT_MODE,c,s,o,r,e.C_NUMBER_MODE]},c]},{ +begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{ +3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0, +illegal:"extends implements",contains:[{ +beginKeywords:"public protected internal private constructor" +},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0, +excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/, +excludeBegin:!0,returnEnd:!0},s,o]},r,{className:"meta",begin:"^#!/usr/bin/env", +end:"$",illegal:"\n"},l]}},grmr_less:e=>{ +const n=ie(e),t=de,a="[\\w-]+",i="("+a+"|@\\{"+a+"\\})",r=[],s=[],o=e=>({ +className:"string",begin:"~?"+e+".*?"+e}),l=(e,n,t)=>({className:e,begin:n, +relevance:t}),c={$pattern:/[a-z-]+/,keyword:"and or not only", +attribute:se.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:c, +relevance:0} +;s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o("'"),o('"'),n.CSS_NUMBER_MODE,{ +begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", +excludeEnd:!0} +},n.HEXCOLOR,d,l("variable","@@?"+a,10),l("variable","@\\{"+a+"\\}"),l("built_in","~?`[^`]*?`"),{ +className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0 +},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const g=s.concat({ +begin:/\{/,end:/\}/,contains:r}),u={beginKeywords:"when",endsWithParent:!0, +contains:[{beginKeywords:"and not"}].concat(s)},b={begin:i+"\\s*:", +returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/ +},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ce.join("|")+")\\b", +end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}] +},m={className:"keyword", +begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", +starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},p={ +className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a +}],starts:{end:"[;}]",returnEnd:!0,contains:g}},_={variants:[{ +begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0, +returnEnd:!0,illegal:"[<='$\"]",relevance:0, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+a+"\\}"),{ +begin:"\\b("+re.join("|")+")\\b",className:"selector-tag" +},n.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{ +className:"selector-pseudo",begin:":("+oe.join("|")+")"},{ +className:"selector-pseudo",begin:":(:)?("+le.join("|")+")"},{begin:/\(/, +end:/\)/,relevance:0,contains:g},{begin:"!important"},n.FUNCTION_DISPATCH]},h={ +begin:a+":(:)?"+`(${t.join("|")})`,returnBegin:!0,contains:[_]} +;return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,p,h,b,_,u,n.FUNCTION_DISPATCH), +{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}}, +grmr_lua:e=>{const n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"] +},i=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,t,{contains:[a],relevance:10 +})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE, +literal:"true false nil", +keyword:"and break do else elseif end for goto if in local not or repeat return then until while", +built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove" +},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)", +contains:[e.inherit(e.TITLE_MODE,{ +begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params", +begin:"\\(",endsWithParent:!0,contains:i}].concat(i) +},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string", +begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{const n={ +className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{ +const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},t={ +variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{ +begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, +relevance:2},{ +begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), +relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ +begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/ +},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, +returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", +excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", +end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[], +variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}] +},i={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{ +begin:/_(?![_\s])/,end:/_/,relevance:0}]},r=e.inherit(a,{contains:[] +}),s=e.inherit(i,{contains:[]});a.contains.push(s),i.contains.push(r) +;let o=[n,t];return[a,i,r,s].forEach((e=>{e.contains=e.contains.concat(o) +})),o=o.concat(a,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ +className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:o},{ +begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", +contains:o}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", +end:"\\s+",excludeEnd:!0},a,i,{className:"quote",begin:"^>\\s+",contains:o, +end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ +begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ +begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", +contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ +begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ +className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ +className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{ +const n=/[a-zA-Z@][a-zA-Z0-9_]*/,t={$pattern:n, +keyword:["@interface","@class","@protocol","@implementation"]};return{ +name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"], +keywords:{"variable.language":["this","super"],$pattern:n, +keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"], +literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"], +built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"], +type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"] +},illegal:"/,end:/$/,illegal:"\\n" +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class", +begin:"("+t.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:t, +contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE, +relevance:0}]}},grmr_perl:e=>{const n=e.regex,t=/[dualxmsipngr]{0,12}/,a={ +$pattern:/[\w.]+/, +keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0" +},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},r={begin:/->\{/, +end:/\}/},s={variants:[{begin:/\$\d/},{ +begin:n.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])") +},{begin:/[$%@][^\s\w{]/,relevance:0}] +},o=[e.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,a,i="\\1")=>{ +const r="\\1"===i?i:n.concat(i,a) +;return n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,r,/(?:\\.|[^\\\/])*?/,i,t) +},d=(e,a,i)=>n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,i,t),g=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{ +endsWithParent:!0}),r,{className:"string",contains:o,variants:[{ +begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[", +end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{ +begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">", +relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'", +contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{ +begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number", +begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", +relevance:0},{ +begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*", +keywords:"split return print reverse grep",relevance:0, +contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{ +begin:c("s|tr|y",n.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{ +begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{ +className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{ +begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",n.either(...l,{capture:!0 +}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{ +begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub", +end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{ +begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$", +subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}] +}];return i.contains=g,r.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:a, +contains:g}},grmr_php:e=>{ +const n=e.regex,t=/(?![A-Za-z0-9])(?![$])/,a=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),i=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),r={ +scope:"variable",match:"\\$+"+a},s={scope:"subst",variants:[{begin:/\$\w+/},{ +begin:/\{\$/,end:/\}/}]},o=e.inherit(e.APOS_STRING_MODE,{illegal:null +}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{ +illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),o,{ +begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/, +contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,n)=>{ +n.data._beginMatch=e[1]||e[2]},"on:end":(e,n)=>{ +n.data._beginMatch!==e[1]&&n.ignoreMatch()}},e.END_SAME_AS_BEGIN({ +begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},d={scope:"number",variants:[{ +begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{ +begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{ +begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?" +}],relevance:0 +},g=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={ +keyword:u,literal:(e=>{const n=[];return e.forEach((e=>{ +n.push(e),e.toLowerCase()===e?n.push(e.toUpperCase()):n.push(e.toLowerCase()) +})),n})(g),built_in:b},p=e=>e.map((e=>e.replace(/\|\d+$/,""))),_={variants:[{ +match:[/new/,n.concat(l,"+"),n.concat("(?!",p(b).join("\\b|"),"\\b)"),i],scope:{ +1:"keyword",4:"title.class"}}]},h=n.concat(a,"\\b(?!\\()"),f={variants:[{ +match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{2:"variable.constant" +}},{match:[/::/,/class/],scope:{2:"variable.language"}},{ +match:[i,n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{1:"title.class", +3:"variable.constant"}},{match:[i,n.concat("::",n.lookahead(/(?!class\b)/))], +scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class", +3:"variable.language"}}]},E={scope:"attr", +match:n.concat(a,n.lookahead(":"),n.lookahead(/(?!::)/))},y={relevance:0, +begin:/\(/,end:/\)/,keywords:m,contains:[E,r,f,e.C_BLOCK_COMMENT_MODE,c,d,_] +},N={relevance:0, +match:[/\b/,n.concat("(?!fn\\b|function\\b|",p(u).join("\\b|"),"|",p(b).join("\\b|"),"\\b)"),a,n.concat(l,"*"),n.lookahead(/(?=\()/)], +scope:{3:"title.function.invoke"},contains:[y]};y.contains.push(N) +;const w=[E,f,e.C_BLOCK_COMMENT_MODE,c,d,_];return{case_insensitive:!1, +keywords:m,contains:[{begin:n.concat(/#\[\s*/,i),beginScope:"meta",end:/]/, +endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{ +begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]}, +contains:["self",...w]},...w,{scope:"meta",match:i}] +},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{ +scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/, +keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE, +contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{ +begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{ +begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},r,N,f,{ +match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},_,{ +scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/, +excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use" +},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params", +begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m, +contains:["self",r,f,e.C_BLOCK_COMMENT_MODE,c,d]}]},{scope:"class",variants:[{ +beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", +illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ +beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ +beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, +contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{ +beginKeywords:"use",relevance:0,end:";",contains:[{ +match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,d]} +},grmr_php_template:e=>({name:"PHP template",subLanguage:"xml",contains:[{ +begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*", +end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0 +},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null, +skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null, +contains:null,skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text", +aliases:["text","txt"],disableAutodetect:!0}),grmr_python:e=>{ +const n=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={ +$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a, +built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], +literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], +type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] +},r={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/, +end:/\}/,keywords:i,illegal:/#/},o={begin:/\{\{/,relevance:0},l={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,o,s]},{begin:/([uU]|[rR])'/,end:/'/, +relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ +begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, +end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, +contains:[e.BACKSLASH_ESCAPE,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,o,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,g="\\b|"+a.join("|"),u={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${g})`},{begin:`(${d})[jJ]?`},{ +begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{ +begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})` +},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${c})[jJ](?=${g})` +}]},b={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:i, +contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ +className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, +end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i, +contains:["self",r,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,r],{ +name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i, +illegal:/(<\/|\?)|=>/,contains:[r,u,{begin:/\bself\b/},{beginKeywords:"if", +relevance:0},l,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{ +1:"keyword",3:"title.function"},contains:[m]},{variants:[{ +match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}], +scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ +className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,m,l]}]}}, +grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta.prompt", +starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{ +begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{ +const n=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/) +;return{name:"R",keywords:{$pattern:t, +keyword:"function if in break next repeat else for while", +literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", +built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" +},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/, +starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)), +endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{ +scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0 +}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}] +}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE], +variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', +relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{ +1:"operator",2:"number"},match:[i,a]},{scope:{1:"operator",2:"number"}, +match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[r,a]},{scope:{ +2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"}, +match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{ +match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`", +contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{ +const n=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=n.concat(a,/(::\w+)*/),r={ +"variable.constant":["__FILE__","__LINE__","__ENCODING__"], +"variable.language":["self","super"], +keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"], +built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"], +literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},o={ +begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s] +}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10 +}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/, +end:/\}/,keywords:r},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c], +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{ +begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{ +begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//, +end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{ +begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{ +begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ +begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ +begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ +begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)), +contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, +contains:[e.BACKSLASH_ESCAPE,c]})]}]},g="[0-9](_?[0-9])*",u={className:"number", +relevance:0,variants:[{ +begin:`\\b([1-9](_?[0-9])*|0)(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{ +begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" +},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ +begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ +begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{ +className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0, +keywords:r}]},m=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{ +match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class", +4:"title.class.inherited"},keywords:r},{match:[/(include|extend)\s+/,i],scope:{ +2:"title.class"},keywords:r},{relevance:0,match:[i,/\.new[. (]/],scope:{ +1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{ +match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[b]},{ +begin:e.IDENT_RE+"::"},{className:"symbol", +begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", +begin:":(?!\\s)",contains:[d,{begin:t}],relevance:0},u,{className:"variable", +begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ +className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0, +relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*", +keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c], +illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{ +begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[", +end:"\\][a-z]*"}]}].concat(o,l),relevance:0}].concat(o,l) +;c.contains=m,b.contains=m;const p=[{begin:/^\s*=>/,starts:{end:"$",contains:m} +},{className:"meta.prompt", +begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", +starts:{end:"$",keywords:r,contains:m}}];return l.unshift(o),{name:"Ruby", +aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/, +contains:[e.SHEBANG({binary:"ruby"})].concat(p).concat(l).concat(m)}}, +grmr_rust:e=>{const n=e.regex,t={className:"title.function.invoke",relevance:0, +begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,n.lookahead(/\s*\(/)) +},a="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],r=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"] +;return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:r, +keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"], +literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:""},t]}}, +grmr_scss:e=>{const n=ie(e),t=le,a=oe,i="@[a-z-]+",r={className:"variable", +begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS", +case_insensitive:!0,illegal:"[=/|']", +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n.CSS_NUMBER_MODE,{ +className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{ +className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0 +},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag", +begin:"\\b("+re.join("|")+")\\b",relevance:0},{className:"selector-pseudo", +begin:":("+a.join("|")+")"},{className:"selector-pseudo", +begin:":(:)?("+t.join("|")+")"},r,{begin:/\(/,end:/\)/, +contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute", +begin:"\\b("+ce.join("|")+")\\b"},{ +begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" +},{begin:/:/,end:/[;}{]/,relevance:0, +contains:[n.BLOCK_COMMENT,r,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH] +},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{ +begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/, +keyword:"and or not only",attribute:se.join(" ")},contains:[{begin:i, +className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute" +},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE] +},n.FUNCTION_DISPATCH]}},grmr_shell:e=>({name:"Shell Session", +aliases:["console","shellsession"],contains:[{className:"meta.prompt", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]}),grmr_sql:e=>{ +const n=e.regex,t=e.COMMENT("--","$"),a=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=r,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!r.includes(e))),c={ +begin:n.concat(/\b/,n.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}} +;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ +$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:n,when:t}={})=>{const a=t +;return n=n||[],e.map((e=>e.match(/\|\d+$/)||n.includes(e)?e:a(e)?e+"|0":e)) +})(l,{when:e=>e.length<3}),literal:a,type:i, +built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] +},contains:[{begin:n.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, +keyword:l.concat(s),literal:a,type:i}},{className:"type", +begin:n.either("double precision","large object","with timezone","without timezone") +},c,{className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},{className:"string", +variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/, +contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{ +className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/, +relevance:0}]}},grmr_swift:e=>{const n={match:/\s+/,relevance:0 +},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,t],i={ +match:[/\./,m(...xe,...Me)],className:{2:"keyword"}},r={match:b(/\./,m(...Ae)), +relevance:0},s=Ae.filter((e=>"string"==typeof e)).concat(["_|0"]),o={variants:[{ +className:"keyword", +match:m(...Ae.filter((e=>"string"!=typeof e)).concat(Se).map(ke),...Me)}]},l={ +$pattern:m(/\b\w+/,/#\w+/),keyword:s.concat(Re),literal:Ce},c=[i,r,o],g=[{ +match:b(/\./,m(...De)),relevance:0},{className:"built_in", +match:b(/\b/,m(...De),/(?=\()/)}],u={match:/->/,relevance:0},p=[u,{ +className:"operator",relevance:0,variants:[{match:Be},{match:`\\.(\\.|${Le})+`}] +}],_="([0-9]_*)+",h="([0-9a-fA-F]_*)+",f={className:"number",relevance:0, +variants:[{match:`\\b(${_})(\\.(${_}))?([eE][+-]?(${_}))?\\b`},{ +match:`\\b0x(${h})(\\.(${h}))?([pP][+-]?(${_}))?\\b`},{match:/\b0o([0-7]_*)+\b/ +},{match:/\b0b([01]_*)+\b/}]},E=(e="")=>({className:"subst",variants:[{ +match:b(/\\/,e,/[0\\tnr"']/)},{match:b(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}] +}),y=(e="")=>({className:"subst",match:b(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/) +}),N=(e="")=>({className:"subst",label:"interpol",begin:b(/\\/,e,/\(/),end:/\)/ +}),w=(e="")=>({begin:b(e,/"""/),end:b(/"""/,e),contains:[E(e),y(e),N(e)] +}),v=(e="")=>({begin:b(e,/"/),end:b(/"/,e),contains:[E(e),N(e)]}),O={ +className:"string", +variants:[w(),w("#"),w("##"),w("###"),v(),v("#"),v("##"),v("###")] +},k=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0, +contains:[e.BACKSLASH_ESCAPE]}],x={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//, +contains:k},M=e=>{const n=b(e,/\//),t=b(/\//,e);return{begin:n,end:t, +contains:[...k,{scope:"comment",begin:`#(?!.*${t})`,end:/$/}]}},S={ +scope:"regexp",variants:[M("###"),M("##"),M("#"),x]},A={match:b(/`/,Fe,/`/) +},C=[A,{className:"variable",match:/\$\d+/},{className:"variable", +match:`\\$${ze}+`}],T=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{ +contains:[{begin:/\(/,end:/\)/,keywords:Pe,contains:[...p,f,O]}]}},{ +scope:"keyword",match:b(/@/,m(...je))},{scope:"meta",match:b(/@/,Fe)}],R={ +match:d(/\b[A-Z]/),relevance:0,contains:[{className:"type", +match:b(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ze,"+") +},{className:"type",match:Ue,relevance:0},{match:/[?!]+/,relevance:0},{ +match:/\.\.\./,relevance:0},{match:b(/\s+&\s+/,d(Ue)),relevance:0}]},D={ +begin://,keywords:l,contains:[...a,...c,...T,u,R]};R.contains.push(D) +;const I={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{ +match:b(Fe,/\s*:/),keywords:"_|0",relevance:0 +},...a,S,...c,...g,...p,f,O,...C,...T,R]},L={begin://, +keywords:"repeat each",contains:[...a,R]},B={begin:/\(/,end:/\)/,keywords:l, +contains:[{begin:m(d(b(Fe,/\s*:/)),d(b(Fe,/\s+/,Fe,/\s*:/))),end:/:/, +relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params", +match:Fe}]},...a,...c,...p,f,O,...T,R,I],endsParent:!0,illegal:/["']/},$={ +match:[/(func|macro)/,/\s+/,m(A.match,Fe,Be)],className:{1:"keyword", +3:"title.function"},contains:[L,B,n],illegal:[/\[/,/%/]},z={ +match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"}, +contains:[L,B,n],illegal:/\[|%/},F={match:[/operator/,/\s+/,Be],className:{ +1:"keyword",3:"title"}},U={begin:[/precedencegroup/,/\s+/,Ue],className:{ +1:"keyword",3:"title"},contains:[R],keywords:[...Te,...Ce],end:/}/} +;for(const e of O.variants){const n=e.contains.find((e=>"interpol"===e.label)) +;n.keywords=l;const t=[...c,...g,...p,f,O,...C];n.contains=[...t,{begin:/\(/, +end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:l, +contains:[...a,$,z,{beginKeywords:"struct protocol class extension enum actor", +end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{ +className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c] +},F,U,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0 +},S,...c,...g,...p,f,O,...C,...T,R,I]}},grmr_typescript:e=>{ +const n=Oe(e),t=_e,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={ +beginKeywords:"namespace",end:/\{/,excludeEnd:!0, +contains:[n.exports.CLASS_REFERENCE]},r={beginKeywords:"interface",end:/\{/, +excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a}, +contains:[n.exports.CLASS_REFERENCE]},s={$pattern:_e, +keyword:he.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]), +literal:fe,built_in:ve.concat(a),"variable.language":we},o={className:"meta", +begin:"@"+t},l=(e,n,t)=>{const a=e.contains.findIndex((e=>e.label===n)) +;if(-1===a)throw Error("can not find mode to replace");e.contains.splice(a,1,t)} +;return Object.assign(n.keywords,s), +n.exports.PARAMS_CONTAINS.push(o),n.contains=n.contains.concat([o,i,r]), +l(n,"shebang",e.SHEBANG()),l(n,"use_strict",{className:"meta",relevance:10, +begin:/^\s*['"]use strict['"]/ +}),n.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(n,{ +name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n},grmr_vbnet:e=>{ +const n=e.regex,t=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,s={ +className:"literal",variants:[{begin:n.concat(/# */,n.either(a,t),/ *#/)},{ +begin:n.concat(/# */,r,/ *#/)},{begin:n.concat(/# */,i,/ *#/)},{ +begin:n.concat(/# */,n.either(a,t),/ +/,n.either(i,r),/ *#/)}] +},o=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}] +}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]}) +;return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0, +classNameAliases:{label:"symbol"},keywords:{ +keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", +built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", +type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", +literal:"true false nothing"}, +illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ +className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, +end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0, +variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ +},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ +begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ +className:"label",begin:/^\w+:/},o,l,{className:"meta", +begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, +end:/$/,keywords:{ +keyword:"const disable else elseif enable end externalsource if region then"}, +contains:[l]}]}},grmr_wasm:e=>{e.regex;const n=e.COMMENT(/\(;/,/;\)/) +;return n.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/, +keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"] +},contains:[e.COMMENT(/;;/,/$/),n,{match:[/(?:offset|align)/,/\s*/,/=/], +className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{ +match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{ +begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword", +3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/, +className:"type"},{className:"keyword", +match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/ +},{className:"number",relevance:0, +match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/ +}]}},grmr_xml:e=>{ +const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={ +className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/, +contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] +},r=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{ +className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={ +endsWithParent:!0,illegal:/`]+/}]}]}]};return{ +name:"HTML, XML", +aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], +case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,o,s,r,{begin:/\[/,end:/\]/,contains:[{ +className:"meta",begin://,contains:[i,r,o,s]}]}] +},e.COMMENT(//,{relevance:10}),{begin://, +relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/, +relevance:10,contains:[o]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{ +end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{ +end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ +className:"tag",begin:/<>|<\/>/},{className:"tag", +begin:n.concat(//,/>/,/\s/)))), +end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{ +className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{ +className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]} +},grmr_yaml:e=>{ +const n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={ +className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ +},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", +variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(a,{ +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),r={ +end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},s={begin:/\{/, +end:/\}/,contains:[r],illegal:"\\n",relevance:0},o={begin:"\\[",end:"\\]", +contains:[r],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{ +begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ +begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", +relevance:10},{className:"string", +begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ +begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, +relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type", +begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t +},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", +begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", +relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ +className:"number", +begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" +},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,o,a],c=[...l] +;return c.pop(),c.push(i),r.contains=c,{name:"YAML",case_insensitive:!0, +aliases:["yml"],contains:l}}});const He=ae;for(const e of Object.keys(Ke)){ +const n=e.replace("grmr_","").replace("_","-");He.registerLanguage(n,Ke[e])} +return He}() +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); \ No newline at end of file diff --git a/doctum-theme/layout/base.twig b/doctum-theme/layout/base.twig new file mode 100644 index 0000000000..637c84e83e --- /dev/null +++ b/doctum-theme/layout/base.twig @@ -0,0 +1,393 @@ +{% extends 'default/layout/base.twig' %} + +{% block head %} + {{ parent() }} + + + +{% endblock %} diff --git a/doctum-theme/macros.twig b/doctum-theme/macros.twig new file mode 100644 index 0000000000..fb899e15cf --- /dev/null +++ b/doctum-theme/macros.twig @@ -0,0 +1,194 @@ + +{% macro class_category_name(categoryId) -%} +{% if categoryId == 1 %}{% trans 'class' %}{% endif %} +{% if categoryId == 2 %}{% trans 'interface' %}{% endif %} +{% if categoryId == 3 %}{% trans 'trait' %}{% endif %} +{%- endmacro %} + +{% macro namespace_link(namespace) -%} +
    {{ namespace == '' ? global_namespace_name() : namespace|raw }} +{%- endmacro %} + +{% macro class_link(class, absolute) -%} + {%- if class.isProjectClass() -%} + + {%- elseif class.isPhpClass() -%} + + {%- endif %} + {{- abbr_class(class, absolute|default(false)) }} + {%- if class.isProjectClass() or class.isPhpClass() %}{% endif %} +{%- endmacro %} + +{% macro method_link(method, absolute, classonly) -%} +{# #} +{# #}{{- abbr_class(method.class) }}{% if not classonly|default(false) %}::{{ method.name|raw }}{% endif -%} +{# #} +{%- endmacro %} + +{% macro property_link(property, absolute, classonly) -%} +{# #} +{# #}{{- abbr_class(property.class) }}{% if not classonly|default(false) %}#{{ property.name|raw }}{% endif -%} +{# #} +{%- endmacro %} + +{% macro hint_link(hints, isIntersectionType = false) -%} + {%- from _self import class_link %} + + {%- if hints %} + {%- for hint in hints %} + {%- if hint.class %} + {{- class_link(hint.name) }} + {%- elseif hint.name %} + {{- abbr_class(hint.name) }} + {%- endif %} + {%- if hint.array %}[]{% endif %} + {%- if not loop.last %}{%- if isIntersectionType %}&{% else %}|{% endif %}{% endif %} + {%- endfor %} + {%- endif %} +{%- endmacro %} + +{% macro source_link(project, class) -%} + {% if class.sourcepath %} + ({% trans 'View source'%}) + {%- endif %} +{%- endmacro %} + +{% macro method_source_link(method) -%} + {% if method.sourcepath %} + {#- l10n: Method at line %s -#} + {{'at line %s'|trans|format( + method.line + )|raw }} + {%- else %} + {#- l10n: Method at line %s -#} + {{- 'at line %s'|trans|format( + method.line + )|raw -}} + {%- endif %} +{%- endmacro %} + +{% macro method_parameters_signature(method) -%} + {%- from "macros.twig" import hint_link -%} + ( + {%- for parameter in method.parameters %} + {%- if parameter.hashint %}{{ hint_link(parameter.hint, parameter.isIntersectionType()) }} {% endif -%} + {%- if parameter.variadic %}...{% endif %}${{ parameter.name|raw }} + {%- if parameter.default is not null %} = {{ parameter.default }}{% endif %} + {%- if not loop.last %}, {% endif %} + {%- endfor -%} + ) +{%- endmacro %} + +{% macro function_parameters_signature(method) -%} + {%- from "macros.twig" import hint_link -%} + ( + {%- for parameter in method.parameters %} + {%- if parameter.hashint %}{{ hint_link(parameter.hint, parameter.isIntersectionType()) }} {% endif -%} + {%- if parameter.variadic %}...{% endif %}${{ parameter.name|raw }} + {%- if parameter.default is not null %} = {{ parameter.default }}{% endif %} + {%- if not loop.last %}, {% endif %} + {%- endfor -%} + ) +{%- endmacro %} + +{% macro render_classes(classes) -%} + {% from _self import class_link, deprecated %} + +
    + {% for class in classes %} +
    +
    + {% if class.isInterface %} + {{- class_link(class, true) -}} + {% else %} + {{- class_link(class, true) -}} + {% endif %} + {{- deprecated(class) -}} +
    +
    + {{- class.shortdesc|desc(class)|md_to_html -}} +
    +
    + {% endfor %} +
    +{%- endmacro %} + +{% macro breadcrumbs(namespace) %} + {% set current_ns = '' %} + {% for ns in namespace|split('\\') %} + {%- if current_ns -%} + {% set current_ns = current_ns ~ '\\' ~ ns %} + {%- else -%} + {% set current_ns = ns %} + {%- endif -%} +
  • {{ ns|raw }}
  • \
  • + {%- endfor %} +{% endmacro %} + +{% macro deprecated(reflection) %} + {% if reflection.deprecated %}{% trans 'deprecated' %}{% endif %} +{% endmacro %} + +{% macro deprecations(reflection) %} + {% from _self import deprecated %} + + {% if reflection.deprecated %} +

    + {{ deprecated(reflection )}} + {% for tag in reflection.deprecated %} + + {{ tag[0]|raw }} + {{ tag[1:]|join(' ')|raw }} + + {% endfor %} +

    + {% endif %} +{% endmacro %} + +{% macro internals(reflection) %} + {% if reflection.isInternal() %} + {% for internalTag in reflection.getInternal() %} + + + + + +
    {% trans 'internal' %} {{ internalTag[0]|raw }} {{ internalTag[1:]|join(' ')|raw }}
    + {% endfor %} +   + {% endif %} +{% endmacro %} + +{% macro categories(reflection) %} + {% if reflection.hasCategories() %} +

    + {% for categoryTag in reflection.getCategories() %} + {% for category in categoryTag %} + {{ category }} + {% endfor %} + {% endfor %} +

    + {% endif %} +{% endmacro %} + +{% macro todo(reflection) %} + {% if project.config('insert_todos') == true %} + {% if reflection.todo %}{% trans 'todo' %}{% endif %} + {% endif %} +{% endmacro %} + +{% macro todos(reflection) %} + {% from _self import todo %} + + {% if reflection.todo %} +

    + {{ todo(reflection )}} + {% for tag in reflection.todo %} + + {{ tag[0]|raw }} + {{ tag[1:]|join(' ')|raw }} + + {% endfor %} +

    + {% endif %} +{% endmacro %} diff --git a/doctum-theme/manifest.yml b/doctum-theme/manifest.yml new file mode 100644 index 0000000000..dd1a77902b --- /dev/null +++ b/doctum-theme/manifest.yml @@ -0,0 +1,6 @@ +name: phpredis +parent: default + +static: + 'css/highlight-github.min.css': 'css/highlight-github.min.css' + 'js/highlight.min.js': 'js/highlight.min.js' diff --git a/doctum.md b/doctum.md index 374e27ccb9..e30407b28d 100644 --- a/doctum.md +++ b/doctum.md @@ -5,4 +5,8 @@ curl -O https://doctum.long-term.support/releases/latest/doctum.phar chmod +x doctum.phar ./doctum.phar update doctum-config.php -``` \ No newline at end of file +``` + +The build uses a custom Doctum theme stored in `doctum-theme/` so that extra +assets such as highlight.js are bundled with the generated HTML. Keep that +directory in sync if you ever update Doctum upstream assets. diff --git a/library.c b/library.c index 7effbd2959..f00c287d61 100644 --- a/library.c +++ b/library.c @@ -126,11 +126,6 @@ static int redis_mbulk_reply_zipped_raw_variant(RedisSock *redis_sock, zval *zre static int redis_bulk_resp_to_zval(RedisSock *redis_sock, zval *zdst, int *dstlen) ; -/* Register a persistent resource in a a way that works for every PHP 7 version. */ -void redis_register_persistent_resource(zend_string *id, void *ptr, int le_id) { - zend_register_persistent_resource(ZSTR_VAL(id), ZSTR_LEN(id), ptr, le_id); -} - static ConnectionPool * redis_sock_get_connection_pool(RedisSock *redis_sock) { @@ -150,9 +145,12 @@ redis_sock_get_connection_pool(RedisSock *redis_sock) /* Create the pool and store it in our persistent list */ pool = pecalloc(1, sizeof(*pool), 1); zend_llist_init(&pool->list, sizeof(php_stream *), NULL, 1); - redis_register_persistent_resource(persistent_id, pool, le_redis_pconnect); + zend_register_persistent_resource(ZSTR_VAL(persistent_id), + ZSTR_LEN(persistent_id), + pool, le_redis_pconnect); zend_string_release(persistent_id); + return pool; } @@ -223,7 +221,6 @@ redis_sock_set_auth(RedisSock *redis_sock, zend_string *user, zend_string *pass) redis_sock->pass = pass ? zend_string_copy(pass) : NULL; } - PHP_REDIS_API void redis_sock_set_auth_zval(RedisSock *redis_sock, zval *zv) { zend_string *user, *pass; @@ -250,6 +247,31 @@ redis_sock_free_auth(RedisSock *redis_sock) { } } +#if PHP_VERSION_ID < 80000 +static void redis_array_release(HashTable *ht) { + if (!ht || (GC_FLAGS(ht) & GC_IMMUTABLE)) { + return; + } + + if (GC_DELREF(ht) == 0) { + zend_array_destroy(ht); + } +} +#else +static inline void redis_array_release(HashTable *ht) { + zend_array_release(ht); +} +#endif + + +void redis_sock_free_context(RedisSock *redis_sock) { + if (redis_sock->context == NULL) + return; + + redis_array_release(redis_sock->context); + redis_sock->context = NULL; +} + PHP_REDIS_API char * redis_sock_auth_cmd(RedisSock *redis_sock, int *cmdlen) { smart_string cmd = {0}; @@ -542,7 +564,7 @@ PHP_REDIS_API int redis_subscribe_response(INTERNAL_FUNCTION_PARAMETERS, zend_hash_str_update_mem(subs, Z_STRVAL_P(z_tmp), Z_STRLEN_P(z_tmp), &sctx->cb, sizeof(sctx->cb)); - zval_dtor(&z_resp); + zval_ptr_dtor_nogc(&z_resp); } if (strcasecmp(sctx->kw, "ssubscribe") == 0) { @@ -596,7 +618,7 @@ PHP_REDIS_API int redis_subscribe_response(INTERNAL_FUNCTION_PARAMETERS, ) { is_pmsg = *Z_STRVAL_P(z_type)=='p'; } else { - zval_dtor(&z_resp); + zval_ptr_dtor_nogc(&z_resp); continue; } @@ -645,7 +667,7 @@ PHP_REDIS_API int redis_subscribe_response(INTERNAL_FUNCTION_PARAMETERS, // If we have a return value free it zval_ptr_dtor(&z_ret); - zval_dtor(&z_resp); + zval_ptr_dtor_nogc(&z_resp); } RETVAL_TRUE; @@ -657,7 +679,7 @@ PHP_REDIS_API int redis_subscribe_response(INTERNAL_FUNCTION_PARAMETERS, zend_hash_destroy(subs); efree(subs); failure: - zval_dtor(&z_resp); + zval_ptr_dtor_nogc(&z_resp); RETVAL_FALSE; return FAILURE; } @@ -689,8 +711,8 @@ PHP_REDIS_API int redis_unsubscribe_response(INTERNAL_FUNCTION_PARAMETERS, (z_chan = zend_hash_index_find(Z_ARRVAL(z_resp), 1)) == NULL ) { efree(sctx); - zval_dtor(&z_resp); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_resp); + zval_ptr_dtor_nogc(&z_ret); RETVAL_FALSE; return FAILURE; } @@ -704,7 +726,7 @@ PHP_REDIS_API int redis_unsubscribe_response(INTERNAL_FUNCTION_PARAMETERS, add_assoc_bool_ex(&z_ret, Z_STRVAL_P(z_chan), Z_STRLEN_P(z_chan), 1); } - zval_dtor(&z_resp); + zval_ptr_dtor_nogc(&z_resp); } efree(sctx); @@ -954,6 +976,7 @@ redis_pool_spprintf(RedisSock *redis_sock, char *fmt, ...) { * S - Pointer to a zend_string * k - Same as 's' but the value will be prefixed if phpredis is set up do do * that and the working slot will be set if it has been passed. + * K - Same as 'S' but the value will be prefixed if phpredis is set up to do * v - A z_val which will be serialized if phpredis is configured to serialize. * f - A double value * F - Alias to 'f' @@ -995,6 +1018,10 @@ redis_spprintf(RedisSock *redis_sock, short *slot, char **ret, char *kw, char *f if (slot) *slot = cluster_hash_key(arg.str, arglen); if (argfree) efree(arg.str); break; + case 'K': + arg.zstr = va_arg(ap, zend_string*); + redis_cmd_append_sstr_key_zstr(&cmd, arg.zstr, redis_sock, slot); + break; case 'v': arg.zv = va_arg(ap, zval*); argfree = redis_pack(redis_sock, arg.zv, &dup, &arglen); @@ -1344,8 +1371,11 @@ redis_parse_info_response(char *response, zval *z_ret) add_assoc_long_ex(z_ret, p1, p - p1, lval); break; case IS_DOUBLE: - add_assoc_double_ex(z_ret, p1, p - p1, dval); - break; + if (dval < HUGE_VAL) { + add_assoc_double_ex(z_ret, p1, p - p1, dval); + break; + } + // fall through default: add_assoc_string_ex(z_ret, p1, p - p1, p + 1); } @@ -1576,7 +1606,7 @@ redis_read_lpos_response(zval *zdst, RedisSock *redis_sock, char reply_type, for (i = 0; i < elements; ++i) { if (redis_sock_gets(redis_sock, inbuf, sizeof(inbuf), &len) < 0) { - zval_dtor(zdst); + zval_ptr_dtor_nogc(zdst); return FAILURE; } add_next_index_long(zdst, atol(inbuf + 1)); @@ -1698,8 +1728,9 @@ static void array_zip_values_and_scores(RedisSock *redis_sock, zval *z_tab, int decode) { - zval z_ret, z_sub; HashTable *keytable = Z_ARRVAL_P(z_tab); + zend_string *hkey, *tmp; + zval z_ret, z_sub; array_init_size(&z_ret, zend_hash_num_elements(keytable) / 2); @@ -1714,13 +1745,14 @@ static void array_zip_values_and_scores(RedisSock *redis_sock, zval *z_tab, } /* get current value, a key */ - zend_string *hkey = Z_STR_P(z_key_p); + hkey = zval_get_tmp_string(z_key_p, &tmp); /* move forward */ zend_hash_move_forward(keytable); /* fetch again */ if ((z_value_p = zend_hash_get_current_data(keytable)) == NULL) { + zend_tmp_string_release(tmp); continue; /* this should never happen, according to the PHP people. */ } @@ -1735,11 +1767,14 @@ static void array_zip_values_and_scores(RedisSock *redis_sock, zval *z_tab, } else { ZVAL_ZVAL(&z_sub, z_value_p, 1, 0); } + zend_symtable_update(Z_ARRVAL_P(&z_ret), hkey, &z_sub); + + zend_tmp_string_release(tmp); } /* replace */ - zval_dtor(z_tab); + zval_ptr_dtor_nogc(z_tab); ZVAL_ZVAL(z_tab, &z_ret, 0, 0); } @@ -1755,7 +1790,7 @@ array_zip_values_recursive(zval *z_tab) zend_hash_move_forward(Z_ARRVAL_P(z_tab)) ) { if ((zv = zend_hash_get_current_data(Z_ARRVAL_P(z_tab))) == NULL) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); return FAILURE; } if (Z_TYPE_P(zv) == IS_STRING) { @@ -1763,12 +1798,12 @@ array_zip_values_recursive(zval *z_tab) zend_hash_move_forward(Z_ARRVAL_P(z_tab)); if ((zv = zend_hash_get_current_data(Z_ARRVAL_P(z_tab))) == NULL) { zend_string_release(zkey); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); return FAILURE; } if (Z_TYPE_P(zv) == IS_ARRAY && array_zip_values_recursive(zv) != SUCCESS) { zend_string_release(zkey); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); return FAILURE; } ZVAL_ZVAL(&z_sub, zv, 1, 0); @@ -1776,14 +1811,14 @@ array_zip_values_recursive(zval *z_tab) zend_string_release(zkey); } else { if (Z_TYPE_P(zv) == IS_ARRAY && array_zip_values_recursive(zv) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); return FAILURE; } ZVAL_ZVAL(&z_sub, zv, 1, 0); add_next_index_zval(&z_ret, &z_sub); } } - zval_dtor(z_tab); + zval_ptr_dtor_nogc(z_tab); ZVAL_ZVAL(z_tab, &z_ret, 0, 0); return SUCCESS; } @@ -1865,7 +1900,7 @@ redis_read_mpop_response(RedisSock *redis_sock, zval *zdst, int elements, int i; for (i = 0; i < elements; i++) { if (read_mbulk_header(redis_sock, &subele) < 0 || subele != 2) { - zval_dtor(&zele); + zval_ptr_dtor_nogc(&zele); goto fail; } redis_mbulk_reply_loop(redis_sock, &zele, subele, UNSERIALIZE_KEYS); @@ -1881,7 +1916,7 @@ redis_read_mpop_response(RedisSock *redis_sock, zval *zdst, int elements, return SUCCESS; fail: - zval_dtor(zdst); + zval_ptr_dtor_nogc(zdst); ZVAL_FALSE(zdst); return FAILURE; @@ -1962,7 +1997,7 @@ redis_read_geosearch_response(zval *zdst, RedisSock *redis_sock, } ZEND_HASH_FOREACH_END(); // Cleanup - zval_dtor(&z_multi_result); + zval_ptr_dtor_nogc(&z_multi_result); } return SUCCESS; @@ -2042,7 +2077,7 @@ redis_hello_response(INTERNAL_FUNCTION_PARAMETERS, if (redis_read_multibulk_recursive(redis_sock, numElems, 0, &z_ret) != SUCCESS || array_zip_values_recursive(&z_ret) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); goto fail; } @@ -2063,7 +2098,7 @@ redis_hello_response(INTERNAL_FUNCTION_PARAMETERS, zv = zend_hash_str_find(Z_ARRVAL(z_ret), ZEND_STRL("version")); redis_sock->hello.version = zv ? zval_get_string(zv) : ZSTR_EMPTY_ALLOC(); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); if (ctx == PHPREDIS_CTX_PTR) { ZVAL_STR_COPY(&z_ret, redis_sock->hello.server); @@ -2227,7 +2262,7 @@ redis_xrange_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (read_mbulk_header(redis_sock, &messages) < 0 || redis_read_stream_messages(redis_sock, messages, &z_messages) < 0) { - zval_dtor(&z_messages); + zval_ptr_dtor_nogc(&z_messages); REDIS_RESPONSE_ERROR(redis_sock, z_tab); return -1; } @@ -2267,7 +2302,7 @@ redis_read_stream_messages_multi(RedisSock *redis_sock, int count, zval *z_strea return 0; failure: efree(id); - zval_dtor(&z_messages); + zval_ptr_dtor_nogc(&z_messages); return -1; } @@ -2293,7 +2328,7 @@ redis_xread_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, return 0; cleanup: - zval_dtor(&z_rv); + zval_ptr_dtor_nogc(&z_rv); failure: REDIS_RESPONSE_ERROR(redis_sock, z_tab); return -1; @@ -2400,8 +2435,8 @@ redis_read_xclaim_reply(RedisSock *redis_sock, int count, int is_xautoclaim, zva return 0; failure: - zval_dtor(&z_msgs); - zval_dtor(rv); + zval_ptr_dtor_nogc(&z_msgs); + zval_ptr_dtor_nogc(rv); if (id) efree(id); return -1; @@ -2473,7 +2508,7 @@ redis_read_xinfo_response(RedisSock *redis_sock, zval *z_ret, int elements) case TYPE_MULTIBULK: array_init(&zv); if (redis_read_xinfo_response(redis_sock, &zv, li) != SUCCESS) { - zval_dtor(&zv); + zval_ptr_dtor_nogc(&zv); goto failure; } if (key) { @@ -2555,7 +2590,7 @@ redis_vinfo_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, array_init_size(&z_ret, count / 2); if (redis_read_vinfo_response(redis_sock, &z_ret, count) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); REDIS_RESPONSE_ERROR(redis_sock, z_tab); return FAILURE; } @@ -2623,7 +2658,7 @@ redis_vemb_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, array_init_size(&z_ret, count); if (redis_read_vemb_response(redis_sock, &z_ret, count) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); REDIS_RESPONSE_ERROR(redis_sock, z_tab); return FAILURE; } @@ -2685,7 +2720,7 @@ redis_vlinks_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, return SUCCESS; fail: - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); REDIS_RESPONSE_ERROR(redis_sock, z_tab); return FAILURE; } @@ -2760,7 +2795,7 @@ redis_xinfo_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, REDIS_RETURN_ZVAL(redis_sock, z_tab, z_ret); return SUCCESS; } - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); } REDIS_RESPONSE_ERROR(redis_sock, z_tab); @@ -2854,7 +2889,7 @@ int redis_acl_custom_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, res = cb(redis_sock, &zret, len); if (res == FAILURE) { - zval_dtor(&zret); + zval_ptr_dtor_nogc(&zret); ZVAL_FALSE(&zret); } } else { @@ -3047,7 +3082,7 @@ redis_sock_configure(RedisSock *redis_sock, HashTable *opts) redis_sock->persistent_id = zval_get_string(val); redis_sock->persistent = 1; } else { - redis_sock->persistent = zval_is_true(val); + redis_sock->persistent = zend_is_true(val); } } else if (zend_string_equals_literal_ci(zkey, "maxRetries")) { if (Z_TYPE_P(val) != IS_LONG || Z_LVAL_P(val) < 0) { @@ -3062,7 +3097,7 @@ redis_sock_configure(RedisSock *redis_sock, HashTable *opts) } redis_sock->retry_interval = zval_get_long(val); } else if (zend_string_equals_literal_ci(zkey, "ssl")) { - if (redis_sock_set_stream_context(redis_sock, val) != SUCCESS) { + if (redis_sock_set_context_zval(redis_sock, val) != SUCCESS) { REDIS_VALUE_EXCEPTION("Invalid SSL context options"); return FAILURE; } @@ -3319,6 +3354,26 @@ redis_sock_check_liveness(RedisSock *redis_sock) return FAILURE; } +static php_stream_context * +alloc_stream_context(RedisSock *redis_sock) { + php_stream_context *ctx; + zend_string *zkey; + zval *z_ele; + + if (redis_sock->context == NULL) + return NULL; + + ctx = php_stream_context_alloc(); + + ZEND_HASH_FOREACH_STR_KEY_VAL(redis_sock->context, zkey, z_ele) { + if (zkey != NULL) { + php_stream_context_set_option(ctx, "ssl", ZSTR_VAL(zkey), z_ele); + } + } ZEND_HASH_FOREACH_END(); + + return ctx; +} + /** * redis_sock_connect */ @@ -3330,6 +3385,10 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock) const char *fmtstr = "%s://%s:%d"; int host_len, usocket = 0, err = 0, tcp_flag = 1; ConnectionPool *p = NULL; + php_stream_context *ctx; + + // Monotonically incrementing persistent id counter + static unsigned long long counter = 0; if (redis_sock->stream != NULL) { redis_sock_disconnect(redis_sock, 0, 1); @@ -3337,7 +3396,7 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock) address = ZSTR_VAL(redis_sock->host); if ((pos = strstr(address, "://")) == NULL) { - strcpy(scheme, redis_sock->stream_ctx ? "ssl" : "tcp"); + strcpy(scheme, redis_sock->context ? "ssl" : "tcp"); } else { snprintf(scheme, sizeof(scheme), "%.*s", (int)(pos - address), address); address = pos + sizeof("://") - 1; @@ -3380,7 +3439,8 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock) } gettimeofday(&tv, NULL); - persistent_id = strpprintf(0, "phpredis_%ld%ld", tv.tv_sec, (long)tv.tv_usec); + persistent_id = strpprintf(0, "phpredis_%ld%ld:%llu", tv.tv_sec, + (long)tv.tv_usec, ++counter); } else { if (redis_sock->persistent_id) { persistent_id = strpprintf(0, "phpredis:%s:%s", host, ZSTR_VAL(redis_sock->persistent_id)); @@ -3396,10 +3456,22 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock) tv_ptr = &tv; } + ctx = alloc_stream_context(redis_sock); + redis_sock->stream = php_stream_xport_create(host, host_len, 0, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, persistent_id ? ZSTR_VAL(persistent_id) : NULL, - tv_ptr, redis_sock->stream_ctx, &estr, &err); + tv_ptr, ctx, &estr, &err); + + /* On successful connection, the context is moved into the stream so we + * can disown it. If the connection failed, clean it up ourselves. */ + if (ctx && redis_sock->stream) { + ZEND_ASSERT(GC_REFCOUNT(ctx->res) == 2); + GC_DELREF(ctx->res); + } else if (ctx) { + ZEND_ASSERT(GC_REFCOUNT(ctx->res) == 1); + zend_list_delete(ctx->res); + } if (persistent_id) { zend_string_release(persistent_id); @@ -3517,11 +3589,7 @@ redis_sock_disconnect(RedisSock *redis_sock, int force, int is_reset_mode) PHP_REDIS_API void redis_sock_set_err(RedisSock *redis_sock, const char *msg, int msg_len) { - // Free our last error - if (redis_sock->err != NULL) { - zend_string_release(redis_sock->err); - redis_sock->err = NULL; - } + redis_sock_clear_err(redis_sock); if (msg != NULL && msg_len > 0) { // Copy in our new error message @@ -3529,25 +3597,41 @@ redis_sock_set_err(RedisSock *redis_sock, const char *msg, int msg_len) } } -PHP_REDIS_API int -redis_sock_set_stream_context(RedisSock *redis_sock, zval *options) -{ - zend_string *zkey; - zval *z_ele; +PHP_REDIS_API void redis_sock_clear_err(RedisSock *redis_sock) { + if (redis_sock->err == NULL) + return; - if (!redis_sock || Z_TYPE_P(options) != IS_ARRAY) - return FAILURE; + zend_string_release(redis_sock->err); + redis_sock->err = NULL; +} - if (!redis_sock->stream_ctx) - redis_sock->stream_ctx = php_stream_context_alloc(); +#if PHP_VERSION_ID < 80000 +#define GC_TRY_ADDREF(ht) do { \ + if (ht && !(GC_FLAGS(ht) & GC_IMMUTABLE)) { \ + GC_ADDREF(ht); \ + } \ +} while(0) +#endif - ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(options), zkey, z_ele) { - if (zkey != NULL) { - php_stream_context_set_option(redis_sock->stream_ctx, "ssl", ZSTR_VAL(zkey), z_ele); - } - } ZEND_HASH_FOREACH_END(); - return SUCCESS; +void redis_sock_set_context(RedisSock *redis_sock, HashTable *ht) { + redis_sock_free_context(redis_sock); + + if (ht == NULL) + return; + + GC_TRY_ADDREF(ht); + redis_sock->context = ht; +} + +int redis_sock_set_context_zval(RedisSock *redis_sock, zval *zv) { + HashTable *ht; + + ht = zv && Z_TYPE_P(zv) == IS_ARRAY ? Z_ARRVAL_P(zv) : NULL; + + redis_sock_set_context(redis_sock, ht); + + return ht ? SUCCESS : FAILURE; } PHP_REDIS_API int @@ -3886,6 +3970,8 @@ PHP_REDIS_API void redis_free_socket(RedisSock *redis_sock) redis_sock_free_auth(redis_sock); redis_free_reply_callbacks(redis_sock); redis_sock_release_hello(&redis_sock->hello); + redis_sock_free_context(redis_sock); + efree(redis_sock); } @@ -4242,12 +4328,15 @@ redis_serialize(RedisSock *redis_sock, zval *z, char **val, size_t *val_len) case REDIS_SERIALIZER_PHP: PHP_VAR_SERIALIZE_INIT(ht); php_var_serialize(&sstr, z, &ht); + PHP_VAR_SERIALIZE_DESTROY(ht); + if (!sstr.s) { + break; + } *val = estrndup(ZSTR_VAL(sstr.s), ZSTR_LEN(sstr.s)); *val_len = ZSTR_LEN(sstr.s); smart_str_free(&sstr); - PHP_VAR_SERIALIZE_DESTROY(ht); return 1; diff --git a/library.h b/library.h index b39fcb61f3..e1e2cf2788 100644 --- a/library.h +++ b/library.h @@ -1,6 +1,8 @@ #ifndef REDIS_LIBRARY_H #define REDIS_LIBRARY_H +#include "php_redis.h" + /* Non cluster command helper */ #define REDIS_SPPRINTF(ret, kw, fmt, ...) \ redis_spprintf(redis_sock, NULL, ret, kw, fmt, ##__VA_ARGS__) @@ -38,8 +40,32 @@ #define REDIS_VALUE_EXCEPTION(m) zend_value_error(m) #endif +#if PHP_VERSION_ID < 80200 +static zend_always_inline +zend_bool zend_string_starts_with_cstr(const zend_string *str, const char *prefix, + size_t prefix_length) +{ + return ZSTR_LEN(str) >= prefix_length && + !memcmp(ZSTR_VAL(str), prefix, prefix_length); +} +#endif + +#if PHP_VERSION_ID < 80000 +static zend_string *zend_string_concat2(const char *str1, size_t len1, + const char *str2, size_t len2) +{ + size_t len = len1 + len2; + zend_string *res = zend_string_alloc(len, 0); + + memcpy(ZSTR_VAL(res), str1, len1); + memcpy(ZSTR_VAL(res) + len1, str2, len2); + ZSTR_VAL(res)[len] = '\0'; + + return res; +} +#endif + -void redis_register_persistent_resource(zend_string *id, void *ptr, int le_id); fold_item* redis_add_reply_callback(RedisSock *redis_sock); void redis_free_reply_callbacks(RedisSock *redis_sock); @@ -158,7 +184,12 @@ PHP_REDIS_API int redis_check_eof(RedisSock *redis_sock, zend_bool no_retry, zen PHP_REDIS_API RedisSock *redis_sock_get(zval *id, int nothrow); PHP_REDIS_API void redis_free_socket(RedisSock *redis_sock); PHP_REDIS_API void redis_sock_set_err(RedisSock *redis_sock, const char *msg, int msg_len); -PHP_REDIS_API int redis_sock_set_stream_context(RedisSock *redis_sock, zval *options); +PHP_REDIS_API void redis_sock_clear_err(RedisSock *redis_sock); + +void redis_sock_set_context(RedisSock *redis_sock, HashTable *ht); +void redis_sock_free_context(RedisSock *redis_sock); +int redis_sock_set_context_zval(RedisSock *redis_sock, zval *zv); + PHP_REDIS_API int redis_sock_set_backoff(RedisSock *redis_sock, zval *options); PHP_REDIS_API int diff --git a/redis.c b/redis.c index 662f18aefa..8bfb1e3ac5 100644 --- a/redis.c +++ b/redis.c @@ -111,6 +111,7 @@ PHP_INI_BEGIN() /* redis session */ PHP_INI_ENTRY("redis.session.locking_enabled", "0", PHP_INI_ALL, NULL) + PHP_INI_ENTRY("redis.session.lock_release_cmd", "eval", PHP_INI_ALL, NULL) PHP_INI_ENTRY("redis.session.lock_expire", "0", PHP_INI_ALL, NULL) PHP_INI_ENTRY("redis.session.lock_retries", "100", PHP_INI_ALL, NULL) PHP_INI_ENTRY("redis.session.lock_wait_time", "20000", PHP_INI_ALL, NULL) @@ -217,6 +218,7 @@ create_redis_object(zend_class_entry *ce) memcpy(&redis_object_handlers, zend_get_std_object_handlers(), sizeof(redis_object_handlers)); redis_object_handlers.offset = XtOffsetOf(redis_object, std); redis_object_handlers.free_obj = free_redis_object; + redis_object_handlers.clone_obj = NULL; redis->std.handlers = &redis_object_handlers; return &redis->std; @@ -602,13 +604,13 @@ redis_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) redis_free_socket(redis->sock); } - redis->sock = redis_sock_create(host, host_len, port, timeout, read_timeout, persistent, - persistent_id, retry_interval); + redis->sock = redis_sock_create(host, host_len, port, timeout, read_timeout, + persistent, persistent_id, retry_interval); if (context) { /* Stream context (e.g. TLS) */ if ((ele = REDIS_HASH_STR_FIND_STATIC(Z_ARRVAL_P(context), "stream"))) { - redis_sock_set_stream_context(redis->sock, ele); + redis_sock_set_context_zval(redis->sock, ele); } /* AUTH */ @@ -988,6 +990,10 @@ PHP_METHOD(Redis, del) { } /* }}} */ +PHP_METHOD(Redis, delex) { + REDIS_PROCESS_CMD(delex, redis_long_response); +} + PHP_METHOD(Redis, delifeq) { REDIS_PROCESS_KW_CMD("DELIFEQ", redis_kv_cmd, redis_long_response); } @@ -1269,7 +1275,7 @@ PHP_METHOD(Redis, sPop) } else if (ZEND_NUM_ARGS() == 2) { REDIS_PROCESS_KW_CMD("SPOP", redis_key_long_cmd, redis_sock_read_multibulk_reply); } else { - ZEND_WRONG_PARAM_COUNT(); + zend_wrong_param_count(); } } @@ -1654,6 +1660,10 @@ PHP_METHOD(Redis, msetnx) { } /* }}} */ +PHP_METHOD(Redis, msetex) { + REDIS_PROCESS_CMD(msetex, redis_long_response); +} + /* {{{ proto string Redis::rpoplpush(string srckey, string dstkey) */ PHP_METHOD(Redis, rpoplpush) { @@ -1852,7 +1862,7 @@ PHP_METHOD(Redis, zPopMax) } else if (ZEND_NUM_ARGS() == 2) { REDIS_PROCESS_KW_CMD("ZPOPMAX", redis_key_long_cmd, redis_mbulk_reply_zipped_keys_dbl); } else { - ZEND_WRONG_PARAM_COUNT(); + zend_wrong_param_count(); } } /* }}} */ @@ -1865,7 +1875,7 @@ PHP_METHOD(Redis, zPopMin) } else if (ZEND_NUM_ARGS() == 2) { REDIS_PROCESS_KW_CMD("ZPOPMIN", redis_key_long_cmd, redis_mbulk_reply_zipped_keys_dbl); } else { - ZEND_WRONG_PARAM_COUNT(); + zend_wrong_param_count(); } } /* }}} */ @@ -2226,7 +2236,7 @@ PHP_METHOD(Redis, exec) redis_sock->mode &= ~MULTI; redis_sock->watching = 0; if (ret < 0) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); ZVAL_FALSE(&z_ret); } } @@ -2243,7 +2253,7 @@ PHP_METHOD(Redis, exec) array_init(&z_ret); if (redis_sock_read_multibulk_multi_reply_loop( INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, &z_ret) != SUCCESS) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); ZVAL_FALSE(&z_ret); } } @@ -2619,6 +2629,18 @@ PHP_METHOD(Redis, _pack) { redis_pack_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock); } +PHP_METHOD(Redis, _digest) { + RedisSock *redis_sock; + + redis_sock = redis_sock_get_instance(getThis(), 0); + if (redis_sock == NULL) { + RETURN_FALSE; + } + + redis_digest_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, + redis_exception_ce); +} + PHP_METHOD(Redis, _unpack) { RedisSock *redis_sock; @@ -2670,11 +2692,7 @@ PHP_METHOD(Redis, clearLastError) { RETURN_FALSE; } - // Clear error message - if (redis_sock->err) { - zend_string_release(redis_sock->err); - redis_sock->err = NULL; - } + redis_sock_clear_err(redis_sock); RETURN_TRUE; } @@ -3068,7 +3086,7 @@ generic_scan_cmd(INTERNAL_FUNCTION_PARAMETERS, REDIS_SCAN_TYPE type) { /* Free our previous reply if we're back in the loop. We know we are * if our return_value is an array */ if (Z_TYPE_P(return_value) == IS_ARRAY) { - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); ZVAL_NULL(return_value); } @@ -3179,6 +3197,10 @@ PHP_METHOD(Redis, geosearchstore) { REDIS_PROCESS_CMD(geosearchstore, redis_long_response); } +PHP_METHOD(Redis, digest) { + REDIS_PROCESS_KW_CMD("DIGEST", redis_key_cmd, redis_ping_response); +} + /* * Vectors */ @@ -3236,6 +3258,10 @@ PHP_METHOD(Redis, vlinks) { REDIS_PROCESS_CMD(vlinks, redis_vlinks_reply); } +PHP_METHOD(Redis, gcra) { + REDIS_PROCESS_CMD(gcra, redis_read_variant_reply); +} + /* * Streams */ @@ -3260,6 +3286,10 @@ PHP_METHOD(Redis, xdel) { REDIS_PROCESS_KW_CMD("XDEL", redis_key_str_arr_cmd, redis_long_response); } +PHP_METHOD(Redis, xdelex) { + REDIS_PROCESS_CMD(xdelex, redis_read_variant_reply); +} + PHP_METHOD(Redis, xgroup) { REDIS_PROCESS_CMD(xgroup, redis_read_variant_reply); } diff --git a/redis.stub.php b/redis.stub.php index 56ca02a623..6d30144064 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -8,6 +8,8 @@ class Redis { /** + * Returned by `\Redis::type()` when the key does not exist or has a type + * we are not familiar with. * * @var int * @cvalue REDIS_NOT_FOUND @@ -16,6 +18,7 @@ class Redis { public const REDIS_NOT_FOUND = UNKNOWN; /** + * Returned by `\Redis::type()` when the key is a string. * * @var int * @cvalue REDIS_STRING @@ -24,6 +27,7 @@ class Redis { public const REDIS_STRING = UNKNOWN; /** + * Returned by `\Redis::type()` when the key is a set. * * @var int * @cvalue REDIS_SET @@ -32,6 +36,7 @@ class Redis { public const REDIS_SET = UNKNOWN; /** + * Returned by `\Redis::type()` when the key is a list. * * @var int * @cvalue REDIS_LIST @@ -40,6 +45,7 @@ class Redis { public const REDIS_LIST = UNKNOWN; /** + * Returned by `\Redis::type()` when the key is a sorted set. * * @var int * @cvalue REDIS_ZSET @@ -48,6 +54,7 @@ class Redis { public const REDIS_ZSET = UNKNOWN; /** + * Returned by `\Redis::type()` when the key is a hash. * * @var int * @cvalue REDIS_HASH @@ -56,6 +63,7 @@ class Redis { public const REDIS_HASH = UNKNOWN; /** + * Returned by `\Redis::type()` when the key is a stream. * * @var int * @cvalue REDIS_STREAM @@ -64,6 +72,7 @@ class Redis { public const REDIS_STREAM = UNKNOWN; /** + * Returned by `\Redis::type()` when the key is a vector set. * * @var int * @cvalue REDIS_VECTORSET @@ -72,6 +81,8 @@ class Redis { public const REDIS_VECTORSET = UNKNOWN; /** + * Returned from `\Redis::getMode()` when we're not in a multi or pipeline + * transaction. * * @var int * @cvalue ATOMIC @@ -80,6 +91,7 @@ class Redis { public const ATOMIC = UNKNOWN; /** + * Returned from `\Redis::getMode()` when we're in a multi transaction. * * @var int * @cvalue MULTI @@ -88,6 +100,7 @@ class Redis { public const MULTI = UNKNOWN; /** + * Returned from `\Redis::getMode()` when we're in a pipeline transaction. * * @var int * @cvalue PIPELINE @@ -96,6 +109,7 @@ class Redis { public const PIPELINE = UNKNOWN; /** + * Used with `\Redis::setOption()` to specify the serializer to use * * @var int * @cvalue REDIS_OPT_SERIALIZER @@ -104,6 +118,7 @@ class Redis { public const OPT_SERIALIZER = UNKNOWN; /** + * Used to set an automatic prefix for keys used in commands. * * @var int * @cvalue REDIS_OPT_PREFIX @@ -112,6 +127,7 @@ class Redis { public const OPT_PREFIX = UNKNOWN; /** + * Used to set the read timeout for the connection. * * @var int * @cvalue REDIS_OPT_READ_TIMEOUT @@ -120,6 +136,7 @@ class Redis { public const OPT_READ_TIMEOUT = UNKNOWN; /** + * Used to enable or disable TCP keepalive on the connection. * * @var int * @cvalue REDIS_OPT_TCP_KEEPALIVE @@ -128,6 +145,7 @@ class Redis { public const OPT_TCP_KEEPALIVE = UNKNOWN; /** + * Used to set the compression algorithm to use for compressing * * @var int * @cvalue REDIS_OPT_COMPRESSION @@ -136,6 +154,9 @@ class Redis { public const OPT_COMPRESSION = UNKNOWN; /** + * Causes PhpRedis to return the actual string in `+OK` style responses + * from Redis. If disabled those replies are just converted to boolean + * true. * * @var int * @cvalue REDIS_OPT_REPLY_LITERAL @@ -144,6 +165,7 @@ class Redis { public const OPT_REPLY_LITERAL = UNKNOWN; /** + * Used to specify the compression level to use when compressing data. * * @var int * @cvalue REDIS_OPT_COMPRESSION_LEVEL @@ -152,6 +174,8 @@ class Redis { public const OPT_COMPRESSION_LEVEL = UNKNOWN; /** + * Tells PhpRedis to return a NULL multi-bulk (`*-1\r\n`) response + * as `null` as opposed to an empty array. * * @var int * @cvalue REDIS_OPT_NULL_MBULK_AS_NULL @@ -160,12 +184,10 @@ class Redis { public const OPT_NULL_MULTIBULK_AS_NULL = UNKNOWN; /** - * @var int - * @cvalue REDIS_OPT_PACK_IGNORE_NUMBERS - * * When enabled, this option tells PhpRedis to ignore purely numeric values * when packing and unpacking data. This does not include numeric strings. - * If you want numeric strings to be ignored, typecast them to an int or float. + * If you want numeric strings to be ignored, typecast them to an int or + * float. * * The primary purpose of this option is to make it more ergonomic when * setting keys that will later be incremented or decremented. @@ -174,10 +196,12 @@ class Redis { * because we have to see if the data is a string representation of an int * or float. * + * @var int + * @cvalue REDIS_OPT_PACK_IGNORE_NUMBERS + * * @example * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY); * $redis->setOption(Redis::OPT_PACK_IGNORE_NUMBERS, true); - * * $redis->set('answer', 32); * * var_dump($redis->incrBy('answer', 10)); // int(42) @@ -186,6 +210,7 @@ class Redis { public const OPT_PACK_IGNORE_NUMBERS = UNKNOWN; /** + * Sets the serializer to none (no serialization). * * @var int * @cvalue REDIS_SERIALIZER_NONE @@ -194,6 +219,7 @@ class Redis { public const SERIALIZER_NONE = UNKNOWN; /** + * Sets the serializer to PHP's built-in `serialize()`/`unserialize()` * * @var int * @cvalue REDIS_SERIALIZER_PHP @@ -203,6 +229,8 @@ class Redis { #ifdef HAVE_REDIS_IGBINARY /** + * Sets the serializer to igbinary. Note that phpredis must be compiled + * with ighbinary support to use this serializer. * * @var int * @cvalue REDIS_SERIALIZER_IGBINARY @@ -213,6 +241,8 @@ class Redis { #ifdef HAVE_REDIS_MSGPACK /** + * Sets the serializer to msgpack. Note that phpredis must be compiled + * with msgpack support to use this serializer. * * @var int * @cvalue REDIS_SERIALIZER_MSGPACK @@ -222,6 +252,7 @@ class Redis { #endif /** + * Sets the serializer to JSON. * * @var int * @cvalue REDIS_SERIALIZER_JSON @@ -230,6 +261,7 @@ class Redis { public const SERIALIZER_JSON = UNKNOWN; /** + * Disables compression. * * @var int * @cvalue REDIS_COMPRESSION_NONE @@ -239,6 +271,8 @@ class Redis { #ifdef HAVE_REDIS_LZF /** + * Sets the compression algorithm to LZF. PhpRedis must be compiled with + * lzf support but this serializer is bundled with the extension. * * @var int * @cvalue REDIS_COMPRESSION_LZF @@ -249,6 +283,9 @@ class Redis { #ifdef HAVE_REDIS_ZSTD /** + * Sets the compression algorithm to ZSTD. PhpRedis must be compiled with + * zstd support to use this serializer. This is often the best balance + * between speed and compression ratio. * * @var int * @cvalue REDIS_COMPRESSION_ZSTD @@ -258,6 +295,9 @@ class Redis { #ifdef ZSTD_CLEVEL_DEFAULT /** + * This constant represents the "default" compression level for ZSTD. If + * PhpRedis is compiled against a new enough ZSTD the value comes from the + * library, otherwise we just set it to 3. * * @var int * @cvalue ZSTD_CLEVEL_DEFAULT @@ -266,6 +306,9 @@ class Redis { public const COMPRESSION_ZSTD_DEFAULT = UNKNOWN; #else /** + * This constant represents the "default" compression level for ZSTD. If + * PhpRedis is compiled against a new enough ZSTD the value comes from the + * library, otherwise we just set it to 3. * * @var int * @@ -275,6 +318,8 @@ class Redis { #if ZSTD_VERSION_NUMBER >= 10400 /** + * The minimum compression level ZSTD supports, which comes from the + * underlying ZSTD library if new enough. Otherwise we just set it to 1. * * @var int * @cvalue ZSTD_minCLevel() @@ -283,14 +328,19 @@ class Redis { public const COMPRESSION_ZSTD_MIN = UNKNOWN; #else /** - * - * @var int - * - */ + * The minimum compression level ZSTD supports, which comes from the + * underlying ZSTD library if new enough. Otherwise we just set it to 1. + * + * @var int + * + */ public const COMPRESSION_ZSTD_MIN = 1; #endif /** + * The maximum compression level ZSTD supports, which comes from the + * underlying ZSTD library. + * * @var int * @cvalue ZSTD_maxCLevel() */ @@ -299,6 +349,9 @@ class Redis { #ifdef HAVE_REDIS_LZ4 /** + * Set the compression algorithm to LZ4. PhpRedis must be compiled with + * lz4 support to use this serializer. This algorithm is generally + * the fastest but has a lower compression ratio than ZSTD. * * @var int * @cvalue REDIS_COMPRESSION_LZ4 @@ -308,6 +361,7 @@ class Redis { #endif /** + * Used with `\Redis::setOption()` to specify scan options. * * @var int * @cvalue REDIS_OPT_SCAN @@ -316,6 +370,9 @@ class Redis { public const OPT_SCAN = UNKNOWN; /** + * When enabled, this option causes PhpRedis to automatically retry `SCAN` + * commands when Redis returns a non-zero cursor but no keys. This can + * happen due to the nature of Redis' scanning algorithm. * * @var int * @cvalue REDIS_SCAN_RETRY @@ -324,6 +381,9 @@ class Redis { public const SCAN_RETRY = UNKNOWN; /** + * Then enabled, this option tells PhpRedis to not retry `SCAN` commands + * when Redis returns a non-zero cursor but no keys. This means that your + * code must handle this case itself. * * @var int * @cvalue REDIS_SCAN_NORETRY @@ -332,6 +392,8 @@ class Redis { public const SCAN_NORETRY = UNKNOWN; /** + * Tells PhpRedis to prefix keys returned from `SCAN` commands with the + * currently set key prefix. * * @var int * @cvalue REDIS_SCAN_PREFIX @@ -340,6 +402,8 @@ class Redis { public const SCAN_PREFIX = UNKNOWN; /** + * Tells PhpRedis to NOT prefix keys returned from `SCAN` commands with + * the currently set key prefix. * * @var int * @cvalue REDIS_SCAN_NOPREFIX @@ -348,6 +412,8 @@ class Redis { public const SCAN_NOPREFIX = UNKNOWN; /** + * This is just the string "before" which is used with various list + * commands to indicate an insertion point. * * @var string * @@ -355,6 +421,8 @@ class Redis { public const BEFORE = "before"; /** + * This is just the string "after" which is used with various list commands + * to indicate an insertion point. * * @var string * @@ -362,6 +430,8 @@ class Redis { public const AFTER = "after"; /** + * This is just the string "left" which is used with various list commands + * such as `LMOVE`. * * @var string * @@ -369,6 +439,8 @@ class Redis { public const LEFT = "left"; /** + * This is just the string "right" which is used with various list commands + * such as `LMOVE`. * * @var string * @@ -376,6 +448,8 @@ class Redis { public const RIGHT = "right"; /** + * How many times should `PhpRedis` attempt to reconnect when we are + * disconnected. * * @var int * @cvalue REDIS_OPT_MAX_RETRIES @@ -384,6 +458,7 @@ class Redis { public const OPT_MAX_RETRIES = UNKNOWN; /** + * Used to specify the backoff algorithm to use when reconnecting. * * @var int * @cvalue REDIS_OPT_BACKOFF_ALGORITHM @@ -392,6 +467,7 @@ class Redis { public const OPT_BACKOFF_ALGORITHM = UNKNOWN; /** + * Default backoff - random delay before the first retry, then constant `base` ms. * * @var int * @cvalue REDIS_BACKOFF_ALGORITHM_DEFAULT @@ -400,6 +476,7 @@ class Redis { public const BACKOFF_ALGORITHM_DEFAULT = UNKNOWN; /** + * Constant backoff - always sleep for exactly `base` ms (capped by `cap`). * * @var int * @cvalue REDIS_BACKOFF_ALGORITHM_CONSTANT @@ -408,6 +485,7 @@ class Redis { public const BACKOFF_ALGORITHM_CONSTANT = UNKNOWN; /** + * Uniform backoff - randomly sleep between 0 and `base` ms for each retry. * * @var int * @cvalue REDIS_BACKOFF_ALGORITHM_UNIFORM @@ -416,6 +494,7 @@ class Redis { public const BACKOFF_ALGORITHM_UNIFORM = UNKNOWN; /** + * Exponential backoff - doubles the delay every retry (up to 2^10) before `cap`. * * @var int * @cvalue REDIS_BACKOFF_ALGORITHM_EXPONENTIAL @@ -424,6 +503,7 @@ class Redis { public const BACKOFF_ALGORITHM_EXPONENTIAL = UNKNOWN; /** + * Full jitter - exponential delay but pick a random value between 0 and that delay. * * @var int * @cvalue REDIS_BACKOFF_ALGORITHM_FULL_JITTER @@ -432,6 +512,7 @@ class Redis { public const BACKOFF_ALGORITHM_FULL_JITTER = UNKNOWN; /** + * Equal jitter - half the exponential delay plus a random amount up to the other half. * * @var int * @cvalue REDIS_BACKOFF_ALGORITHM_EQUAL_JITTER @@ -440,6 +521,7 @@ class Redis { public const BACKOFF_ALGORITHM_EQUAL_JITTER = UNKNOWN; /** + * Decorrelated jitter - pick a random delay between `base` and 3x the previous delay. * * @var int * @cvalue REDIS_BACKOFF_ALGORITHM_DECORRELATED_JITTER @@ -448,6 +530,7 @@ class Redis { public const BACKOFF_ALGORITHM_DECORRELATED_JITTER = UNKNOWN; /** + * Backoff base - minimum delay in milliseconds that algorithms start from. * * @var int * @cvalue REDIS_OPT_BACKOFF_BASE @@ -456,6 +539,7 @@ class Redis { public const OPT_BACKOFF_BASE = UNKNOWN; /** + * Backoff cap - maximum delay in milliseconds that any algorithm can reach. * * @var int * @cvalue REDIS_OPT_BACKOFF_CAP @@ -470,42 +554,44 @@ class Redis { * * **NOTE**: Below is an example options array with various setting * - * $options = [ - * 'host' => 'localhost', - * 'port' => 6379, - * 'readTimeout' => 2.5, - * 'connectTimeout' => 2.5, - * 'persistent' => true, - * - * // Valid formats: NULL, ['user', 'pass'], 'pass', or ['pass'] - * 'auth' => ['phpredis', 'phpredis'], - * - * // See PHP stream options for valid SSL configuration settings. - * 'ssl' => ['verify_peer' => false], - * - * // How quickly to retry a connection after we time out or it closes. - * // Note that this setting is overridden by 'backoff' strategies. - * 'retryInterval' => 100, - * - * // Which backoff algorithm to use. 'decorrelated jitter' is - * // likely the best one for most solution, but there are many - * // to choose from: - * // REDIS_BACKOFF_ALGORITHM_DEFAULT - * // REDIS_BACKOFF_ALGORITHM_CONSTANT - * // REDIS_BACKOFF_ALGORITHM_UNIFORM - * // REDIS_BACKOFF_ALGORITHM_EXPONENTIAL - * // REDIS_BACKOFF_ALGORITHM_FULL_JITTER - * // REDIS_BACKOFF_ALGORITHM_EQUAL_JITTER - * // REDIS_BACKOFF_ALGORITHM_DECORRELATED_JITTER - * // 'base', and 'cap' are in milliseconds and represent the first - * // delay redis will use when reconnecting, and the maximum delay - * // we will reach while retrying. - * 'backoff' => [ - * 'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER, - * 'base' => 500, - * 'cap' => 750, - * ] - * ]; + *```php + *$options = [ + * 'host' => 'localhost', + * 'port' => 6379, + * 'readTimeout' => 2.5, + * 'connectTimeout' => 2.5, + * 'persistent' => true, + * + * // Valid formats: NULL, ['user', 'pass'], 'pass', or ['pass'] + * 'auth' => ['phpredis', 'phpredis'], + * + * // See PHP stream options for valid SSL configuration settings. + * 'ssl' => ['verify_peer' => false], + * + * // How quickly to retry a connection after we time out or it closes. + * // Note that this setting is overridden by 'backoff' strategies. + * 'retryInterval' => 100, + * + * // Which backoff algorithm to use. 'decorrelated jitter' is + * // likely the best one for most solution, but there are many + * // to choose from: + * // REDIS_BACKOFF_ALGORITHM_DEFAULT + * // REDIS_BACKOFF_ALGORITHM_CONSTANT + * // REDIS_BACKOFF_ALGORITHM_UNIFORM + * // REDIS_BACKOFF_ALGORITHM_EXPONENTIAL + * // REDIS_BACKOFF_ALGORITHM_FULL_JITTER + * // REDIS_BACKOFF_ALGORITHM_EQUAL_JITTER + * // REDIS_BACKOFF_ALGORITHM_DECORRELATED_JITTER + * // 'base', and 'cap' are in milliseconds and represent the first + * // delay redis will use when reconnecting, and the maximum delay + * // we will reach while retrying. + * 'backoff' => [ + * 'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER, + * 'base' => 500, + * 'cap' => 750, + * ] + *]; + *``` * * Note: If you do wish to connect via the constructor, only 'host' is * strictly required, which will cause PhpRedis to connect to that @@ -514,35 +600,52 @@ class Redis { * * @see Redis::connect() * @see https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ - * @param array $options + * @param array|null $options * * @return Redis + * + * @example + * $redis = new Redis(['host' => '127.0.0.1', 'port' => 6380]); + * */ public function __construct(?array $options = null); + /** + * Destructor to clean up the Redis object. + * + * This method will disconnect from Redis. If the connection is persistento + * it will be stashed for future reuse. + * + */ public function __destruct(); /** - * Compress a value with the currently configured compressor as set with - * Redis::setOption(). + * Compress a value with the currently configured compressor (Redis::OPT_COMPRESSION) + * exactly the same way PhpRedis does before sending data to Redis. * * @see Redis::setOption() * * @param string $value The value to be compressed - * @return string The compressed result + * @return string The compressed result (or the original value if compression is disabled) + * + * @example + * $redis->_compress('payload'); * */ public function _compress(string $value): string; /** - * Uncompress the provided argument that has been compressed with the - * currently configured compressor as set with Redis::setOption(). + * Uncompress the provided argument using the compressor configured via + * Redis::setOption() (Redis::OPT_COMPRESSION). * * @see Redis::setOption() * * @param string $value The compressed value to uncompress. * @return string The uncompressed result. * + * @example + * $redis->_uncompress($redis->_compress('payload')); + * */ public function _uncompress(string $value): string; @@ -553,6 +656,9 @@ public function _uncompress(string $value): string; * @param string $key The key/string to prefix * @return string The prefixed string * + * @example + * $redis->_prefix('user:42'); + * */ public function _prefix(string $key): string; @@ -565,6 +671,9 @@ public function _prefix(string $key): string; * @param mixed $value The value to serialize * @return string The serialized result * + * @example + * $redis->_serialize(['answer' => 42]); + * */ public function _serialize(mixed $value): string; @@ -577,29 +686,68 @@ public function _serialize(mixed $value): string; * @param string $value The value to unserialize * @return mixed The unserialized result * + * @example + * $redis->_unserialize($redis->_serialize(['answer' => 42])); + * */ public function _unserialize(string $value): mixed; /** - * Pack the provided value with the configured serializer and compressor - * as set with Redis::setOption(). + * Pack the provided value by first serializing it (if Redis::OPT_SERIALIZER is set) + * and then compressing the serialized payload (if Redis::OPT_COMPRESSION is set), + * mirroring exactly what PhpRedis transmits to Redis. * * @param mixed $value The value to pack * @return string The packed result having been serialized and * compressed. + * + * @example + * $redis->_pack(['count' => 5]); + * */ public function _pack(mixed $value): string; /** - * Unpack the provided value with the configured compressor and serializer - * as set with Redis::setOption(). + * Compute the XXH3 digest of a PHP value after it has been `_pack`ed, producing + * the same digest Redis' DIGEST command would return for the stored value. + * + * @param mixed $value The value to compute the digest for. + * @return string The computed digest. + * + * @throws RedisException If XXH3 is not supported. * - * @param string $value The value which has been serialized and compressed. - * @return mixed The uncompressed and eserialized value. + * @note This function requires PHP >= 8.1 which is the version PHP + * added support for XXH3 hashing and made the hash extension + * mandatory. + * + * @example + * $redis->_digest(['token' => 'abc']); + * + */ + public function _digest(mixed $value): string; + + /** + * Unpack the provided value by first uncompressing it (if Redis::OPT_COMPRESSION + * is set) and then unserializing it (if Redis::OPT_SERIALIZER is set) to recover + * the original PHP value. + * + * @param string $value The value which has been serialized and compressed. + * @return mixed The uncompressed and deserialized value. + * + * @example + * $redis->_unpack($redis->_pack(['count' => 5])); * */ public function _unpack(string $value): mixed; + /** + * Execute Redis ACL subcommands. + * + * @see https://redis.io/docs/latest/commands/acl/ + * + * @example + * $redis->acl('list'); + */ public function acl(string $subcmd, string ...$args): mixed; /** @@ -610,7 +758,7 @@ public function acl(string $subcmd, string ...$args): mixed; * * @return Redis|int|false The new string length of the key or false on failure. * - * @see https://redis.io/commands/append + * @see https://redis.io/docs/latest/commands/append/ * * @example * $redis->set('foo', 'hello); @@ -625,43 +773,58 @@ public function append(string $key, mixed $value): Redis|int|false; * $redis->auth(['password']); * $redis->auth(['username', 'password']); * - * @see https://redis.io/commands/auth + * @see https://redis.io/docs/latest/commands/auth/ * * @param mixed $credentials A string password, or an array with one or two string elements. * @return Redis|bool Whether the AUTH was successful. * + * @example + * $redis->auth('secret'); + * */ public function auth(#[\SensitiveParameter] mixed $credentials): Redis|bool; /** * Execute a save of the Redis database in the background. * - * @see https://redis.io/commands/bgsave + * @see https://redis.io/docs/latest/commands/bgsave/ * * @return Redis|bool Whether the command was successful. + * + * @example + * $redis->bgSave(); + * */ public function bgSave(): Redis|bool; /** * Asynchronously rewrite Redis' append-only file * - * @see https://redis.io/commands/bgrewriteaof + * @see https://redis.io/docs/latest/commands/bgrewriteaof/ * * @return Redis|bool Whether the command was successful. + * + * @example + * $redis->bgrewriteaof(); + * */ public function bgrewriteaof(): Redis|bool; /** - * @see https://redis.io/commands/waitaof + * @see https://redis.io/docs/latest/commands/waitaof/ + * + * @return Redis|array|false + * + * @example + * $redis->waitaof(1, 1, 5000); * - * @return Redis|array */ public function waitaof(int $numlocal, int $numreplicas, int $timeout): Redis|array|false; /** * Count the number of set bits in a Redis string. * - * @see https://redis.io/commands/bitcount/ + * @see https://redis.io/docs/latest/commands/bitcount/ * * @param string $key The key in question (must be a string key) * @param int $start The index where Redis should start counting. If omitted it @@ -674,6 +837,9 @@ public function waitaof(int $numlocal, int $numreplicas, int $timeout): Redis|ar * * @return Redis|int|false The number of bits set in the requested range. * + * @example + * $redis->bitcount('bitmap', 0, -1); + * */ public function bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false; @@ -682,7 +848,7 @@ public function bitop(string $operation, string $deskey, string $srckey, string /** * Return the position of the first bit set to 0 or 1 in a string. * - * @see https://redis.io/commands/bitpos/ + * @see https://redis.io/docs/latest/commands/bitpos/ * * @param string $key The key to check (must be a string) * @param bool $bit Whether to look for an unset (0) or set (1) bit. @@ -692,6 +858,10 @@ public function bitop(string $operation, string $deskey, string $srckey, string * was 0 and end was 2, Redis would only search the first two bits. * * @return Redis|int|false The position of the first set or unset bit. + * + * @example + * $redis->bitpos('bitmap', true, 0, -1); + * **/ public function bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false; @@ -699,7 +869,7 @@ public function bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bo * Pop an element off the beginning of a Redis list or lists, potentially blocking up to a specified * timeout. This method may be called in two distinct ways, of which examples are provided below. * - * @see https://redis.io/commands/blpop/ + * @see https://redis.io/docs/latest/commands/blpop/ * * @param string|array $key_or_keys This can either be a string key or an array of one or more * keys. @@ -719,9 +889,12 @@ public function blPop(string|array $key_or_keys, string|float|int $timeout_or_ke * Pop an element off of the end of a Redis list or lists, potentially blocking up to a specified timeout. * The calling convention is identical to Redis::blPop() so see that documentation for more details. * - * @see https://redis.io/commands/brpop/ + * @see https://redis.io/docs/latest/commands/brpop/ * @see Redis::blPop() * + * @example + * $redis->brPop(['queue:critical', 'queue:default'], 5); + * */ public function brPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed ...$extra_args): Redis|array|null|false; @@ -729,13 +902,16 @@ public function brPop(string|array $key_or_keys, string|float|int $timeout_or_ke * Pop an element from the end of a Redis list, pushing it to the beginning of another Redis list, * optionally blocking up to a specified timeout. * - * @see https://redis.io/commands/brpoplpush/ + * @see https://redis.io/docs/latest/commands/brpoplpush/ * * @param string $src The source list * @param string $dst The destination list * @param int|float $timeout The number of seconds to wait. Note that you must be connected * to Redis >= 6.0.0 to send a floating point timeout. * + * @example + * $redis->brpoplpush('queue:pending', 'queue:processing', 5); + * */ public function brpoplpush(string $src, string $dst, int|float $timeout): Redis|string|false; @@ -748,13 +924,13 @@ public function brpoplpush(string $src, string $dst, int|float $timeout): Redis| * **NOTE**: We recommend calling this function with an array and a timeout as the other strategy * may be deprecated in future versions of PhpRedis * - * @see https://redis.io/commands/bzpopmax + * @see https://redis.io/docs/latest/commands/bzpopmax/ * - * @param string|array $key_or_keys Either a string key or an array of one or more keys. - * @param string|int $timeout_or_key If the previous argument was an array, this argument + * @param string|array $key Either a string key or an array of one or more keys. + * @param string|int $timeout_or_key If the previous argument was an array, this argument * must be a timeout value. Otherwise it could also be * another key. - * @param mixed $extra_args Can consist of additional keys, until the last argument + * @param mixed ...$extra_args Can consist of additional keys, until the last argument * which needs to be a timeout. * * @return Redis|array|false The popped elements. @@ -771,9 +947,12 @@ public function bzPopMax(string|array $key, string|int $timeout_or_key, mixed .. * * This command is identical in semantics to bzPopMax so please see that method for more information. * - * @see https://redis.io/commands/bzpopmin + * @see https://redis.io/docs/latest/commands/bzpopmin/ * @see Redis::bzPopMax() * + * @example + * $redis->bzPopMin(['scores:high', 'scores:low'], 1.5); + * */ public function bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): Redis|array|false; @@ -793,13 +972,19 @@ public function bzPopMin(string|array $key, string|int $timeout_or_key, mixed .. * * NOTE: If Redis::OPT_NULL_MULTIBULK_AS_NULL is set to true via Redis::setOption(), this method will * instead return NULL when Redis doesn't pop any elements. + * + * @see https://redis.io/docs/latest/commands/bzmpop/ + * + * @example + * $redis->bzmpop(1.5, ['scores:high', 'scores:low'], 'MIN', 2); + * */ public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): Redis|array|null|false; /** * POP one or more of the highest or lowest scoring elements from one or more sorted sets. * - * @see https://redis.io/commands/zmpop + * @see https://redis.io/docs/latest/commands/zmpop/ * * @param array $keys One or more sorted sets * @param string $from The string 'MIN' or 'MAX' (case insensitive) telling Redis whether you want to @@ -807,6 +992,10 @@ public function bzmpop(float $timeout, array $keys, string $from, int $count = 1 * @param int $count Pop up to how many elements at once. * * @return Redis|array|null|false An array of popped elements or false if none could be popped. + * + * @example + * $redis->zmpop(['scores:high', 'scores:low'], 'MAX', 2); + * */ public function zmpop(array $keys, string $from, int $count = 1): Redis|array|null|false; @@ -814,7 +1003,7 @@ public function zmpop(array $keys, string $from, int $count = 1): Redis|array|nu * Pop one or more elements from one or more Redis LISTs, blocking up to a specified timeout when * no elements are available. * - * @see https://redis.io/commands/blmpop + * @see https://redis.io/docs/latest/commands/blmpop/ * * @param float $timeout The number of seconds Redis will block when no elements are available. * @param array $keys One or more Redis LISTs to pop from. @@ -824,13 +1013,17 @@ public function zmpop(array $keys, string $from, int $count = 1): Redis|array|nu * * @return Redis|array|null|false One or more elements popped from the list(s) or false if all LISTs * were empty. + * + * @example + * $redis->blmpop(1.5, ['queue:critical', 'queue:default'], 'LEFT', 2); + * */ public function blmpop(float $timeout, array $keys, string $from, int $count = 1): Redis|array|null|false; /** * Pop one or more elements off of one or more Redis LISTs. * - * @see https://redis.io/commands/lmpop + * @see https://redis.io/docs/latest/commands/lmpop/ * * @param array $keys An array with one or more Redis LIST key names. * @param string $from The string 'LEFT' or 'RIGHT' (case insensitive), telling Redis whether to pop\ @@ -840,6 +1033,9 @@ public function blmpop(float $timeout, array $keys, string $from, int $count = 1 * @return Redis|array|null|false One or more elements popped from the LIST(s) or false if all the LISTs * were empty. * + * @example + * $redis->lmpop(['queue:critical', 'queue:default'], 'RIGHT', 2); + * */ public function lmpop(array $keys, string $from, int $count = 1): Redis|array|null|false; @@ -859,10 +1055,49 @@ public function lmpop(array $keys, string $from, int $count = 1): Redis|array|nu */ public function clearLastError(): bool; + /** + * Execute Redis CLIENT subcommands. + * + * @param string $opt The CLIENT subcommand to execute. + * @param mixed ...$args Additional arguments depending on the subcommand. + * + * @see https://redis.io/docs/latest/commands/client/ + * + * @example + * $redis->client('list'); + */ public function client(string $opt, mixed ...$args): mixed; + /** + * Closes the connection to Redis + * + * This function will close the connection whether it is persistent or not. + * + * @return bool Whether the connection was successfully closed. + * + * @example + * $redis = new Redis; + * $redis->pconnect('localhost', 6379); + * $id1 = $redis->client('id'); + * $redis->close(); + * + * $redis = new Redis; + * $redis->pconnect('localhost', 6379); + * $id2 = $redis->client('id'); + * + * // Will print "id is different" + * printf("ID is %s\n", $id1 == $id2 ? 'the same' : 'different'); + */ public function close(): bool; + /** + * Execute Redis COMMAND subcommands. + * + * @see https://redis.io/docs/latest/commands/command/ + * + * @example + * $redis->command('command'); + */ public function command(?string $opt = null, mixed ...$args): mixed; /** @@ -871,10 +1106,10 @@ public function command(?string $opt = null, mixed ...$args): mixed; * What the command does in particular depends on the `$operation` qualifier. * Operations that PhpRedis supports are: RESETSTAT, REWRITE, GET, and SET. * - * @param string $operation The CONFIG operation to execute (e.g. GET, SET, REWRITE). + * @param string $operation The CONFIG operation to execute (e.g. GET, SET, REWRITE). * @param array|string|null $key_or_settings One or more keys or values. - * @param string $value The value if this is a `CONFIG SET` operation. - * @see https://redis.io/commands/config + * @param string|null $value The value if this is a `CONFIG SET` operation. + * @see https://redis.io/docs/latest/commands/config/ * * @example * $redis->config('GET', 'timeout'); @@ -884,6 +1119,39 @@ public function command(?string $opt = null, mixed ...$args): mixed; */ public function config(string $operation, array|string|null $key_or_settings = null, ?string $value = null): mixed; + /** + * Connect to a Redis server + * + * @param string $host The Redis server hostname or IP + * address. + * @param int $port The Redis server port. Defaults to + * 6379. + * @param float $timeout The connection timeout in seconds. + * Defaults to 0 (no timeout). + * @param string|null $persistent_id If set, a persistent connection will + * be made with this ID. + * @param int $retry_interval The number of milliseconds to wait + * between connection attempts. + * @param float $read_timeout The read timeout in seconds. + * Defaults to 0 (no timeout). + * @param array|null $context An optional stream context to use + * when connecting. + * See `\Redis::__construct()` for more + * details. + * @return bool Whether the connection was successful. + * + * @throws RedisException On connection errors. + * + * @example + * $redis = new \Redis; + * try { + * $redis->connect('localhost', 6379, 2.5, null, 100, 2.5); + * $foo = $redis->get('foo'); + * printf("foo: %s\n", $foo); + * } catch (Exception $ex) { + * fprintf(STDERR, "Error: {$ex->getMessage()}\n"); + * } + */ public function connect(string $host, int $port = 6379, float $timeout = 0, ?string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, ?array $context = null): bool; @@ -892,19 +1160,19 @@ public function connect(string $host, int $port = 6379, float $timeout = 0, ?str * * $redis = new Redis(['host' => 'localhost']); * - * @param string $src The key to copy - * @param string $dst The name of the new key created from the source key. - * @param array $options An array with modifiers on how COPY should operate. - * - * $options = [ - * 'REPLACE' => true|false # Whether to replace an existing key. - * 'DB' => int # Copy key to specific db. - * ]; - * + * @param string $src The key to copy + * @param string $dst The name of the new key created from the source key. + * @param array|null $options An array with modifiers on how COPY should operate. + * ```php + * $options = [ + * 'REPLACE' => true|false # Whether to replace an existing key. + * 'DB' => int # Copy key to specific db. + * ]; + * ``` * * @return Redis|bool True if the copy was completed and false if not. * - * @see https://redis.io/commands/copy + * @see https://redis.io/docs/latest/commands/copy/ * * @example * $redis->pipeline() @@ -925,9 +1193,9 @@ public function copy(string $src, string $dst, ?array $options = null): Redis|bo /** * Return the number of keys in the currently selected Redis database. * - * @see https://redis.io/commands/dbsize + * @see https://redis.io/docs/latest/commands/dbsize/ * - * @return Redis|int The number of keys or false on failure. + * @return Redis|int|false The number of keys or false on failure. * * @example * $redis = new Redis(['host' => 'localhost']); @@ -939,6 +1207,18 @@ public function copy(string $src, string $dst, ?array $options = null): Redis|bo */ public function dbSize(): Redis|int|false; + /** + * Execute the Redis `DEBUG` command. Note that this is disabled by default + * and can be very dangerous, even allowing you to crash the server. Use + * with caution + * + * @note The command has greatly increased in complexity since it was first + * added to PhpRedis, so you may need to use it via `Redis::rawCommand()` + * for certain subcommands. + * + * @param string $key The DEBUG subcommand to execute. + * @return Redis|string The result of the DEBUG command. + */ public function debug(string $key): Redis|string; /** @@ -952,8 +1232,8 @@ public function debug(string $key): Redis|string; * * @return Redis|int|false The new value of the key or false on failure. * - * @see https://redis.io/commands/decr - * @see https://redis.io/commands/decrby + * @see https://redis.io/docs/latest/commands/decr/ + * @see https://redis.io/docs/latest/commands/decrby/ * * @example $redis->decr('counter'); * @example $redis->decr('counter', 2); @@ -968,7 +1248,7 @@ public function decr(string $key, int $by = 1): Redis|int|false; * * @return Redis|int|false The new value of the key or false on failure. * - * @see https://redis.io/commands/decrby + * @see https://redis.io/docs/latest/commands/decrby/ * * @example $redis->decrby('counter', 1); * @example $redis->decrby('counter', 2); @@ -982,19 +1262,35 @@ public function decrBy(string $key, int $value): Redis|int|false; * of keys to delete, and the second is to pass N arguments, all names of keys. See * below for an example of both strategies. * - * @param array|string $key_or_keys Either an array with one or more key names or a string with - * the name of a key. - * @param string $other_keys One or more additional keys passed in a variadic fashion. + * @param array|string $key Either an array with one or more key names or a string with + * the name of a key. + * @param string ...$other_keys One or more additional keys passed in a variadic fashion. * * @return Redis|int|false The number of keys that were deleted * - * @see https://redis.io/commands/del + * @see https://redis.io/docs/latest/commands/del/ * * @example $redis->del('key:0', 'key:1'); * @example $redis->del(['key:2', 'key:3', 'key:4']); */ public function del(array|string $key, string ...$other_keys): Redis|int|false; + /** + * Delete a key conditionally based on its value or hash digest + * + * @param string $key The key to delete + * @param array|null $options An array with options to modify how DELX works. + * + * @return Redis|int|false Returns 1 if the key was deleted, 0 if it was not. + * + * @see https://redis.io/docs/latest/commands/delex/ + * + * @example + * $redis->delex('session:42'); + * + */ + public function delex(string $key, ?array $options = null): Redis|int|false; + /** * Delete a key if it's equal to the specified value. This command is * specific to Valkey >= 9.0 @@ -1002,12 +1298,24 @@ public function del(array|string $key, string ...$other_keys): Redis|int|false; * @param string $key The key to delete * @param mixed $value The value to compare against the key's value. * @return Redis|int|false Returns 1 if the key was deleted, 0 if it was not. + * + * @see https://valkey.io/commands/delifeq/ + * + * @example + * $redis->delifeq('session:42', 'token'); + * */ public function delifeq(string $key, mixed $value): Redis|int|false; /** * @deprecated * @alias Redis::del + * + * @see https://redis.io/docs/latest/commands/del/ + * + * @example + * $redis->delete('legacy:key'); + * */ public function delete(array|string $key, string ...$other_keys): Redis|int|false; @@ -1016,6 +1324,8 @@ public function delete(array|string $key, string ...$other_keys): Redis|int|fals * * @return Redis|bool True if we could discard the transaction. * + * @see https://redis.io/docs/latest/commands/discard/ + * * @example * $redis->getMode(); * $redis->set('foo', 'bar'); @@ -1027,15 +1337,11 @@ public function discard(): Redis|bool; /** * Dump Redis' internal binary representation of a key. * - * - * $redis->zRange('new-zset', 0, -1, true); - * - * * @param string $key The key to dump. * - * @return Redis|string A binary string representing the key's value. + * @return Redis|string|false A binary string representing the key's value. * - * @see https://redis.io/commands/dump + * @see https://redis.io/docs/latest/commands/dump/ * * @example * $redis->zadd('zset', 0, 'zero', 1, 'one', 2, 'two'); @@ -1051,7 +1357,7 @@ public function dump(string $key): Redis|string|false; * * @return Redis|string|false The string sent to Redis or false on failure. * - * @see https://redis.io/commands/echo + * @see https://redis.io/docs/latest/commands/echo/ * * @example $redis->echo('Hello, World'); */ @@ -1060,7 +1366,7 @@ public function echo(string $str): Redis|string|false; /** * Execute a LUA script on the redis server. * - * @see https://redis.io/commands/eval/ + * @see https://redis.io/docs/latest/commands/eval/ * * @param string $script A string containing the LUA script * @param array $args An array of arguments to pass to this script @@ -1070,6 +1376,10 @@ public function echo(string $str): Redis|string|false; * * @return mixed LUA scripts may return arbitrary data so this method can return * strings, arrays, nested arrays, etc. + * + * @example + * $redis->eval('return redis.call("set", KEYS[1], ARGV[1])', ['counter', 1], 1); + * */ public function eval(string $script, array $args = [], int $num_keys = 0): mixed; @@ -1078,6 +1388,11 @@ public function eval(string $script, array $args = [], int $num_keys = 0): mixed * may not modify data in redis. * * @see Redis::eval_ro() + * @see https://redis.io/docs/latest/commands/eval_ro/ + * + * @example + * $redis->eval_ro('return redis.call("get", KEYS[1])', ['counter'], 1); + * */ public function eval_ro(string $script_sha, array $args = [], int $num_keys = 0): mixed; @@ -1085,18 +1400,22 @@ public function eval_ro(string $script_sha, array $args = [], int $num_keys = 0) * Execute a LUA script on the server but instead of sending the script, send * the SHA1 hash of the script. * - * @param string $script_sha The SHA1 hash of the lua code. Note that the script - * must already exist on the server, either having been - * loaded with `SCRIPT LOAD` or having been executed directly - * with `EVAL` first. - * @param array $args Arguments to send to the script. - * @param int $num_keys The number of arguments that are keys + * @param string $sha1 The SHA1 hash of the lua code. Note that the script + * must already exist on the server, either having been + * loaded with `SCRIPT LOAD` or having been executed directly + * with `EVAL` first. + * @param array $args Arguments to send to the script. + * @param int $num_keys The number of arguments that are keys * * @return mixed Returns whatever the specific script does. * - * @see https://redis.io/commands/evalsha/ + * @see https://redis.io/docs/latest/commands/evalsha/ * @see Redis::eval(); * + * @example + * $sha = $redis->script('load', 'return redis.call("incr", KEYS[1])'); + * $redis->evalsha($sha, ['counter'], 1); + * */ public function evalsha(string $sha1, array $args = [], int $num_keys = 0): mixed; @@ -1105,6 +1424,12 @@ public function evalsha(string $sha1, array $args = [], int $num_keys = 0): mixe * may not modify data in redis. * * @see Redis::evalsha() + * @see https://redis.io/docs/latest/commands/evalsha_ro/ + * + * @example + * $sha = $redis->script('load', 'return redis.call("get", KEYS[1])'); + * $redis->evalsha_ro($sha, ['counter'], 1); + * */ public function evalsha_ro(string $sha1, array $args = [], int $num_keys = 0): mixed; @@ -1113,8 +1438,8 @@ public function evalsha_ro(string $sha1, array $args = [], int $num_keys = 0): m * * @return Redis|array|false The array of pipeline'd or multi replies or false on failure. * - * @see https://redis.io/commands/exec - * @see https://redis.io/commands/multi + * @see https://redis.io/docs/latest/commands/exec/ + * @see https://redis.io/docs/latest/commands/multi/ * @see Redis::pipeline() * @see Redis::multi() * @@ -1131,13 +1456,13 @@ public function exec(): Redis|array|false; /** * Test if one or more keys exist. * - * @param mixed $key Either an array of keys or a string key - * @param mixed $other_keys If the previous argument was a string, you may send any number of - * additional keys to test. + * @param mixed $key Either an array of keys or a string key + * @param mixed ...$other_keys If the previous argument was a string, you may send any number of + * additional keys to test. * * @return Redis|int|bool The number of keys that do exist and false on failure * - * @see https://redis.io/commands/exists + * @see https://redis.io/docs/latest/commands/exists/ * * @example $redis->exists(['k1', 'k2', 'k3']); * @example $redis->exists('k4', 'k5', 'notakey'); @@ -1161,7 +1486,10 @@ public function exists(mixed $key, mixed ...$other_keys): Redis|int|bool; *
    * * @return Redis|bool True if an expiration was set and false otherwise. - * @see https://redis.io/commands/expire + * @see https://redis.io/docs/latest/commands/expire/ + * + * @example + * $redis->expire('session:42', 60); * */ public function expire(string $key, int $timeout, ?string $mode = null): Redis|bool; @@ -1186,9 +1514,13 @@ public function expire(string $key, int $timeout, ?string $mode = null): Redis|b * @param string|null $mode An option 'mode' that modifies how the command acts (see {@link Redis::expire}). * @return Redis|bool True if an expiration was set, false if not. * - * @see https://redis.io/commands/expireat - * @see https://redis.io/commands/expire + * @see https://redis.io/docs/latest/commands/expireat/ + * @see https://redis.io/docs/latest/commands/expire/ * @see Redis::expire() + * + * @example + * $redis->expireAt('session:42', time() + 300); + * */ public function expireAt(string $key, int $timestamp, ?string $mode = null): Redis|bool; @@ -1202,7 +1534,7 @@ public function failover(?array $to = null, bool $abort = false, int $timeout = * @return Redis|int|false The timestamp when the key expires, or -1 if the key has no expiry * and -2 if the key doesn't exist. * - * @see https://redis.io/commands/expiretime + * @see https://redis.io/docs/latest/commands/expiretime/ * * @example * $redis->setEx('mykey', 60, 'myval'); @@ -1213,13 +1545,17 @@ public function expiretime(string $key): Redis|int|false; /** * Get the expiration timestamp of a given Redis key but in milliseconds. * - * @see https://redis.io/commands/pexpiretime + * @see https://redis.io/docs/latest/commands/pexpiretime/ * @see Redis::expiretime() * * @param string $key The key to check * * @return Redis|int|false The expiration timestamp of this key (in milliseconds) or -1 if the * key has no expiration, and -2 if it does not exist. + * + * @example + * $redis->pexpiretime('session:42'); + * */ public function pexpiretime(string $key): Redis|int|false; @@ -1233,7 +1569,11 @@ public function pexpiretime(string $key): Redis|int|false; * @return mixed Function may return arbitrary data so this method can return * strings, arrays, nested arrays, etc. * - * @see https://redis.io/commands/fcall + * @see https://redis.io/docs/latest/commands/fcall/ + * + * @example + * $redis->fcall('mylib.increment', ['counter'], [1]); + * */ public function fcall(string $fn, array $keys = [], array $args = []): mixed; @@ -1247,59 +1587,73 @@ public function fcall(string $fn, array $keys = [], array $args = []): mixed; * @return mixed Function may return arbitrary data so this method can return * strings, arrays, nested arrays, etc. * - * @see https://redis.io/commands/fcall_ro + * @see https://redis.io/docs/latest/commands/fcall_ro/ + * + * @example + * $redis->fcall_ro('mylib.peek', ['counter']); + * */ public function fcall_ro(string $fn, array $keys = [], array $args = []): mixed; /** * Deletes every key in all Redis databases * - * @param bool $sync Whether to perform the task in a blocking or non-blocking way. - * @return bool + * @param bool $sync Whether to perform the task in a blocking or non-blocking way. + * + * @see https://redis.io/docs/latest/commands/flushall/ + * + * @example + * $redis->flushAll(true); * - * @see https://redis.io/commands/flushall */ public function flushAll(?bool $sync = null): Redis|bool; /** * Deletes all the keys of the currently selected database. * - * @param bool $sync Whether to perform the task in a blocking or non-blocking way. - * @return bool + * @param bool $sync Whether to perform the task in a blocking or non-blocking way. + * + * @see https://redis.io/docs/latest/commands/flushdb/ + * + * @example + * $redis->flushDB(true); * - * @see https://redis.io/commands/flushdb */ public function flushDB(?bool $sync = null): Redis|bool; /** * Functions is an API for managing code to be executed on the server. * - * @param string $operation The subcommand you intend to execute. Valid options are as follows - * 'LOAD' - Create a new library with the given library name and code. - * 'DELETE' - Delete the given library. - * 'LIST' - Return general information on all the libraries - * 'STATS' - Return information about the current function running - * 'KILL' - Kill the current running function - * 'FLUSH' - Delete all the libraries - * 'DUMP' - Return a serialized payload representing the current libraries - * 'RESTORE' - Restore the libraries represented by the given payload - * @param member $args Additional arguments + * @param string $operation The subcommand you intend to execute. Valid options are as follows + * 'LOAD' - Create a new library with the given library name and code. + * 'DELETE' - Delete the given library. + * 'LIST' - Return general information on all the libraries + * 'STATS' - Return information about the current function running + * 'KILL' - Kill the current running function + * 'FLUSH' - Delete all the libraries + * 'DUMP' - Return a serialized payload representing the current libraries + * 'RESTORE' - Restore the libraries represented by the given payload + * @param mixed ...$args Additional arguments * * @return Redis|bool|string|array Depends on subcommand. * - * @see https://redis.io/commands/function + * @see https://redis.io/docs/latest/commands/function/ + * + * @example + * $redis->function('LIST'); + * */ public function function(string $operation, mixed ...$args): Redis|bool|string|array; /** * Add one or more members to a geospacial sorted set * - * @param string $key The sorted set to add data to. - * @param float $lng The longitude of the first member - * @param float $lat The latitude of the first member. - * @param member $other_triples_and_options You can continue to pass longitude, latitude, and member - * arguments to add as many members as you wish. Optionally, the final argument may be - * a string with options for the command @see Redis documentation for the options. + * @param string $key The sorted set to add data to. + * @param float $lng The longitude of the first member + * @param float $lat The latitude of the first member. + * @param mixed ...$other_triples_and_options You can continue to pass longitude, latitude, and member + * arguments to add as many members as you wish. Optionally, the final argument may be + * a string with options for the command @see Redis documentation for the options. * * @return Redis|int|false The number of added elements is returned. If the 'CH' option is specified, * the return value is the number of members *changed*. @@ -1307,7 +1661,7 @@ public function function(string $operation, mixed ...$args): Redis|bool|string|a * @example $redis->geoAdd('cities', -121.8374, 39.7284, 'Chico', -122.03218, 37.322, 'Cupertino'); * @example $redis->geoadd('cities', -121.837478, 39.728494, 'Chico', ['XX', 'CH']); * - * @see https://redis.io/commands/geoadd + * @see https://redis.io/docs/latest/commands/geoadd/ */ public function geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options): Redis|int|false; @@ -1315,36 +1669,36 @@ public function geoadd(string $key, float $lng, float $lat, string $member, mixe /** * Get the distance between two members of a geospacially encoded sorted set. * - * @param string $key The Sorted set to query. - * @param string $src The first member. - * @param string $dst The second member. - * @param string $unit Which unit to use when computing distance, defaulting to meters. - * - * M - meters - * KM - kilometers - * FT - feet - * MI - miles - * + * @param string $key The Sorted set to query. + * @param string $src The first member. + * @param string $dst The second member. + * @param string|null $unit Which unit to use when computing distance, defaulting to meters. + * + * M - meters + * KM - kilometers + * FT - feet + * MI - miles + * * * @return Redis|float|false The calculated distance in whichever units were specified or false * if one or both members did not exist. * * @example $redis->geodist('cities', 'Chico', 'Cupertino', 'mi'); * - * @see https://redis.io/commands/geodist + * @see https://redis.io/docs/latest/commands/geodist/ */ public function geodist(string $key, string $src, string $dst, ?string $unit = null): Redis|float|false; /** * Retrieve one or more GeoHash encoded strings for members of the set. * - * @param string $key The key to query - * @param string $member The first member to request - * @param string $other_members One or more additional members to request. + * @param string $key The key to query + * @param string $member The first member to request + * @param string ...$other_members One or more additional members to request. * * @return Redis|array|false An array of GeoHash encoded values. * - * @see https://redis.io/commands/geohash + * @see https://redis.io/docs/latest/commands/geohash/ * @see https://en.wikipedia.org/wiki/Geohash * * @example $redis->geohash('cities', 'Chico', 'Cupertino'); @@ -1354,13 +1708,13 @@ public function geohash(string $key, string $member, string ...$other_members): /** * Return the longitude and latitude for one or more members of a geospacially encoded sorted set. * - * @param string $key The set to query. - * @param string $member The first member to query. - * @param string $other_members One or more members to query. + * @param string $key The set to query. + * @param string $member The first member to query. + * @param string ...$other_members One or more members to query. * - * @return An array of longitude and latitude pairs. + * @return Redis|array|false An array of longitude and latitude pairs. * - * @see https://redis.io/commands/geopos + * @see https://redis.io/docs/latest/commands/geopos/ * * @example $redis->geopos('cities', 'Seattle', 'New York'); */ @@ -1376,7 +1730,7 @@ public function geopos(string $key, string $member, string ...$other_members): R * @param string $unit The unit of the provided radius (defaults to 'meters). * See {@link Redis::geodist} for possible units. * @param array $options An array of options that modifies how the command behaves. - * + * ```php * $options = [ * 'WITHCOORD', # Return members and their coordinates. * 'WITHDIST', # Return members and their distances from the center. @@ -1393,11 +1747,11 @@ public function geopos(string $key, string $member, string ...$other_members): R * # Store the distances in the specified key * 'STOREDIST' => * ]; - * + * ``` * * @return mixed This command can return various things, depending on the options passed. * - * @see https://redis.io/commands/georadius + * @see https://redis.io/docs/latest/commands/georadius/ * * @example $redis->georadius('cities', 47.608013, -122.335167, 1000, 'km'); */ @@ -1407,6 +1761,11 @@ public function georadius(string $key, float $lng, float $lat, float $radius, st * A readonly variant of `GEORADIUS` that may be executed on replicas. * * @see Redis::georadius + * @see https://redis.io/docs/latest/commands/georadius_ro/ + * + * @example + * $redis->georadius_ro('cities', -122.335167, 47.608013, 100, 'km'); + * */ public function georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed; @@ -1423,12 +1782,20 @@ public function georadius_ro(string $key, float $lng, float $lat, float $radius, * * @return mixed This command can return various things depending on options. * + * @see https://redis.io/docs/latest/commands/georadiusbymember/ + * * @example $redis->georadiusbymember('cities', 'Seattle', 200, 'mi'); */ public function georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []): mixed; /** * This is the read-only variant of `GEORADIUSBYMEMBER` that can be run on replicas. + * + * @see https://redis.io/docs/latest/commands/georadiusbymember_ro/ + * + * @example + * $redis->georadiusbymember_ro('cities', 'Seattle', 200, 'mi'); + * */ public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): mixed; @@ -1444,6 +1811,12 @@ public function georadiusbymember_ro(string $key, string $member, float $radius, * @param string $unit The unit of our shape. See {@link Redis::geodist} for possible units. * @param array $options @see {@link Redis::georadius} for options. Note that the `STORE` * options are not allowed for this command. + * + * @see https://redis.io/docs/latest/commands/geosearch/ + * + * @example + * $redis->geosearch('cities', 'Seattle', 50, 'km', ['WITHDIST']); + * */ public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array; @@ -1460,7 +1833,7 @@ public function geosearch(string $key, array|string $position, array|int|float $ * to search. * @param string $unit The unit of our shape. See {@link Redis::geodist} for possible units. * @param array $options - * + * ```php * $options = [ * 'ASC' | 'DESC', # The sort order of returned members * 'WITHDIST' # Also store distances. @@ -1469,7 +1842,13 @@ public function geosearch(string $key, array|string $position, array|int|float $ * # passed as the `LIMIT` argument, and the `ANY` argument. * 'COUNT' => [], or [, ] * ]; - * + * ``` + * + * @see https://redis.io/docs/latest/commands/geosearchstore/ + * + * @example + * $redis->geosearchstore('west:cities', 'cities', 'Seattle', 50, 'km', ['DESC']); + * */ public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): Redis|array|int|false; @@ -1479,7 +1858,7 @@ public function geosearchstore(string $dst, string $src, array|string $position, * @param string $key The key to query * @return mixed The keys value or false if it did not exist. * - * @see https://redis.io/commands/get + * @see https://redis.io/docs/latest/commands/get/ * * @example $redis->get('foo'); */ @@ -1501,6 +1880,10 @@ public function getWithMeta(string $key): Redis|array|false; * @return mixed The authentication information used to authenticate the connection. * * @see Redis::auth() + * + * @example + * $redis->getAuth(); + * */ public function getAuth(): mixed; @@ -1512,7 +1895,7 @@ public function getAuth(): mixed; * * @example $redis->getbit('bitmap', 1337); * - * @see https://redis.io/commands/getbit + * @see https://redis.io/docs/latest/commands/getbit/ */ public function getBit(string $key, int $idx): Redis|int|false; @@ -1521,7 +1904,7 @@ public function getBit(string $key, int $idx): Redis|int|false; * * @param string $key The key to query * @param array $options Options to modify how the command works. - * + * ```php * $options = [ * 'EX' => # Expire in N seconds * 'PX' => # Expire in N milliseconds @@ -1529,11 +1912,11 @@ public function getBit(string $key, int $idx): Redis|int|false; * 'PXAT' => # Expire at a unix timestamp (in milliseconds); * 'PERSIST' # Remove any configured expiration on the key. * ]; - * + * ``` * * @return Redis|string|bool The key's value or false if it didn't exist. * - * @see https://redis.io/commands/getex + * @see https://redis.io/docs/latest/commands/getex/ * * @example $redis->getEx('mykey', ['EX' => 60]); */ @@ -1544,10 +1927,14 @@ public function getEx(string $key, array $options = []): Redis|string|bool; * * This value is updated internally in PhpRedis each time {@link Redis::select} is called. * - * @return The database we're connected to. + * @return int The database we're connected to. * * @see Redis::select() - * @see https://redis.io/commands/select + * @see https://redis.io/docs/latest/commands/select/ + * + * @example + * $redis->getDBNum(); + * */ public function getDBNum(): int; @@ -1557,7 +1944,7 @@ public function getDBNum(): int; * @param string $key The key to get/delete. * @return Redis|string|bool The value of the key or false if it didn't exist. * - * @see https://redis.io/commands/getdel + * @see https://redis.io/docs/latest/commands/getdel/ * * @example $redis->getdel('token:123'); */ @@ -1567,21 +1954,32 @@ public function getDel(string $key): Redis|string|bool; * Return the host or Unix socket we are connected to. * * @return string The host or Unix socket. + * + * @example + * $redis->getHost(); + * */ public function getHost(): string; /** * Get the last error returned to us from Redis, if any. * - * @return string The error string or NULL if there is none. + * @return string|null The error string or NULL if there is none. + * + * @example + * $redis->getLastError(); + * */ - public function getLastError(): ?string; + public function getLastError(): string|null; /** * Returns whether the connection is in ATOMIC, MULTI, or PIPELINE mode * * @return int The mode we're in. * + * @example + * $redis->getMode(); + * */ public function getMode(): int; @@ -1591,20 +1989,32 @@ public function getMode(): int; * @see Redis::setOption() for a detailed list of options and their values. * * @return mixed The setting itself or false on failure + * + * @example + * $redis->getOption(Redis::OPT_PREFIX); + * */ public function getOption(int $option): mixed; /** * Get the persistent connection ID, if there is one. * - * @return string The ID or NULL if we don't have one. + * @return string|null The ID or NULL if we don't have one. + * + * @example + * $redis->getPersistentID(); + * */ - public function getPersistentID(): ?string; + public function getPersistentID(): string|null; /** * Get the port we are connected to. This number will be zero if we are connected to a unix socket. * * @return int The port. + * + * @example + * $redis->getPort(); + * */ public function getPort(): int; @@ -1612,6 +2022,10 @@ public function getPort(): int; * Get the server name as reported by the `HELLO` response. * * @return string|false + * + * @example + * $redis->serverName(); + * */ public function serverName(): string|false; @@ -1619,6 +2033,10 @@ public function serverName(): string|false; * Get the server version as reported by the `HELLO` response. * * @return string|false + * + * @example + * $redis->serverVersion(); + * */ public function serverVersion(): string|false; @@ -1631,7 +2049,7 @@ public function serverVersion(): string|false; * * @return Redis|string|false The substring or false on failure. * - * @see https://redis.io/commands/getrange + * @see https://redis.io/docs/latest/commands/getrange/ * * @example * $redis->set('silly-word', 'Supercalifragilisticexpialidocious'); @@ -1642,28 +2060,28 @@ public function getRange(string $key, int $start, int $end): Redis|string|false; /** * Get the longest common subsequence between two string keys. * - * @param string $key1 The first key to check - * @param string $key2 The second key to check - * @param array $options An optional array of modifiers for the command. + * @param string $key1 The first key to check + * @param string $key2 The second key to check + * @param array|null $options An optional array of modifiers for the command. * - * - * $options = [ - * 'MINMATCHLEN' => int # Exclude matching substrings that are less than this value + * ```php + * $options = [ + * 'MINMATCHLEN' => int # Exclude matching substrings that are less than this value * - * 'WITHMATCHLEN' => bool # Whether each match should also include its length. + * 'WITHMATCHLEN' => bool # Whether each match should also include its length. * - * 'LEN' # Return the length of the longest subsequence + * 'LEN' # Return the length of the longest subsequence * - * 'IDX' # Each returned match will include the indexes where the - * # match occurs in each string. - * ]; - * + * 'IDX' # Each returned match will include the indexes where the + * # match occurs in each string. + * ]; + * ``` * - * NOTE: 'LEN' cannot be used with 'IDX'. + * NOTE: 'LEN' cannot be used with 'IDX'. * * @return Redis|string|array|int|false Various reply types depending on options. * - * @see https://redis.io/commands/lcs + * @see https://redis.io/docs/latest/commands/lcs/ * * @example * $redis->set('seq1', 'gtaggcccgcacggtctttaatgtatccctgtttaccatgccatacctgagcgcatacgc'); @@ -1676,6 +2094,10 @@ public function lcs(string $key1, string $key2, ?array $options = null): Redis|s * Get the currently set read timeout on the connection. * * @return float The timeout. + * + * @example + * $redis->getReadTimeout(); + * */ public function getReadTimeout(): float; @@ -1687,7 +2109,7 @@ public function getReadTimeout(): float; * * @return Redis|string|false The old value of the key or false if it didn't exist. * - * @see https://redis.io/commands/getset + * @see https://redis.io/docs/latest/commands/getset/ * * @example * $redis->getset('captain', 'Pike'); @@ -1698,7 +2120,11 @@ public function getset(string $key, mixed $value): Redis|string|false; /** * Retrieve any set connection timeout * - * @return float The currently set timeout or false on failure (e.g. we aren't connected). + * @return float|false The currently set timeout or false on failure (e.g. we aren't connected). + * + * @example + * $redis->getTimeout(); + * */ public function getTimeout(): float|false; @@ -1706,6 +2132,10 @@ public function getTimeout(): float|false; * Get the number of bytes sent and received on the socket. * * @return array An array in the form [$sent_bytes, $received_bytes] + * + * @example + * $redis->getTransferredBytes(); + * */ public function getTransferredBytes(): array; @@ -1713,19 +2143,23 @@ public function getTransferredBytes(): array; * Reset the number of bytes sent and received on the socket. * * @return void + * + * @example + * $redis->clearTransferredBytes(); + * */ public function clearTransferredBytes(): void; /** * Remove one or more fields from a hash. * - * @param string $key The hash key in question. - * @param string $field The first field to remove - * @param string $other_fields One or more additional fields to remove. + * @param string $key The hash key in question. + * @param string $field The first field to remove + * @param string ...$other_fields One or more additional fields to remove. * * @return Redis|int|false The number of fields actually removed. * - * @see https://redis.io/commands/hdel + * @see https://redis.io/docs/latest/commands/hdel/ * * @example $redis->hDel('communication', 'Alice', 'Bob'); */ @@ -1739,7 +2173,7 @@ public function hDel(string $key, string $field, string ...$other_fields): Redis * * @return Redis|bool True if it exists, false if not. * - * @see https://redis.io/commands/hexists + * @see https://redis.io/docs/latest/commands/hexists/ * * @example $redis->hExists('communication', 'Alice'); */ @@ -1753,9 +2187,10 @@ public function hGet(string $key, string $member): mixed; * @param string $key The hash to query. * @return Redis|array|false All fields and values or false if the key didn't exist. * - * @see https://redis.io/commands/hgetall + * @see https://redis.io/docs/latest/commands/hgetall/ * - * @example $redis->hgetall('myhash'); + * @example + * $redis->hgetall('myhash'); */ public function hGetAll(string $key): Redis|array|false; @@ -1779,7 +2214,7 @@ public function hGetWithMeta(string $key, string $member): mixed; * * @return Redis|int|false The new value of the field. * - * @see https://redis.io/commands/hincrby + * @see https://redis.io/docs/latest/commands/hincrby/ * * @example * $redis->hMSet('player:1', ['name' => 'Alice', 'score' => 0]); @@ -1796,7 +2231,7 @@ public function hIncrBy(string $key, string $field, int $value): Redis|int|false * * @return Redis|float|false The field value after incremented. * - * @see https://redis.io/commands/hincrbyfloat + * @see https://redis.io/docs/latest/commands/hincrbyfloat/ * * @example * $redis->hincrbyfloat('numbers', 'tau', 2 * 3.1415926); @@ -1810,7 +2245,7 @@ public function hIncrByFloat(string $key, string $field, float $value): Redis|fl * * @return Redis|list|false The fields in the hash or false if the hash doesn't exist. * - * @see https://redis.io/commands/hkeys + * @see https://redis.io/docs/latest/commands/hkeys/ * * @example $redis->hkeys('myhash'); */ @@ -1819,7 +2254,7 @@ public function hKeys(string $key): Redis|array|false; /** * Get the number of fields in a hash. * - * @see https://redis.io/commands/hlen + * @see https://redis.io/docs/latest/commands/hlen/ * * @param string $key The hash to check. * @@ -1837,7 +2272,7 @@ public function hLen(string $key): Redis|int|false; * * @return Redis|array|false The fields and values or false if the key didn't exist. * - * @see https://redis.io/commands/hmget + * @see https://redis.io/docs/latest/commands/hmget/ * * @example $redis->hMGet('player:1', ['name', 'score']); */ @@ -1847,11 +2282,17 @@ public function hMget(string $key, array $fields): Redis|array|false; * Get one or more fields of a hash while optionally setting expiration * information * - * @param string $key The hash to query. - * @param array $fields One or more fields to query in the hash. - * @param string|array $expiry Info about the expiration + * @param string $key The hash to query. + * @param array $fields One or more fields to query in the hash. + * @param string|array|null $expiry Info about the expiration * * @return Redis|array|false The fields and values or false if the key didn't exist. + * + * @see https://redis.io/docs/latest/commands/hgetex/ + * + * @example + * $redis->hgetex('profiles', ['name', 'email'], ['EX' => 60]); + * */ public function hgetex(string $key, array $fields, string|array|null $expiry = null): Redis|array|false; @@ -1863,6 +2304,12 @@ public function hgetex(string $key, array $fields, string|array|null $expiry = n * @param array|null $expiry Info about the expiration * * @return Redis|int|false One if fields were set zero if not. + * + * @see https://redis.io/docs/latest/commands/hsetex/ + * + * @example + * $redis->hsetex('profiles', ['token' => 'abc123'], ['EX' => 60]); + * */ public function hsetex(string $key, array $fields, ?array $expiry = null): Redis|int|false; @@ -1873,6 +2320,12 @@ public function hsetex(string $key, array $fields, ?array $expiry = null): Redis * @param array $fields One or more fields * * @return Redis|array|false The field and values or false on failure + * + * @see https://redis.io/docs/latest/commands/hgetdel/ + * + * @example + * $redis->hgetdel('profiles', ['token']); + * */ public function hgetdel(string $key, array $fields): Redis|array|false; @@ -1884,7 +2337,7 @@ public function hgetdel(string $key, array $fields): Redis|array|false; * * @return Redis|bool True if the operation was successful * - * @see https://redis.io/commands/hmset + * @see https://redis.io/docs/latest/commands/hmset/ * * @example $redis->hmset('updates', ['status' => 'starting', 'elapsed' => 0]); */ @@ -1893,19 +2346,19 @@ public function hMset(string $key, array $fieldvals): Redis|bool; /** * Get one or more random field from a hash. * - * @param string $key The hash to query. - * @param array $options An array of options to modify how the command behaves. + * @param string $key The hash to query. + * @param array|null $options An array of options to modify how the command behaves. * - * - * $options = [ - * 'COUNT' => int # An optional number of fields to return. - * 'WITHVALUES' => bool # Also return the field values. - * ]; - * + * ```php + * $options = [ + * 'COUNT' => int # An optional number of fields to return. + * 'WITHVALUES' => bool # Also return the field values. + * ]; + * ``` * - * @return Redis|array|string One or more random fields (and possibly values). + * @return Redis|string|array|false One or more random fields (and possibly values). * - * @see https://redis.io/commands/hrandfield + * @see https://redis.io/docs/latest/commands/hrandfield/ * * @example $redis->hrandfield('settings'); * @example $redis->hrandfield('settings', ['count' => 2, 'withvalues' => true]); @@ -1915,13 +2368,13 @@ public function hRandField(string $key, ?array $options = null): Redis|string|ar /** * Add or update one or more hash fields and values. * - * @param string $key The hash to create/update. - * @param mixed $fields_and_vals Argument pairs of fields and values. Alternatively, an associative array with the - * fields and their values. + * @param string $key The hash to create/update. + * @param mixed ...$fields_and_vals Argument pairs of fields and values. Alternatively, an associative array with the + * fields and their values. * * @return Redis|int|false The number of fields that were added, or false on failure. * - * @see https://redis.io/commands/hset/ + * @see https://redis.io/docs/latest/commands/hset/ * * @example $redis->hSet('player:1', 'name', 'Kim', 'score', 78); * @example $redis->hSet('player:1', ['name' => 'Kim', 'score' => 78]); @@ -1936,7 +2389,7 @@ public function hSet(string $key, mixed ...$fields_and_vals): Redis|int|false; * * @return Redis|bool True if the field was set and false if not. * - * @see https://redis.io/commands/hsetnx + * @see https://redis.io/docs/latest/commands/hsetnx/ * * @example * $redis->hsetnx('player:1', 'lock', 'enabled'); @@ -1958,7 +2411,7 @@ public function hSetNx(string $key, string $field, mixed $value): Redis|bool; * $redis->hmset('hash', ['50bytes' => str_repeat('a', 50)]); * $redis->hstrlen('hash', '50bytes'); * - * @see https://redis.io/commands/hstrlen + * @see https://redis.io/docs/latest/commands/hstrlen/ */ public function hStrLen(string $key, string $field): Redis|int|false; @@ -1969,7 +2422,7 @@ public function hStrLen(string $key, string $field): Redis|int|false; * * @return Redis|list|false The values from the hash. * - * @see https://redis.io/commands/hvals + * @see https://redis.io/docs/latest/commands/hvals/ * * @example $redis->hvals('player:1'); */ @@ -1978,13 +2431,18 @@ public function hVals(string $key): Redis|array|false; /** * Set the expiration on one or more fields in a hash. * - * @param string $key The hash to update. - * @param int $ttl The time to live in seconds. - * @param array $fields The fields to set the expiration on. - * @param string|null $option An optional mode (NX, XX, ETC) + * @param string $key The hash to update. + * @param int $ttl The time to live in seconds. + * @param array $fields The fields to set the expiration on. + * @param string|null $mode An optional mode (NX, XX, ETC) + * * @return Redis|array|false * - * @see https://redis.io/commands/hexpire + * @see https://redis.io/docs/latest/commands/hexpire/ + * + * @example + * $redis->hexpire('profiles', 300, ['token'], 'NX'); + * */ public function hexpire(string $key, int $ttl, array $fields, ?string $mode = NULL): Redis|array|false; @@ -1992,13 +2450,18 @@ public function hexpire(string $key, int $ttl, array $fields, /** * Set the expiration on one or more fields in a hash in milliseconds. * - * @param string $key The hash to update. - * @param int $ttl The time to live in milliseconds. - * @param array $fields The fields to set the expiration on. - * @param string|null $option An optional mode (NX, XX, ETC) + * @param string $key The hash to update. + * @param int $ttl The time to live in milliseconds. + * @param array $fields The fields to set the expiration on. + * @param string|null $mode An optional mode (NX, XX, ETC) + * * @return Redis|array|false * - * @see https://redis.io/commands/hexpire + * @see https://redis.io/docs/latest/commands/hexpire/ + * + * @example + * $redis->hpexpire('profiles', 1500, ['token']); + * */ public function hpexpire(string $key, int $ttl, array $fields, ?string $mode = NULL): Redis|array|false; @@ -2006,13 +2469,18 @@ public function hpexpire(string $key, int $ttl, array $fields, /** * Set the expiration time on one or more fields of a hash. * - * @param string $key The hash to update. - * @param int $time The time to live in seconds. - * @param array $fields The fields to set the expiration on. - * @param string|null $option An optional mode (NX, XX, ETC) + * @param string $key The hash to update. + * @param int $time The time to live in seconds. + * @param array $fields The fields to set the expiration on. + * @param string|null $mode An optional mode (NX, XX, ETC) + * * @return Redis|array|false * - * @see https://redis.io/commands/hexpire + * @see https://redis.io/docs/latest/commands/hexpire/ + * + * @example + * $redis->hexpireat('profiles', time() + 600, ['token']); + * */ public function hexpireat(string $key, int $time, array $fields, ?string $mode = NULL): Redis|array|false; @@ -2020,13 +2488,18 @@ public function hexpireat(string $key, int $time, array $fields, /** * Set the expiration time on one or more fields of a hash in milliseconds. * - * @param string $key The hash to update. - * @param int $mstime The time to live in milliseconds. - * @param array $fields The fields to set the expiration on. - * @param string|null $option An optional mode (NX, XX, ETC) + * @param string $key The hash to update. + * @param int $mstime The time to live in milliseconds. + * @param array $fields The fields to set the expiration on. + * @param string|null $mode An optional mode (NX, XX, ETC) + * * @return Redis|array|false * - * @see https://redis.io/commands/hexpire + * @see https://redis.io/docs/latest/commands/hexpire/ + * + * @example + * $redis->hpexpireat('profiles', (int) (microtime(true) * 1000) + 60000, ['token']); + * */ public function hpexpireat(string $key, int $mstime, array $fields, ?string $mode = NULL): Redis|array|false; @@ -2039,7 +2512,11 @@ public function hpexpireat(string $key, int $mstime, array $fields, * * @return Redis|array|false * - * @see https://redis.io/commands/httl + * @see https://redis.io/docs/latest/commands/httl/ + * + * @example + * $redis->httl('profiles', ['token']); + * */ public function httl(string $key, array $fields): Redis|array|false; @@ -2051,7 +2528,11 @@ public function httl(string $key, array $fields): Redis|array|false; * * @return Redis|array|false * - * @see https://redis.io/commands/hpttl + * @see https://redis.io/docs/latest/commands/hpttl/ + * + * @example + * $redis->hpttl('profiles', ['token']); + * */ public function hpttl(string $key, array $fields): Redis|array|false; @@ -2063,7 +2544,11 @@ public function hpttl(string $key, array $fields): Redis|array|false; * * @return Redis|array|false * - * @see https://redis.io/commands/hexpiretime + * @see https://redis.io/docs/latest/commands/hexpiretime/ + * + * @example + * $redis->hexpiretime('profiles', ['token']); + * */ public function hexpiretime(string $key, array $fields): Redis|array|false; @@ -2075,7 +2560,11 @@ public function hexpiretime(string $key, array $fields): Redis|array|false; * * @return Redis|array|false * - * @see https://redis.io/commands/hpexpiretime + * @see https://redis.io/docs/latest/commands/hpexpiretime/ + * + * @example + * $redis->hpexpiretime('profiles', ['token']); + * */ public function hpexpiretime(string $key, array $fields): Redis|array|false; @@ -2087,22 +2576,26 @@ public function hpexpiretime(string $key, array $fields): Redis|array|false; * * @return Redis|array|false * - * @see https://redis.io/commands/hpersist + * @see https://redis.io/docs/latest/commands/hpersist/ + * + * @example + * $redis->hpersist('profiles', ['token']); + * */ public function hpersist(string $key, array $fields): Redis|array|false; /** * Iterate over the fields and values of a hash in an incremental fashion. * - * @see https://redis.io/commands/hscan - * @see https://redis.io/commands/scan + * @see https://redis.io/docs/latest/commands/hscan/ + * @see https://redis.io/docs/latest/commands/scan/ * - * @param string $key The hash to query. - * @param int $iterator The scan iterator, which should be initialized to NULL before the first call. - * This value will be updated after every call to hscan, until it reaches zero - * meaning the scan is complete. - * @param string|null $pattern An optional glob-style pattern to filter fields with. - * @param int $count An optional hint to Redis about how many fields and values to return per HSCAN. + * @param string $key The hash to query. + * @param int|string|null $iterator The scan iterator, which should be initialized to NULL before the first call. + * This value will be updated after every call to hscan, until it reaches zero + * meaning the scan is complete. + * @param string|null $pattern An optional glob-style pattern to filter fields with. + * @param int $count An optional hint to Redis about how many fields and values to return per HSCAN. * * @return Redis|array|bool An array with a subset of fields and values. * @@ -2134,10 +2627,15 @@ public function hscan(string $key, null|int|string &$iterator, ?string $pattern * Set an expiration on a key member (KeyDB only). * * @see https://docs.keydb.dev/docs/commands/#expiremember + * @see https://redis.io/docs/latest/commands/expiremember/ * * @param string $key The key to expire * @param string $field The field to expire * @param string|null $unit The unit of the ttl (s, or ms). + * + * @example + * $redis->expiremember('profiles', 'token', 60); + * */ public function expiremember(string $key, string $field, int $ttl, ?string $unit = null): Redis|int|false; @@ -2145,18 +2643,23 @@ public function expiremember(string $key, string $field, int $ttl, ?string $unit * Set an expiration on a key membert to a specific unix timestamp (KeyDB only). * * @see https://docs.keydb.dev/docs/commands/#expirememberat + * @see https://redis.io/docs/latest/commands/expirememberat/ * * @param string $key The key to expire * @param string $field The field to expire * @param int $timestamp The unix timestamp to expire at. + * + * @example + * $redis->expirememberat('profiles', 'token', time() + 300); + * */ public function expirememberat(string $key, string $field, int $timestamp): Redis|int|false; /** * Increment a key's value, optionally by a specific amount. * - * @see https://redis.io/commands/incr - * @see https://redis.io/commands/incrby + * @see https://redis.io/docs/latest/commands/incr/ + * @see https://redis.io/docs/latest/commands/incrby/ * * @param string $key The key to increment * @param int $by An optional amount to increment by. @@ -2171,7 +2674,7 @@ public function incr(string $key, int $by = 1): Redis|int|false; /** * Increment a key by a specific integer value * - * @see https://redis.io/commands/incrby + * @see https://redis.io/docs/latest/commands/incrby/ * * @param string $key The key to increment. * @param int $value The amount to increment. @@ -2188,11 +2691,13 @@ public function incrBy(string $key, int $value): Redis|int|false; /** * Increment a numeric key by a floating point value. * - * @param string $key The key to increment - * @param floag $value How much to increment (or decrement) the value. + * @param string $key The key to increment + * @param float $value How much to increment (or decrement) the value. * * @return Redis|float|false The new value of the key or false if the key didn't contain a string. * + * @see https://redis.io/docs/latest/commands/incrbyfloat/ + * * @example * $redis->incrbyfloat('tau', 3.1415926); * $redis->incrbyfloat('tau', 3.1415926); @@ -2207,11 +2712,15 @@ public function incrByFloat(string $key, float $value): Redis|float|false; * * If connected to Redis server >= 7.0.0 you may pass multiple optional sections. * - * @see https://redis.io/commands/info/ + * @see https://redis.io/docs/latest/commands/info/ * - * @param string $sections Optional section(s) you wish Redis server to return. + * @param string ...$sections Optional section(s) you wish Redis server to return. * * @return Redis|array|false + * + * @example + * $redis->info('server', 'stats'); + * */ public function info(string ...$sections): Redis|array|false; @@ -2219,18 +2728,33 @@ public function info(string ...$sections): Redis|array|false; * Check if we are currently connected to a Redis instance. * * @return bool True if we are, false if not + * + * @example + * $redis->isConnected(); + * */ public function isConnected(): bool; /** * @param string $pattern * @return Redis|list|false + * + * @see https://redis.io/docs/latest/commands/keys/ + * + * @example + * $redis->keys('session:*'); + * */ public function keys(string $pattern); /** - * @param mixed $elements * @return Redis|int|false + * + * @see https://redis.io/docs/latest/commands/linsert/ + * + * @example + * $redis->lInsert('letters', Redis::AFTER, 'b', 'beta'); + * */ public function lInsert(string $key, string $pos, mixed $pivot, mixed $value); @@ -2240,6 +2764,12 @@ public function lInsert(string $key, string $pos, mixed $pivot, mixed $value); * @param string $key The list * * @return Redis|int|false The number of elements in the list or false on failure. + * + * @see https://redis.io/docs/latest/commands/llen/ + * + * @example + * $redis->lLen('queue'); + * */ public function lLen(string $key): Redis|int|false; @@ -2254,6 +2784,8 @@ public function lLen(string $key): Redis|int|false; * - `Redis::LEFT`, or `Redis::RIGHT`. * @return Redis|string|false The element removed from the source list. * + * @see https://redis.io/docs/latest/commands/lmove/ + * * @example * $redis->rPush('numbers', 'one', 'two', 'three'); * $redis->lMove('numbers', 'odds', Redis::LEFT, Redis::LEFT); @@ -2273,6 +2805,8 @@ public function lMove(string $src, string $dst, string $wherefrom, string $where * * @return Redis|string|false; * + * @see https://redis.io/docs/latest/commands/blmove/ + * * @example * @redis->lPush('numbers', 'one'); * @redis->blmove('numbers', 'odds', Redis::LEFT, Redis::LEFT 1.0); @@ -2286,10 +2820,11 @@ public function blmove(string $src, string $dst, string $wherefrom, string $wher * * @param string $key The list to pop from. * @param int $count Optional number of elements to remove. By default one element is popped. - * @return Redis|null|bool|int|array Will return the element(s) popped from the list or false/NULL - * if none was removed. * - * @see https://redis.io/commands/lpop + * @return Redis|bool|string|array Will return the element(s) popped from the list or false/NULL + * if none was removed. + * + * @see https://redis.io/docs/latest/commands/lpop/ * * @example $redis->lpop('mylist'); * @example $redis->lpop('mylist', 4); @@ -2299,40 +2834,46 @@ public function lPop(string $key, int $count = 0): Redis|bool|string|array; /** * Retrieve the index of an element in a list. * - * @param string $key The list to query. - * @param mixed $value The value to search for. - * @param array $options Options to configure how the command operates - * - * $options = [ - * # How many matches to return. By default a single match is returned. - * # If count is set to zero, it means unlimited. - * 'COUNT' => - * - * # Specify which match you want returned. `RANK` 1 means "the first match" - * # 2 means the second, and so on. If passed as a negative number the - * # RANK is computed right to left, so a `RANK` of -1 means "the last match". - * 'RANK' => - * - * # This argument allows you to limit how many elements Redis will search before - * # returning. This is useful to prevent Redis searching very long lists while - * # blocking the client. - * 'MAXLEN => - * ]; - * + * @param string $key The list to query. + * @param mixed $value The value to search for. + * @param array|null $options Options to configure how the command operates + * ```php + * $options = [ + * # How many matches to return. By default a single match is returned. + * # If count is set to zero, it means unlimited. + * 'COUNT' => + * + * # Specify which match you want returned. `RANK` 1 means "the first match" + * # 2 means the second, and so on. If passed as a negative number the + * # RANK is computed right to left, so a `RANK` of -1 means "the last match". + * 'RANK' => + * + * # This argument allows you to limit how many elements Redis will search before + * # returning. This is useful to prevent Redis searching very long lists while + * # blocking the client. + * 'MAXLEN => + * ]; + * ``` * * @return Redis|null|bool|int|array Returns one or more of the matching indexes, or null/false if none were found. + * + * @see https://redis.io/docs/latest/commands/lpos/ + * + * @example + * $redis->lPos('queue', 'job-42'); + * */ public function lPos(string $key, mixed $value, ?array $options = null): Redis|null|bool|int|array; /** * Prepend one or more elements to a list. * - * @param string $key The list to prepend. - * @param mixed $elements One or more elements to prepend. + * @param string $key The list to prepend. + * @param mixed ...$elements One or more elements to prepend. * - * @return Redis|int The new length of the list after prepending. + * @return Redis|int|false The new length of the list after prepending. * - * @see https://redis.io/commands/lpush + * @see https://redis.io/docs/latest/commands/lpush/ * * @example $redis->lPush('mylist', 'cat', 'bear', 'aligator'); */ @@ -2341,12 +2882,12 @@ public function lPush(string $key, mixed ...$elements): Redis|int|false; /** * Append one or more elements to a list. * - * @param string $key The list to append to. - * @param mixed $elements one or more elements to append. + * @param string $key The list to append to. + * @param mixed ...$elements one or more elements to append. * * @return Redis|int|false The new length of the list * - * @see https://redis.io/commands/rpush + * @see https://redis.io/docs/latest/commands/rpush/ * * @example $redis->rPush('mylist', 'xray', 'yankee', 'zebra'); */ @@ -2360,6 +2901,11 @@ public function rPush(string $key, mixed ...$elements): Redis|int|false; * * @return Redis|int|false The new length of the list. * + * @see https://redis.io/docs/latest/commands/lpushx/ + * + * @example + * $redis->lPushx('queue', 'job-42'); + * */ public function lPushx(string $key, mixed $value): Redis|int|false; @@ -2371,6 +2917,11 @@ public function lPushx(string $key, mixed $value): Redis|int|false; * * @return Redis|int|false The new length of the list. * + * @see https://redis.io/docs/latest/commands/rpushx/ + * + * @example + * $redis->rPushx('queue', 'job-99'); + * */ public function rPushx(string $key, mixed $value): Redis|int|false; @@ -2383,7 +2934,11 @@ public function rPushx(string $key, mixed $value): Redis|int|false; * * @return Redis|bool True if the list was modified. * - * @see https://redis.io/commands/lset + * @see https://redis.io/docs/latest/commands/lset/ + * + * @example + * $redis->lSet('queue', 0, 'job-42'); + * */ public function lSet(string $key, int $index, mixed $value): Redis|bool; @@ -2392,7 +2947,11 @@ public function lSet(string $key, int $index, mixed $value): Redis|bool; * * @return int The unix timestamp of the last save time * - * @see https://redis.io/commands/lastsave + * @see https://redis.io/docs/latest/commands/lastsave/ + * + * @example + * $redis->lastSave(); + * */ public function lastSave(): int; @@ -2402,6 +2961,12 @@ public function lastSave(): int; * @param string $key The key to query * @param int $index The index to check. * @return mixed The index or NULL/false if the element was not found. + * + * @see https://redis.io/docs/latest/commands/lindex/ + * + * @example + * $redis->lindex('queue', 0); + * */ public function lindex(string $key, int $index): mixed; @@ -2416,6 +2981,8 @@ public function lindex(string $key, int $index): mixed; * * @return Redis|array|false The range of elements between the indexes. * + * @see https://redis.io/docs/latest/commands/lrange/ + * * @example $redis->lrange('mylist', 0, -1); // the whole list * @example $redis->lrange('mylist', -2, -1); // the last two elements in the list. */ @@ -2430,7 +2997,11 @@ public function lrange(string $key, int $start , int $end): Redis|array|false; * * @return Redis|int|false The number of elements removed. * - * @see https://redis.io/commands/lrem + * @see https://redis.io/docs/latest/commands/lrem/ + * + * @example + * $redis->lrem('queue', 0, 'expired-job'); + * */ public function lrem(string $key, mixed $value, int $count = 0): Redis|int|false; @@ -2443,6 +3014,8 @@ public function lrem(string $key, mixed $value, int $count = 0): Redis|int|false * * @return Redis|bool true if the list was trimmed. * + * @see https://redis.io/docs/latest/commands/ltrim/ + * * @example $redis->ltrim('mylist', 0, 3); // Keep the first four elements */ public function ltrim(string $key, int $start , int $end): Redis|bool; @@ -2453,10 +3026,38 @@ public function ltrim(string $key, int $start , int $end): Redis|bool; * @param array $keys The keys to retrieve * @return Redis|array|false an array of keys with their values. * + * @see https://redis.io/docs/latest/commands/mget/ + * * @example $redis->mget(['key1', 'key2']); */ public function mget(array $keys): Redis|array|false; + /** + * Proxy for the Redis MIGRATE command. + * + * @param string $host The destination redis host. + * @param int $port The destination redis port. + * @param string|array $key The key or array of keys to migrate. + * @param int $dstdb The destination database index. + * @param int $timeout The timeout for the operation in + * milliseconds. + * @param bool $copy Whether to copy the key(s) or move + * them. + * @param bool $replace Whether to replace existing keys on + * the destination. + * @param mixed|null $credentials Optional credentials for + * authenticating to the destination + * server. + * + * @see https://redis.io/docs/latest/commands/migrate/ + * + * @example + * $redis->connect('localhost', 6379); + * $redis->set('foo', '6379_key'); + * + * // Move the key to localhost:9999 with a 5 second timeout + * var_dump($redis->migrate('localhost', 9999, 'foo', 0, 5000)); + */ public function migrate(string $host, int $port, string|array $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, #[\SensitiveParameter] mixed $credentials = null): Redis|bool; @@ -2466,20 +3067,39 @@ public function migrate(string $host, int $port, string|array $key, int $dstdb, * * @param string $key The key to move * @return Redis|bool True if the key was moved + * + * @see https://redis.io/docs/latest/commands/move/ + * + * @example + * $redis->move('cart:42', 1); + * */ public function move(string $key, int $index): Redis|bool; /** - * Set one or more string keys. + * Set one or more string keys. + * + * @param array $key_values An array with keys and their values. + * @return Redis|bool True if the keys could be set. + * + * @see https://redis.io/docs/latest/commands/mset/ + * + * @example $redis->mSet(['foo' => 'bar', 'baz' => 'bop']); + */ + public function mset(array $key_values): Redis|bool; + + /** + * Set one or more keys and values with optional expiry information. * - * @param array $key_values An array with keys and their values. - * @return Redis|bool True if the keys could be set. + * @param array $key_vals An array of keys with their values. + * @param int|float|array|null $expiry An optional array with expiry information. + * @return Redis|int|false 1 if all keys were set, 0 if none were. * - * @see https://redis.io/commands/mset + * @see https://redis.io/commands/msetex * - * @example $redis->mSet(['foo' => 'bar', 'baz' => 'bop']); + * @example $redis->msetex(['foo' => 'bar', 'baz' => 'bop'], ['EX' => 60]); */ - public function mset(array $key_values): Redis|bool; + public function msetex(array $key_vals, int|float|array|null $expiry = null): Redis|int|false; /** * Set one or more string keys but only if none of the key exist. @@ -2488,7 +3108,7 @@ public function mset(array $key_values): Redis|bool; * * @return Redis|bool True if the keys were set and false if not. * - * @see https://redis.io/commands/msetnx + * @see https://redis.io/docs/latest/commands/msetnx/ * * @example $redis->msetnx(['foo' => 'bar', 'baz' => 'bop']); */ @@ -2502,7 +3122,7 @@ public function msetnx(array $key_values): Redis|bool; * * @return Redis|bool True if the transaction could be started. * - * @see https://redis.io/commands/multi + * @see https://redis.io/docs/latest/commands/multi/ * * @example * $redis->multi(); @@ -2512,14 +3132,55 @@ public function msetnx(array $key_values): Redis|bool; */ public function multi(int $value = Redis::MULTI): bool|Redis; + /** + * Get encoding and other information about a key. + * + * @param string $subcommand The subcommand to execute. This can be either 'encoding', 'freq', or 'idle'. + * @param string $key The key to query. + * + * @return Redis|int|string|false The requested information about the key. + * + * @example + * $redis->del('list1'); + * $redis->rPush('list1', 'a', 'b', 'c'); + * echo $redis->object('encoding', 'list1'); + * + */ public function object(string $subcommand, string $key): Redis|int|string|false; /** * @deprecated * @alias Redis::connect + * + * @example + * $redis->open('127.0.0.1', 6379); + * */ public function open(string $host, int $port = 6379, float $timeout = 0, ?string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, ?array $context = null): bool; + /** + * Connects to a Redis server creating or reusing a persistent connection. + * + * @param string $host The Redis server hostname. + * @param int $port The Redis server port. + * @param float $timeout Connection timeout in seconds. + * @param string|null $persistent_id An optional persistent ID to use for the connection. + * @param int $retry_interval The number of microseconds to wait before retrying a connection. + * @param float $read_timeout Read timeout in seconds. + * @param array|null $context An optional stream context array. + * + * @return bool True if the connection was successful. + * + * @throws RedisException + * + * @example + * try { + * $redis = new Redis(); + * $redis->pconnect('localhost', 6379); + * } catch (Exception $ex) { + * echo "Could not connect to Redis: ", $ex->getMessage(), "\n"; + * } + */ public function pconnect(string $host, int $port = 6379, float $timeout = 0, ?string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, ?array $context = null): bool; /** @@ -2528,21 +3189,32 @@ public function pconnect(string $host, int $port = 6379, float $timeout = 0, ?st * @param string $key The key to operate against. * * @return Redis|bool True if a timeout was removed and false if it was not or the key didn't exist. + * + * @see https://redis.io/docs/latest/commands/persist/ + * + * @example + * $redis->persist('session:42'); + * */ public function persist(string $key): Redis|bool; /** - * Sets an expiration in milliseconds on a given key. If connected to Redis >= 7.0.0 - * you can pass an optional mode argument that modifies how the command will execute. + * Sets an expiration in milliseconds on a given key. If connected to Redis >= 7.0.0 + * you can pass an optional mode argument that modifies how the command will execute. * - * @see Redis::expire() for a description of the mode argument. + * @see Redis::expire() for a description of the mode argument. + * @see https://redis.io/docs/latest/commands/pexpire/ * - * @param string $key The key to set an expiration on. - * @param int $timeout The number of milliseconds after which key will be automatically deleted. - * @param string|null $mode A two character modifier that changes how the - * command works. + * @param string $key The key to set an expiration on. + * @param int $timeout The number of milliseconds after which key will be automatically deleted. + * @param string|null $mode A two character modifier that changes how the + * command works. + * + * @return bool True if an expiry was set on the key, and false otherwise. + * + * @example + * $redis->pexpire('session:42', 5000); * - * @return Redis|bool True if an expiry was set on the key, and false otherwise. */ public function pexpire(string $key, int $timeout, ?string $mode = null): bool; @@ -2551,6 +3223,7 @@ public function pexpire(string $key, int $timeout, ?string $mode = null): bool; * Redis >= 7.0.0 you can pass an optional 'mode' argument. * * @see Redis::expire() For a description of the mode argument. + * @see https://redis.io/docs/latest/commands/pexpireat/ * * @param string $key The key to set an expiration on. * @param int $timestamp The unix timestamp to expire at. @@ -2558,51 +3231,67 @@ public function pexpire(string $key, int $timeout, ?string $mode = null): bool; * command works. * * @return Redis|bool True if an expiration was set on the key, false otherwise. + * + * @example + * $redis->pexpireAt('session:42', (int) (microtime(true) * 1000) + 60000); + * */ public function pexpireAt(string $key, int $timestamp, ?string $mode = null): Redis|bool; /** * Add one or more elements to a Redis HyperLogLog key * - * @see https://redis.io/commands/pfadd + * @see https://redis.io/docs/latest/commands/pfadd/ * * @param string $key The key in question. * * @param array $elements One or more elements to add. * * @return Redis|int Returns 1 if the set was altered, and zero if not. + * + * @example + * $redis->pfadd('visitors', ['alice', 'bob']); + * */ public function pfadd(string $key, array $elements): Redis|int; /** * Retrieve the cardinality of a Redis HyperLogLog key. * - * @see https://redis.io/commands/pfcount + * @see https://redis.io/docs/latest/commands/pfcount/ + * + * @param array|string $key_or_keys Either one key or an array of keys + * + * @return Redis|int|false The estimated cardinality of the set. * - * @param string $key_or_keys Either one key or an array of keys + * @example + * $redis->pfcount(['visitors:today', 'visitors:yesterday']); * - * @return Redis|int The estimated cardinality of the set. */ public function pfcount(array|string $key_or_keys): Redis|int|false; /** * Merge one or more source HyperLogLog sets into a destination set. * - * @see https://redis.io/commands/pfmerge + * @see https://redis.io/docs/latest/commands/pfmerge/ * * @param string $dst The destination key. * @param array $srckeys One or more source keys. * * @return Redis|bool Always returns true. + * + * @example + * $redis->pfmerge('visitors:all', ['visitors:today', 'visitors:yesterday']); + * */ public function pfmerge(string $dst, array $srckeys): Redis|bool; /** * PING the redis server with an optional string argument. * - * @see https://redis.io/commands/ping + * @see https://redis.io/docs/latest/commands/ping/ * - * @param string $message An optional string message that Redis will reply with, if passed. + * @param string|null $message An optional string message that Redis will reply with, if passed. * * @return Redis|string|false If passed no message, this command will simply return `true`. * If a message is passed, it will return the message. @@ -2621,7 +3310,7 @@ public function ping(?string $message = null): Redis|string|bool; * * NOTE: That this is shorthand for Redis::multi(Redis::PIPELINE) * - * @return Redis The redis object is returned, to facilitate method chaining. + * @return bool|Redis The redis object is returned, to facilitate method chaining. * * @example * $redis->pipeline() @@ -2635,6 +3324,10 @@ public function pipeline(): bool|Redis; /** * @deprecated * @alias Redis::pconnect + * + * @example + * $redis->popen('127.0.0.1', 6379, 0.0, 'cache'); + * */ public function popen(string $host, int $port = 6379, float $timeout = 0, ?string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, ?array $context = null): bool; @@ -2647,6 +3340,8 @@ public function popen(string $host, int $port = 6379, float $timeout = 0, ?strin * * @return Redis|bool True if the key could be set. * + * @see https://redis.io/docs/latest/commands/psetex/ + * * @example $redis->psetex('mykey', 1000, 'myval'); */ public function psetex(string $key, int $expire, mixed $value): Redis|bool; @@ -2657,13 +3352,19 @@ public function psetex(string $key, int $expire, mixed $value): Redis|bool; * @param array $patterns One or more patterns to subscribe to. * @param callable $cb A callback with the following prototype: * - * + * ```php * function ($redis, $channel, $message) { } - * + * ``` * - * @see https://redis.io/commands/psubscribe + * @see https://redis.io/docs/latest/commands/psubscribe/ * * @return bool True if we were subscribed. + * + * @example + * $redis->psubscribe(['user:*'], function (Redis $client, string $pattern, string $channel, string $message): void { + * printf('[%s] %s' . PHP_EOL, $channel, $message); + * }); + * */ public function psubscribe(array $patterns, callable $cb): bool; @@ -2678,7 +3379,7 @@ public function psubscribe(array $patterns, callable $cb): bool; * -2 - The key did not exist. *
    * - * @see https://redis.io/commands/pttl + * @see https://redis.io/docs/latest/commands/pttl/ * * @example $redis->pttl('ttl-key'); */ @@ -2687,27 +3388,47 @@ public function pttl(string $key): Redis|int|false; /** * Publish a message to a pubsub channel * - * @see https://redis.io/commands/publish + * @see https://redis.io/docs/latest/commands/publish/ * * @param string $channel The channel to publish to. * @param string $message The message itself. * - * @return Redis|int The number of subscribed clients to the given channel. + * @return Redis|int|false The number of subscribed clients to the given channel. + * + * @example + * $redis->publish('updates', 'build complete'); + * */ public function publish(string $channel, string $message): Redis|int|false; + /** + * Interact with the Redis PubSub subsystem. + * + * @param string $command The PubSub command to execute. This can be one of: + * @param mixed $arg An optional argument to the command. + * + * @return mixed Can return any number of things depending on the command executed. + * @see https://redis.io/docs/latest/commands/pubsub/ + * + * @example + * $redis->pubsub('channels'); + */ public function pubsub(string $command, mixed $arg = null): mixed; /** * Unsubscribe from one or more channels by pattern * - * @see https://redis.io/commands/punsubscribe - * @see https://redis.io/commands/subscribe + * @see https://redis.io/docs/latest/commands/punsubscribe/ + * @see https://redis.io/docs/latest/commands/subscribe/ * @see Redis::subscribe() * * @param array $patterns One or more glob-style patterns of channel names. * * @return Redis|array|bool The array of subscribed patterns or false on failure. + * + * @example + * $redis->punsubscribe(['user:*', 'room:*']); + * */ public function punsubscribe(array $patterns): Redis|array|bool; @@ -2720,7 +3441,7 @@ public function punsubscribe(array $patterns): Redis|array|bool; * * @return Redis|array|string|bool One or more popped elements or false if all were empty. * - * @see https://redis.io/commands/rpop + * @see https://redis.io/docs/latest/commands/rpop/ * * @example $redis->rPop('mylist'); * @example $redis->rPop('mylist', 4); @@ -2730,10 +3451,13 @@ public function rPop(string $key, int $count = 0): Redis|array|string|bool; /** * Return a random key from the current database * - * @see https://redis.io/commands/randomkey + * @see https://redis.io/docs/latest/commands/randomkey/ * * @return Redis|string|false A random key name or false if no keys exist * + * @example + * $redis->randomKey(); + * */ public function randomKey(): Redis|string|false; @@ -2741,7 +3465,7 @@ public function randomKey(): Redis|string|false; * Execute any arbitrary Redis command by name. * * @param string $command The command to execute - * @param mixed $args One or more arguments to pass to the command. + * @param mixed ...$args One or more arguments to pass to the command. * * @return mixed Can return any number of things depending on command executed. * @@ -2754,19 +3478,23 @@ public function rawcommand(string $command, mixed ...$args): mixed; /** * Unconditionally rename a key from $old_name to $new_name * - * @see https://redis.io/commands/rename + * @see https://redis.io/docs/latest/commands/rename/ * * @param string $old_name The original name of the key * @param string $new_name The new name for the key * * @return Redis|bool True if the key was renamed or false if not. + * + * @example + * $redis->rename('config:pending', 'config:active'); + * */ public function rename(string $old_name, string $new_name): Redis|bool; /** * Renames $key_src to $key_dst but only if newkey does not exist. * - * @see https://redis.io/commands/renamenx + * @see https://redis.io/docs/latest/commands/renamenx/ * * @param string $key_src The source key name * @param string $key_dst The destination key name. @@ -2786,37 +3514,43 @@ public function renameNx(string $key_src, string $key_dst): Redis|bool; * Reset the state of the connection. * * @return Redis|bool Should always return true unless there is an error. + * + * @see https://redis.io/docs/latest/commands/reset/ + * + * @example + * $redis->reset(); + * */ public function reset(): Redis|bool; /** * Restore a key by the binary payload generated by the DUMP command. * - * @param string $key The name of the key you wish to create. - * @param int $ttl What Redis should set the key's TTL (in milliseconds) to once it is created. - * Zero means no TTL at all. - * @param string $value The serialized binary value of the string (generated by DUMP). - * @param array $options An array of additional options that modifies how the command operates. + * @param string $key The name of the key you wish to create. + * @param int $ttl What Redis should set the key's TTL (in milliseconds) to once it is created. + * Zero means no TTL at all. + * @param string $value The serialized binary value of the string (generated by DUMP). + * @param array|null $options An array of additional options that modifies how the command operates. * - * - * $options = [ - * 'ABSTTL' # If this is present, the `$ttl` provided by the user should - * # be an absolute timestamp, in milliseconds() + * ```php + * $options = [ + * 'ABSTTL' # If this is present, the `$ttl` provided by the user should + * # be an absolute timestamp, in milliseconds() * - * 'REPLACE' # This flag instructs Redis to store the key even if a key with - * # that name already exists. + * 'REPLACE' # This flag instructs Redis to store the key even if a key with + * # that name already exists. * - * 'IDLETIME' => int # Tells Redis to set the keys internal 'idletime' value to a - * # specific number (see the Redis command OBJECT for more info). - * 'FREQ' => int # Tells Redis to set the keys internal 'FREQ' value to a specific - * # number (this relates to Redis' LFU eviction algorithm). - * ]; - * + * 'IDLETIME' => int # Tells Redis to set the keys internal 'idletime' value to a + * # specific number (see the Redis command OBJECT for more info). + * 'FREQ' => int # Tells Redis to set the keys internal 'FREQ' value to a specific + * # number (this relates to Redis' LFU eviction algorithm). + * ]; + * ``` * * @return Redis|bool True if the key was stored, false if not. * - * @see https://redis.io/commands/restore - * @see https://redis.io/commands/dump + * @see https://redis.io/docs/latest/commands/restore/ + * @see https://redis.io/docs/latest/commands/dump/ * @see Redis::dump() * * @example @@ -2832,6 +3566,12 @@ public function restore(string $key, int $ttl, string $value, ?array $options = * * @return mixed Will return an array with the role of the connected instance unless there is * an error. + * + * @see https://redis.io/docs/latest/commands/role/ + * + * @example + * $redis->role(); + * */ public function role(): mixed; @@ -2844,7 +3584,7 @@ public function role(): mixed; * * @return Redis|string|false The popped element or false if the source key was empty. * - * @see https://redis.io/commands/rpoplpush + * @see https://redis.io/docs/latest/commands/rpoplpush/ * * @example * $redis->pipeline() @@ -2860,13 +3600,13 @@ public function rpoplpush(string $srckey, string $dstkey): Redis|string|false; /** * Add one or more values to a Redis SET key. * - * @param string $key The key name - * @param mixed $member A value to add to the set. - * @param mixed $other_members One or more additional values to add + * @param string $key The key name + * @param mixed $value A value to add to the set. + * @param mixed ...$other_values One or more additional values to add * * @return Redis|int|false The number of values added to the set. * - * @see https://redis.io/commands/sadd + * @see https://redis.io/docs/latest/commands/sadd/ * * @example * $redis->del('myset'); @@ -2880,12 +3620,13 @@ public function sAdd(string $key, mixed $value, mixed ...$other_values): Redis|i * Add one or more values to a Redis SET key. This is an alternative to Redis::sadd() but * instead of being variadic, takes a single array of values. * - * @see https://redis.io/commands/sadd + * @see https://redis.io/docs/latest/commands/sadd/ * @see Redis::sadd() * - * @param string $key The set to add values to. - * @param array $values One or more members to add to the set. - * @return Redis|int|false The number of members added to the set. + * @param string $key The set to add values to. + * @param array $values One or more members to add to the set. + * + * @return int The number of members added to the set. * * @example * $redis->del('myset'); @@ -2899,13 +3640,13 @@ public function sAddArray(string $key, array $values): int; * Given one or more Redis SETS, this command returns all of the members from the first * set that are not in any subsequent set. * - * @param string $key The first set - * @param string $other_keys One or more additional sets + * @param string $key The first set + * @param string ...$other_keys One or more additional sets * * @return Redis|array|false Returns the elements from keys 2..N that don't exist in the * first sorted set, or false on failure. * - * @see https://redis.io/commands/sdiff + * @see https://redis.io/docs/latest/commands/sdiff/ * * @example * $redis->pipeline() @@ -2923,14 +3664,18 @@ public function sDiff(string $key, string ...$other_keys): Redis|array|false; * This method performs the same operation as SDIFF except it stores the resulting diff * values in a specified destination key. * - * @see https://redis.io/commands/sdiffstore + * @see https://redis.io/docs/latest/commands/sdiffstore/ * @see Redis::sdiff() * - * @param string $dst The key where to store the result - * @param string $key The first key to perform the DIFF on - * @param string $other_keys One or more additional keys. + * @param string $dst The key where to store the result + * @param string $key The first key to perform the DIFF on + * @param string ...$other_keys One or more additional keys. * * @return Redis|int|false The number of values stored in the destination set or false on failure. + * + * @example + * $redis->sDiffStore('diff:set', 'set:all', 'set:archived'); + * */ public function sDiffStore(string $dst, string $key, string ...$other_keys): Redis|int|false; @@ -2938,13 +3683,12 @@ public function sDiffStore(string $dst, string $key, string ...$other_keys): Red * Given one or more Redis SET keys, this command will return all of the elements that are * in every one. * - * @see https://redis.io/commands/sinter + * @see https://redis.io/docs/latest/commands/sinter/ * - * @param string $key The first SET key to intersect. - * @param string $other_keys One or more Redis SET keys. + * @param array|string $key The first SET key to intersect. + * @param string ...$other_keys One or more Redis SET keys. * * @example - * * $redis->pipeline() * ->del('alice_likes', 'bob_likes', 'bill_likes') * ->sadd('alice_likes', 'asparagus', 'broccoli', 'carrot', 'potato') @@ -2953,7 +3697,6 @@ public function sDiffStore(string $dst, string $key, string ...$other_keys): Red * ->exec(); * * var_dump($redis->sinter('alice_likes', 'bob_likes', 'bill_likes')); - * */ public function sInter(array|string $key, string ...$other_keys): Redis|array|false; @@ -2966,16 +3709,14 @@ public function sInter(array|string $key, string ...$other_keys): Redis|array|fa * * @return Redis|int|false The * - * @see https://redis.io/commands/sintercard + * @see https://redis.io/docs/latest/commands/sintercard/ * * @example - * * $redis->sAdd('set1', 'apple', 'pear', 'banana', 'carrot'); * $redis->sAdd('set2', 'apple', 'banana'); * $redis->sAdd('set3', 'pear', 'banana'); * * $redis->sInterCard(['set1', 'set2', 'set3']); - * */ public function sintercard(array $keys, int $limit = -1): Redis|int|false; @@ -2983,20 +3724,20 @@ public function sintercard(array $keys, int $limit = -1): Redis|int|false; * Perform the intersection of one or more Redis SETs, storing the result in a destination * key, rather than returning them. * - * @param array|string $key_or_keys Either a string key, or an array of keys (with at least two - * elements, consisting of the destination key name and one - * or more source keys names. - * @param string $other_keys If the first argument was a string, subsequent arguments should - * be source key names. + * @param array|string $key Either a string key, or an array of keys (with at least two + * elements, consisting of the destination key name and one + * or more source keys names. + * @param string ...$other_keys If the first argument was a string, subsequent arguments should + * be source key names. * - * @return Redis|int|false The number of values stored in the destination key or false on failure. + * @return Redis|int|false The number of values stored in the destination key or false on failure. * - * @see https://redis.io/commands/sinterstore + * @see https://redis.io/docs/latest/commands/sinterstore/ * @see Redis::sinter() - * - * @example $redis->sInterStore(['dst', 'src1', 'src2', 'src3']); - * @example $redis->sInterStore('dst', 'src1', 'src'2', 'src3'); - * + * + * @example + * $redis->sInterStore(['dst', 'src1', 'src2', 'src3']); + * $redis->sInterStore('dst', 'src1', 'src'2', 'src3'); */ public function sInterStore(array|string $key, string ...$other_keys): Redis|int|false; @@ -3007,7 +3748,7 @@ public function sInterStore(array|string $key, string ...$other_keys): Redis|int * * @return Redis|array|false Every element in the set or false on failure. * - * @see https://redis.io/commands/smembers + * @see https://redis.io/docs/latest/commands/smembers/ * * @example * $redis->sAdd('tng-crew', ...['Picard', 'Riker', 'Data', 'Worf', 'La Forge', 'Troi', 'Crusher', 'Broccoli']); @@ -3018,13 +3759,13 @@ public function sMembers(string $key): Redis|array|false; /** * Check if one or more values are members of a set. * - * @see https://redis.io/commands/smismember - * @see https://redis.io/commands/smember + * @see https://redis.io/docs/latest/commands/smismember/ + * @see https://redis.io/docs/latest/commands/smember/ * @see Redis::smember() * - * @param string $key The set to query. - * @param string $member The first value to test if exists in the set. - * @param string $other_members Any number of additional values to check. + * @param string $key The set to query. + * @param string $member The first value to test if exists in the set. + * @param string ...$other_members Any number of additional values to check. * * @return Redis|array|false An array of integers representing whether each passed value * was a member of the set. @@ -3039,7 +3780,7 @@ public function sMisMember(string $key, string $member, string ...$other_members * Pop a member from one set and push it onto another. This command will create the * destination set if it does not currently exist. * - * @see https://redis.io/commands/smove + * @see https://redis.io/docs/latest/commands/smove/ * * @param string $src The source set. * @param string $dst The destination set. @@ -3058,7 +3799,7 @@ public function sMove(string $src, string $dst, mixed $value): Redis|bool; /** * Remove one or more elements from a set. * - * @see https://redis.io/commands/spop + * @see https://redis.io/docs/latest/commands/spop/ * * @param string $key The set in question. * @param int $count An optional number of members to pop. This defaults to @@ -3086,7 +3827,7 @@ public function sPop(string $key, int $count = 0): Redis|string|array|false; * * @return Redis|array|string|false One or more random members or false on failure. * - * @see https://redis.io/commands/srandmember + * @see https://redis.io/docs/latest/commands/srandmember/ * * @example $redis->sRandMember('myset'); * @example $redis->sRandMember('myset', 10); @@ -3097,10 +3838,10 @@ public function sRandMember(string $key, int $count = 0): mixed; /** * Returns the union of one or more Redis SET keys. * - * @see https://redis.io/commands/sunion + * @see https://redis.io/docs/latest/commands/sunion/ * - * @param string $key The first SET to do a union with - * @param string $other_keys One or more subsequent keys + * @param string $key The first SET to do a union with + * @param string ...$other_keys One or more subsequent keys * * @return Redis|array|false The union of the one or more input sets or false on failure. * @@ -3111,15 +3852,19 @@ public function sUnion(string $key, string ...$other_keys): Redis|array|false; /** * Perform a union of one or more Redis SET keys and store the result in a new set * - * @see https://redis.io/commands/sunionstore + * @see https://redis.io/docs/latest/commands/sunionstore/ * @see Redis::sunion() * - * @param string $dst The destination key - * @param string $key The first source key - * @param string $other_keys One or more additional source keys + * @param string $dst The destination key + * @param string $key The first source key + * @param string ...$other_keys One or more additional source keys * * @return Redis|int|false The number of elements stored in the destination SET or * false on failure. + * + * @example + * $redis->sUnionStore('union:set', 'set:a', 'set:b'); + * */ public function sUnionStore(string $dst, string $key, string ...$other_keys): Redis|int|false; @@ -3127,10 +3872,14 @@ public function sUnionStore(string $dst, string $key, string ...$other_keys): Re * Persist the Redis database to disk. This command will block the server until the save is * completed. For a nonblocking alternative, see Redis::bgsave(). * - * @see https://redis.io/commands/save + * @see https://redis.io/docs/latest/commands/save/ * @see Redis::bgsave() * * @return Redis|bool Returns true unless an error occurs. + * + * @example + * $redis->save(); + * */ public function save(): Redis|bool; @@ -3144,21 +3893,18 @@ public function save(): Redis|bool; * 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. * - * @param int $iterator The cursor returned by Redis for every subsequent call to SCAN. On - * the initial invocation of the call, it should be initialized by the - * caller to NULL. Each time SCAN is invoked, the iterator will be - * updated to a new number, until finally Redis will set the value to - * zero, indicating that the scan is complete. - * - * @param string|null $pattern An optional glob-style pattern for matching key names. If passed as - * NULL, it is the equivalent of sending '*' (match every key). - * - * @param int $count A hint to redis that tells it how many keys to return in a single - * call to SCAN. The larger the number, the longer Redis may block - * clients while iterating the key space. - * - * @param string $type An optional argument to specify which key types to scan (e.g. - * 'STRING', 'LIST', 'SET') + * @param int|string|null $iterator The cursor returned by Redis for every subsequent call to SCAN. On + * the initial invocation of the call, it should be initialized by the + * caller to NULL. Each time SCAN is invoked, the iterator will be + * updated to a new number, until finally Redis will set the value to + * zero, indicating that the scan is complete. + * @param string|null $pattern An optional glob-style pattern for matching key names. If passed as + * NULL, it is the equivalent of sending '*' (match every key). + * @param int $count A hint to redis that tells it how many keys to return in a single + * call to SCAN. The larger the number, the longer Redis may block + * clients while iterating the key space. + * @param string|null $type An optional argument to specify which key types to scan (e.g. + * 'STRING', 'LIST', 'SET') * * @return array|false An array of keys, or false if no keys were returned for this * invocation of scan. Note that it is possible for Redis to return @@ -3166,7 +3912,7 @@ public function save(): Redis|bool; * should instead continue to SCAN until the iterator reference is * returned to zero. * - * @see https://redis.io/commands/scan + * @see https://redis.io/docs/latest/commands/scan/ * @see Redis::setOption() * * @example @@ -3204,7 +3950,7 @@ public function scan(null|int|string &$iterator, ?string $pattern = null, int $c * * @return Redis|int|false The cardinality of the set or false on failure. * - * @see https://redis.io/commands/scard + * @see https://redis.io/docs/latest/commands/scard/ * * @example $redis->scard('set'); */ @@ -3213,10 +3959,10 @@ public function scard(string $key): Redis|int|false; /** * An administrative command used to interact with LUA scripts stored on the server. * - * @see https://redis.io/commands/script + * @see https://redis.io/docs/latest/commands/script/ * * @param string $command The script suboperation to execute. - * @param mixed $args One or more additional argument + * @param mixed ...$args One or more additional argument * * @return mixed This command returns various things depending on the specific operation executed. * @@ -3232,7 +3978,7 @@ public function script(string $command, mixed ...$args): mixed; * * @return Redis|bool true on success and false on failure * - * @see https://redis.io/commands/select + * @see https://redis.io/docs/latest/commands/select/ * * @example $redis->select(1); */ @@ -3261,8 +4007,8 @@ public function select(int $db): Redis|bool; * * @return Redis|string|bool True if the key was set or false on failure. * - * @see https://redis.io/commands/set - * @see https://redis.io/commands/setex + * @see https://redis.io/docs/latest/commands/set/ + * @see https://redis.io/docs/latest/commands/setex/ * * @example $redis->set('key', 'value'); * @example $redis->set('key', 'expires_in_60_seconds', 60); @@ -3272,7 +4018,7 @@ public function set(string $key, mixed $value, mixed $options = null): Redis|str /** * Set a specific bit in a Redis string to zero or one * - * @see https://redis.io/commands/setbit + * @see https://redis.io/docs/latest/commands/setbit/ * * @param string $key The Redis STRING key to modify * @param bool $value Whether to set the bit to zero or one. @@ -3288,7 +4034,7 @@ public function setBit(string $key, int $idx, bool $value): Redis|int|false; /** * Update or append to a Redis string at a specific starting index * - * @see https://redis.io/commands/setrange + * @see https://redis.io/docs/latest/commands/setrange/ * * @param string $key The key to update * @param int $index Where to insert the provided value @@ -3331,6 +4077,9 @@ public function setRange(string $key, int $index, string $value): Redis|int|fals * * @return bool true if the setting was updated, false if not. * + * @example + * $redis->setOption(Redis::OPT_PREFIX, 'app:'); + * */ public function setOption(int $option, mixed $value): bool; @@ -3343,6 +4092,8 @@ public function setOption(int $option, mixed $value): bool; * * @return Redis|bool True on success or false on failure. * + * @see https://redis.io/docs/latest/commands/setex/ + * * @example $redis->setex('60s-ttl', 60, 'some-value'); */ public function setex(string $key, int $expire, mixed $value); @@ -3350,7 +4101,7 @@ public function setex(string $key, int $expire, mixed $value); /** * Set a key to a value, but only if that key does not already exist. * - * @see https://redis.io/commands/setnx + * @see https://redis.io/docs/latest/commands/setnx/ * * @param string $key The key name to set. * @param mixed $value What to set the key to. @@ -3370,6 +4121,8 @@ public function setnx(string $key, mixed $value): Redis|bool; * * @return Redis|bool True if the member exists and false if not. * + * @see https://redis.io/docs/latest/commands/sismember/ + * * @example $redis->sismember('myset', 'mem1', 'mem2'); */ public function sismember(string $key, mixed $value): Redis|bool; @@ -3384,9 +4137,13 @@ public function sismember(string $key, mixed $value): Redis|bool; * * @deprecated * - * @see https://redis.io/commands/slaveof - * @see https://redis.io/commands/replicaof + * @see https://redis.io/docs/latest/commands/slaveof/ + * @see https://redis.io/docs/latest/commands/replicaof/ * @see Redis::replicaof() + * + * @example + * $redis->slaveof('10.0.0.5', 6380); + * */ public function slaveof(?string $host = null, int $port = 6379): Redis|bool; @@ -3394,12 +4151,12 @@ public function slaveof(?string $host = null, int $port = 6379): Redis|bool; * Used to turn a Redis instance into a replica of another, or to remove * replica status promoting the instance to a primary. * - * @see https://redis.io/commands/replicaof - * @see https://redis.io/commands/slaveof + * @see https://redis.io/docs/latest/commands/replicaof/ + * @see https://redis.io/docs/latest/commands/slaveof/ * @see Redis::slaveof() * - * @param string $host The host of the primary to start replicating. - * @param string $port The port of the primary to start replicating. + * @param string|null $host The host of the primary to start replicating. + * @param int $port The port of the primary to start replicating. * * @return Redis|bool Success if we were successfully able to start replicating a primary or * were able to promote the replicat to a primary. @@ -3419,14 +4176,18 @@ public function replicaof(?string $host = null, int $port = 6379): Redis|bool; /** * Update one or more keys last modified metadata. * - * @see https://redis.io/commands/touch/ + * @see https://redis.io/docs/latest/commands/touch/ * - * @param array|string $key Either the first key or if passed as the only argument - * an array of keys. - * @param string $more_keys One or more keys to send to the command. + * @param array|string $key_or_array Either the first key or if passed as the only argument + * an array of keys. + * @param string ...$more_keys One or more keys to send to the command. * * @return Redis|int|false This command returns the number of keys that exist and * had their last modified time reset + * + * @example + * $redis->touch('cache:1', 'cache:2'); + * */ public function touch(array|string $key_or_array, string ...$more_keys): Redis|int|false; @@ -3450,7 +4211,7 @@ public function touch(array|string $key_or_array, string ...$more_keys): Redis|i * * @return mixed * - * @see https://redis.io/commands/slowlog/ + * @see https://redis.io/docs/latest/commands/slowlog/ * * @example $redis->slowlog('get', -1); // Retrieve all slowlog entries. * @example $redis->slowlog('len'); // Retrieve slowlog length. @@ -3461,12 +4222,12 @@ public function slowlog(string $operation, int $length = 0): mixed; /** * Sort the contents of a Redis key in various ways. * - * @see https://redis.io/commands/sort/ + * @see https://redis.io/docs/latest/commands/sort/ * - * @param string $key The key you wish to sort - * @param array $options Various options controlling how you would like the - * data sorted. See blow for a detailed description - * of this options array. + * @param string $key The key you wish to sort + * @param array|null $options Various options controlling how you would like the + * data sorted. See blow for a detailed description + * of this options array. * * @return mixed This command can either return an array with the sorted data * or the number of elements placed in a destination set when @@ -3491,37 +4252,66 @@ public function sort(string $key, ?array $options = null): mixed; * This is simply a read-only variant of the sort command * * @see Redis::sort() + * @see https://redis.io/docs/latest/commands/sort_ro/ + * + * @example + * $redis->sort_ro('numbers', ['LIMIT' => [0, 5]]); + * */ public function sort_ro(string $key, ?array $options = null): mixed; /** * @deprecated + * + * @see https://redis.io/docs/latest/commands/sort/ + * + * @example + * $redis->sortAsc('numbers'); + * */ public function sortAsc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array; /** * @deprecated + * + * @see https://redis.io/docs/latest/commands/sort/ + * + * @example + * $redis->sortAscAlpha('tags'); + * */ public function sortAscAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array; /** * @deprecated + * + * @see https://redis.io/docs/latest/commands/sort/ + * + * @example + * $redis->sortDesc('numbers'); + * */ public function sortDesc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array; /** * @deprecated + * + * @see https://redis.io/docs/latest/commands/sort/ + * + * @example + * $redis->sortDescAlpha('tags'); + * */ public function sortDescAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array; /** * Remove one or more values from a Redis SET key. * - * @see https://redis.io/commands/srem + * @see https://redis.io/docs/latest/commands/srem/ * - * @param string $key The Redis SET key in question. - * @param mixed $value The first value to remove. - * @param mixed $more_values One or more additional values to remove. + * @param string $key The Redis SET key in question. + * @param mixed $value The first value to remove. + * @param mixed ...$other_values One or more additional values to remove. * * @return Redis|int|false The number of values removed from the set or false on failure. * @@ -3532,19 +4322,19 @@ public function srem(string $key, mixed $value, mixed ...$other_values): Redis|i /** * Scan the members of a redis SET key. * - * @see https://redis.io/commands/sscan - * @see https://redis.io/commands/scan + * @see https://redis.io/docs/latest/commands/sscan/ + * @see https://redis.io/docs/latest/commands/scan/ * @see Redis::setOption() * - * @param string $key The Redis SET key in question. - * @param int $iterator A reference to an iterator which should be initialized to NULL that - * PhpRedis will update with the value returned from Redis after each - * subsequent call to SSCAN. Once this cursor is zero you know all - * members have been traversed. - * @param string|null $pattern An optional glob style pattern to match against, so Redis only - * returns the subset of members matching this pattern. - * @param int $count A hint to Redis as to how many members it should scan in one command - * before returning members for that iteration. + * @param string $key The Redis SET key in question. + * @param int|string|null $iterator A reference to an iterator which should be initialized to NULL that + * PhpRedis will update with the value returned from Redis after each + * subsequent call to SSCAN. Once this cursor is zero you know all + * members have been traversed. + * @param string|null $pattern An optional glob style pattern to match against, so Redis only + * returns the subset of members matching this pattern. + * @param int $count A hint to Redis as to how many members it should scan in one command + * before returning members for that iteration. * * @example * $redis->del('myset'); @@ -3596,7 +4386,7 @@ public function sscan(string $key, null|int|string &$iterator, ?string $pattern * @return bool True on success, false on faiilure. Note that this command will block the * client in a subscribe loop, waiting for messages to arrive. * - * @see https://redis.io/commands/ssubscribe + * @see https://redis.io/docs/latest/commands/ssubscribe/ * * @example * $redis = new Redis(['host' => 'localhost']); @@ -3625,7 +4415,7 @@ public function ssubscribe(array $channels, callable $cb): bool; * @return Redis|int|false The length of the string key if it exists, zero if it does not, and * false on failure. * - * @see https://redis.io/commands/strlen + * @see https://redis.io/docs/latest/commands/strlen/ * * @example $redis->strlen('mykey'); */ @@ -3641,7 +4431,7 @@ public function strlen(string $key): Redis|int|false; * @return bool True on success, false on faiilure. Note that this command will block the * client in a subscribe loop, waiting for messages to arrive. * - * @see https://redis.io/commands/subscribe + * @see https://redis.io/docs/latest/commands/subscribe/ * * @example * $redis = new Redis(['host' => 'localhost']); @@ -3669,7 +4459,7 @@ public function subscribe(array $channels, callable $cb): bool; * @param array $channels One or more channels to unsubscribe from. * @return Redis|array|bool The array of unsubscribed channels. * - * @see https://redis.io/commands/sunsubscribe + * @see https://redis.io/docs/latest/commands/sunsubscribe/ * @see Redis::ssubscribe() * * @example @@ -3698,7 +4488,7 @@ public function sunsubscribe(array $channels): Redis|array|bool; * * @return Redis|bool Success if the databases could be swapped and false on failure. * - * @see https://redis.io/commands/swapdb + * @see https://redis.io/docs/latest/commands/swapdb/ * @see Redis::del() * * @example @@ -3712,10 +4502,10 @@ public function swapdb(int $src, int $dst): Redis|bool; /** * Retrieve the server time from the connected Redis instance. * - * @see https://redis.io/commands/time + * @see https://redis.io/docs/latest/commands/time/ * - * @return A two element array consisting of a Unix Timestamp and the number of microseconds - * elapsed since the second. + * @return Redis|array A two element array consisting of a Unix Timestamp and the number of microseconds + * elapsed since the second. * * @example $redis->time(); */ @@ -3729,7 +4519,7 @@ public function time(): Redis|array; * no expiration, and -2 if the key does not exist. In the event of an * error, this command will return false. * - * @see https://redis.io/commands/ttl + * @see https://redis.io/docs/latest/commands/ttl/ * * @example $redis->ttl('mykey'); */ @@ -3738,7 +4528,7 @@ public function ttl(string $key): Redis|int|false; /** * Get the type of a given Redis key. * - * @see https://redis.io/commands/type + * @see https://redis.io/docs/latest/commands/type/ * * @param string $key The key to check * @return Redis|int|false The Redis type constant or false on failure. @@ -3766,15 +4556,15 @@ public function type(string $key): Redis|int|false; * deletion is asynchronous, meaning it is safe to delete large keys without fear of * Redis blocking for a long period of time. * - * @param array|string $key_or_keys Either an array with one or more keys or a string with - * the first key to delete. - * @param string $other_keys If the first argument passed to this method was a string - * you may pass any number of additional key names. + * @param array|string $key Either an array with one or more keys or a string with + * the first key to delete. + * @param string ...$other_keys If the first argument passed to this method was a string + * you may pass any number of additional key names. * * @return Redis|int|false The number of keys deleted or false on failure. * - * @see https://redis.io/commands/unlink - * @see https://redis.io/commands/del + * @see https://redis.io/docs/latest/commands/unlink/ + * @see https://redis.io/docs/latest/commands/del/ * @see Redis::del() * * @example $redis->unlink('key1', 'key2', 'key3'); @@ -3788,7 +4578,7 @@ public function unlink(array|string $key, string ...$other_keys): Redis|int|fals * @param array $channels One or more channels to unsubscribe from. * @return Redis|array|bool The array of unsubscribed channels. * - * @see https://redis.io/commands/unsubscribe + * @see https://redis.io/docs/latest/commands/unsubscribe/ * @see Redis::subscribe() * * @example @@ -3808,25 +4598,29 @@ public function unsubscribe(array $channels): Redis|array|bool; /** * Remove any previously WATCH'ed keys in a transaction. * - * @see https://redis.io/commands/unwatch - * @see https://redis.io/commands/unwatch + * @see https://redis.io/docs/latest/commands/unwatch/ + * @see https://redis.io/docs/latest/commands/unwatch/ * @see Redis::watch() * - * @return True on success and false on failure. + * @return Redis|bool True on success and false on failure. + * + * @example + * $redis->unwatch(); + * */ public function unwatch(): Redis|bool; /** * Watch one or more keys for conditional execution of a transaction. * - * @param array|string $key_or_keys Either an array with one or more key names, or a string key name - * @param string $other_keys If the first argument was passed as a string, any number of additional - * string key names may be passed variadically. - * @return Redis|bool + * @param array|string $key Either an array with one or more key names, or a string key name + * @param string ...$other_keys If the first argument was passed as a string, any number of additional + * string key names may be passed variadically. * + * @return Redis|bool * - * @see https://redis.io/commands/watch - * @see https://redis.io/commands/unwatch + * @see https://redis.io/docs/latest/commands/watch/ + * @see https://redis.io/docs/latest/commands/unwatch/ * * @example * $redis1 = new Redis(['host' => 'localhost']); @@ -3860,12 +4654,15 @@ public function watch(array|string $key, string ...$other_keys): Redis|bool; * Block the client up to the provided timeout until a certain number of replicas have confirmed * receiving them. * - * @see https://redis.io/commands/wait + * @see https://redis.io/docs/latest/commands/wait/ * * @param int $numreplicas The number of replicas we want to confirm write operations * @param int $timeout How long to wait (zero meaning forever). * - * @return Redis|int|false The number of replicas that have confirmed or false on failure. + * @return int|false The number of replicas that have confirmed or false on failure. + * + * @example + * $redis->wait(1, 1000); * */ public function wait(int $numreplicas, int $timeout): int|false; @@ -3880,8 +4677,8 @@ public function wait(int $numreplicas, int $timeout): int|false; * * @return int|false The number of acknowledged messages * - * @see https://redis.io/commands/xack - * @see https://redis.io/commands/xreadgroup + * @see https://redis.io/docs/latest/commands/xack/ + * @see https://redis.io/docs/latest/commands/xreadgroup/ * @see Redis::xack() * * @example @@ -3927,7 +4724,7 @@ public function xack(string $key, string $group, array $ids): int|false; * `$maxlen` values. * @param bool $nomkstream If passed as `TRUE`, the stream must exist for Redis to append the message. * - * @see https://redis.io/commands/xadd + * @see https://redis.io/docs/latest/commands/xadd/ * * @example $redis->xAdd('ds9-season-1', '1-1', ['title' => 'Emissary Part 1']); * @example $redis->xAdd('ds9-season-1', '1-2', ['title' => 'A Man Alone']); @@ -3938,8 +4735,8 @@ public function xadd(string $key, string $id, array $values, int $maxlen = 0, bo * This command allows a consumer to claim pending messages that have been idle for a specified period of time. * Its purpose is to provide a mechanism for picking up messages that may have had a failed consumer. * - * @see https://redis.io/commands/xautoclaim - * @see https://redis.io/commands/xclaim + * @see https://redis.io/docs/latest/commands/xautoclaim/ + * @see https://redis.io/docs/latest/commands/xclaim/ * @see https://redis.io/docs/data-types/streams-tutorial/ * * @param string $key The stream to check. @@ -3977,32 +4774,32 @@ public function xautoclaim(string $key, string $group, string $consumer, int $mi * This method allows a consumer to take ownership of pending stream entries, by ID. Another * command that does much the same thing but does not require passing specific IDs is `Redis::xAutoClaim`. * - * @see https://redis.io/commands/xclaim - * @see https://redis.io/commands/xautoclaim. - * - * @param string $key The stream we wish to claim messages for. - * @param string $group Our consumer group. - * @param string $consumer Our consumer. - * @param int $min_idle_time The minimum idle-time in milliseconds a message must have for ownership to be transferred. - * @param array $options An options array that modifies how the command operates. - * - * - * # Following is an options array describing every option you can pass. Note that - * # 'IDLE', and 'TIME' are mutually exclusive. - * $options = [ - * 'IDLE' => 3 # Set the idle time of the message to a 3. By default - * # the idle time is set to zero. - * 'TIME' => 1000*time() # Same as IDLE except it takes a unix timestamp in - * # milliseconds. - * 'RETRYCOUNT' => 0 # Set the retry counter to zero. By default XCLAIM - * # doesn't modify the counter. - * 'FORCE' # Creates the pending message entry even if IDs are - * # not already - * # in the PEL with another client. - * 'JUSTID' # Return only an array of IDs rather than the messages - * # themselves. - * ]; - * + * @see https://redis.io/docs/latest/commands/xclaim/ + * @see https://redis.io/docs/latest/commands/xautoclaim./ + * + * @param string $key The stream we wish to claim messages for. + * @param string $group Our consumer group. + * @param string $consumer Our consumer. + * @param int $min_idle The minimum idle-time in milliseconds a message must have for ownership to be transferred. + * @param array $options An options array that modifies how the command operates. + * + * ```php + * # Following is an options array describing every option you can pass. Note that + * # 'IDLE', and 'TIME' are mutually exclusive. + * $options = [ + * 'IDLE' => 3 # Set the idle time of the message to a 3. By default + * # the idle time is set to zero. + * 'TIME' => 1000*time() # Same as IDLE except it takes a unix timestamp in + * # milliseconds. + * 'RETRYCOUNT' => 0 # Set the retry counter to zero. By default XCLAIM + * # doesn't modify the counter. + * 'FORCE' # Creates the pending message entry even if IDs are + * # not already + * # in the PEL with another client. + * 'JUSTID' # Return only an array of IDs rather than the messages + * # themselves. + * ]; + * ``` * * @return Redis|array|bool An array of claimed messages or false on failure. * @@ -4038,45 +4835,69 @@ public function xclaim(string $key, string $group, string $consumer, int $min_id * * @return Redis|int|false The number of messages removed or false on failure. * + * @see https://redis.io/docs/latest/commands/xdel/ + * * @example $redis->xDel('stream', ['1-1', '2-1', '3-1']); */ public function xdel(string $key, array $ids): Redis|int|false; + /** + * Remove one or more IDs from a stream with extended options. + * + * @param string $key The stream to modify. + * @param array $ids One or more message IDs to remove. + * @param string|null $mode An optional mode argument. Valid modes + * are as follows: KEEPREF | DELREF | ACKED + * + * @return Redis|array|false An array corresponding to IDs. 1 if the id was + * deleted and 0 if not. + * + * @see https://redis.io/docs/latest/commands/xdelex/ + * + * @example + * $redis->xadd('s', '*', ['field' => 'value1']); + * $redis->xdelex('s', ['1-0'], 'KEEPREF'); + */ + public function xdelex(string $key, array $ids, ?string $mode = null): Redis|array|false; + /** * XGROUP * * Perform various operation on consumer groups for a particular Redis STREAM. What the command does * is primarily based on which operation is passed. * - * @see https://redis.io/commands/xgroup/ - * - * @param string $operation The subcommand you intend to execute. Valid options are as follows - * 'HELP' - Redis will return information about the command - * Requires: none - * 'CREATE' - Create a consumer group. - * Requires: Key, group, consumer. - * 'SETID' - Set the ID of an existing consumer group for the stream. - * Requires: Key, group, id. - * 'CREATECONSUMER' - Create a new consumer group for the stream. You must - * also pass key, group, and the consumer name you wish to - * create. - * Requires: Key, group, consumer. - * 'DELCONSUMER' - Delete a consumer from group attached to the stream. - * Requires: Key, group, consumer. - * 'DESTROY' - Delete a consumer group from a stream. - * Requires: Key, group. - * @param string $key The STREAM we're operating on. - * @param string $group The consumer group we want to create/modify/delete. - * @param string $id_or_consumer The STREAM id (e.g. '$') or consumer group. See the operation section - * for information about which to send. - * @param bool $mkstream This flag may be sent in combination with the 'CREATE' operation, and - * cause Redis to also create the STREAM if it doesn't currently exist. - * - * @param bool $entriesread Allows you to set Redis' 'entries-read' STREAM value. This argument is - * only relevant to the 'CREATE' and 'SETID' operations. - * Note: Requires Redis >= 7.0.0. - * - * @return mixed This command return various results depending on the operation performed. + * @see https://redis.io/docs/latest/commands/xgroup/ + * + * @param string $operation The subcommand you intend to execute. Valid options are as follows + * 'HELP' - Redis will return information about the command + * Requires: none + * 'CREATE' - Create a consumer group. + * Requires: Key, group, consumer. + * 'SETID' - Set the ID of an existing consumer group for the stream. + * Requires: Key, group, id. + * 'CREATECONSUMER' - Create a new consumer group for the stream. You must + * also pass key, group, and the consumer name you wish to + * create. + * Requires: Key, group, consumer. + * 'DELCONSUMER' - Delete a consumer from group attached to the stream. + * Requires: Key, group, consumer. + * 'DESTROY' - Delete a consumer group from a stream. + * Requires: Key, group. + * @param string|null $key The STREAM we're operating on. + * @param string|null $group The consumer group we want to create/modify/delete. + * @param string|null $id_or_consumer The STREAM id (e.g. '$') or consumer group. See the operation section + * for information about which to send. + * @param bool $mkstream This flag may be sent in combination with the 'CREATE' operation, and + * cause Redis to also create the STREAM if it doesn't currently exist. + * @param int $entries_read Allows you to set Redis' 'entries-read' STREAM value. This argument is + * only relevant to the 'CREATE' and 'SETID' operations. + * Note: Requires Redis >= 7.0.0. + * + * @return mixed This command return various results depending on the operation performed. + * + * @example + * $redis->xgroup('CREATE', 'mystream', 'workers', '$'); + * */ public function xgroup(string $operation, ?string $key = null, ?string $group = null, ?string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2): mixed; @@ -4084,14 +4905,14 @@ public function xgroup(string $operation, ?string $key = null, ?string $group = /** * Retrieve information about a stream key. * - * @param string $operation The specific info operation to perform. - * @param string $arg1 The first argument (depends on operation) - * @param string $arg2 The second argument - * @param int $count The COUNT argument to `XINFO STREAM` + * @param string $operation The specific info operation to perform. + * @param string|null $arg1 The first argument (depends on operation) + * @param string|null $arg2 The second argument + * @param int $count The COUNT argument to `XINFO STREAM` * * @return mixed This command can return different things depending on the operation being called. * - * @see https://redis.io/commands/xinfo + * @see https://redis.io/docs/latest/commands/xinfo/ * * @example $redis->xInfo('CONSUMERS', 'stream'); * @example $redis->xInfo('GROUPS', 'stream'); @@ -4107,7 +4928,7 @@ public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = n * * @return Redis|int|false The number of messages or false on failure. * - * @see https://redis.io/commands/xlen + * @see https://redis.io/docs/latest/commands/xlen/ * * @example $redis->xLen('stream'); */ @@ -4117,18 +4938,21 @@ public function xlen(string $key): Redis|int|false; * Interact with stream messages that have been consumed by a consumer group but not yet * acknowledged with XACK. * - * @see https://redis.io/commands/xpending - * @see https://redis.io/commands/xreadgroup + * @see https://redis.io/docs/latest/commands/xpending/ + * @see https://redis.io/docs/latest/commands/xreadgroup/ * - * @param string $key The stream to inspect. - * @param string $group The user group we want to see pending messages from. - * @param string $start The minimum ID to consider. - * @param string $string The maximum ID to consider. - * @param string $count Optional maximum number of messages to return. - * @param string $consumer If provided, limit the returned messages to a specific consumer. + * @param string $key The stream to inspect. + * @param string $group The user group we want to see pending messages from. + * @param string|null $start The minimum ID to consider. + * @param string|null $end The maximum ID to consider. + * @param int $count Optional maximum number of messages to return. + * @param string|null $consumer If provided, limit the returned messages to a specific consumer. * * @return Redis|array|false The pending messages belonging to the stream or false on failure. * + * @example + * $redis->xpending('mystream', 'workers', '-', '+', 10); + * */ public function xpending(string $key, string $group, ?string $start = null, ?string $end = null, int $count = -1, ?string $consumer = null): Redis|array|false; @@ -4142,7 +4966,7 @@ public function xpending(string $key, string $group, ?string $start = null, ?str * * @return Redis|array|bool The entries in the stream within the requested range or false on failure. * - * @see https://redis.io/commands/xrange + * @see https://redis.io/docs/latest/commands/xrange/ * * @example $redis->xRange('stream', '0-1', '0-2'); * @example $redis->xRange('stream', '-', '+'); @@ -4159,7 +4983,7 @@ public function xrange(string $key, string $start, string $end, int $count = -1) * * @return Redis|array|bool An array of read elements or false if there aren't any. * - * @see https://redis.io/commands/xread + * @see https://redis.io/docs/latest/commands/xread/ * * @example * $redis->xAdd('s03', '3-1', ['title' => 'The Search, Part I']); @@ -4184,7 +5008,7 @@ public function xread(array $streams, int $count = -1, int $block = -1): Redis|a * * @return Redis|array|bool Zero or more unread messages or false on failure. * - * @see https://redis.io/commands/xreadgroup + * @see https://redis.io/docs/latest/commands/xreadgroup/ * * @example * $redis->xGroup('CREATE', 'episodes', 'ds9', '0-0', true); @@ -4218,8 +5042,8 @@ public function xreadgroup(string $group, string $consumer, array $streams, int * * @return Redis|array|bool The entries within the requested range, from newest to oldest. * - * @see https://redis.io/commands/xrevrange - * @see https://redis.io/commands/xrange + * @see https://redis.io/docs/latest/commands/xrevrange/ + * @see https://redis.io/docs/latest/commands/xrange/ * * @example $redis->xRevRange('stream', '0-2', '0-1'); * @example $redis->xRevRange('stream', '+', '-'); @@ -4235,6 +5059,12 @@ public function xrevrange(string $key, string $end, string $start, int $count = * @param array|null $options An optional options array * * @return Redis|int|false One if the key was added zero if not. + * + * @see https://redis.io/docs/latest/commands/vadd/ + * + * @example + * $redis->vadd('embeddings', [0.12, 0.04, 0.88], 'doc:1'); + * */ public function vadd(string $key, array $values, mixed $element, array|null $options = null): Redis|int|false; @@ -4251,6 +5081,12 @@ public function vadd(string $key, array $values, mixed $element, array|null $opt * @param array|null $options An optional options array * * @return Redis|array|false An array of elements and their similarity scores, or false on failure. + * + * @see https://redis.io/docs/latest/commands/vsim/ + * + * @example + * $redis->vsim('embeddings', 'doc:1', ['COUNT' => 3]); + * */ public function vsim(string $key, mixed $member, array|null $options = null): Redis|array|false; @@ -4260,6 +5096,12 @@ public function vsim(string $key, mixed $member, array|null $options = null): Re * @param string $key The vector set to query. * * @return Redis|int|false The number of elements in the vector set or false on failure. + * + * @see https://redis.io/docs/latest/commands/vcard/ + * + * @example + * $redis->vcard('embeddings'); + * */ public function vcard(string $key): Redis|int|false; @@ -4269,6 +5111,12 @@ public function vcard(string $key): Redis|int|false; * @param string $key The vector set to query. * * @return Redis|int|false The number of dimensions in the vector set or false on failure. + * + * @see https://redis.io/docs/latest/commands/vdim/ + * + * @example + * $redis->vdim('embeddings'); + * */ public function vdim(string $key): Redis|int|false; @@ -4278,6 +5126,12 @@ public function vdim(string $key): Redis|int|false; * @param string $key The vector set to query. * * @return Redis|array|false An array of information about the vector set or false on failure. + * + * @see https://redis.io/docs/latest/commands/vinfo/ + * + * @example + * $redis->vinfo('embeddings'); + * */ public function vinfo(string $key): Redis|array|false; @@ -4288,6 +5142,12 @@ public function vinfo(string $key): Redis|array|false; * @param mixed $member The member to check for. * * @return Redis|bool true if the member exists, false if it does not. + * + * @see https://redis.io/docs/latest/commands/vismember/ + * + * @example + * $redis->vismember('embeddings', 'doc:1'); + * */ public function vismember(string $key, mixed $member): Redis|bool; @@ -4299,6 +5159,12 @@ public function vismember(string $key, mixed $member): Redis|bool; * @param bool $raw If set to `true`, the raw embeddings will be returned * * @return Redis|array|false An array of embeddings for the member or false on failure. + * + * @see https://redis.io/docs/latest/commands/vemb/ + * + * @example + * $redis->vemb('embeddings', 'doc:1'); + * */ public function vemb(string $key, mixed $member, bool $raw = false): Redis|array|false; @@ -4307,6 +5173,12 @@ public function vemb(string $key, mixed $member, bool $raw = false): Redis|array * * @param string $key The vector set to query. * @param int $count The number of random members to return. + * + * @see https://redis.io/docs/latest/commands/vrandmember/ + * + * @example + * $redis->vrandmember('embeddings', 2); + * */ public function vrandmember(string $key, int $count = 0): Redis|array|string|false; @@ -4319,6 +5191,12 @@ public function vrandmember(string $key, int $count = 0): Redis|array|string|fal * @param int $count An optional maximum number of elements to return. * * @return Redis|array|false An array of elements in the requested range or false on failure. + * + * @see https://redis.io/docs/latest/commands/vrange/ + * + * @example + * $redis->vrange('embeddings', '-', '+', 5); + * */ public function vrange(string $key, string $min, string $max, int $count = -1): Redis|array|false; @@ -4329,6 +5207,12 @@ public function vrange(string $key, string $min, string $max, int $count = -1): * @param mixed $member The member to remove. * * @return Redis|int|faslse 1 if the member was removed, 0 if it was not. + * + * @see https://redis.io/docs/latest/commands/vrem/ + * + * @example + * $redis->vrem('embeddings', 'doc:1'); + * */ public function vrem(string $key, mixed $member): Redis|int|false; @@ -4342,17 +5226,29 @@ public function vrem(string $key, mixed $member): Redis|int|false; * will be json encoded. * * @return Redis|int|false 1 if the attributes were set, 0 if they were not. + * + * @see https://redis.io/docs/latest/commands/vsetattr/ + * + * @example + * $redis->vsetattr('embeddings', 'doc:1', ['topic' => 'tech']); + * */ public function vsetattr(string $key, mixed $member, array|string $attributes): Redis|int|false; /** * Get the attributes of a vector set element * - * @param string $key The vector set to query. - * @param mixed $member The member to query. - * @param bool $decode Whether to automatically deserialize any returned json. + * @param string $key The vector set to query. + * @param mixed $member The member to query. + * @param bool $decode Whether to automatically deserialize any returned json. + * + * @return Redis|array|string|false An array of attributes for the member or false on failure. + * + * @see https://redis.io/docs/latest/commands/vgetattr/ + * + * @example + * $redis->vgetattr('embeddings', 'doc:1'); * - * @return Redis|array|false An array of attributes for the member or false on failure. */ public function vgetattr(string $key, mixed $member, bool $decode = true): Redis|array|string|false; @@ -4364,9 +5260,34 @@ public function vgetattr(string $key, mixed $member, bool $decode = true): Redis * @param bool $withscores If set to `true`, the scores of the adjacent values will be returned. * * @return Redis|array|false An array of adjacent values and their scores, or false on failure. + * + * @see https://redis.io/docs/latest/commands/vlinks/ + * + * @example + * $redis->vlinks('embeddings', 'doc:1', true); + * */ public function vlinks(string $key, mixed $member, bool $withscores = false): Redis|array|false; + /** + * Get rate limiting information + * + * @param string $key + * @param int $maxBurst + * @param int $requestsPerPeriod + * @param int $period + * @param int $tokens = 0 + * @return Redis|array|false + * + * @see https://redis.io/docs/latest/commands/gcra/ + * + * @example + * $redis->gcra('user:123', 10, 100, 3600); + */ + public function gcra(string $key, int $maxBurst, int $requestsPerPeriod, + int $period, int $tokens = 0): Redis|array|false; + + /** * Truncate a STREAM key in various ways. * @@ -4382,7 +5303,7 @@ public function vlinks(string $key, mixed $member, bool $withscores = false): Re * * @return Redis|int|false The number of entries deleted from the stream. * - * @see https://redis.io/commands/xtrim + * @see https://redis.io/docs/latest/commands/xtrim/ * * @example $redis->xTrim('stream', 3); * @example $redis->xTrim('stream', '2-1', false, true); @@ -4392,41 +5313,41 @@ public function xtrim(string $key, string $threshold, bool $approx = false, bool /** * Add one or more elements and scores to a Redis sorted set. * - * @param string $key The sorted set in question. - * @param array|float $score_or_options Either the score for the first element, or an array of options. - * - * $options = [ - * 'NX', # Only update elements that already exist - * 'NX', # Only add new elements but don't update existing ones. - * - * 'LT' # Only update existing elements if the new score is - * # less than the existing one. - * 'GT' # Only update existing elements if the new score is - * # greater than the existing one. - * - * 'CH' # Instead of returning the number of elements added, - * # Redis will return the number Of elements that were - * # changed in the operation. - * - * 'INCR' # Instead of setting each element to the provide score, - * # increment the element by the - * # provided score, much like ZINCRBY. When this option - * # is passed, you may only send a single score and member. - * ]; - * - * Note: 'GX', 'LT', and 'NX' cannot be passed together, and PhpRedis - * will send whichever one is last in the options array. - * - * @param mixed $more_scores_and_mems A variadic number of additional scores and members. - * - * @return Redis|int|false The return value varies depending on the options passed. + * @param string $key The sorted set in question. + * @param array|float $score_or_options Either the score for the first element, or an array of options. + * ```php + * $options = [ + * 'NX', # Only update elements that already exist + * 'NX', # Only add new elements but don't update existing ones. + * + * 'LT' # Only update existing elements if the new score is + * # less than the existing one. + * 'GT' # Only update existing elements if the new score is + * # greater than the existing one. + * + * 'CH' # Instead of returning the number of elements added, + * # Redis will return the number Of elements that were + * # changed in the operation. + * + * 'INCR' # Instead of setting each element to the provide score, + * # increment the element by the + * # provided score, much like ZINCRBY. When this option + * # is passed, you may only send a single score and member. + * ]; + * ``` + * Note: 'GX', 'LT', and 'NX' cannot be passed together, and PhpRedis + * will send whichever one is last in the options array. + * @param mixed ...$more_scores_and_mems A variadic number of additional scores and members. + * + * @return Redis|int|float|false The return value varies depending on the options passed. * * Following is information about the options that may be passed as the second argument: * - * @see https://redis.io/commands/zadd + * @see https://redis.io/docs/latest/commands/zadd/ * - * @example $redis->zadd('zs', 1, 'first', 2, 'second', 3, 'third'); - * @example $redis->zAdd('zs', ['XX'], 8, 'second', 99, 'new-element'); + * @example + * $redis->zadd('zs', 1, 'first', 2, 'second', 3, 'third'); + * $redis->zAdd('zs', ['XX'], 8, 'second', 99, 'new-element'); */ public function zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems): Redis|int|float|false; @@ -4437,7 +5358,7 @@ public function zAdd(string $key, array|float $score_or_options, mixed ...$more_ * * @return Redis|int|false The number of elements in the set or false on failure * - * @see https://redis.io/commands/zcard + * @see https://redis.io/docs/latest/commands/zcard/ * * @example $redis->zCard('zs'); */ @@ -4446,18 +5367,19 @@ public function zCard(string $key): Redis|int|false; /** * Count the number of members in a sorted set with scores inside a provided range. * - * @param string $key The sorted set to check. - * @param int|string $min The minimum score to include in the count - * @param int|string $max The maximum score to include in the count + * @param string $key The sorted set to check. + * @param int|string $start The minimum score to include in the count + * @param int|string $end The maximum score to include in the count * * NOTE: In addition to a floating point score you may pass the special values of '-inf' and * '+inf' meaning negative and positive infinity, respectively. * - * @see https://redis.io/commands/zcount + * @see https://redis.io/docs/latest/commands/zcount/ * - * @example $redis->zCount('fruit-rankings', '0', '+inf'); - * @example $redis->zCount('fruit-rankings', 50, 60); - * @example $redis->zCount('fruit-rankings', '-inf', 0); + * @example + * $redis->zCount('fruit-rankings', '0', '+inf'); + * $redis->zCount('fruit-rankings', 50, 60); + * $redis->zCount('fruit-rankings', '-inf', 0); */ public function zCount(string $key, int|string $start, int|string $end): Redis|int|false; @@ -4469,10 +5391,11 @@ public function zCount(string $key, int|string $start, int|string $end): Redis|i * * @return Redis|float|false The new score of the member or false on failure. * - * @see https://redis.io/commands/zincrby + * @see https://redis.io/docs/latest/commands/zincrby/ * - * @example $redis->zIncrBy('zs', 5.0, 'bananas'); - * @example $redis->zIncrBy('zs', 2.0, 'eggplants'); + * @example + * $redis->zIncrBy('zs', 5.0, 'bananas'); + * $redis->zIncrBy('zs', 2.0, 'eggplants'); */ public function zIncrBy(string $key, float $value, mixed $member): Redis|float|false; @@ -4486,7 +5409,7 @@ public function zIncrBy(string $key, float $value, mixed $member): Redis|float|f * * @return Redis|int|false The number of members that fall within the range or false on failure. * - * @see https://redis.io/commands/zlexcount + * @see https://redis.io/docs/latest/commands/zlexcount/ * * @example * $redis->zAdd('captains', 0, 'Janeway', 0, 'Kirk', 0, 'Picard', 0, 'Sisko', 0, 'Archer'); @@ -4497,11 +5420,11 @@ public function zLexCount(string $key, string $min, string $max): Redis|int|fals /** * Retrieve the score of one or more members in a sorted set. * - * @see https://redis.io/commands/zmscore + * @see https://redis.io/docs/latest/commands/zmscore/ * - * @param string $key The sorted set - * @param mixed $member The first member to return the score from - * @param mixed $other_members One or more additional members to return the scores of. + * @param string $key The sorted set + * @param mixed $member The first member to return the score from + * @param mixed ...$other_members One or more additional members to return the scores of. * * @return Redis|array|false An array of the scores of the requested elements. * @@ -4516,12 +5439,12 @@ public function zMscore(string $key, mixed $member, mixed ...$other_members): Re /** * Pop one or more of the highest scoring elements from a sorted set. * - * @param string $key The sorted set to pop elements from. - * @param int $count An optional count of elements to pop. + * @param string $key The sorted set to pop elements from. + * @param int|null $count An optional count of elements to pop. * * @return Redis|array|false All of the popped elements with scores or false on failure * - * @see https://redis.io/commands/zpopmax + * @see https://redis.io/docs/latest/commands/zpopmax/ * * @example * $redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three'); @@ -4534,12 +5457,12 @@ public function zPopMax(string $key, ?int $count = null): Redis|array|false; /** * Pop one or more of the lowest scoring elements from a sorted set. * - * @param string $key The sorted set to pop elements from. - * @param int $count An optional count of elements to pop. + * @param string $key The sorted set to pop elements from. + * @param int|null $count An optional count of elements to pop. * * @return Redis|array|false The popped elements with their scores or false on failure. * - * @see https://redis.io/commands/zpopmin + * @see https://redis.io/docs/latest/commands/zpopmin/ * * @example * $redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three'); @@ -4561,7 +5484,7 @@ public function zPopMin(string $key, ?int $count = null): Redis|array|false; * @param array|bool|null $options This value may either be an array of options to pass to * the command, or for historical purposes a boolean which * controls just the 'WITHSCORES' option. - * + * ```php * $options = [ * 'WITHSCORES' => true, # Return both scores and members. * 'LIMIT' => [10, 10], # Start at offset 10 and return 10 elements. @@ -4569,18 +5492,19 @@ public function zPopMin(string $key, ?int $count = null): Redis|array|false; * 'BYSCORE', # Treat `start` and `end` as scores instead * 'BYLEX' # Treat `start` and `end` as lexicographical values. * ]; - * + * ``` * - * Note: 'BYLEX' and 'BYSCORE' are mutually exclusive. + * Note: `BYLEX` and `BYSCORE` are mutually exclusive. * * * @return Redis|array|false An array with matching elements or false on failure. * - * @see https://redis.io/commands/zrange/ + * @see https://redis.io/docs/latest/commands/zrange/ * @category zset * - * @example $redis->zRange('zset', 0, -1); - * @example $redis->zRange('zset', '-inf', 'inf', ['byscore']); + * @example + * $redis->zRange('zset', 0, -1); + * $redis->zRange('zset', '-inf', 'inf', ['byscore']); */ public function zRange(string $key, string|int $start, string|int $end, array|bool|null $options = null): Redis|array|false; @@ -4595,7 +5519,7 @@ public function zRange(string $key, string|int $start, string|int $end, array|bo * * @return Redis|array|false An array of matching elements or false on failure. * - * @see https://redis.io/commands/zrangebylex + * @see https://redis.io/docs/latest/commands/zrangebylex/ * * @example * $redis = new Redis(['host' => 'localhost']); @@ -4620,10 +5544,11 @@ public function zRangeByLex(string $key, string $min, string $max, int $offset = * * @return Redis|array|false The number of matching elements or false on failure. * - * @see https://redis.io/commands/zrangebyscore + * @see https://redis.io/docs/latest/commands/zrangebyscore/ * - * @example $redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true]); - * @example $redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true, 'LIMIT' => [5, 5]]); + * @example + * $redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true]); + * $redis->zRangeByScore('zs', 20, 30, ['WITHSCORES' => true, 'LIMIT' => [5, 5]]); */ public function zRangeByScore(string $key, string $start, string $end, array $options = []): Redis|array|false; @@ -4639,11 +5564,15 @@ public function zRangeByScore(string $key, string $start, string $end, array $op * * @return Redis|int|false The number of elements stored in $dstkey or false on failure. * - * @see https://redis.io/commands/zrange/ + * @see https://redis.io/docs/latest/commands/zrange/ * @see Redis::zRange * @category zset * * See {@link Redis::zRange} for a full description of the possible options. + * + * @example + * $redis->zrangestore('recent:leaders', 'leaders', '0', '9'); + * */ public function zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = null): Redis|int|false; @@ -4651,18 +5580,18 @@ public function zrangestore(string $dstkey, string $srckey, string $start, strin /** * Retrieve one or more random members from a Redis sorted set. * - * @param string $key The sorted set to pull random members from. - * @param array $options One or more options that determine exactly how the command operates. - * - * OPTION TYPE MEANING - * 'COUNT' int The number of random members to return. - * 'WITHSCORES' bool Whether to return scores and members instead of + * @param string $key The sorted set to pull random members from. + * @param array|null $options One or more options that determine exactly how the command operates. + * OPTION TYPE MEANING + * 'COUNT' int The number of random members to return. + * 'WITHSCORES' bool Whether to return scores and members instead of * * @return Redis|string|array One or more random elements. * - * @see https://redis.io/commands/zrandmember + * @see https://redis.io/docs/latest/commands/zrandmember/ * - * @example $redis->zRandMember('zs', ['COUNT' => 2, 'WITHSCORES' => true]); + * @example + * $redis->zRandMember('zs', ['COUNT' => 2, 'WITHSCORES' => true]); */ public function zRandMember(string $key, ?array $options = null): Redis|string|array; @@ -4673,25 +5602,27 @@ public function zRandMember(string $key, ?array $options = null): Redis|string|a * @param mixed $member The member to test. * * @return Redis|int|false The rank of the requested member. - * @see https://redis.io/commands/zrank + * @see https://redis.io/docs/latest/commands/zrank/ * - * @example $redis->zRank('zs', 'zero'); - * @example $redis->zRank('zs', 'three'); + * @example + * $redis->zRank('zs', 'zero'); + * $redis->zRank('zs', 'three'); */ public function zRank(string $key, mixed $member): Redis|int|false; /** * Remove one or more members from a Redis sorted set. * - * @param mixed $key The sorted set in question. - * @param mixed $member The first member to remove. - * @param mixed $other_members One or more members to remove passed in a variadic fashion. + * @param mixed $key The sorted set in question. + * @param mixed $member The first member to remove. + * @param mixed ...$other_members One or more members to remove passed in a variadic fashion. * * @return Redis|int|false The number of members that were actually removed or false on failure. * - * @see https://redis.io/commands/zrem + * @see https://redis.io/docs/latest/commands/zrem/ * - * @example $redis->zRem('zs', 'mem:0', 'mem:1', 'mem:2', 'mem:6', 'mem:7', 'mem:8', 'mem:9'); + * @example + * $redis->zRem('zs', 'mem:0', 'mem:1', 'mem:2', 'mem:6', 'mem:7', 'mem:8', 'mem:9'); */ public function zRem(mixed $key, mixed $member, mixed ...$other_members): Redis|int|false; @@ -4704,11 +5635,12 @@ public function zRem(mixed $key, mixed $member, mixed ...$other_members): Redis| * * @return Redis|int|false The number of elements removed from the set or false on failure. * - * @see https://redis.io/commands/zremrangebylex + * @see https://redis.io/docs/latest/commands/zremrangebylex/ * @see Redis::zrangebylex() * - * @example $redis->zRemRangeByLex('zs', '[a', '(b'); - * @example $redis->zRemRangeByLex('zs', '(banana', '(eggplant'); + * @example + * $redis->zRemRangeByLex('zs', '[a', '(b'); + * $redis->zRemRangeByLex('zs', '(banana', '(eggplant'); */ public function zRemRangeByLex(string $key, string $min, string $max): Redis|int|false; @@ -4721,22 +5653,23 @@ public function zRemRangeByLex(string $key, string $min, string $max): Redis|int * * @return Redis|int|false The number of members removed from the set or false on failure. * - * @see https://redis.io/commands/zremrangebyrank + * @see https://redis.io/docs/latest/commands/zremrangebyrank/ * - * @example $redis->zRemRangeByRank('zs', 0, 3); + * @example + * $redis->zRemRangeByRank('zs', 0, 3); */ public function zRemRangeByRank(string $key, int $start, int $end): Redis|int|false; /** * Remove one or more members of a sorted set by their score. * - * @param string $key The sorted set where we want to remove members. - * @param int $start The lowest score to remove. - * @param int $end The highest score to remove. + * @param string $key The sorted set where we want to remove members. + * @param string $start The lowest score to remove. + * @param string $end The highest score to remove. * * @return Redis|int|false The number of members removed from the set or false on failure. * - * @see https://redis.io/commands/zremrangebyrank + * @see https://redis.io/docs/latest/commands/zremrangebyrank/ * * @example * $redis->zAdd('zs', 2, 'two', 4, 'four', 6, 'six'); @@ -4747,21 +5680,22 @@ public function zRemRangeByScore(string $key, string $start, string $end): Redis /** * List the members of a Redis sorted set in reverse order * - * @param string $key The sorted set in question. - * @param int $start The index to start listing elements - * @param int $end The index to stop listing elements. - * @param mixed $withscores Whether or not Redis should also return each members score. See + * @param string $key The sorted set in question. + * @param int $start The index to start listing elements + * @param int $end The index to stop listing elements. + * @param mixed|null $scores Whether or not Redis should also return each members score. See * the example below demonstrating how it may be used. * * @return Redis|array|false The members (and possibly scores) of the matching elements or false * on failure. * - * @see https://redis.io/commands/zrevrange + * @see https://redis.io/docs/latest/commands/zrevrange/ * - * @example $redis->zRevRange('zs', 0, -1); - * @example $redis->zRevRange('zs', 2, 3); - * @example $redis->zRevRange('zs', 0, -1, true); - * @example $redis->zRevRange('zs', 0, -1, ['withscores' => true]); + * @example + * $redis->zRevRange('zs', 0, -1); + * $redis->zRevRange('zs', 2, 3); + * $redis->zRevRange('zs', 0, -1, true); + * $redis->zRevRange('zs', 0, -1, ['withscores' => true]); */ public function zRevRange(string $key, int $start, int $end, mixed $scores = null): Redis|array|false; @@ -4769,42 +5703,43 @@ public function zRevRange(string $key, int $start, int $end, mixed $scores = nul * List members of a Redis sorted set within a legographical range, in reverse order. * * @param string $key The sorted set to list - * @param string $min The maximum legographical element to include in the result. + * @param string $max The maximum legographical element to include in the result. * @param string $min The minimum lexographical element to include in the result. - * @param string $offset An option offset within the matching elements to start at. - * @param string $count An optional count to limit the replies to. + * @param int $offset An option offset within the matching elements to start at. + * @param int $count An optional count to limit the replies to. * * @return Redis|array|false The matching members or false on failure. * - * @see https://redis.io/commands/zrevrangebylex + * @see https://redis.io/docs/latest/commands/zrevrangebylex/ * @see Redis::zrangebylex() * - * @example $redis->zRevRangeByLex('captains', '[Q', '[J'); - * @example $redis->zRevRangeByLex('captains', '[Q', '[J', 1, 2); + * @example + * $redis->zRevRangeByLex('captains', '[Q', '[J'); + * $redis->zRevRangeByLex('captains', '[Q', '[J', 1, 2); */ public function zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1): Redis|array|false; /** * List elements from a Redis sorted set by score, highest to lowest * - * @param string $key The sorted set to query. - * @param string $max The highest score to include in the results. - * @param string $min The lowest score to include in the results. - * @param array $options An options array that modifies how the command executes. + * @param string $key The sorted set to query. + * @param string $max The highest score to include in the results. + * @param string $min The lowest score to include in the results. + * @param array|bool $options An options array that modifies how the command executes. * - * - * $options = [ - * 'WITHSCORES' => true|false # Whether or not to return scores - * 'LIMIT' => [offset, count] # Return a subset of the matching members - * ]; - * + * ```php + * $options = [ + * 'WITHSCORES' => true|false # Whether or not to return scores + * 'LIMIT' => [offset, count] # Return a subset of the matching members + * ]; + * ``` * - * NOTE: For legacy reason, you may also simply pass `true` for the - * options argument, to mean `WITHSCORES`. + * NOTE: For legacy reason, you may also simply pass `true` for the + * options argument, to mean `WITHSCORES`. * * @return Redis|array|false The matching members in reverse order of score or false on failure. * - * @see https://redis.io/commands/zrevrangebyscore + * @see https://redis.io/docs/latest/commands/zrevrangebyscore/ * * @example * $redis->zadd('oldest-people', 122.4493, 'Jeanne Calment', 119.2932, 'Kane Tanaka', @@ -4827,7 +5762,7 @@ public function zRevRangeByScore(string $key, string $max, string $min, array|bo * * @return Redis|int|false The reverse rank (the rank if counted high to low) of the member or * false on failure. - * @see https://redis.io/commands/zrevrank + * @see https://redis.io/docs/latest/commands/zrevrank/ * * @example * $redis->zAdd('ds9-characters', 10, 'Sisko', 9, 'Garak', 8, 'Dax', 7, 'Odo'); @@ -4843,9 +5778,9 @@ public function zRevRank(string $key, mixed $member): Redis|int|false; * @param string $key The sorted set to query. * @param mixed $member The member we wish to query. * - * @return The score of the requested element or false if it is not found. + * @return Redis|float|false The score of the requested element or false if it is not found. * - * @see https://redis.io/commands/zscore + * @see https://redis.io/docs/latest/commands/zscore/ * * @example * $redis->zAdd('telescopes', 11.9, 'LBT', 10.4, 'GTC', 10, 'HET'); @@ -4857,13 +5792,13 @@ public function zScore(string $key, mixed $member): Redis|float|false; * Given one or more sorted set key names, return every element that is in the first * set but not any of the others. * - * @param array $keys One or more sorted sets. - * @param array $options An array which can contain ['WITHSCORES' => true] if you want Redis to - * return members and scores. + * @param array $keys One or more sorted sets. + * @param array|null $options An array which can contain ['WITHSCORES' => true] if you want Redis to + * return members and scores. * * @return Redis|array|false An array of members or false on failure. * - * @see https://redis.io/commands/zdiff + * @see https://redis.io/docs/latest/commands/zdiff/ * * @example * $redis->zAdd('primes', 1, 'one', 3, 'three', 5, 'five'); @@ -4879,29 +5814,33 @@ public function zdiff(array $keys, ?array $options = null): Redis|array|false; * * See {@link Redis::zdiff} for a more detailed description of how the diff operation works. * - * @param string $key The destination set name. + * @param string $dst The destination set name. * @param array $keys One or more source key names * * @return Redis|int|false The number of elements stored in the destination set or false on * failure. * - * @see https://redis.io/commands/zdiff + * @see https://redis.io/docs/latest/commands/zdiff/ * @see Redis::zdiff() + * + * @example + * $redis->zdiffstore('only:new', ['all:users', 'inactive:users']); + * */ public function zdiffstore(string $dst, array $keys): Redis|int|false; /** * Compute the intersection of one or more sorted sets and return the members * - * @param array $keys One or more sorted sets. - * @param array $weights An optional array of weights to be applied to each set when performing - * the intersection. - * @param array $options Options for how Redis should combine duplicate elements when performing the - * intersection. See Redis::zunion() for details. + * @param array $keys One or more sorted sets. + * @param array|null $weights An optional array of weights to be applied to each set when performing + * the intersection. + * @param array|null $options Options for how Redis should combine duplicate elements when performing the + * intersection. See Redis::zunion() for details. * * @return Redis|array|false All of the members that exist in every set. * - * @see https://redis.io/commands/zinter + * @see https://redis.io/docs/latest/commands/zinter/ * * @example * $redis->zAdd('TNG', 2, 'Worf', 2.5, 'Data', 4.0, 'Picard'); @@ -4917,8 +5856,8 @@ public function zinter(array $keys, ?array $weights = null, ?array $options = nu * Similar to ZINTER but instead of returning the intersected values, this command returns the * cardinality of the intersected set. * - * @see https://redis.io/commands/zintercard - * @see https://redis.io/commands/zinter + * @see https://redis.io/docs/latest/commands/zintercard/ + * @see https://redis.io/docs/latest/commands/zinter/ * @see Redis::zinter() * * @param array $keys One or more sorted set key names. @@ -4939,19 +5878,18 @@ public function zintercard(array $keys, int $limit = -1): Redis|int|false; /** * Compute the intersection of one or more sorted sets storing the result in a new sorted set. * - * @param string $dst The destination sorted set to store the intersected values. - * @param array $keys One or more sorted set key names. - * @param array $weights An optional array of floats to weight each passed input set. - * @param string $aggregate An optional aggregation method to use. - * - * 'SUM' - Store sum of all intersected members (this is the default). - * 'MIN' - Store minimum value for each intersected member. - * 'MAX' - Store maximum value for each intersected member. + * @param string $dst The destination sorted set to store the intersected values. + * @param array $keys One or more sorted set key names. + * @param array|null $weights An optional array of floats to weight each passed input set. + * @param string|null $aggregate An optional aggregation method to use. + * 'SUM' - Store sum of all intersected members (this is the default). + * 'MIN' - Store minimum value for each intersected member. + * 'MAX' - Store maximum value for each intersected member. * * @return Redis|int|false The total number of members writtern to the destination set or false on failure. * - * @see https://redis.io/commands/zinterstore - * @see https://redis.io/commands/zinter + * @see https://redis.io/docs/latest/commands/zinterstore/ + * @see https://redis.io/docs/latest/commands/zinter/ * * @example * $redis->zAdd('zs1', 3, 'apples', 2, 'pears'); @@ -4966,50 +5904,60 @@ public function zinterstore(string $dst, array $keys, ?array $weights = null, ?s /** * Scan the members of a sorted set incrementally, using a cursor * - * @param string $key The sorted set to scan. - * @param int $iterator A reference to an iterator that should be initialized to NULL initially, that - * will be updated after each subsequent call to ZSCAN. Once the iterator - * has returned to zero the scan is complete - * @param string|null $pattern An optional glob-style pattern that limits which members are returned during - * the scanning process. - * @param int $count A hint for Redis that tells it how many elements it should test before returning - * from the call. The higher the more work Redis may do in any one given call to - * ZSCAN potentially blocking for longer periods of time. + * @param string $key The sorted set to scan. + * @param int|string|null $iterator A reference to an iterator that should be initialized to NULL initially, that + * will be updated after each subsequent call to ZSCAN. Once the iterator + * has returned to zero the scan is complete + * @param string|null $pattern An optional glob-style pattern that limits which members are returned during + * the scanning process. + * @param int $count A hint for Redis that tells it how many elements it should test before returning + * from the call. The higher the more work Redis may do in any one given call to + * ZSCAN potentially blocking for longer periods of time. * * @return Redis|array|false An array of elements or false on failure. * - * @see https://redis.io/commands/zscan - * @see https://redis.io/commands/scan + * @see https://redis.io/docs/latest/commands/zscan/ + * @see https://redis.io/docs/latest/commands/scan/ * @see Redis::scan() * * NOTE: See Redis::scan() for detailed example code on how to call SCAN like commands. * + * @example + * $it = null; + * while ($members = $redis->zscan('leaders', $it)) { + * foreach ($members as $member => $score) { + * printf('%s => %s' . PHP_EOL, $member, $score); + * } + * } + * */ public function zscan(string $key, null|int|string &$iterator, ?string $pattern = null, int $count = 0): Redis|array|false; /** * Retrieve the union of one or more sorted sets * - * @param array $keys One or more sorted set key names - * @param array $weights An optional array with floating point weights used when performing the union. - * Note that if this argument is passed, it must contain the same number of - * elements as the $keys array. - * @param array $options An array that modifies how this command functions. + * @param array $keys One or more sorted set key names + * @param array|null $weights An optional array with floating point weights used when performing the union. + * Note that if this argument is passed, it must contain the same number of + * elements as the $keys array. + * @param array|null $options An array that modifies how this command functions. * - * - * $options = [ - * # By default when members exist in more than one set Redis will SUM - * # total score for each match. Instead, it can return the AVG, MIN, - * # or MAX value based on this option. - * 'AGGREGATE' => 'sum' | 'min' | 'max' + * ```php + * $options = [ + * # By default when members exist in more than one set Redis will SUM + * # total score for each match. Instead, it can return the AVG, MIN, + * # or MAX value based on this option. + * 'AGGREGATE' => 'sum' | 'min' | 'max' * - * # Whether Redis should also return each members aggregated score. - * 'WITHSCORES' => true | false - * ] - * + * # Whether Redis should also return each members aggregated score. + * 'WITHSCORES' => true | false + * ] + * ``` * * @return Redis|array|false The union of each sorted set or false on failure * + * @see https://redis.io/docs/latest/commands/zunion/ + * * @example * $redis->del('store1', 'store2', 'store3'); * $redis->zAdd('store1', 1, 'apples', 3, 'pears', 6, 'bananas'); @@ -5025,15 +5973,15 @@ public function zunion(array $keys, ?array $weights = null, ?array $options = nu /** * Perform a union on one or more Redis sets and store the result in a destination sorted set. * - * @param string $dst The destination set to store the union. - * @param array $keys One or more input keys on which to perform our union. - * @param array $weights An optional weights array used to weight each input set. - * @param string $aggregate An optional modifier in how Redis will combine duplicate members. - * Valid: 'MIN', 'MAX', 'SUM'. + * @param string $dst The destination set to store the union. + * @param array $keys One or more input keys on which to perform our union. + * @param array|null $weights An optional weights array used to weight each input set. + * @param string|null $aggregate An optional modifier in how Redis will combine duplicate members. + * Valid: 'MIN', 'MAX', 'SUM'. * * @return Redis|int|false The number of members stored in the destination set or false on failure. * - * @see https://redis.io/commands/zunionstore + * @see https://redis.io/docs/latest/commands/zunionstore/ * @see Redis::zunion() * * @example @@ -5044,6 +5992,22 @@ public function zunion(array $keys, ?array $weights = null, ?array $options = nu * $redis->zUnionStore('dst', ['zs1', 'zs2', 'zs3']); */ public function zunionstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null): Redis|int|false; + + /** + * Ask the server for the XXH3 digest of a given key's value + * + * @param strinig $key The key to retrieve the digest for. + * @return Redis|string|false The XXH3 digest as a string or false on failure. + * + * @see https://redis.io/docs/latest/commands/digest/ + * + * @example + * $redis->digest('session:42'); + * + */ + public function digest(string $key): Redis|string|false; } + + class RedisException extends RuntimeException {} diff --git a/redis_arginfo.h b/redis_arginfo.h index 568bf43655..73acd29d8f 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: 358ec6a551a8da176ffa340e6f9696389b614758 */ + * Stub hash: 3ee3118802fef67d6bd7176f2a72f0568d962c8b */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") @@ -28,6 +28,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_Redis__pack arginfo_class_Redis__serialize +#define arginfo_class_Redis__digest arginfo_class_Redis__serialize + #define arginfo_class_Redis__unpack arginfo_class_Redis__unserialize ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_acl, 0, 1, IS_MIXED, 0) @@ -175,6 +177,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_del, 0, 1, Redis ZEND_ARG_VARIADIC_TYPE_INFO(0, other_keys, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_delex, 0, 1, Redis, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") +ZEND_END_ARG_INFO() + #define arginfo_class_Redis_delifeq arginfo_class_Redis_append #define arginfo_class_Redis_delete arginfo_class_Redis_del @@ -655,6 +662,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_mset, 0, 1, Redi ZEND_ARG_TYPE_INFO(0, key_values, IS_ARRAY, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_msetex, 0, 1, Redis, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key_vals, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(0, expiry, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_ARRAY|MAY_BE_NULL, "null") +ZEND_END_ARG_INFO() + #define arginfo_class_Redis_msetnx arginfo_class_Redis_mset ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_multi, 0, 0, Redis, MAY_BE_BOOL) @@ -1010,6 +1022,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_xdel, 0, 2, Redi ZEND_ARG_TYPE_INFO(0, ids, IS_ARRAY, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_xdelex, 0, 2, Redis, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ids, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_xgroup, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, operation, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 1, "null") @@ -1130,6 +1148,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_vlinks, 0, 2, Re ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, withscores, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_gcra, 0, 4, Redis, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, maxBurst, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, requestsPerPeriod, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, period, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tokens, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_xtrim, 0, 2, Redis, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, threshold, IS_STRING, 0) @@ -1299,6 +1325,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_Redis_zunionstore arginfo_class_Redis_zinterstore +#define arginfo_class_Redis_digest arginfo_class_Redis_dump + ZEND_METHOD(Redis, __construct); ZEND_METHOD(Redis, __destruct); ZEND_METHOD(Redis, _compress); @@ -1307,6 +1335,7 @@ ZEND_METHOD(Redis, _prefix); ZEND_METHOD(Redis, _serialize); ZEND_METHOD(Redis, _unserialize); ZEND_METHOD(Redis, _pack); +ZEND_METHOD(Redis, _digest); ZEND_METHOD(Redis, _unpack); ZEND_METHOD(Redis, acl); ZEND_METHOD(Redis, append); @@ -1338,6 +1367,7 @@ ZEND_METHOD(Redis, debug); ZEND_METHOD(Redis, decr); ZEND_METHOD(Redis, decrBy); ZEND_METHOD(Redis, del); +ZEND_METHOD(Redis, delex); ZEND_METHOD(Redis, delifeq); ZEND_METHOD(Redis, discard); ZEND_METHOD(Redis, dump); @@ -1447,6 +1477,7 @@ ZEND_METHOD(Redis, mget); ZEND_METHOD(Redis, migrate); ZEND_METHOD(Redis, move); ZEND_METHOD(Redis, mset); +ZEND_METHOD(Redis, msetex); ZEND_METHOD(Redis, msetnx); ZEND_METHOD(Redis, multi); ZEND_METHOD(Redis, object); @@ -1530,6 +1561,7 @@ ZEND_METHOD(Redis, xadd); ZEND_METHOD(Redis, xautoclaim); ZEND_METHOD(Redis, xclaim); ZEND_METHOD(Redis, xdel); +ZEND_METHOD(Redis, xdelex); ZEND_METHOD(Redis, xgroup); ZEND_METHOD(Redis, xinfo); ZEND_METHOD(Redis, xlen); @@ -1551,6 +1583,7 @@ ZEND_METHOD(Redis, vrem); ZEND_METHOD(Redis, vsetattr); ZEND_METHOD(Redis, vgetattr); ZEND_METHOD(Redis, vlinks); +ZEND_METHOD(Redis, gcra); ZEND_METHOD(Redis, xtrim); ZEND_METHOD(Redis, zAdd); ZEND_METHOD(Redis, zCard); @@ -1583,6 +1616,7 @@ ZEND_METHOD(Redis, zinterstore); ZEND_METHOD(Redis, zscan); ZEND_METHOD(Redis, zunion); ZEND_METHOD(Redis, zunionstore); +ZEND_METHOD(Redis, digest); static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, __construct, arginfo_class_Redis___construct, ZEND_ACC_PUBLIC) @@ -1593,6 +1627,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, _serialize, arginfo_class_Redis__serialize, ZEND_ACC_PUBLIC) ZEND_ME(Redis, _unserialize, arginfo_class_Redis__unserialize, ZEND_ACC_PUBLIC) ZEND_ME(Redis, _pack, arginfo_class_Redis__pack, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, _digest, arginfo_class_Redis__digest, ZEND_ACC_PUBLIC) ZEND_ME(Redis, _unpack, arginfo_class_Redis__unpack, ZEND_ACC_PUBLIC) ZEND_ME(Redis, acl, arginfo_class_Redis_acl, ZEND_ACC_PUBLIC) ZEND_ME(Redis, append, arginfo_class_Redis_append, ZEND_ACC_PUBLIC) @@ -1624,6 +1659,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, decr, arginfo_class_Redis_decr, ZEND_ACC_PUBLIC) ZEND_ME(Redis, decrBy, arginfo_class_Redis_decrBy, ZEND_ACC_PUBLIC) ZEND_ME(Redis, del, arginfo_class_Redis_del, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, delex, arginfo_class_Redis_delex, ZEND_ACC_PUBLIC) ZEND_ME(Redis, delifeq, arginfo_class_Redis_delifeq, ZEND_ACC_PUBLIC) #if (PHP_VERSION_ID >= 80400) ZEND_RAW_FENTRY("delete", zim_Redis_del, arginfo_class_Redis_delete, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, NULL) @@ -1738,6 +1774,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, migrate, arginfo_class_Redis_migrate, ZEND_ACC_PUBLIC) ZEND_ME(Redis, move, arginfo_class_Redis_move, ZEND_ACC_PUBLIC) ZEND_ME(Redis, mset, arginfo_class_Redis_mset, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, msetex, arginfo_class_Redis_msetex, ZEND_ACC_PUBLIC) ZEND_ME(Redis, msetnx, arginfo_class_Redis_msetnx, ZEND_ACC_PUBLIC) ZEND_ME(Redis, multi, arginfo_class_Redis_multi, ZEND_ACC_PUBLIC) ZEND_ME(Redis, object, arginfo_class_Redis_object, ZEND_ACC_PUBLIC) @@ -1831,6 +1868,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, xautoclaim, arginfo_class_Redis_xautoclaim, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xclaim, arginfo_class_Redis_xclaim, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xdel, arginfo_class_Redis_xdel, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, xdelex, arginfo_class_Redis_xdelex, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xgroup, arginfo_class_Redis_xgroup, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xinfo, arginfo_class_Redis_xinfo, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xlen, arginfo_class_Redis_xlen, ZEND_ACC_PUBLIC) @@ -1852,6 +1890,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, vsetattr, arginfo_class_Redis_vsetattr, ZEND_ACC_PUBLIC) ZEND_ME(Redis, vgetattr, arginfo_class_Redis_vgetattr, ZEND_ACC_PUBLIC) ZEND_ME(Redis, vlinks, arginfo_class_Redis_vlinks, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, gcra, arginfo_class_Redis_gcra, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xtrim, arginfo_class_Redis_xtrim, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zAdd, arginfo_class_Redis_zAdd, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zCard, arginfo_class_Redis_zCard, ZEND_ACC_PUBLIC) @@ -1884,6 +1923,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, zscan, arginfo_class_Redis_zscan, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zunion, arginfo_class_Redis_zunion, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zunionstore, arginfo_class_Redis_zunionstore, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, digest, arginfo_class_Redis_digest, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/redis_array.c b/redis_array.c index bc64047509..ee4b8d78ad 100644 --- a/redis_array.c +++ b/redis_array.c @@ -66,17 +66,17 @@ redis_array_free(RedisArray *ra) /* Redis objects */ for(i = 0; i< ra->count; i++) { - zval_dtor(&ra->redis[i]); + zval_ptr_dtor_nogc(&ra->redis[i]); zend_string_release(ra->hosts[i]); } efree(ra->redis); efree(ra->hosts); /* delete hash function */ - zval_dtor(&ra->z_fun); + zval_ptr_dtor_nogc(&ra->z_fun); /* Distributor */ - zval_dtor(&ra->z_dist); + zval_ptr_dtor_nogc(&ra->z_dist); /* Hashing algorithm */ if (ra->algorithm) zend_string_release(ra->algorithm); @@ -121,6 +121,7 @@ create_redis_array_object(zend_class_entry *ce) memcpy(&redis_array_object_handlers, zend_get_std_object_handlers(), sizeof(redis_array_object_handlers)); redis_array_object_handlers.offset = XtOffsetOf(redis_array_object, std); redis_array_object_handlers.free_obj = free_redis_array_object; + redis_array_object_handlers.clone_obj = NULL; obj->std.handlers = &redis_array_object_handlers; return &obj->std; @@ -214,8 +215,8 @@ PHP_METHOD(RedisArray, __construct) if (algorithm) zend_string_release(algorithm); if (user) zend_string_release(user); if (pass) zend_string_release(pass); - zval_dtor(&z_dist); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_dist); + zval_ptr_dtor_nogc(&z_fun); finish: @@ -277,10 +278,10 @@ ra_forward_call(INTERNAL_FUNCTION_PARAMETERS, RedisArray *ra, const char *cmd, /* multi/exec */ if(ra->z_multi_exec) { call_user_function(&redis_ce->function_table, ra->z_multi_exec, &z_fun, return_value, argc, z_callargs); - zval_dtor(return_value); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(return_value); + zval_ptr_dtor_nogc(&z_fun); for (i = 0; i < argc; ++i) { - zval_dtor(&z_callargs[i]); + zval_ptr_dtor_nogc(&z_callargs[i]); } efree(z_callargs); RETURN_ZVAL(getThis(), 1, 0); @@ -295,7 +296,7 @@ ra_forward_call(INTERNAL_FUNCTION_PARAMETERS, RedisArray *ra, const char *cmd, ra_index_multi(redis_inst, MULTI); /* call using discarded temp value and extract exec results after. */ call_user_function(&redis_ce->function_table, redis_inst, &z_fun, return_value, argc, z_callargs); - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); /* add keys to index. */ ra_index_key(key, key_len, redis_inst); @@ -309,7 +310,7 @@ ra_forward_call(INTERNAL_FUNCTION_PARAMETERS, RedisArray *ra, const char *cmd, /* check if we have an error. */ if (ra->prev && RA_CALL_FAILED(return_value, cmd)) { /* there was an error reading, try with prev ring. */ /* Free previous return value */ - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); /* ERROR, FALLBACK TO PREVIOUS RING and forward a reference to the first redis instance we were looking at. */ ra_forward_call(INTERNAL_FUNCTION_PARAM_PASSTHRU, ra->prev, cmd, cmd_len, z_args, z_new_target ? z_new_target : redis_inst); @@ -323,9 +324,9 @@ ra_forward_call(INTERNAL_FUNCTION_PARAMETERS, RedisArray *ra, const char *cmd, } /* cleanup */ - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); for (i = 0; i < argc; ++i) { - zval_dtor(&z_callargs[i]); + zval_ptr_dtor_nogc(&z_callargs[i]); } efree(z_callargs); } @@ -543,7 +544,7 @@ multihost_distribute(INTERNAL_FUNCTION_PARAMETERS, const char *method_name) multihost_distribute_call(ra, return_value, &z_fun, 0, NULL); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); } static void @@ -568,7 +569,7 @@ multihost_distribute_flush(INTERNAL_FUNCTION_PARAMETERS, const char *method_name multihost_distribute_call(ra, return_value, &z_fun, 1, z_args); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); } PHP_METHOD(RedisArray, info) @@ -629,8 +630,8 @@ PHP_METHOD(RedisArray, keys) multihost_distribute_call(ra, return_value, &z_fun, 1, z_args); - zval_dtor(&z_args[0]); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_fun); } PHP_METHOD(RedisArray, getOption) @@ -656,7 +657,7 @@ PHP_METHOD(RedisArray, getOption) multihost_distribute_call(ra, return_value, &z_fun, 1, z_args); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); } PHP_METHOD(RedisArray, setOption) @@ -685,8 +686,8 @@ PHP_METHOD(RedisArray, setOption) multihost_distribute_call(ra, return_value, &z_fun, 2, z_args); - zval_dtor(&z_args[1]); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_args[1]); + zval_ptr_dtor_nogc(&z_fun); } PHP_METHOD(RedisArray, select) @@ -712,7 +713,7 @@ PHP_METHOD(RedisArray, select) multihost_distribute_call(ra, return_value, &z_fun, 1, z_args); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); } #define HANDLE_MULTI_EXEC(ra, cmd, cmdlen) do { \ @@ -732,7 +733,7 @@ PHP_METHOD(RedisArray, select) } \ /* call */\ ra_forward_call(INTERNAL_FUNCTION_PARAM_PASSTHRU, ra, cmd, cmdlen, &z_arg_array, NULL); \ - zval_dtor(&z_arg_array); \ + zval_ptr_dtor_nogc(&z_arg_array); \ return; \ } \ } while(0) @@ -825,13 +826,13 @@ PHP_METHOD(RedisArray, mget) call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_arg); /* cleanup args array */ - zval_dtor(&z_arg); + zval_ptr_dtor_nogc(&z_arg); /* Error out if we didn't get a proper response */ if (Z_TYPE(z_ret) != IS_ARRAY) { /* cleanup */ - zval_dtor(&z_ret); - zval_dtor(&z_tmp_array); + zval_ptr_dtor_nogc(&z_ret); + zval_ptr_dtor_nogc(&z_tmp_array); RETVAL_FALSE; goto cleanup; } @@ -842,10 +843,10 @@ PHP_METHOD(RedisArray, mget) ZVAL_ZVAL(&z_arg, z_cur, 1, 0); add_index_zval(&z_tmp_array, i, &z_arg); } - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); } - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); array_init(return_value); /* copy temp array in the right order to return_value */ @@ -857,7 +858,7 @@ PHP_METHOD(RedisArray, mget) } /* cleanup */ - zval_dtor(&z_tmp_array); + zval_ptr_dtor_nogc(&z_tmp_array); cleanup: efree(argv); efree(pos); @@ -954,7 +955,7 @@ PHP_METHOD(RedisArray, mset) } if(!found) { - zval_dtor(&z_argarray); + zval_ptr_dtor_nogc(&z_argarray); continue; /* don't run empty MSETs */ } @@ -967,11 +968,11 @@ PHP_METHOD(RedisArray, mset) call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray); } - zval_dtor(&z_argarray); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_argarray); + zval_ptr_dtor_nogc(&z_ret); } - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); /* Free any keys that we needed to allocate memory for, because they weren't strings */ for(i = 0; i < argc; i++) { @@ -1027,7 +1028,7 @@ ra_generic_del(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len) /* init data structures */ h_keys = Z_ARRVAL(z_keys); if ((argc = zend_hash_num_elements(h_keys)) == 0) { - if (free_zkeys) zval_dtor(&z_keys); + if (free_zkeys) zval_ptr_dtor_nogc(&z_keys); efree(z_args); RETURN_FALSE; } @@ -1075,7 +1076,7 @@ ra_generic_del(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len) } if(!found) { /* don't run empty DEL or UNLINK commands */ - zval_dtor(&z_argarray); + zval_ptr_dtor_nogc(&z_argarray); continue; } @@ -1089,11 +1090,11 @@ ra_generic_del(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len) } total += Z_LVAL(z_ret); /* increment total */ - zval_dtor(&z_argarray); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_argarray); + zval_ptr_dtor_nogc(&z_ret); } - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); RETVAL_LONG(total); @@ -1103,7 +1104,7 @@ ra_generic_del(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len) efree(argc_each); if(free_zkeys) { - zval_dtor(&z_keys); + zval_ptr_dtor_nogc(&z_keys); } efree(z_args); } @@ -1147,7 +1148,7 @@ ra_generic_scan_cmd(INTERNAL_FUNCTION_PARAMETERS, const char *kw, int kw_len) ZVAL_STRINGL(&z_fun, kw, kw_len); call_user_function(&redis_ce->function_table, redis_inst, &z_fun, return_value, ZEND_NUM_ARGS(), z_args); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); ZVAL_ZVAL(z_cursor, &z_args[1], 0, 1); } @@ -1193,7 +1194,7 @@ PHP_METHOD(RedisArray, scan) ZVAL_STRING(&z_fun, "SCAN"); call_user_function(&redis_ce->function_table, redis_inst, &z_fun, return_value, ZEND_NUM_ARGS() - 1, z_args); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_fun); ZVAL_ZVAL(z_iter, &z_args[0], 0, 1); } diff --git a/redis_array.stub.php b/redis_array.stub.php index 9312b58008..7f3a4cc290 100644 --- a/redis_array.stub.php +++ b/redis_array.stub.php @@ -6,6 +6,260 @@ * @generate-class-entries */ +/** + * @method mixed acl(string $subcmd, string ...$args) + * @method RedisArray|int|false append(string $key, mixed $value) + * @method RedisArray|bool auth(#[\SensitiveParameter] mixed $credentials) + * @method RedisArray|bool bgrewriteaof() + * @method RedisArray|array|false waitaof(int $numlocal, int $numreplicas, int $timeout) + * @method RedisArray|int|false bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false) + * @method RedisArray|int|false bitop(string $operation, string $deskey, string $srckey, string ...$other_keys) + * @method RedisArray|int|false bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false) + * @method RedisArray|array|null|false blPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed ...$extra_args) + * @method RedisArray|array|null|false brPop(string|array $key_or_keys, string|float|int $timeout_or_key, mixed ...$extra_args) + * @method RedisArray|string|false brpoplpush(string $src, string $dst, int|float $timeout) + * @method RedisArray|array|false bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) + * @method RedisArray|array|false bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args) + * @method RedisArray|array|null|false bzmpop(float $timeout, array $keys, string $from, int $count = 1) + * @method RedisArray|array|null|false zmpop(array $keys, string $from, int $count = 1) + * @method RedisArray|array|null|false blmpop(float $timeout, array $keys, string $from, int $count = 1) + * @method RedisArray|array|null|false lmpop(array $keys, string $from, int $count = 1) + * @method bool clearLastError() + * @method mixed client(string $opt, mixed ...$args) + * @method bool close() + * @method mixed command(?string $opt = null, mixed ...$args) + * @method mixed config(string $operation, array|string|null $key_or_settings = null, ?string $value = null) + * @method RedisArray|bool copy(string $src, string $dst, ?array $options = null) + * @method RedisArray|int|false dbSize() + * @method RedisArray|string debug(string $key) + * @method RedisArray|int|false decr(string $key, int $by = 1) + * @method RedisArray|int|false decrBy(string $key, int $value) + * @method RedisArray|int|false delex(string $key, ?array $options = null) + * @method RedisArray|int|false delifeq(string $key, mixed $value) + * @method RedisArray|int|false delete(array|string $key, string ...$other_keys) + * @method RedisArray|string|false dump(string $key) + * @method RedisArray|string|false echo(string $str) + * @method mixed eval(string $script, array $args = [], int $num_keys = 0) + * @method mixed eval_ro(string $script_sha, array $args = [], int $num_keys = 0) + * @method mixed evalsha(string $sha1, array $args = [], int $num_keys = 0) + * @method mixed evalsha_ro(string $sha1, array $args = [], int $num_keys = 0) + * @method RedisArray|int|bool exists(mixed $key, mixed ...$other_keys) + * @method RedisArray|bool expire(string $key, int $timeout, ?string $mode = null) + * @method RedisArray|bool expireAt(string $key, int $timestamp, ?string $mode = null) + * @method RedisArray|bool failover(?array $to = null, bool $abort = false, int $timeout = 0) + * @method RedisArray|int|false expiretime(string $key) + * @method RedisArray|int|false pexpiretime(string $key) + * @method mixed fcall(string $fn, array $keys = [], array $args = []) + * @method mixed fcall_ro(string $fn, array $keys = [], array $args = []) + * @method RedisArray|bool|string|array function(string $operation, mixed ...$args) + * @method RedisArray|int|false geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options) + * @method RedisArray|float|false geodist(string $key, string $src, string $dst, ?string $unit = null) + * @method RedisArray|array|false geohash(string $key, string $member, string ...$other_members) + * @method RedisArray|array|false geopos(string $key, string $member, string ...$other_members) + * @method mixed georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) + * @method mixed georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []) + * @method mixed georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []) + * @method mixed georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []) + * @method array geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []) + * @method RedisArray|array|int|false geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []) + * @method mixed get(string $key) + * @method RedisArray|array|false getWithMeta(string $key) + * @method mixed getAuth() + * @method RedisArray|int|false getBit(string $key, int $idx) + * @method RedisArray|string|bool getEx(string $key, array $options = []) + * @method int getDBNum() + * @method RedisArray|string|bool getDel(string $key) + * @method string getHost() + * @method string|null getLastError() + * @method int getMode() + * @method string|null getPersistentID() + * @method int getPort() + * @method string|false serverName() + * @method string|false serverVersion() + * @method RedisArray|string|false getRange(string $key, int $start, int $end) + * @method RedisArray|string|array|int|false lcs(string $key1, string $key2, ?array $options = null) + * @method float getReadTimeout() + * @method RedisArray|string|false getset(string $key, mixed $value) + * @method float|false getTimeout() + * @method array getTransferredBytes() + * @method void clearTransferredBytes() + * @method RedisArray|int|false hDel(string $key, string $field, string ...$other_fields) + * @method RedisArray|bool hExists(string $key, string $field) + * @method mixed hGet(string $key, string $member) + * @method RedisArray|array|false hGetAll(string $key) + * @method mixed hGetWithMeta(string $key, string $member) + * @method RedisArray|int|false hIncrBy(string $key, string $field, int $value) + * @method RedisArray|float|false hIncrByFloat(string $key, string $field, float $value) + * @method RedisArray|array|false hKeys(string $key) + * @method RedisArray|int|false hLen(string $key) + * @method RedisArray|array|false hMget(string $key, array $fields) + * @method RedisArray|array|false hgetex(string $key, array $fields, string|array|null $expiry = null) + * @method RedisArray|int|false hsetex(string $key, array $fields, ?array $expiry = null) + * @method RedisArray|array|false hgetdel(string $key, array $fields) + * @method RedisArray|bool hMset(string $key, array $fieldvals) + * @method RedisArray|string|array|false hRandField(string $key, ?array $options = null) + * @method RedisArray|int|false hSet(string $key, mixed ...$fields_and_vals) + * @method RedisArray|bool hSetNx(string $key, string $field, mixed $value) + * @method RedisArray|int|false hStrLen(string $key, string $field) + * @method RedisArray|array|false hVals(string $key) + * @method RedisArray|array|false httl(string $key, array $fields) + * @method RedisArray|array|false hpttl(string $key, array $fields) + * @method RedisArray|array|false hexpiretime(string $key, array $fields) + * @method RedisArray|array|false hpexpiretime(string $key, array $fields) + * @method RedisArray|array|false hpersist(string $key, array $fields) + * @method RedisArray|int|false expiremember(string $key, string $field, int $ttl, ?string $unit = null) + * @method RedisArray|int|false expirememberat(string $key, string $field, int $timestamp) + * @method RedisArray|int|false incr(string $key, int $by = 1) + * @method RedisArray|int|false incrBy(string $key, int $value) + * @method RedisArray|float|false incrByFloat(string $key, float $value) + * @method bool isConnected() + * @method lInsert(string $key, string $pos, mixed $pivot, mixed $value) + * @method RedisArray|int|false lLen(string $key) + * @method RedisArray|string|false lMove(string $src, string $dst, string $wherefrom, string $whereto) + * @method RedisArray|string|false blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout) + * @method RedisArray|bool|string|array lPop(string $key, int $count = 0) + * @method RedisArray|null|bool|int|array lPos(string $key, mixed $value, ?array $options = null) + * @method RedisArray|int|false lPush(string $key, mixed ...$elements) + * @method RedisArray|int|false rPush(string $key, mixed ...$elements) + * @method RedisArray|int|false lPushx(string $key, mixed $value) + * @method RedisArray|int|false rPushx(string $key, mixed $value) + * @method RedisArray|bool lSet(string $key, int $index, mixed $value) + * @method int lastSave() + * @method mixed lindex(string $key, int $index) + * @method RedisArray|array|false lrange(string $key, int $start , int $end) + * @method RedisArray|int|false lrem(string $key, mixed $value, int $count = 0) + * @method RedisArray|bool ltrim(string $key, int $start , int $end) + * @method RedisArray|bool move(string $key, int $index) + * @method RedisArray|int|false msetex(array $key_vals, int|float|array|null $expiry = null) + * @method RedisArray|bool msetnx(array $key_values) + * @method RedisArray|int|string|false object(string $subcommand, string $key) + * @method 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) + * @method 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) + * @method RedisArray|bool persist(string $key) + * @method bool pexpire(string $key, int $timeout, ?string $mode = null) + * @method RedisArray|bool pexpireAt(string $key, int $timestamp, ?string $mode = null) + * @method RedisArray|int pfadd(string $key, array $elements) + * @method RedisArray|int|false pfcount(array|string $key_or_keys) + * @method RedisArray|bool pfmerge(string $dst, array $srckeys) + * @method bool|RedisArray pipeline() + * @method 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) + * @method RedisArray|bool psetex(string $key, int $expire, mixed $value) + * @method bool psubscribe(array $patterns, callable $cb) + * @method RedisArray|int|false pttl(string $key) + * @method RedisArray|int|false publish(string $channel, string $message) + * @method mixed pubsub(string $command, mixed $arg = null) + * @method RedisArray|array|bool punsubscribe(array $patterns) + * @method RedisArray|array|string|bool rPop(string $key, int $count = 0) + * @method RedisArray|string|false randomKey() + * @method mixed rawcommand(string $command, mixed ...$args) + * @method RedisArray|bool rename(string $old_name, string $new_name) + * @method RedisArray|bool renameNx(string $key_src, string $key_dst) + * @method RedisArray|bool reset() + * @method RedisArray|bool restore(string $key, int $ttl, string $value, ?array $options = null) + * @method mixed role() + * @method RedisArray|string|false rpoplpush(string $srckey, string $dstkey) + * @method RedisArray|int|false sAdd(string $key, mixed $value, mixed ...$other_values) + * @method int sAddArray(string $key, array $values) + * @method RedisArray|array|false sDiff(string $key, string ...$other_keys) + * @method RedisArray|int|false sDiffStore(string $dst, string $key, string ...$other_keys) + * @method RedisArray|array|false sInter(array|string $key, string ...$other_keys) + * @method RedisArray|int|false sintercard(array $keys, int $limit = -1) + * @method RedisArray|int|false sInterStore(array|string $key, string ...$other_keys) + * @method RedisArray|array|false sMembers(string $key) + * @method RedisArray|array|false sMisMember(string $key, string $member, string ...$other_members) + * @method RedisArray|bool sMove(string $src, string $dst, mixed $value) + * @method RedisArray|string|array|false sPop(string $key, int $count = 0) + * @method mixed sRandMember(string $key, int $count = 0) + * @method RedisArray|array|false sUnion(string $key, string ...$other_keys) + * @method RedisArray|int|false sUnionStore(string $dst, string $key, string ...$other_keys) + * @method RedisArray|int|false scard(string $key) + * @method mixed script(string $command, mixed ...$args) + * @method RedisArray|string|bool set(string $key, mixed $value, mixed $options = null) + * @method RedisArray|int|false setBit(string $key, int $idx, bool $value) + * @method RedisArray|int|false setRange(string $key, int $index, string $value) + * @method setex(string $key, int $expire, mixed $value) + * @method RedisArray|bool setnx(string $key, mixed $value) + * @method RedisArray|bool sismember(string $key, mixed $value) + * @method RedisArray|bool slaveof(?string $host = null, int $port = 6379) + * @method RedisArray|bool replicaof(?string $host = null, int $port = 6379) + * @method RedisArray|int|false touch(array|string $key_or_array, string ...$more_keys) + * @method mixed slowlog(string $operation, int $length = 0) + * @method mixed sort(string $key, ?array $options = null) + * @method mixed sort_ro(string $key, ?array $options = null) + * @method array sortAsc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + * @method array sortAscAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + * @method array sortDesc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + * @method array sortDescAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null) + * @method RedisArray|int|false srem(string $key, mixed $value, mixed ...$other_values) + * @method bool ssubscribe(array $channels, callable $cb) + * @method RedisArray|int|false strlen(string $key) + * @method bool subscribe(array $channels, callable $cb) + * @method RedisArray|array|bool sunsubscribe(array $channels) + * @method RedisArray|bool swapdb(int $src, int $dst) + * @method RedisArray|array time() + * @method RedisArray|int|false ttl(string $key) + * @method RedisArray|int|false type(string $key) + * @method RedisArray|array|bool unsubscribe(array $channels) + * @method RedisArray|bool watch(array|string $key, string ...$other_keys) + * @method int|false wait(int $numreplicas, int $timeout) + * @method int|false xack(string $key, string $group, array $ids) + * @method RedisArray|string|false xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false, bool $nomkstream = false) + * @method RedisArray|bool|array xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false) + * @method RedisArray|array|bool xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options) + * @method RedisArray|int|false xdel(string $key, array $ids) + * @method Relay|array|false xdelex(string $key, array $ids, ?string $mode = null) + * @method mixed xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1) + * @method RedisArray|int|false xlen(string $key) + * @method RedisArray|array|false xpending(string $key, string $group, ?string $start = null, ?string $end = null, int $count = -1, ?string $consumer = null) + * @method RedisArray|array|bool xrange(string $key, string $start, string $end, int $count = -1) + * @method RedisArray|array|bool xread(array $streams, int $count = -1, int $block = -1) + * @method RedisArray|array|bool xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1) + * @method RedisArray|array|bool xrevrange(string $key, string $end, string $start, int $count = -1) + * @method RedisArray|int|false vadd(string $key, array $values, mixed $element, array|null $options = null) + * @method RedisArray|array|false vsim(string $key, mixed $member, array|null $options = null) + * @method RedisArray|int|false vcard(string $key) + * @method RedisArray|int|false vdim(string $key) + * @method RedisArray|array|false vinfo(string $key) + * @method RedisArray|bool vismember(string $key, mixed $member) + * @method RedisArray|array|false vemb(string $key, mixed $member, bool $raw = false) + * @method RedisArray|array|string|false vrandmember(string $key, int $count = 0) + * @method RedisArray|array|false vrange(string $key, string $min, string $max, int $count = -1) + * @method RedisArray|int|false vrem(string $key, mixed $member) + * @method RedisArray|int|false vsetattr(string $key, mixed $member, array|string $attributes) + * @method RedisArray|array|string|false vgetattr(string $key, mixed $member, bool $decode = true) + * @method RedisArray|array|false vlinks(string $key, mixed $member, bool $withscores = false) + * @method RedisArray|int|false xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1) + * @method RedisArray|int|float|false zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems) + * @method RedisArray|int|false zCard(string $key) + * @method RedisArray|int|false zCount(string $key, int|string $start, int|string $end) + * @method RedisArray|float|false zIncrBy(string $key, float $value, mixed $member) + * @method RedisArray|int|false zLexCount(string $key, string $min, string $max) + * @method RedisArray|array|false zMscore(string $key, mixed $member, mixed ...$other_members) + * @method RedisArray|array|false zPopMax(string $key, ?int $count = null) + * @method RedisArray|array|false zPopMin(string $key, ?int $count = null) + * @method RedisArray|array|false zRange(string $key, string|int $start, string|int $end, array|bool|null $options = null) + * @method RedisArray|array|false zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) + * @method RedisArray|array|false zRangeByScore(string $key, string $start, string $end, array $options = []) + * @method RedisArray|string|array zRandMember(string $key, ?array $options = null) + * @method RedisArray|int|false zRank(string $key, mixed $member) + * @method RedisArray|int|false zRem(mixed $key, mixed $member, mixed ...$other_members) + * @method RedisArray|int|false zRemRangeByLex(string $key, string $min, string $max) + * @method RedisArray|int|false zRemRangeByRank(string $key, int $start, int $end) + * @method RedisArray|int|false zRemRangeByScore(string $key, string $start, string $end) + * @method RedisArray|array|false zRevRange(string $key, int $start, int $end, mixed $scores = null) + * @method RedisArray|array|false zRevRangeByLex(string $key, string $max, string $min, int $offset = -1, int $count = -1) + * @method RedisArray|array|false zRevRangeByScore(string $key, string $max, string $min, array|bool $options = []) + * @method RedisArray|int|false zRevRank(string $key, mixed $member) + * @method RedisArray|float|false zScore(string $key, mixed $member) + * @method RedisArray|array|false zdiff(array $keys, ?array $options = null) + * @method RedisArray|int|false zdiffstore(string $dst, array $keys) + * @method RedisArray|array|false zinter(array $keys, ?array $weights = null, ?array $options = null) + * @method RedisArray|int|false zintercard(array $keys, int $limit = -1) + * @method RedisArray|int|false zinterstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null) + * @method RedisArray|array|false zunion(array $keys, ?array $weights = null, ?array $options = null) + * @method RedisArray|int|false zunionstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null) + * @method RedisArray|string|false digest(string $key) + */ class RedisArray { public function __call(string $function_name, array $arguments): mixed; diff --git a/redis_array_arginfo.h b/redis_array_arginfo.h index ab1ac840e3..313bdc183a 100644 --- a/redis_array_arginfo.h +++ b/redis_array_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: ddb92422452cb767a7d6694aa8ac60d883db6672 */ + * Stub hash: 1293a0ccef1e700da87d9ace76c3a05d91c0ffc7 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_RedisArray___call, 0, 2, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, function_name, IS_STRING, 0) @@ -109,7 +109,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_RedisArray_zscan arginfo_class_RedisArray_hscan - ZEND_METHOD(RedisArray, __call); ZEND_METHOD(RedisArray, __construct); ZEND_METHOD(RedisArray, _continuum); @@ -142,7 +141,6 @@ ZEND_METHOD(RedisArray, unlink); ZEND_METHOD(RedisArray, unwatch); ZEND_METHOD(RedisArray, zscan); - static const zend_function_entry class_RedisArray_methods[] = { ZEND_ME(RedisArray, __call, arginfo_class_RedisArray___call, ZEND_ACC_PUBLIC) ZEND_ME(RedisArray, __construct, arginfo_class_RedisArray___construct, ZEND_ACC_PUBLIC) @@ -183,7 +181,11 @@ static zend_class_entry *register_class_RedisArray(void) zend_class_entry ce, *class_entry; INIT_CLASS_ENTRY(ce, "RedisArray", class_RedisArray_methods); +#if (PHP_VERSION_ID >= 80400) + class_entry = zend_register_internal_class_with_flags(&ce, NULL, 0); +#else class_entry = zend_register_internal_class_ex(&ce, NULL); +#endif return class_entry; } diff --git a/redis_array_impl.c b/redis_array_impl.c index a8d06875ed..90e592fe77 100644 --- a/redis_array_impl.c +++ b/redis_array_impl.c @@ -202,7 +202,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_zval(Z_ARRVAL(z_tmp), name, name_len, &z_fun, 1, 0); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find distributor */ @@ -210,7 +210,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_zval(Z_ARRVAL(z_tmp), name, name_len, &z_dist, 1, 0); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find hash algorithm */ @@ -218,7 +218,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_string(Z_ARRVAL(z_tmp), name, name_len, &algorithm); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find index option */ @@ -226,7 +226,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_zend_bool(Z_ARRVAL(z_tmp), name, name_len, &b_index); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find autorehash option */ @@ -234,7 +234,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_zend_bool(Z_ARRVAL(z_tmp), name, name_len, &b_autorehash); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find retry interval option */ @@ -242,7 +242,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_long(Z_ARRVAL(z_tmp), name, name_len, &l_retry_interval); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find pconnect option */ @@ -250,7 +250,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_zend_bool(Z_ARRVAL(z_tmp), name, name_len, &b_pconnect); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find lazy connect option */ @@ -258,7 +258,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_zend_bool(Z_ARRVAL(z_tmp), name, name_len, &b_lazy_connect); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find connect timeout option */ @@ -266,7 +266,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_double(Z_ARRVAL(z_tmp), name, name_len, &d_connect_timeout); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find read timeout option */ @@ -274,7 +274,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_double(Z_ARRVAL(z_tmp), name, name_len, &read_timeout); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find consistent option */ @@ -285,7 +285,7 @@ RedisArray *ra_load_array(const char *name) { consistent = Z_TYPE_P(z_data) == IS_STRING && redis_strncmp(Z_STRVAL_P(z_data), ZEND_STRL("1")) == 0; } - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* find auth option */ @@ -293,7 +293,7 @@ RedisArray *ra_load_array(const char *name) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_auth(Z_ARRVAL(z_tmp), name, name_len, &user, &pass); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* create RedisArray object */ @@ -309,10 +309,10 @@ RedisArray *ra_load_array(const char *name) { if (user) zend_string_release(user); if (pass) zend_string_release(pass); - zval_dtor(&z_params_hosts); - zval_dtor(&z_params_prev); - zval_dtor(&z_dist); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_params_hosts); + zval_ptr_dtor_nogc(&z_params_prev); + zval_ptr_dtor_nogc(&z_dist); + zval_ptr_dtor_nogc(&z_fun); return ra; } @@ -385,7 +385,7 @@ ra_make_array(HashTable *hosts, zval *z_fun, zval *z_dist, HashTable *hosts_prev if (ra_load_hosts(ra, hosts, user, pass, retry_interval, b_lazy_connect) == NULL || !ra->count) { for (i = 0; i < ra->count; ++i) { - zval_dtor(&ra->redis[i]); + zval_ptr_dtor_nogc(&ra->redis[i]); zend_string_release(ra->hosts[i]); } efree(ra->redis); @@ -435,8 +435,8 @@ ra_call_extractor(RedisArray *ra, const char *key, int key_len) out = zval_get_string(&z_ret); } - zval_dtor(&z_argv); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_argv); + zval_ptr_dtor_nogc(&z_ret); return out; } @@ -474,8 +474,8 @@ ra_call_distributor(RedisArray *ra, const char *key, int key_len) ret = (Z_TYPE(z_ret) == IS_LONG) ? Z_LVAL(z_ret) : -1; - zval_dtor(&z_argv); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_argv); + zval_ptr_dtor_nogc(&z_ret); return ret; } @@ -573,8 +573,8 @@ ra_index_multi(zval *z_redis, long multi_value) { ZVAL_STRINGL(&z_fun_multi, "MULTI", 5); ZVAL_LONG(&z_args[0], multi_value); call_user_function(&redis_ce->function_table, z_redis, &z_fun_multi, &z_ret, 1, z_args); - zval_dtor(&z_fun_multi); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_multi); + zval_ptr_dtor_nogc(&z_ret); } static void @@ -604,9 +604,9 @@ ra_index_change_keys(const char *cmd, zval *z_keys, zval *z_redis) { /* run cmd */ call_user_function(&redis_ce->function_table, z_redis, &z_fun, &z_ret, argc, z_args); - zval_dtor(&z_args[0]); - zval_dtor(&z_fun); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_fun); + zval_ptr_dtor_nogc(&z_ret); efree(z_args); /* free container */ } @@ -643,7 +643,7 @@ ra_index_keys(zval *z_pairs, zval *z_redis) { ra_index_change_keys("SADD", &z_keys, z_redis); /* cleanup */ - zval_dtor(&z_keys); + zval_ptr_dtor_nogc(&z_keys); } void @@ -659,10 +659,10 @@ ra_index_key(const char *key, int key_len, zval *z_redis) { /* run SADD */ call_user_function(&redis_ce->function_table, z_redis, &z_fun_sadd, &z_ret, 2, z_args); - zval_dtor(&z_fun_sadd); - zval_dtor(&z_args[1]); - zval_dtor(&z_args[0]); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_sadd); + zval_ptr_dtor_nogc(&z_args[1]); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_ret); } void @@ -673,7 +673,7 @@ ra_index_exec(zval *z_redis, zval *return_value, int keep_all) { /* run EXEC */ ZVAL_STRINGL(&z_fun_exec, "EXEC", 4); call_user_function(&redis_ce->function_table, z_redis, &z_fun_exec, &z_ret, 0, NULL); - zval_dtor(&z_fun_exec); + zval_ptr_dtor_nogc(&z_fun_exec); /* extract first element of exec array and put into return_value. */ if(Z_TYPE(z_ret) == IS_ARRAY) { @@ -686,7 +686,7 @@ ra_index_exec(zval *z_redis, zval *return_value, int keep_all) { } } } - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); /* zval *zptr = &z_ret; */ /* php_var_dump(&zptr, 0); */ @@ -701,8 +701,8 @@ ra_index_discard(zval *z_redis, zval *return_value) { ZVAL_STRINGL(&z_fun_discard, "DISCARD", 7); call_user_function(&redis_ce->function_table, z_redis, &z_fun_discard, &z_ret, 0, NULL); - zval_dtor(&z_fun_discard); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_discard); + zval_ptr_dtor_nogc(&z_ret); } void @@ -714,8 +714,8 @@ ra_index_unwatch(zval *z_redis, zval *return_value) { ZVAL_STRINGL(&z_fun_unwatch, "UNWATCH", 7); call_user_function(&redis_ce->function_table, z_redis, &z_fun_unwatch, &z_ret, 0, NULL); - zval_dtor(&z_fun_unwatch); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_unwatch); + zval_ptr_dtor_nogc(&z_ret); } zend_bool @@ -753,15 +753,15 @@ ra_get_key_type(zval *z_redis, const char *key, int key_len, zval *z_from, long ZVAL_NULL(&z_ret); ZVAL_STRINGL(&z_fun, "TYPE", 4); call_user_function(&redis_ce->function_table, z_redis, &z_fun, &z_ret, 1, &z_arg); - zval_dtor(&z_fun); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun); + zval_ptr_dtor_nogc(&z_ret); /* run TYPE */ ZVAL_NULL(&z_ret); ZVAL_STRINGL(&z_fun, "TTL", 3); call_user_function(&redis_ce->function_table, z_redis, &z_fun, &z_ret, 1, &z_arg); - zval_dtor(&z_fun); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun); + zval_ptr_dtor_nogc(&z_ret); /* Get the result from the pipeline. */ ra_index_exec(z_from, &z_ret, 1); @@ -775,8 +775,8 @@ ra_get_key_type(zval *z_redis, const char *key, int key_len, zval *z_from, long res[i++] = Z_LVAL_P(z_data); } ZEND_HASH_FOREACH_END(); } - zval_dtor(&z_arg); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_arg); + zval_ptr_dtor_nogc(&z_ret); return success; } @@ -794,10 +794,10 @@ ra_remove_from_index(zval *z_redis, const char *key, int key_len) { call_user_function(&redis_ce->function_table, z_redis, &z_fun_srem, &z_ret, 2, z_args); /* cleanup */ - zval_dtor(&z_fun_srem); - zval_dtor(&z_args[1]); - zval_dtor(&z_args[0]); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_srem); + zval_ptr_dtor_nogc(&z_args[1]); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_ret); } @@ -814,9 +814,9 @@ ra_del_key(const char *key, int key_len, zval *z_from) { ZVAL_STRINGL(&z_fun_del, "DEL", 3); ZVAL_STRINGL(&z_args[0], key, key_len); call_user_function(&redis_ce->function_table, z_from, &z_fun_del, &z_ret, 1, z_args); - zval_dtor(&z_fun_del); - zval_dtor(&z_args[0]); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_del); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_ret); /* remove key from index */ ra_remove_from_index(z_from, key, key_len); @@ -839,9 +839,9 @@ ra_expire_key(const char *key, int key_len, zval *z_to, long ttl) { ZVAL_STRINGL(&z_args[0], key, key_len); ZVAL_LONG(&z_args[1], ttl); call_user_function(&redis_ce->function_table, z_to, &z_fun_expire, &z_ret, 2, z_args); - zval_dtor(&z_fun_expire); - zval_dtor(&z_args[0]); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_expire); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_ret); } return 1; @@ -863,15 +863,15 @@ ra_move_zset(const char *key, int key_len, zval *z_from, zval *z_to, long ttl) { ZVAL_STRINGL(&z_args[2], "-1", 2); ZVAL_BOOL(&z_args[3], 1); call_user_function(&redis_ce->function_table, z_from, &z_fun_zrange, &z_ret, 4, z_args); - zval_dtor(&z_fun_zrange); - zval_dtor(&z_args[2]); - zval_dtor(&z_args[1]); - zval_dtor(&z_args[0]); + zval_ptr_dtor_nogc(&z_fun_zrange); + zval_ptr_dtor_nogc(&z_args[2]); + zval_ptr_dtor_nogc(&z_args[1]); + zval_ptr_dtor_nogc(&z_args[0]); if(Z_TYPE(z_ret) != IS_ARRAY) { /* key not found or replaced */ /* TODO: report? */ - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); return 0; } @@ -906,13 +906,13 @@ ra_move_zset(const char *key, int key_len, zval *z_from, zval *z_to, long ttl) { ra_expire_key(key, key_len, z_to, ttl); /* cleanup */ - zval_dtor(&z_fun_zadd); - zval_dtor(&z_ret_dest); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_zadd); + zval_ptr_dtor_nogc(&z_ret_dest); + zval_ptr_dtor_nogc(&z_ret); /* Free the array itself */ for (i = 0; i < 1 + 2 * count; i++) { - zval_dtor(&z_zadd_args[i]); + zval_ptr_dtor_nogc(&z_zadd_args[i]); } efree(z_zadd_args); @@ -928,12 +928,12 @@ ra_move_string(const char *key, int key_len, zval *z_from, zval *z_to, long ttl) ZVAL_STRINGL(&z_fun_get, "GET", 3); ZVAL_STRINGL(&z_args[0], key, key_len); call_user_function(&redis_ce->function_table, z_from, &z_fun_get, &z_ret, 1, z_args); - zval_dtor(&z_fun_get); + zval_ptr_dtor_nogc(&z_fun_get); if(Z_TYPE(z_ret) != IS_STRING) { /* key not found or replaced */ /* TODO: report? */ - zval_dtor(&z_args[0]); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_ret); return 0; } @@ -942,21 +942,21 @@ ra_move_string(const char *key, int key_len, zval *z_from, zval *z_to, long ttl) ZVAL_STRINGL(&z_fun_set, "SETEX", 5); ZVAL_LONG(&z_args[1], ttl); ZVAL_STRINGL(&z_args[2], Z_STRVAL(z_ret), Z_STRLEN(z_ret)); /* copy z_ret to arg 1 */ - zval_dtor(&z_ret); /* free memory from our previous call */ + zval_ptr_dtor_nogc(&z_ret); /* free memory from our previous call */ call_user_function(&redis_ce->function_table, z_to, &z_fun_set, &z_ret, 3, z_args); /* cleanup */ - zval_dtor(&z_args[2]); + zval_ptr_dtor_nogc(&z_args[2]); } else { ZVAL_STRINGL(&z_fun_set, "SET", 3); ZVAL_STRINGL(&z_args[1], Z_STRVAL(z_ret), Z_STRLEN(z_ret)); /* copy z_ret to arg 1 */ - zval_dtor(&z_ret); /* free memory from our previous return value */ + zval_ptr_dtor_nogc(&z_ret); /* free memory from our previous return value */ call_user_function(&redis_ce->function_table, z_to, &z_fun_set, &z_ret, 2, z_args); /* cleanup */ - zval_dtor(&z_args[1]); + zval_ptr_dtor_nogc(&z_args[1]); } - zval_dtor(&z_fun_set); - zval_dtor(&z_args[0]); - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_fun_set); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(&z_ret); return 1; } @@ -969,27 +969,27 @@ ra_move_hash(const char *key, int key_len, zval *z_from, zval *z_to, long ttl) { ZVAL_STRINGL(&z_args[0], key, key_len); ZVAL_STRINGL(&z_fun_hgetall, "HGETALL", 7); call_user_function(&redis_ce->function_table, z_from, &z_fun_hgetall, &z_args[1], 1, z_args); - zval_dtor(&z_fun_hgetall); + zval_ptr_dtor_nogc(&z_fun_hgetall); if (Z_TYPE(z_args[1]) != IS_ARRAY) { /* key not found or replaced */ /* TODO: report? */ - zval_dtor(&z_args[1]); - zval_dtor(&z_args[0]); + zval_ptr_dtor_nogc(&z_args[1]); + zval_ptr_dtor_nogc(&z_args[0]); return 0; } /* run HMSET on target */ ZVAL_STRINGL(&z_fun_hmset, "HMSET", 5); call_user_function(&redis_ce->function_table, z_to, &z_fun_hmset, &z_ret_dest, 2, z_args); - zval_dtor(&z_fun_hmset); - zval_dtor(&z_ret_dest); + zval_ptr_dtor_nogc(&z_fun_hmset); + zval_ptr_dtor_nogc(&z_ret_dest); /* Expire if needed */ ra_expire_key(key, key_len, z_to, ttl); /* cleanup */ - zval_dtor(&z_args[1]); - zval_dtor(&z_args[0]); + zval_ptr_dtor_nogc(&z_args[1]); + zval_ptr_dtor_nogc(&z_args[0]); return 1; } @@ -1018,15 +1018,15 @@ ra_move_collection(const char *key, int key_len, zval *z_from, zval *z_to, call_user_function(&redis_ce->function_table, z_from, &z_fun_retrieve, &z_ret, list_count, z_retrieve_args); /* cleanup */ - zval_dtor(&z_fun_retrieve); + zval_ptr_dtor_nogc(&z_fun_retrieve); for(i = 0; i < list_count; ++i) { - zval_dtor(&z_retrieve_args[i]); + zval_ptr_dtor_nogc(&z_retrieve_args[i]); } efree(z_retrieve_args); if(Z_TYPE(z_ret) != IS_ARRAY) { /* key not found or replaced */ /* TODO: report? */ - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); return 0; } @@ -1045,19 +1045,19 @@ ra_move_collection(const char *key, int key_len, zval *z_from, zval *z_to, } ZEND_HASH_FOREACH_END(); /* Clean up our input return value */ - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); call_user_function(&redis_ce->function_table, z_to, &z_fun_sadd, &z_ret, count, z_sadd_args); /* cleanup */ - zval_dtor(&z_fun_sadd); + zval_ptr_dtor_nogc(&z_fun_sadd); for (i = 0; i < count; i++) { - zval_dtor(&z_sadd_args[i]); + zval_ptr_dtor_nogc(&z_sadd_args[i]); } efree(z_sadd_args); /* Clean up our output return value */ - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); /* Expire if needed */ ra_expire_key(key, key_len, z_to, ttl); @@ -1150,8 +1150,8 @@ zval_rehash_callback(zend_fcall_info *z_cb, zend_fcall_info_cache *z_cb_cache, zend_call_function(z_cb, z_cb_cache); /* cleanup */ - zval_dtor(&z_args[0]); - zval_dtor(z_ret); + zval_ptr_dtor_nogc(&z_args[0]); + zval_ptr_dtor_nogc(z_ret); } static void @@ -1172,8 +1172,8 @@ ra_rehash_server(RedisArray *ra, zval *z_redis, zend_string *hostname, zend_bool } ZVAL_NULL(&z_ret); call_user_function(&redis_ce->function_table, z_redis, &z_fun, &z_ret, 1, &z_argv); - zval_dtor(&z_argv); - zval_dtor(&z_fun); + zval_ptr_dtor_nogc(&z_argv); + zval_ptr_dtor_nogc(&z_fun); if (Z_TYPE(z_ret) == IS_ARRAY) { h_keys = Z_ARRVAL(z_ret); @@ -1181,7 +1181,7 @@ ra_rehash_server(RedisArray *ra, zval *z_redis, zend_string *hostname, zend_bool } if (!count) { - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); return; } @@ -1203,7 +1203,7 @@ ra_rehash_server(RedisArray *ra, zval *z_redis, zend_string *hostname, zend_bool } ZEND_HASH_FOREACH_END(); /* cleanup */ - zval_dtor(&z_ret); + zval_ptr_dtor_nogc(&z_ret); } void diff --git a/redis_array_legacy_arginfo.h b/redis_array_legacy_arginfo.h index 7fe38aa7dc..cdb20349c1 100644 --- a/redis_array_legacy_arginfo.h +++ b/redis_array_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: ddb92422452cb767a7d6694aa8ac60d883db6672 */ + * Stub hash: 1293a0ccef1e700da87d9ace76c3a05d91c0ffc7 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisArray___call, 0, 0, 2) ZEND_ARG_INFO(0, function_name) @@ -105,7 +105,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_RedisArray_zscan arginfo_class_RedisArray_hscan - ZEND_METHOD(RedisArray, __call); ZEND_METHOD(RedisArray, __construct); ZEND_METHOD(RedisArray, _continuum); @@ -138,7 +137,6 @@ ZEND_METHOD(RedisArray, unlink); ZEND_METHOD(RedisArray, unwatch); ZEND_METHOD(RedisArray, zscan); - static const zend_function_entry class_RedisArray_methods[] = { ZEND_ME(RedisArray, __call, arginfo_class_RedisArray___call, ZEND_ACC_PUBLIC) ZEND_ME(RedisArray, __construct, arginfo_class_RedisArray___construct, ZEND_ACC_PUBLIC) @@ -179,7 +177,11 @@ static zend_class_entry *register_class_RedisArray(void) zend_class_entry ce, *class_entry; INIT_CLASS_ENTRY(ce, "RedisArray", class_RedisArray_methods); +#if (PHP_VERSION_ID >= 80400) + class_entry = zend_register_internal_class_with_flags(&ce, NULL, 0); +#else class_entry = zend_register_internal_class_ex(&ce, NULL); +#endif return class_entry; } diff --git a/redis_cluster.c b/redis_cluster.c index 6d7768d5f5..71a5003e7b 100644 --- a/redis_cluster.c +++ b/redis_cluster.c @@ -209,6 +209,7 @@ zend_object * create_cluster_context(zend_class_entry *class_type) { memcpy(&RedisCluster_handlers, zend_get_std_object_handlers(), sizeof(RedisCluster_handlers)); RedisCluster_handlers.offset = XtOffsetOf(redisCluster, std); RedisCluster_handlers.free_obj = free_cluster_context; + RedisCluster_handlers.clone_obj = NULL; cluster->std.handlers = &RedisCluster_handlers; @@ -245,9 +246,8 @@ static void redis_cluster_init(redisCluster *c, HashTable *ht_seeds, double time c->flags->user = zend_string_copy(user); if (pass && ZSTR_LEN(pass)) c->flags->pass = zend_string_copy(pass); - if (context) { - redis_sock_set_stream_context(c->flags, context); - } + if (context) + redis_sock_set_context_zval(c->flags, context); c->flags->timeout = timeout; c->flags->read_timeout = read_timeout; @@ -292,7 +292,7 @@ void redis_cluster_load(redisCluster *c, char *name, int name_len) { if ((z_value = zend_hash_str_find(Z_ARRVAL(z_seeds), name, name_len)) != NULL) { ht_seeds = Z_ARRVAL_P(z_value); } else { - zval_dtor(&z_seeds); + zval_ptr_dtor_nogc(&z_seeds); CLUSTER_THROW_EXCEPTION("Couldn't find seeds for cluster", 0); return; } @@ -302,7 +302,7 @@ void redis_cluster_load(redisCluster *c, char *name, int name_len) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_double(Z_ARRVAL(z_tmp), name, name_len, &timeout); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* Read timeout */ @@ -310,7 +310,7 @@ void redis_cluster_load(redisCluster *c, char *name, int name_len) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_double(Z_ARRVAL(z_tmp), name, name_len, &read_timeout); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* Persistent connections */ @@ -318,21 +318,21 @@ void redis_cluster_load(redisCluster *c, char *name, int name_len) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_bool(Z_ARRVAL(z_tmp), name, name_len, &persistent); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } if ((iptr = INI_STR("redis.clusters.auth"))) { array_init(&z_tmp); sapi_module.treat_data(PARSE_STRING, estrdup(iptr), &z_tmp); redis_conf_auth(Z_ARRVAL(z_tmp), name, name_len, &user, &pass); - zval_dtor(&z_tmp); + zval_ptr_dtor_nogc(&z_tmp); } /* Attempt to create/connect to the cluster */ redis_cluster_init(c, ht_seeds, timeout, read_timeout, persistent, user, pass, NULL); /* Clean up */ - zval_dtor(&z_seeds); + zval_ptr_dtor_nogc(&z_seeds); if (user) zend_string_release(user); if (pass) zend_string_release(pass); } @@ -353,7 +353,7 @@ PHP_METHOD(RedisCluster, __construct) { // Parse arguments if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), - "Os!|addbza!", &object, redis_cluster_ce, &name, + "Os!|a!ddbza!", &object, redis_cluster_ce, &name, &name_len, &z_seeds, &timeout, &read_timeout, &persistent, &z_auth, &context) == FAILURE) { @@ -361,7 +361,7 @@ PHP_METHOD(RedisCluster, __construct) { } /* If we've got a string try to load from INI */ - if (ZEND_NUM_ARGS() < 2) { + if (ZEND_NUM_ARGS() < 2 || z_seeds == NULL) { if (name_len == 0) { // Require a name CLUSTER_THROW_EXCEPTION("You must specify a name or pass seeds!", 0); } @@ -797,7 +797,11 @@ static void cluster_generic_delete(INTERNAL_FUNCTION_PARAMETERS, /* {{{ proto array RedisCluster::del(string key1, string key2, ... keyN) */ PHP_METHOD(RedisCluster, del) { - cluster_generic_delete(INTERNAL_FUNCTION_PARAM_PASSTHRU, "DEL", sizeof("DEL") - 1); + cluster_generic_delete(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_STRL("DEL")); +} + +PHP_METHOD(RedisCluster, delex) { + CLUSTER_PROCESS_CMD(delex, cluster_long_resp, 0); } PHP_METHOD(RedisCluster, delifeq) { @@ -809,6 +813,10 @@ PHP_METHOD(RedisCluster, unlink) { cluster_generic_delete(INTERNAL_FUNCTION_PARAM_PASSTHRU, "UNLINK", sizeof("UNLINK") - 1); } +PHP_METHOD(RedisCluster, msetex) { + CLUSTER_PROCESS_CMD(msetex, cluster_long_resp, 0); +} + /* {{{ proto array RedisCluster::mget(array keys) */ PHP_METHOD(RedisCluster, mget) { zval *z_ret = emalloc(sizeof(*z_ret)); @@ -819,7 +827,7 @@ PHP_METHOD(RedisCluster, mget) { if (cluster_mkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "MGET", sizeof("MGET")-1, z_ret, cluster_mbulk_mget_resp) < 0) { - zval_dtor(z_ret); + zval_ptr_dtor_nogc(z_ret); efree(z_ret); RETURN_FALSE; } @@ -850,7 +858,7 @@ PHP_METHOD(RedisCluster, msetnx) { if (cluster_mset_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "MSETNX", sizeof("MSETNX")-1, z_ret, cluster_msetnx_resp) ==-1) { - zval_dtor(z_ret); + zval_ptr_dtor_nogc(z_ret); efree(z_ret); RETURN_FALSE; } @@ -928,7 +936,7 @@ PHP_METHOD(RedisCluster, keys) { { php_error_docref(0, E_ERROR, "Can't send KEYS to %s:%d", ZSTR_VAL(node->sock->host), node->sock->port); - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); efree(cmd); RETURN_FALSE; } @@ -996,7 +1004,7 @@ PHP_METHOD(RedisCluster, spop) { } else if (ZEND_NUM_ARGS() == 2) { CLUSTER_PROCESS_KW_CMD("SPOP", redis_key_long_cmd, cluster_mbulk_resp, 0); } else { - ZEND_WRONG_PARAM_COUNT(); + zend_wrong_param_count(); } } /* }}} */ @@ -1756,7 +1764,7 @@ PHP_METHOD(RedisCluster, zpopmax) { } else if (ZEND_NUM_ARGS() == 2) { CLUSTER_PROCESS_KW_CMD("ZPOPMAX", redis_key_long_cmd, cluster_mbulk_zipdbl_resp, 0); } else { - ZEND_WRONG_PARAM_COUNT(); + zend_wrong_param_count(); } } /* }}} */ @@ -1768,7 +1776,7 @@ PHP_METHOD(RedisCluster, zpopmin) { } else if (ZEND_NUM_ARGS() == 2) { CLUSTER_PROCESS_KW_CMD("ZPOPMIN", redis_key_long_cmd, cluster_mbulk_zipdbl_resp, 0); } else { - ZEND_WRONG_PARAM_COUNT(); + zend_wrong_param_count(); } } /* }}} */ @@ -2023,6 +2031,13 @@ PHP_METHOD(RedisCluster, _pack) { redis_pack_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags); } +PHP_METHOD(RedisCluster, _digest) { + redisCluster *c = GET_CONTEXT(); + + redis_digest_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags, + redis_cluster_exception_ce); +} + PHP_METHOD(RedisCluster, _unpack) { redisCluster *c = GET_CONTEXT(); redis_unpack_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags); @@ -2509,7 +2524,7 @@ static void cluster_kscan_cmd(INTERNAL_FUNCTION_PARAMETERS, do { /* Free our return value if we're back in the loop */ if (Z_TYPE_P(return_value) == IS_ARRAY) { - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); ZVAL_NULL(return_value); } @@ -2579,7 +2594,7 @@ PHP_METHOD(RedisCluster, acl) { /* ACL in cluster needs a slot argument, and then at least the op */ if (argc < 2) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); RETURN_FALSE; } @@ -2681,7 +2696,7 @@ PHP_METHOD(RedisCluster, scan) { do { /* Free our return value if we're back in the loop */ if (Z_TYPE_P(return_value) == IS_ARRAY) { - zval_dtor(return_value); + zval_ptr_dtor_nogc(return_value); ZVAL_NULL(return_value); } @@ -3073,22 +3088,30 @@ PHP_METHOD(RedisCluster, randomkey) { } /* }}} */ -PHP_METHOD(RedisCluster, waitaof) { - zend_long numlocal, numreplicas, timeout; +static +void cluster_gen_wait_cmd(INTERNAL_FUNCTION_PARAMETERS, const char *kw, + size_t kwlen, zend_bool has_local, int reply_type) +{ + zend_long numreplicas, timeout, numlocal = 0; redisCluster *c = GET_CONTEXT(); smart_string cmdstr = {0}; void *ctx = NULL; short slot; zval *node; + int argc; - ZEND_PARSE_PARAMETERS_START(4, 4) + argc = 3 + !!has_local; + + ZEND_PARSE_PARAMETERS_START(argc, argc) Z_PARAM_ZVAL(node) - Z_PARAM_LONG(numlocal) + if (has_local) { + Z_PARAM_LONG(numlocal) + } Z_PARAM_LONG(numreplicas) Z_PARAM_LONG(timeout) ZEND_PARSE_PARAMETERS_END(); - if (numlocal < 0 || numreplicas < 0 || timeout < 0) { + if (numreplicas < 0 || timeout < 0 || numlocal < 0) { php_error_docref(NULL, E_WARNING, "No arguments can be negative"); RETURN_FALSE; } @@ -3098,14 +3121,16 @@ PHP_METHOD(RedisCluster, waitaof) { RETURN_FALSE; } - REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, 3, "WAITAOF"); - redis_cmd_append_sstr_long(&cmdstr, numlocal); + redis_cmd_init_sstr(&cmdstr, argc - 1, (char*)kw, kwlen); + if (has_local) { + redis_cmd_append_sstr_long(&cmdstr, numlocal); + } redis_cmd_append_sstr_long(&cmdstr, numreplicas); redis_cmd_append_sstr_long(&cmdstr, timeout); c->readonly = 0; - if (cluster_send_slot(c, slot, cmdstr.c, cmdstr.len, TYPE_MULTIBULK) < 0) { + if (cluster_send_slot(c, slot, cmdstr.c, cmdstr.len, reply_type) < 0) { CLUSTER_THROW_EXCEPTION("Unable to send command at the specified node", 0); smart_string_free(&cmdstr); RETURN_FALSE; @@ -3120,6 +3145,16 @@ PHP_METHOD(RedisCluster, waitaof) { smart_string_free(&cmdstr); } +PHP_METHOD(RedisCluster, wait) { + cluster_gen_wait_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_STRL("WAIT"), 0, + TYPE_INT); +} + +PHP_METHOD(RedisCluster, waitaof) { + cluster_gen_wait_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_STRL("WAITAOF"), 1, + TYPE_MULTIBULK); +} + /* {{{ proto bool RedisCluster::ping(string key| string msg) * proto bool RedisCluster::ping(array host_port| string msg) */ PHP_METHOD(RedisCluster, ping) { @@ -3239,6 +3274,10 @@ PHP_METHOD(RedisCluster, vsetattr) { CLUSTER_PROCESS_CMD(vsetattr, cluster_long_resp, 0); } +PHP_METHOD(RedisCluster, gcra) { + CLUSTER_PROCESS_CMD(gcra, cluster_variant_resp, 0); +} + /* {{{ proto long RedisCluster::xack(string key, string group, array ids) }}} */ PHP_METHOD(RedisCluster, xack) { CLUSTER_PROCESS_CMD(xack, cluster_long_resp, 0); @@ -3263,6 +3302,10 @@ PHP_METHOD(RedisCluster, xdel) { CLUSTER_PROCESS_KW_CMD("XDEL", redis_key_str_arr_cmd, cluster_long_resp, 0); } +PHP_METHOD(RedisCluster, xdelex) { + CLUSTER_PROCESS_CMD(xdelex, cluster_variant_resp, 0); +} + /* {{{ proto variant RedisCluster::xgroup(string op, [string key, string arg1, string arg2]) }}} */ PHP_METHOD(RedisCluster, xgroup) { CLUSTER_PROCESS_CMD(xgroup, cluster_variant_resp, 0); @@ -3417,5 +3460,9 @@ PHP_METHOD(RedisCluster, copy) { CLUSTER_PROCESS_CMD(copy, cluster_1_resp, 0); } +PHP_METHOD(RedisCluster, digest) { + CLUSTER_PROCESS_KW_CMD("DIGEST", redis_key_cmd, cluster_bulk_raw_resp, 1); +} + /* vim: set tabstop=4 softtabstop=4 expandtab shiftwidth=4: */ diff --git a/redis_cluster.stub.php b/redis_cluster.stub.php index 63ba4d23a0..7f7d93fbb0 100644 --- a/redis_cluster.stub.php +++ b/redis_cluster.stub.php @@ -8,6 +8,8 @@ class RedisCluster { /** + * Used to configure how `PhpRedis` will failover to replica nodes when a + * primary node fails to respond. * * @var int * @cvalue REDIS_OPT_FAILOVER @@ -16,6 +18,7 @@ class RedisCluster { public const OPT_SLAVE_FAILOVER = UNKNOWN; /** + * Never read from replicas. * * @var int * @cvalue REDIS_FAILOVER_NONE @@ -24,6 +27,7 @@ class RedisCluster { public const FAILOVER_NONE = UNKNOWN; /** + * Attempt to read from replicas when the primary errors out or is down. * * @var int * @cvalue REDIS_FAILOVER_ERROR @@ -32,6 +36,8 @@ class RedisCluster { public const FAILOVER_ERROR = UNKNOWN; /** + * Distribute readonly commands at random between the primary and + * replica(s). * * @var int * @cvalue REDIS_FAILOVER_DISTRIBUTE @@ -40,6 +46,7 @@ class RedisCluster { public const FAILOVER_DISTRIBUTE = UNKNOWN; /** + * Distribute readonly commands between the replicas only. * * @var int * @cvalue REDIS_FAILOVER_DISTRIBUTE_SLAVES @@ -50,37 +57,42 @@ class RedisCluster { public function __construct(string|null $name, ?array $seeds = null, int|float $timeout = 0, int|float $read_timeout = 0, bool $persistent = false, #[\SensitiveParameter] mixed $auth = null, ?array $context = null); /** - * @see Redis::_compress() + * {@see \Redis::_compress()} */ public function _compress(string $value): string; /** - * @see Redis::_uncompress() + * @see \Redis::_uncompress() */ public function _uncompress(string $value): string; /** - * @see Redis::_serialize() + * @see \Redis::_serialize() */ public function _serialize(mixed $value): bool|string; /** - * @see Redis::_unserialize() + * @see \Redis::_unserialize() */ public function _unserialize(string $value): mixed; /** - * @see Redis::_pack() + * @see \Redis::_pack() */ public function _pack(mixed $value): string; /** - * @see Redis::_unpack() + * @see \Redis::_digest() + */ + public function _digest(mixed $value): string; + + /** + * @see \Redis::_unpack() */ public function _unpack(string $value): mixed; /** - * @see Redis::_prefix() + * @see \Redis::_prefix() */ public function _prefix(string $key): bool|string; @@ -89,35 +101,43 @@ public function _masters(): array; public function _redir(): string|null; /** - * @see Redis::acl + * @see \Redis::acl() */ public function acl(string|array $key_or_address, string $subcmd, string ...$args): mixed; /** - * @see Redis::append() + * @see \Redis::append() */ public function append(string $key, mixed $value): RedisCluster|bool|int; /** - * @see Redis::bgrewriteaof + * @see \Redis::bgrewriteaof() */ public function bgrewriteaof(string|array $key_or_address): RedisCluster|bool; + /** + * @see \Redis::wait() + */ + public function wait(string|array $key_or_address, int $numreplicas, int $timeout): RedisCluster|int|false; + + /** + * @see \Redis::waitaof() + */ public function waitaof(string|array $key_or_address, int $numlocal, int $numreplicas, int $timeout): RedisCluster|array|false; /** - * @see Redis::bgsave + * @see \Redis::bgSave() */ public function bgsave(string|array $key_or_address): RedisCluster|bool; /** - * @see Redis::bitcount + * @see \Redis::bitcount() */ public function bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false): RedisCluster|bool|int; /** - * @see Redis::bitop + * @see \Redis::bitop() */ public function bitop(string $operation, string $deskey, string $srckey, string ...$otherkeys): RedisCluster|bool|int; @@ -136,97 +156,97 @@ public function bitop(string $operation, string $deskey, string $srckey, string public function bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false): RedisCluster|int|false; /** - * See Redis::blpop() + * @see \Redis::blPop() */ public function blpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args): RedisCluster|array|null|false; /** - * See Redis::brpop() + * @see \Redis::brPop() */ public function brpop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args): RedisCluster|array|null|false; /** - * See Redis::brpoplpush() + * @see \Redis::brpoplpush() */ public function brpoplpush(string $srckey, string $deskey, int $timeout): mixed; /** * Move an element from one list into another. * - * @see Redis::lmove + * @see \Redis::lMove() */ - public function lmove(string $src, string $dst, string $wherefrom, string $whereto): Redis|string|false; + public function lmove(string $src, string $dst, string $wherefrom, string $whereto): RedisCluster|string|false; /** * Move an element from one list to another, blocking up to a timeout until an element is available. * - * @see Redis::blmove + * @see \Redis::blmove() * */ - public function blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout): Redis|string|false; + public function blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout): RedisCluster|string|false; /** - * @see Redis::bzpopmax + * @see \Redis::bzPopMax() */ public function bzpopmax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array; /** - * @see Redis::bzpopmin + * @see \Redis::bzPopMin() */ public function bzpopmin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array; /** - * @see Redis::bzmpop + * @see \Redis::bzmpop() */ public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): RedisCluster|array|null|false; /** - * @see Redis::zmpop + * @see \Redis::zmpop() */ public function zmpop(array $keys, string $from, int $count = 1): RedisCluster|array|null|false; /** - * @see Redis::blmpop() + * @see \Redis::blmpop() */ public function blmpop(float $timeout, array $keys, string $from, int $count = 1): RedisCluster|array|null|false; /** - * @see Redis::lmpop() + * @see \Redis::lmpop() */ public function lmpop(array $keys, string $from, int $count = 1): RedisCluster|array|null|false; /** - * @see Redis::clearlasterror() + * @see \Redis::clearLastError() */ public function clearlasterror(): bool; /** - * @see Redis::client + * @see \Redis::client() */ public function client(string|array $key_or_address, string $subcommand, ?string $arg = null): array|string|bool; /** - * @see Redis::close + * @see \Redis::close() */ public function close(): bool; /** - * @see Redis::cluster + * @see \Redis::cluster() */ public function cluster(string|array $key_or_address, string $command, mixed ...$extra_args): mixed; /** - * @see Redis::command + * @see \Redis::command() */ public function command(mixed ...$extra_args): mixed; /** - * @see Redis::config() + * @see \Redis::config() */ public function config(string|array $key_or_address, string $subcommand, mixed ...$extra_args): mixed; /** - * @see Redis::dbsize() + * @see \Redis::dbSize() */ public function dbsize(string|array $key_or_address): RedisCluster|int; @@ -236,25 +256,35 @@ public function dbsize(string|array $key_or_address): RedisCluster|int; public function copy(string $src, string $dst, ?array $options = null): RedisCluster|bool; /** - * @see Redis::decr() + * @see \Redis::decr() */ public function decr(string $key, int $by = 1): RedisCluster|int|false; /** - * @see Redis::decrby() + * @see \Redis::decrBy() */ public function decrby(string $key, int $value): RedisCluster|int|false; /** - * @see Redis::decrbyfloat + * @see \Redis::decrbyfloat() */ public function decrbyfloat(string $key, float $value): float; /** - * @see Redis::del() + * @see \Redis::del() */ public function del(array|string $key, string ...$other_keys): RedisCluster|int|false; + /** + * Delete a key conditionally based on its value or hash digest + * + * @param string $key The key to delete + * @param array|null $options An array with options to modify how DELX works. + * + * @return RedisCluster|int|false Returns 1 if the key was deleted, 0 if it was not. + */ + public function delex(string $key, ?array $options = null): RedisCluster|int|false; + /** * Delete a key if it's equal to the specified value. This command is * specific to Valkey >= 9.0 @@ -266,122 +296,122 @@ public function del(array|string $key, string ...$other_keys): RedisCluster|int| public function delifeq(string $key, mixed $value): RedisCluster|int|false; /** - * @see Redis::discard + * @see \Redis::discard() */ public function discard(): bool; /** - * @see Redis::dump + * @see \Redis::dump() */ public function dump(string $key): RedisCluster|string|false; /** - * @see Redis::echo() + * @see \Redis::echo() */ public function echo(string|array $key_or_address, string $msg): RedisCluster|string|false; /** - * @see Redis::eval + * @see \Redis::eval() */ public function eval(string $script, array $args = [], int $num_keys = 0): mixed; /** - * @see Redis::eval_ro + * @see \Redis::eval_ro() */ public function eval_ro(string $script, array $args = [], int $num_keys = 0): mixed; /** - * @see Redis::evalsha + * @see \Redis::evalsha() */ public function evalsha(string $script_sha, array $args = [], int $num_keys = 0): mixed; /** - * @see Redis::evalsha_ro + * @see \Redis::evalsha_ro() */ public function evalsha_ro(string $script_sha, array $args = [], int $num_keys = 0): mixed; /** - * @see Redis::exec() + * @see \Redis::exec() */ public function exec(): array|false; /** - * @see Redis::exists + * @see \Redis::exists() */ public function exists(mixed $key, mixed ...$other_keys): RedisCluster|int|bool; /** - * @see Redis::touch() + * @see \Redis::touch() */ public function touch(mixed $key, mixed ...$other_keys): RedisCluster|int|bool; /** - * @see Redis::expire + * @see \Redis::expire() */ public function expire(string $key, int $timeout, ?string $mode = null): RedisCluster|bool; /** - * @see Redis::expireat + * @see \Redis::expireAt() */ public function expireat(string $key, int $timestamp, ?string $mode = null): RedisCluster|bool; /** - * @see Redis::expiretime() + * @see \Redis::expiretime() */ public function expiretime(string $key): RedisCluster|int|false; /** - * @see Redis::pexpiretime() + * @see \Redis::pexpiretime() */ public function pexpiretime(string $key): RedisCluster|int|false; /** - * @see Redis::flushall + * @see \Redis::flushAll() */ public function flushall(string|array $key_or_address, bool $async = false): RedisCluster|bool; /** - * @see Redis::flushdb + * @see \Redis::flushDB() */ public function flushdb(string|array $key_or_address, bool $async = false): RedisCluster|bool; /** - * @see Redis::geoadd + * @see \Redis::geoadd() */ public function geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options): RedisCluster|int|false; /** - * @see Redis::geodist + * @see \Redis::geodist() */ public function geodist(string $key, string $src, string $dest, ?string $unit = null): RedisCluster|float|false; /** - * @see Redis::geohash + * @see \Redis::geohash() */ public function geohash(string $key, string $member, string ...$other_members): RedisCluster|array|false; /** - * @see Redis::geopos + * @see \Redis::geopos() */ public function geopos(string $key, string $member, string ...$other_members): RedisCluster|array|false; /** - * @see Redis::georadius + * @see \Redis::georadius() */ public function georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed; /** - * @see Redis::georadius_ro + * @see \Redis::georadius_ro() */ public function georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed; /** - * @see Redis::georadiusbymember + * @see \Redis::georadiusbymember() */ public function georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []): mixed; /** - * @see Redis::georadiusbymember_ro + * @see \Redis::georadiusbymember_ro() */ public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): mixed; @@ -396,154 +426,154 @@ public function geosearch(string $key, array|string $position, array|int|float $ public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): RedisCluster|array|int|false; /** - * @see Redis::get + * @see \Redis::get() */ public function get(string $key): mixed; /** - * @see Redis::getdel + * @see \Redis::getDel() */ public function getdel(string $key): mixed; /** - * @see Redis::getWithMeta + * @see \Redis::getWithMeta() */ public function getWithMeta(string $key): RedisCluster|array|false; /** - * @see Redis::getEx + * @see \Redis::getEx() */ public function getex(string $key, array $options = []): RedisCluster|string|false; /** - * @see Redis::getbit + * @see \Redis::getBit() */ public function getbit(string $key, int $value): RedisCluster|int|false; /** - * @see Redis::getlasterror + * @see \Redis::getLastError() */ public function getlasterror(): string|null; /** - * @see Redis::getmode + * @see \Redis::getMode() */ public function getmode(): int; /** - * @see Redis::getoption + * @see \Redis::getOption() */ public function getoption(int $option): mixed; /** - * @see Redis::getrange + * @see \Redis::getRange() */ public function getrange(string $key, int $start, int $end): RedisCluster|string|false; /** - * @see Redis::lcs + * @see \Redis::lcs() */ public function lcs(string $key1, string $key2, ?array $options = null): RedisCluster|string|array|int|false; /** - * @see Redis::getset + * @see \Redis::getset() */ public function getset(string $key, mixed $value): RedisCluster|string|bool; /** - * @see Redis::gettransferredbytes + * @see \Redis::getTransferredBytes() */ public function gettransferredbytes(): array|false; /** - * @see Redis::cleartransferredbytes + * @see \Redis::clearTransferredBytes() */ public function cleartransferredbytes(): void; /** - * @see Redis::hdel + * @see \Redis::hDel() */ public function hdel(string $key, string $member, string ...$other_members): RedisCluster|int|false; /** - * @see Redis::hexists + * @see \Redis::hExists() */ public function hexists(string $key, string $member): RedisCluster|bool; /** - * @see Redis::hget + * @see \Redis::hGet() */ public function hget(string $key, string $member): mixed; /** - * @see Redis::hgetall + * @see \Redis::hGetAll() */ public function hgetall(string $key): RedisCluster|array|false; /** - * @see Redis::hgetWithMeta + * @see \Redis::hGetWithMeta() */ public function hgetWithMeta(string $key, string $member): mixed; /** - * @see Redis::hincrby + * @see \Redis::hIncrBy() */ public function hincrby(string $key, string $member, int $value): RedisCluster|int|false; /** - * @see Redis::hincrbyfloat + * @see \Redis::hIncrByFloat() */ public function hincrbyfloat(string $key, string $member, float $value): RedisCluster|float|false; /** - * @see Redis::hkeys + * @see \Redis::hKeys() */ public function hkeys(string $key): RedisCluster|array|false; /** - * @see Redis::hlen + * @see \Redis::hLen() */ public function hlen(string $key): RedisCluster|int|false; /** - * @see Redis::hmget + * @see \Redis::hMget() */ public function hmget(string $key, array $keys): RedisCluster|array|false; /** - * @see Redis::hgetex + * @see \Redis::hgetex() */ public function hgetex(string $key, array $fields, string|array|null $expiry = null): RedisCluster|array|false; /** - * @see Redis::hsetex + * @see \Redis::hsetex() */ public function hsetex(string $key, array $fields, ?array $expiry = null): RedisCluster|int|false; /** - * @see Redis::hgetdel + * @see \Redis::hgetdel() */ public function hgetdel(string $key, array $fields): RedisCluster|array|false; /** - * @see Redis::hmset + * @see \Redis::hMset() */ public function hmset(string $key, array $key_values): RedisCluster|bool; /** - * @see Redis::hscan + * @see \Redis::hscan() */ public function hscan(string $key, null|int|string &$iterator, ?string $pattern = null, int $count = 0): array|bool; /** - * @see Redis::expiremember + * @see \Redis::expiremember() */ - public function expiremember(string $key, string $field, int $ttl, ?string $unit = null): Redis|int|false; + public function expiremember(string $key, string $field, int $ttl, ?string $unit = null): RedisCluster|int|false; /** - * @see Redis::expirememberat + * @see \Redis::expirememberat() */ - public function expirememberat(string $key, string $field, int $timestamp): Redis|int|false; + public function expirememberat(string $key, string $field, int $timestamp): RedisCluster|int|false; /** * @see https://redis.io/commands/hrandfield @@ -551,86 +581,86 @@ public function expirememberat(string $key, string $field, int $timestamp): Redi public function hrandfield(string $key, ?array $options = null): RedisCluster|string|array; /** - * @see Redis::hset + * @see \Redis::hSet() */ public function hset(string $key, string $member, mixed $value): RedisCluster|int|false; /** - * @see Redis::hsetnx + * @see \Redis::hSetNx() */ public function hsetnx(string $key, string $member, mixed $value): RedisCluster|bool; /** - * @see Redis::hstrlen + * @see \Redis::hStrLen() */ public function hstrlen(string $key, string $field): RedisCluster|int|false; /** - * @see Redis::hexpire + * @see \Redis::hexpire() */ public function hexpire(string $key, int $ttl, array $fields, ?string $mode = NULL): RedisCluster|array|false; /** - * @see Redis::hpexpire + * @see \Redis::hpexpire() */ public function hpexpire(string $key, int $ttl, array $fields, ?string $mode = NULL): RedisCluster|array|false; /** - * @see Redis::hexpireat + * @see \Redis::hexpireat() */ public function hexpireat(string $key, int $time, array $fields, ?string $mode = NULL): RedisCluster|array|false; /** - * @see Redis::hpexpireat + * @see \Redis::hpexpireat() */ public function hpexpireat(string $key, int $mstime, array $fields, ?string $mode = NULL): RedisCluster|array|false; /** - * @see Redis::httl + * @see \Redis::httl() */ public function httl(string $key, array $fields): RedisCluster|array|false; /** - * @see Redis::hpttl + * @see \Redis::hpttl() */ public function hpttl(string $key, array $fields): RedisCluster|array|false; /** - * @see Redis::hexpiretime + * @see \Redis::hexpiretime() */ public function hexpiretime(string $key, array $fields): RedisCluster|array|false; /** - * @see Redis::hpexpiretime + * @see \Redis::hpexpiretime() */ public function hpexpiretime(string $key, array $fields): RedisCluster|array|false; /** - * @see Redis::hpexpiretime + * @see \Redis::hpexpiretime() */ public function hpersist(string $key, array $fields): RedisCluster|array|false; /** - * @see Redis::hvals + * @see \Redis::hVals() */ public function hvals(string $key): RedisCluster|array|false; /** - * @see Redis::incr + * @see \Redis::incr() */ public function incr(string $key, int $by = 1): RedisCluster|int|false; /** - * @see Redis::incrby + * @see \Redis::incrBy() */ public function incrby(string $key, int $value): RedisCluster|int|false; /** - * @see Redis::incrbyfloat + * @see \Redis::incrByFloat() */ public function incrbyfloat(string $key, float $value): RedisCluster|float|false; @@ -653,140 +683,145 @@ public function incrbyfloat(string $key, float $value): RedisCluster|float|false public function info(string|array $key_or_address, string ...$sections): RedisCluster|array|false; /** - * @see Redis::keys + * @see \Redis::keys() */ public function keys(string $pattern): RedisCluster|array|false; /** - * @see Redis::lastsave + * @see \Redis::lastSave() */ public function lastsave(string|array $key_or_address): RedisCluster|int|false; /** - * @see Redis::lget + * @see \Redis::lget() */ public function lget(string $key, int $index): RedisCluster|string|bool; /** - * @see Redis::lindex + * @see \Redis::lindex() */ public function lindex(string $key, int $index): mixed; /** - * @see Redis::linsert + * @see \Redis::lInsert() */ public function linsert(string $key, string $pos, mixed $pivot, mixed $value): RedisCluster|int|false; /** - * @see Redis::llen + * @see \Redis::lLen() */ public function llen(string $key): RedisCluster|int|bool; /** - * @see Redis::lpop + * @see \Redis::lPop() */ public function lpop(string $key, int $count = 0): RedisCluster|bool|string|array; /** - * @see Redis::lpos + * @see \Redis::lPos() */ - public function lpos(string $key, mixed $value, ?array $options = null): Redis|null|bool|int|array; + public function lpos(string $key, mixed $value, ?array $options = null): RedisCluster|null|bool|int|array; /** - * @see Redis::lpush + * @see \Redis::lPush() */ public function lpush(string $key, mixed $value, mixed ...$other_values): RedisCluster|int|bool; /** - * @see Redis::lpushx + * @see \Redis::lPushx() */ public function lpushx(string $key, mixed $value): RedisCluster|int|bool; /** - * @see Redis::lrange + * @see \Redis::lrange() */ public function lrange(string $key, int $start, int $end): RedisCluster|array|false; /** - * @see Redis::lrem + * @see \Redis::lrem() */ public function lrem(string $key, mixed $value, int $count = 0): RedisCluster|int|bool; /** - * @see Redis::lset + * @see \Redis::lSet() */ public function lset(string $key, int $index, mixed $value): RedisCluster|bool; /** - * @see Redis::ltrim + * @see \Redis::ltrim() */ public function ltrim(string $key, int $start, int $end): RedisCluster|bool; /** - * @see Redis::mget + * @see \Redis::mget() */ public function mget(array $keys): RedisCluster|array|false; /** - * @see Redis::mset + * @see \Redis::mset() */ public function mset(array $key_values): RedisCluster|bool; /** - * @see Redis::msetnx + * @see \Redis::msetnx() */ public function msetnx(array $key_values): RedisCluster|array|false; + /** + * @see \Redis::msetex() + */ + public function msetex(array $key_vals, int|float|array|null $expiry = null): Redis|int|false; + /* We only support Redis::MULTI in RedisCluster but take the argument so we can test MULTI..EXEC with RedisTest.php and in the event we add pipeline support in the future. */ public function multi(int $value = Redis::MULTI): RedisCluster|bool; /** - * @see Redis::object + * @see \Redis::object() */ public function object(string $subcommand, string $key): RedisCluster|int|string|false; /** - * @see Redis::persist + * @see \Redis::persist() */ public function persist(string $key): RedisCluster|bool; /** - * @see Redis::pexpire + * @see \Redis::pexpire() */ public function pexpire(string $key, int $timeout, ?string $mode = null): RedisCluster|bool; /** - * @see Redis::pexpireat + * @see \Redis::pexpireAt() */ public function pexpireat(string $key, int $timestamp, ?string $mode = null): RedisCluster|bool; /** - * @see Redis::pfadd() + * @see \Redis::pfadd() */ public function pfadd(string $key, array $elements): RedisCluster|bool; /** - * @see Redis::pfcount() + * @see \Redis::pfcount() */ public function pfcount(string $key): RedisCluster|int|false; /** - * @see Redis::pfmerge() + * @see \Redis::pfmerge() */ public function pfmerge(string $key, array $keys): RedisCluster|bool; /** * PING an instance in the redis cluster. * - * @see Redis::ping() + * @see \Redis::ping() * * @param string|array $key_or_address Either a key name or a two element array with host and * address, informing RedisCluster which node to ping. * - * @param string $message An optional message to send. + * @param string|null $message An optional message to send. * * @return mixed This method always returns `true` if no message was sent, and the message itself * if one was. @@ -794,122 +829,122 @@ public function pfmerge(string $key, array $keys): RedisCluster|bool; public function ping(string|array $key_or_address, ?string $message = null): mixed; /** - * @see Redis::psetex + * @see \Redis::psetex() */ public function psetex(string $key, int $timeout, string $value): RedisCluster|bool; /** - * @see Redis::psubscribe + * @see \Redis::psubscribe() */ public function psubscribe(array $patterns, callable $callback): void; /** - * @see Redis::pttl + * @see \Redis::pttl() */ public function pttl(string $key): RedisCluster|int|false; /** - * @see Redis::publish + * @see \Redis::publish() */ public function publish(string $channel, string $message): RedisCluster|bool|int; /** - * @see Redis::pubsub + * @see \Redis::pubsub() */ public function pubsub(string|array $key_or_address, string ...$values): mixed; /** - * @see Redis::punsubscribe + * @see \Redis::punsubscribe() */ public function punsubscribe(string $pattern, string ...$other_patterns): bool|array; /** - * @see Redis::randomkey + * @see \Redis::randomKey() */ public function randomkey(string|array $key_or_address): RedisCluster|bool|string; /** - * @see Redis::rawcommand + * @see \Redis::rawcommand() */ public function rawcommand(string|array $key_or_address, string $command, mixed ...$args): mixed; /** - * @see Redis::rename + * @see \Redis::rename() */ public function rename(string $key_src, string $key_dst): RedisCluster|bool; /** - * @see Redis::renamenx + * @see \Redis::renameNx() */ public function renamenx(string $key, string $newkey): RedisCluster|bool; /** - * @see Redis::restore + * @see \Redis::restore() */ public function restore(string $key, int $timeout, string $value, ?array $options = null): RedisCluster|bool; /** - * @see Redis::role + * @see \Redis::role() */ public function role(string|array $key_or_address): mixed; /** - * @see Redis::rpop() + * @see \Redis::rPop() */ public function rpop(string $key, int $count = 0): RedisCluster|bool|string|array; /** - * @see Redis::rpoplpush() + * @see \Redis::rpoplpush() */ public function rpoplpush(string $src, string $dst): RedisCluster|bool|string; /** - * @see Redis::rpush + * @see \Redis::rPush() */ public function rpush(string $key, mixed ...$elements): RedisCluster|int|false; /** - * @see Redis::rpushx + * @see \Redis::rPushx() */ public function rpushx(string $key, string $value): RedisCluster|bool|int; /** - * @see Redis::sadd() + * @see \Redis::sAdd() */ public function sadd(string $key, mixed $value, mixed ...$other_values): RedisCluster|int|false; /** - * @see Redis::saddarray() + * @see \Redis::sAddArray() */ public function saddarray(string $key, array $values): RedisCluster|bool|int; /** - * @see Redis::save + * @see \Redis::save() */ public function save(string|array $key_or_address): RedisCluster|bool; /** - * @see Redis::scan + * @see \Redis::scan() */ public function scan(null|int|string &$iterator, string|array $key_or_address, ?string $pattern = null, int $count = 0): bool|array; /** - * @see Redis::scard + * @see \Redis::scard() */ public function scard(string $key): RedisCluster|int|false; /** - * @see Redis::script + * @see \Redis::script() */ public function script(string|array $key_or_address, mixed ...$args): mixed; /** - * @see Redis::sdiff() + * @see \Redis::sDiff() */ public function sdiff(string $key, string ...$other_keys): RedisCluster|array|false; /** - * @see Redis::sdiffstore() + * @see \Redis::sDiffStore() */ public function sdiffstore(string $dst, string $key, string ...$other_keys): RedisCluster|int|false; @@ -919,177 +954,177 @@ public function sdiffstore(string $dst, string $key, string ...$other_keys): Red public function set(string $key, mixed $value, mixed $options = null): RedisCluster|string|bool; /** - * @see Redis::setbit + * @see \Redis::setBit() */ public function setbit(string $key, int $offset, bool $onoff): RedisCluster|int|false; /** - * @see Redis::setex + * @see \Redis::setex() */ public function setex(string $key, int $expire, mixed $value): RedisCluster|bool; /** - * @see Redis::setnx + * @see \Redis::setnx() */ public function setnx(string $key, mixed $value): RedisCluster|bool; /** - * @see Redis::setoption + * @see \Redis::setOption() */ public function setoption(int $option, mixed $value): bool; /** - * @see Redis::setrange + * @see \Redis::setRange() */ public function setrange(string $key, int $offset, string $value): RedisCluster|int|false; /** - * @see Redis::sinter() + * @see \Redis::sInter() */ public function sinter(array|string $key, string ...$other_keys): RedisCluster|array|false; /** - * @see Redis::sintercard + * @see \Redis::sintercard() */ public function sintercard(array $keys, int $limit = -1): RedisCluster|int|false; /** - * @see Redis::sinterstore() + * @see \Redis::sInterStore() */ public function sinterstore(array|string $key, string ...$other_keys): RedisCluster|int|false; /** - * @see Redis::sismember + * @see \Redis::sismember() */ public function sismember(string $key, mixed $value): RedisCluster|bool; /** - * @see Redis::smismember + * @see \Redis::sMisMember() */ public function smismember(string $key, string $member, string ...$other_members): RedisCluster|array|false; /** - * @see Redis::slowlog + * @see \Redis::slowlog() */ public function slowlog(string|array $key_or_address, mixed ...$args): mixed; /** - * @see Redis::smembers() + * @see \Redis::sMembers() */ public function smembers(string $key): RedisCluster|array|false; /** - * @see Redis::smove() + * @see \Redis::sMove() */ public function smove(string $src, string $dst, string $member): RedisCluster|bool; /** - * @see Redis::sort() + * @see \Redis::sort() */ public function sort(string $key, ?array $options = null): RedisCluster|array|bool|int|string; /** - * @see Redis::sort_ro() + * @see \Redis::sort_ro() */ public function sort_ro(string $key, ?array $options = null): RedisCluster|array|bool|int|string; /** - * @see Redis::spop + * @see \Redis::sPop() */ public function spop(string $key, int $count = 0): RedisCluster|string|array|false; /** - * @see Redis::srandmember + * @see \Redis::sRandMember() */ public function srandmember(string $key, int $count = 0): RedisCluster|string|array|false; /** - * @see Redis::srem + * @see \Redis::srem() */ public function srem(string $key, mixed $value, mixed ...$other_values): RedisCluster|int|false; /** - * @see Redis::sscan + * @see \Redis::sscan() */ public function sscan(string $key, null|int|string &$iterator, ?string $pattern = null, int $count = 0): array|false; /** - * @see Redis::strlen + * @see \Redis::strlen() */ public function strlen(string $key): RedisCluster|int|false; /** - * @see Redis::subscribe + * @see \Redis::subscribe() */ public function subscribe(array $channels, callable $cb): void; /** - * @see Redis::sunion() + * @see \Redis::sUnion() */ public function sunion(string $key, string ...$other_keys): RedisCluster|bool|array; /** - * @see Redis::sunionstore() + * @see \Redis::sUnionStore() */ public function sunionstore(string $dst, string $key, string ...$other_keys): RedisCluster|int|false; /** - * @see Redis::time + * @see \Redis::time() */ public function time(string|array $key_or_address): RedisCluster|bool|array; /** - * @see Redis::ttl + * @see \Redis::ttl() */ public function ttl(string $key): RedisCluster|int|false; /** - * @see Redis::type + * @see \Redis::type() */ public function type(string $key): RedisCluster|int|false; /** - * @see Redis::unsubscribe + * @see \Redis::unsubscribe() */ public function unsubscribe(array $channels): bool|array; /** - * @see Redis::unlink + * @see \Redis::unlink() */ public function unlink(array|string $key, string ...$other_keys): RedisCluster|int|false; /** - * @see Redis::unwatch + * @see \Redis::unwatch() */ public function unwatch(): bool; /** - * @see Redis::watch + * @see \Redis::watch() */ public function watch(string $key, string ...$other_keys): RedisCluster|bool; /** - * @see Redis::vadd + * @see \Redis::vadd() */ public function vadd(string $key, array $values, mixed $element, array|null $options = null): RedisCluster|int|false; /** - * @see Redis::vsim + * @see \Redis::vsim() */ public function vsim(string $key, mixed $member, array|null $options = null): RedisCluster|array|false; /** - * @see Redis::vcard + * @see \Redis::vcard() */ public function vcard(string $key): RedisCluster|int|false; /** - * @see Redis::vdim + * @see \Redis::vdim() */ public function vdim(string $key): RedisCluster|int|false; /** - * @see Redis::vinfo + * @see \Redis::vinfo() */ public function vinfo(string $key): RedisCluster|array|false; @@ -1104,12 +1139,12 @@ public function vinfo(string $key): RedisCluster|array|false; public function vismember(string $key, mixed $member): RedisCluster|bool; /** - * @see Redis::vemb + * @see \Redis::vemb() */ public function vemb(string $key, mixed $member, bool $raw = false): RedisCluster|array|false; /** - * @see Redis::vrandmember + * @see \Redis::vrandmember() */ public function vrandmember(string $key, int $count = 0): RedisCluster|array|string|false; @@ -1127,148 +1162,160 @@ public function vrange(string $key, string $min, string $max, int $count = -1): /** - * @see Redis::vrem + * @see \Redis::vrem() */ public function vrem(string $key, mixed $member): RedisCluster|int|false; /** - * @see Redis::vlinks + * @see \Redis::vlinks() */ public function vlinks(string $key, mixed $member, bool $withscores = false): RedisCluster|array|false; /** - * @see Redis::vgetattr + * @see \Redis::vgetattr() */ - public function vgetattr(string $key, mixed $member, bool $decode = true): Redis|array|string|false; + public function vgetattr(string $key, mixed $member, bool $decode = true): RedisCluster|array|string|false; /** - * @see Redis::vsetattr + * @see \Redis::vsetattr() */ - public function vsetattr(string $key, mixed $member, array|string $attributes): Redis|int|false; + public function vsetattr(string $key, mixed $member, array|string $attributes): RedisCluster|int|false; + + /** + * @see \Redis::gcra() + */ + public function gcra(string $key, int $maxBurst, int $requestsPerPeriod, + int $period, int $tokens = 0): RedisCluster|array|false; + /** - * @see Redis::xack + * @see \Redis::xack() */ public function xack(string $key, string $group, array $ids): RedisCluster|int|false; /** - * @see Redis::xadd + * @see \Redis::xadd() */ public function xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false): RedisCluster|string|false; /** - * @see Redis::xclaim + * @see \Redis::xclaim() */ public function xclaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options): RedisCluster|string|array|false; /** - * @see Redis::xdel + * @see \Redis::xdel() */ public function xdel(string $key, array $ids): RedisCluster|int|false; /** - * @see Redis::xgroup + * @see \Redis::xdelex() + */ + public function xdelex(string $key, array $ids, ?string $mode = null): RedisCluster|array|false; + + /** + * @see \Redis::xgroup() */ public function xgroup(string $operation, ?string $key = null, ?string $group = null, ?string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2): mixed; /** - * @see Redis::xautoclaim + * @see \Redis::xautoclaim() */ public function xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false): RedisCluster|bool|array; /** - * @see Redis::xinfo + * @see \Redis::xinfo() */ public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1): mixed; /** - * @see Redis::xlen + * @see \Redis::xlen() */ public function xlen(string $key): RedisCluster|int|false; /** - * @see Redis::xpending + * @see \Redis::xpending() */ public function xpending(string $key, string $group, ?string $start = null, ?string $end = null, int $count = -1, ?string $consumer = null): RedisCluster|array|false; /** - * @see Redis::xrange + * @see \Redis::xrange() */ public function xrange(string $key, string $start, string $end, int $count = -1): RedisCluster|bool|array; /** - * @see Redis::xread + * @see \Redis::xread() */ public function xread(array $streams, int $count = -1, int $block = -1): RedisCluster|bool|array; /** - * @see Redis::xreadgroup + * @see \Redis::xreadgroup() */ public function xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1): RedisCluster|bool|array; /** - * @see Redis::xrevrange + * @see \Redis::xrevrange() */ public function xrevrange(string $key, string $start, string $end, int $count = -1): RedisCluster|bool|array; /** - * @see Redis::xtrim + * @see \Redis::xtrim() */ public function xtrim(string $key, int $maxlen, bool $approx = false, bool $minid = false, int $limit = -1): RedisCluster|int|false; /** - * @see Redis::zadd + * @see \Redis::zAdd() */ public function zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems): RedisCluster|int|float|false; /** - * @see Redis::zcard + * @see \Redis::zCard() */ public function zcard(string $key): RedisCluster|int|false; /** - * @see Redis::zcount + * @see \Redis::zCount() */ public function zcount(string $key, string $start, string $end): RedisCluster|int|false; /** - * @see Redis::zincrby + * @see \Redis::zIncrBy() */ public function zincrby(string $key, float $value, string $member): RedisCluster|float|false; /** - * @see Redis::zinterstore + * @see \Redis::zinterstore() */ public function zinterstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null): RedisCluster|int|false; /** - * @see Redis::zintercard + * @see \Redis::zintercard() */ public function zintercard(array $keys, int $limit = -1): RedisCluster|int|false; /** - * @see Redis::zlexcount + * @see \Redis::zLexCount() */ public function zlexcount(string $key, string $min, string $max): RedisCluster|int|false; /** - * @see Redis::zpopmax + * @see \Redis::zPopMax() */ public function zpopmax(string $key, ?int $value = null): RedisCluster|bool|array; /** - * @see Redis::zpopmin + * @see \Redis::zPopMin() */ public function zpopmin(string $key, ?int $value = null): RedisCluster|bool|array; /** - * @see Redis::zrange + * @see \Redis::zRange() */ public function zrange(string $key, mixed $start, mixed $end, array|bool|null $options = null): RedisCluster|array|bool; /** - * @see Redis::zrangestore + * @see \Redis::zrangestore() */ public function zrangestore(string $dstkey, string $srckey, int $start, int $end, array|bool|null $options = null): RedisCluster|int|false; @@ -1279,77 +1326,77 @@ public function zrangestore(string $dstkey, string $srckey, int $start, int $end public function zrandmember(string $key, ?array $options = null): RedisCluster|string|array; /** - * @see Redis::zrangebylex + * @see \Redis::zRangeByLex() */ public function zrangebylex(string $key, string $min, string $max, int $offset = -1, int $count = -1): RedisCluster|array|false; /** - * @see Redis::zrangebyscore + * @see \Redis::zRangeByScore() */ public function zrangebyscore(string $key, string $start, string $end, array $options = []): RedisCluster|array|false; /** - * @see Redis::zrank + * @see \Redis::zRank() */ public function zrank(string $key, mixed $member): RedisCluster|int|false; /** - * @see Redis::zrem + * @see \Redis::zRem() */ public function zrem(string $key, string $value, string ...$other_values): RedisCluster|int|false; /** - * @see Redis::zremrangebylex + * @see \Redis::zRemRangeByLex() */ public function zremrangebylex(string $key, string $min, string $max): RedisCluster|int|false; /** - * @see Redis::zremrangebyrank + * @see \Redis::zRemRangeByRank() */ public function zremrangebyrank(string $key, string $min, string $max): RedisCluster|int|false; /** - * @see Redis::zremrangebyscore + * @see \Redis::zRemRangeByScore() */ public function zremrangebyscore(string $key, string $min, string $max): RedisCluster|int|false; /** - * @see Redis::zrevrange + * @see \Redis::zRevRange() */ public function zrevrange(string $key, string $min, string $max, ?array $options = null): RedisCluster|bool|array; /** - * @see Redis::zrevrangebylex + * @see \Redis::zRevRangeByLex() */ public function zrevrangebylex(string $key, string $min, string $max, ?array $options = null): RedisCluster|bool|array; /** - * @see Redis::zrevrangebyscore + * @see \Redis::zRevRangeByScore() */ public function zrevrangebyscore(string $key, string $min, string $max, ?array $options = null): RedisCluster|bool|array; /** - * @see Redis::zrevrank + * @see \Redis::zRevRank() */ public function zrevrank(string $key, mixed $member): RedisCluster|int|false; /** - * @see Redis::zscan + * @see \Redis::zscan() */ public function zscan(string $key, null|int|string &$iterator, ?string $pattern = null, int $count = 0): RedisCluster|bool|array; /** - * @see Redis::zscore + * @see \Redis::zScore() */ public function zscore(string $key, mixed $member): RedisCluster|float|false; /** * @see https://redis.io/commands/zmscore */ - public function zmscore(string $key, mixed $member, mixed ...$other_members): Redis|array|false; + public function zmscore(string $key, mixed $member, mixed ...$other_members): RedisCluster|array|false; /** - * @see Redis::zunionstore + * @see \Redis::zunionstore() */ public function zunionstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null): RedisCluster|int|false; @@ -1372,6 +1419,11 @@ public function zunion(array $keys, ?array $weights = null, ?array $options = nu * @see https://redis.io/commands/zdiff */ public function zdiff(array $keys, ?array $options = null): RedisCluster|array|false; + + /** + * @see https://redis.io/commands/digest + */ + public function digest(string $key): RedisCluster|string|false; } class RedisClusterException extends RuntimeException {} diff --git a/redis_cluster_arginfo.h b/redis_cluster_arginfo.h index d6cfd44f09..6d255712c8 100644 --- a/redis_cluster_arginfo.h +++ b/redis_cluster_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6561a50ccac9841ac01a53feb5f88e7f592e1bc2 */ + * Stub hash: 6c7a87611b3bc9039650a3cf2e3c4d4f916611b0 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) @@ -29,6 +29,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_RedisCluster__pack, 0, 1, ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() +#define arginfo_class_RedisCluster__digest arginfo_class_RedisCluster__pack + #define arginfo_class_RedisCluster__unpack arginfo_class_RedisCluster__unserialize ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_RedisCluster__prefix, 0, 1, MAY_BE_BOOL|MAY_BE_STRING) @@ -56,6 +58,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_bgrewrite ZEND_ARG_TYPE_MASK(0, key_or_address, MAY_BE_STRING|MAY_BE_ARRAY, NULL) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_wait, 0, 3, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_MASK(0, key_or_address, MAY_BE_STRING|MAY_BE_ARRAY, NULL) + ZEND_ARG_TYPE_INFO(0, numreplicas, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_waitaof, 0, 4, RedisCluster, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_MASK(0, key_or_address, MAY_BE_STRING|MAY_BE_ARRAY, NULL) ZEND_ARG_TYPE_INFO(0, numlocal, IS_LONG, 0) @@ -101,14 +109,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_RedisCluster_brpoplpush, 0 ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_lmove, 0, 4, Redis, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_lmove, 0, 4, RedisCluster, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, src, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, dst, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, wherefrom, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, whereto, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_blmove, 0, 5, Redis, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_blmove, 0, 5, RedisCluster, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, src, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, dst, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, wherefrom, IS_STRING, 0) @@ -198,6 +206,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_del, 0, 1 ZEND_ARG_VARIADIC_TYPE_INFO(0, other_keys, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_delex, 0, 1, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_delifeq, 0, 2, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) @@ -444,14 +457,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_RedisCluster_hscan, 0, 2, ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, count, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_expiremember, 0, 3, Redis, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_expiremember, 0, 3, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, unit, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_expirememberat, 0, 3, Redis, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_expirememberat, 0, 3, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) @@ -562,7 +575,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_lpop, 0, ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, count, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_lpos, 0, 2, Redis, MAY_BE_NULL|MAY_BE_BOOL|MAY_BE_LONG|MAY_BE_ARRAY) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_lpos, 0, 2, RedisCluster, MAY_BE_NULL|MAY_BE_BOOL|MAY_BE_LONG|MAY_BE_ARRAY) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") @@ -615,6 +628,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_msetnx, 0 ZEND_ARG_TYPE_INFO(0, key_values, IS_ARRAY, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_msetex, 0, 1, Redis, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key_vals, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(0, expiry, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_ARRAY|MAY_BE_NULL, "null") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_multi, 0, 0, RedisCluster, MAY_BE_BOOL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_LONG, 0, "Redis::MULTI") ZEND_END_ARG_INFO() @@ -934,18 +952,26 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_vlinks, 0 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, withscores, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_vgetattr, 0, 2, Redis, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_vgetattr, 0, 2, RedisCluster, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, member, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, decode, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_vsetattr, 0, 3, Redis, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_vsetattr, 0, 3, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, member, IS_MIXED, 0) ZEND_ARG_TYPE_MASK(0, attributes, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_gcra, 0, 4, RedisCluster, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, maxBurst, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, requestsPerPeriod, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, period, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tokens, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_xack, 0, 3, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, group, IS_STRING, 0) @@ -974,6 +1000,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_xdel, 0, ZEND_ARG_TYPE_INFO(0, ids, IS_ARRAY, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_xdelex, 0, 2, RedisCluster, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ids, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_RedisCluster_xgroup, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, operation, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 1, "null") @@ -1155,7 +1187,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_zscore, 0 ZEND_ARG_TYPE_INFO(0, member, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_zmscore, 0, 2, Redis, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_zmscore, 0, 2, RedisCluster, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, member, IS_MIXED, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, other_members, IS_MIXED, 0) @@ -1181,12 +1213,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_zdiff, 0, ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() +#define arginfo_class_RedisCluster_digest arginfo_class_RedisCluster_dump + ZEND_METHOD(RedisCluster, __construct); ZEND_METHOD(RedisCluster, _compress); ZEND_METHOD(RedisCluster, _uncompress); ZEND_METHOD(RedisCluster, _serialize); ZEND_METHOD(RedisCluster, _unserialize); ZEND_METHOD(RedisCluster, _pack); +ZEND_METHOD(RedisCluster, _digest); ZEND_METHOD(RedisCluster, _unpack); ZEND_METHOD(RedisCluster, _prefix); ZEND_METHOD(RedisCluster, _masters); @@ -1194,6 +1229,7 @@ ZEND_METHOD(RedisCluster, _redir); ZEND_METHOD(RedisCluster, acl); ZEND_METHOD(RedisCluster, append); ZEND_METHOD(RedisCluster, bgrewriteaof); +ZEND_METHOD(RedisCluster, wait); ZEND_METHOD(RedisCluster, waitaof); ZEND_METHOD(RedisCluster, bgsave); ZEND_METHOD(RedisCluster, bitcount); @@ -1222,6 +1258,7 @@ ZEND_METHOD(RedisCluster, decr); ZEND_METHOD(RedisCluster, decrby); ZEND_METHOD(RedisCluster, decrbyfloat); ZEND_METHOD(RedisCluster, del); +ZEND_METHOD(RedisCluster, delex); ZEND_METHOD(RedisCluster, delifeq); ZEND_METHOD(RedisCluster, discard); ZEND_METHOD(RedisCluster, dump); @@ -1314,6 +1351,7 @@ ZEND_METHOD(RedisCluster, ltrim); ZEND_METHOD(RedisCluster, mget); ZEND_METHOD(RedisCluster, mset); ZEND_METHOD(RedisCluster, msetnx); +ZEND_METHOD(RedisCluster, msetex); ZEND_METHOD(RedisCluster, multi); ZEND_METHOD(RedisCluster, object); ZEND_METHOD(RedisCluster, persist); @@ -1391,10 +1429,12 @@ ZEND_METHOD(RedisCluster, vrem); ZEND_METHOD(RedisCluster, vlinks); ZEND_METHOD(RedisCluster, vgetattr); ZEND_METHOD(RedisCluster, vsetattr); +ZEND_METHOD(RedisCluster, gcra); ZEND_METHOD(RedisCluster, xack); ZEND_METHOD(RedisCluster, xadd); ZEND_METHOD(RedisCluster, xclaim); ZEND_METHOD(RedisCluster, xdel); +ZEND_METHOD(RedisCluster, xdelex); ZEND_METHOD(RedisCluster, xgroup); ZEND_METHOD(RedisCluster, xautoclaim); ZEND_METHOD(RedisCluster, xinfo); @@ -1436,6 +1476,7 @@ ZEND_METHOD(RedisCluster, zinter); ZEND_METHOD(RedisCluster, zdiffstore); ZEND_METHOD(RedisCluster, zunion); ZEND_METHOD(RedisCluster, zdiff); +ZEND_METHOD(RedisCluster, digest); static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, __construct, arginfo_class_RedisCluster___construct, ZEND_ACC_PUBLIC) @@ -1444,6 +1485,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, _serialize, arginfo_class_RedisCluster__serialize, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _unserialize, arginfo_class_RedisCluster__unserialize, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _pack, arginfo_class_RedisCluster__pack, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, _digest, arginfo_class_RedisCluster__digest, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _unpack, arginfo_class_RedisCluster__unpack, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _prefix, arginfo_class_RedisCluster__prefix, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _masters, arginfo_class_RedisCluster__masters, ZEND_ACC_PUBLIC) @@ -1451,6 +1493,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, acl, arginfo_class_RedisCluster_acl, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, append, arginfo_class_RedisCluster_append, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, bgrewriteaof, arginfo_class_RedisCluster_bgrewriteaof, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, wait, arginfo_class_RedisCluster_wait, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, waitaof, arginfo_class_RedisCluster_waitaof, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, bgsave, arginfo_class_RedisCluster_bgsave, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, bitcount, arginfo_class_RedisCluster_bitcount, ZEND_ACC_PUBLIC) @@ -1479,6 +1522,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, decrby, arginfo_class_RedisCluster_decrby, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, decrbyfloat, arginfo_class_RedisCluster_decrbyfloat, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, del, arginfo_class_RedisCluster_del, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, delex, arginfo_class_RedisCluster_delex, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, delifeq, arginfo_class_RedisCluster_delifeq, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, discard, arginfo_class_RedisCluster_discard, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, dump, arginfo_class_RedisCluster_dump, ZEND_ACC_PUBLIC) @@ -1571,6 +1615,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, mget, arginfo_class_RedisCluster_mget, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, mset, arginfo_class_RedisCluster_mset, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, msetnx, arginfo_class_RedisCluster_msetnx, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, msetex, arginfo_class_RedisCluster_msetex, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, multi, arginfo_class_RedisCluster_multi, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, object, arginfo_class_RedisCluster_object, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, persist, arginfo_class_RedisCluster_persist, ZEND_ACC_PUBLIC) @@ -1648,10 +1693,12 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, vlinks, arginfo_class_RedisCluster_vlinks, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, vgetattr, arginfo_class_RedisCluster_vgetattr, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, vsetattr, arginfo_class_RedisCluster_vsetattr, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, gcra, arginfo_class_RedisCluster_gcra, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xack, arginfo_class_RedisCluster_xack, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xadd, arginfo_class_RedisCluster_xadd, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xclaim, arginfo_class_RedisCluster_xclaim, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xdel, arginfo_class_RedisCluster_xdel, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, xdelex, arginfo_class_RedisCluster_xdelex, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xgroup, arginfo_class_RedisCluster_xgroup, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xautoclaim, arginfo_class_RedisCluster_xautoclaim, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xinfo, arginfo_class_RedisCluster_xinfo, ZEND_ACC_PUBLIC) @@ -1693,6 +1740,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, zdiffstore, arginfo_class_RedisCluster_zdiffstore, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, zunion, arginfo_class_RedisCluster_zunion, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, zdiff, arginfo_class_RedisCluster_zdiff, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, digest, arginfo_class_RedisCluster_digest, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/redis_cluster_legacy_arginfo.h b/redis_cluster_legacy_arginfo.h index d61b36e6bb..3fd44e313b 100644 --- a/redis_cluster_legacy_arginfo.h +++ b/redis_cluster_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6561a50ccac9841ac01a53feb5f88e7f592e1bc2 */ + * Stub hash: 6c7a87611b3bc9039650a3cf2e3c4d4f916611b0 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1) ZEND_ARG_INFO(0, name) @@ -23,6 +23,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_RedisCluster__pack arginfo_class_RedisCluster__compress +#define arginfo_class_RedisCluster__digest arginfo_class_RedisCluster__compress + #define arginfo_class_RedisCluster__unpack arginfo_class_RedisCluster__compress ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster__prefix, 0, 0, 1) @@ -49,6 +51,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_bgrewriteaof, 0, 0, 1) ZEND_ARG_INFO(0, key_or_address) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_wait, 0, 0, 3) + ZEND_ARG_INFO(0, key_or_address) + ZEND_ARG_INFO(0, numreplicas) + ZEND_ARG_INFO(0, timeout) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_waitaof, 0, 0, 4) ZEND_ARG_INFO(0, key_or_address) ZEND_ARG_INFO(0, numlocal) @@ -178,6 +186,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_del, 0, 0, 1) ZEND_ARG_VARIADIC_INFO(0, other_keys) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_delex, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, options) +ZEND_END_ARG_INFO() + #define arginfo_class_RedisCluster_delifeq arginfo_class_RedisCluster_append #define arginfo_class_RedisCluster_discard arginfo_class_RedisCluster__masters @@ -301,10 +314,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_RedisCluster_getWithMeta arginfo_class_RedisCluster__prefix -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_getex, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() +#define arginfo_class_RedisCluster_getex arginfo_class_RedisCluster_delex #define arginfo_class_RedisCluster_getbit arginfo_class_RedisCluster_append @@ -402,7 +412,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_expirememberat, 0, 0, 3) ZEND_ARG_INFO(0, timestamp) ZEND_END_ARG_INFO() -#define arginfo_class_RedisCluster_hrandfield arginfo_class_RedisCluster_getex +#define arginfo_class_RedisCluster_hrandfield arginfo_class_RedisCluster_delex #define arginfo_class_RedisCluster_hset arginfo_class_RedisCluster_hincrby @@ -526,6 +536,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_RedisCluster_msetnx arginfo_class_RedisCluster_mset +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_msetex, 0, 0, 1) + ZEND_ARG_INFO(0, key_vals) + ZEND_ARG_INFO(0, expiry) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_multi, 0, 0, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() @@ -705,9 +720,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_smove, 0, 0, 3) ZEND_ARG_INFO(0, member) ZEND_END_ARG_INFO() -#define arginfo_class_RedisCluster_sort arginfo_class_RedisCluster_getex +#define arginfo_class_RedisCluster_sort arginfo_class_RedisCluster_delex -#define arginfo_class_RedisCluster_sort_ro arginfo_class_RedisCluster_getex +#define arginfo_class_RedisCluster_sort_ro arginfo_class_RedisCluster_delex #define arginfo_class_RedisCluster_spop arginfo_class_RedisCluster_lpop @@ -800,6 +815,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_vsetattr, 0, 0, 3) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_gcra, 0, 0, 4) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, maxBurst) + ZEND_ARG_INFO(0, requestsPerPeriod) + ZEND_ARG_INFO(0, period) + ZEND_ARG_INFO(0, tokens) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_xack, 0, 0, 3) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, group) @@ -828,6 +851,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_xdel, 0, 0, 2) ZEND_ARG_INFO(0, ids) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_xdelex, 0, 0, 2) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, ids) + ZEND_ARG_INFO(0, mode) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_xgroup, 0, 0, 1) ZEND_ARG_INFO(0, operation) ZEND_ARG_INFO(0, key) @@ -949,7 +978,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_zrangestore, 0, 0, 4) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -#define arginfo_class_RedisCluster_zrandmember arginfo_class_RedisCluster_getex +#define arginfo_class_RedisCluster_zrandmember arginfo_class_RedisCluster_delex ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_zrangebylex, 0, 0, 3) ZEND_ARG_INFO(0, key) @@ -1010,12 +1039,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_zdiff, 0, 0, 1) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +#define arginfo_class_RedisCluster_digest arginfo_class_RedisCluster__prefix + ZEND_METHOD(RedisCluster, __construct); ZEND_METHOD(RedisCluster, _compress); ZEND_METHOD(RedisCluster, _uncompress); ZEND_METHOD(RedisCluster, _serialize); ZEND_METHOD(RedisCluster, _unserialize); ZEND_METHOD(RedisCluster, _pack); +ZEND_METHOD(RedisCluster, _digest); ZEND_METHOD(RedisCluster, _unpack); ZEND_METHOD(RedisCluster, _prefix); ZEND_METHOD(RedisCluster, _masters); @@ -1023,6 +1055,7 @@ ZEND_METHOD(RedisCluster, _redir); ZEND_METHOD(RedisCluster, acl); ZEND_METHOD(RedisCluster, append); ZEND_METHOD(RedisCluster, bgrewriteaof); +ZEND_METHOD(RedisCluster, wait); ZEND_METHOD(RedisCluster, waitaof); ZEND_METHOD(RedisCluster, bgsave); ZEND_METHOD(RedisCluster, bitcount); @@ -1051,6 +1084,7 @@ ZEND_METHOD(RedisCluster, decr); ZEND_METHOD(RedisCluster, decrby); ZEND_METHOD(RedisCluster, decrbyfloat); ZEND_METHOD(RedisCluster, del); +ZEND_METHOD(RedisCluster, delex); ZEND_METHOD(RedisCluster, delifeq); ZEND_METHOD(RedisCluster, discard); ZEND_METHOD(RedisCluster, dump); @@ -1143,6 +1177,7 @@ ZEND_METHOD(RedisCluster, ltrim); ZEND_METHOD(RedisCluster, mget); ZEND_METHOD(RedisCluster, mset); ZEND_METHOD(RedisCluster, msetnx); +ZEND_METHOD(RedisCluster, msetex); ZEND_METHOD(RedisCluster, multi); ZEND_METHOD(RedisCluster, object); ZEND_METHOD(RedisCluster, persist); @@ -1220,10 +1255,12 @@ ZEND_METHOD(RedisCluster, vrem); ZEND_METHOD(RedisCluster, vlinks); ZEND_METHOD(RedisCluster, vgetattr); ZEND_METHOD(RedisCluster, vsetattr); +ZEND_METHOD(RedisCluster, gcra); ZEND_METHOD(RedisCluster, xack); ZEND_METHOD(RedisCluster, xadd); ZEND_METHOD(RedisCluster, xclaim); ZEND_METHOD(RedisCluster, xdel); +ZEND_METHOD(RedisCluster, xdelex); ZEND_METHOD(RedisCluster, xgroup); ZEND_METHOD(RedisCluster, xautoclaim); ZEND_METHOD(RedisCluster, xinfo); @@ -1265,6 +1302,7 @@ ZEND_METHOD(RedisCluster, zinter); ZEND_METHOD(RedisCluster, zdiffstore); ZEND_METHOD(RedisCluster, zunion); ZEND_METHOD(RedisCluster, zdiff); +ZEND_METHOD(RedisCluster, digest); static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, __construct, arginfo_class_RedisCluster___construct, ZEND_ACC_PUBLIC) @@ -1273,6 +1311,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, _serialize, arginfo_class_RedisCluster__serialize, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _unserialize, arginfo_class_RedisCluster__unserialize, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _pack, arginfo_class_RedisCluster__pack, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, _digest, arginfo_class_RedisCluster__digest, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _unpack, arginfo_class_RedisCluster__unpack, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _prefix, arginfo_class_RedisCluster__prefix, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, _masters, arginfo_class_RedisCluster__masters, ZEND_ACC_PUBLIC) @@ -1280,6 +1319,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, acl, arginfo_class_RedisCluster_acl, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, append, arginfo_class_RedisCluster_append, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, bgrewriteaof, arginfo_class_RedisCluster_bgrewriteaof, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, wait, arginfo_class_RedisCluster_wait, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, waitaof, arginfo_class_RedisCluster_waitaof, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, bgsave, arginfo_class_RedisCluster_bgsave, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, bitcount, arginfo_class_RedisCluster_bitcount, ZEND_ACC_PUBLIC) @@ -1308,6 +1348,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, decrby, arginfo_class_RedisCluster_decrby, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, decrbyfloat, arginfo_class_RedisCluster_decrbyfloat, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, del, arginfo_class_RedisCluster_del, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, delex, arginfo_class_RedisCluster_delex, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, delifeq, arginfo_class_RedisCluster_delifeq, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, discard, arginfo_class_RedisCluster_discard, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, dump, arginfo_class_RedisCluster_dump, ZEND_ACC_PUBLIC) @@ -1400,6 +1441,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, mget, arginfo_class_RedisCluster_mget, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, mset, arginfo_class_RedisCluster_mset, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, msetnx, arginfo_class_RedisCluster_msetnx, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, msetex, arginfo_class_RedisCluster_msetex, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, multi, arginfo_class_RedisCluster_multi, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, object, arginfo_class_RedisCluster_object, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, persist, arginfo_class_RedisCluster_persist, ZEND_ACC_PUBLIC) @@ -1477,10 +1519,12 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, vlinks, arginfo_class_RedisCluster_vlinks, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, vgetattr, arginfo_class_RedisCluster_vgetattr, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, vsetattr, arginfo_class_RedisCluster_vsetattr, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, gcra, arginfo_class_RedisCluster_gcra, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xack, arginfo_class_RedisCluster_xack, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xadd, arginfo_class_RedisCluster_xadd, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xclaim, arginfo_class_RedisCluster_xclaim, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xdel, arginfo_class_RedisCluster_xdel, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, xdelex, arginfo_class_RedisCluster_xdelex, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xgroup, arginfo_class_RedisCluster_xgroup, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xautoclaim, arginfo_class_RedisCluster_xautoclaim, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, xinfo, arginfo_class_RedisCluster_xinfo, ZEND_ACC_PUBLIC) @@ -1522,6 +1566,7 @@ static const zend_function_entry class_RedisCluster_methods[] = { ZEND_ME(RedisCluster, zdiffstore, arginfo_class_RedisCluster_zdiffstore, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, zunion, arginfo_class_RedisCluster_zunion, ZEND_ACC_PUBLIC) ZEND_ME(RedisCluster, zdiff, arginfo_class_RedisCluster_zdiff, ZEND_ACC_PUBLIC) + ZEND_ME(RedisCluster, digest, arginfo_class_RedisCluster_digest, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/redis_commands.c b/redis_commands.c index 8fe055f321..8c8518649a 100644 --- a/redis_commands.c +++ b/redis_commands.c @@ -16,12 +16,14 @@ +----------------------------------------------------------------------+ */ +#include "hash/php_hash.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "redis_commands.h" + #include "php_network.h" #ifndef PHP_WIN32 @@ -76,6 +78,45 @@ typedef struct redisRestoreOptions { zend_long freq; } redisRestoreOptions; +typedef enum redisSetType { + REDIS_SET_NONE, + REDIS_SET_NX, + REDIS_SET_XX +} redisSetType; + +typedef enum redisExpiryType { + REDIS_EXPIRY_NONE, + REDIS_EXPIRY_EX, + REDIS_EXPIRY_PX, + REDIS_EXPIRY_EXAT, + REDIS_EXPIRY_PXAT, +} redisExpiryType; + +typedef enum redisEqType { + REDIS_IF_NONE, + REDIS_IFEQ, + REDIS_IFNE, + REDIS_IFDEQ, + REDIS_IFDNE +} redisEqType; + +typedef struct redisExpiryOptions { + redisExpiryType type; + zend_long ttl; + zend_bool keepttl; +} redisExpiryOptions; + +typedef struct redisSetOptions { + redisSetType type; + zend_bool get; + redisExpiryOptions expiry; + struct { + redisEqType type; + zval *zval; + } eq; +} redisSetOptions; + + #define REDIS_ZCMD_HAS_DST_KEY (1 << 0) #define REDIS_ZCMD_HAS_WITHSCORES (1 << 1) #define REDIS_ZCMD_HAS_BY_LEX_SCORE (1 << 2) @@ -490,7 +531,7 @@ redis_failover_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, } else if (zend_string_equals_literal_ci(zkey, "port")) { port = zval_get_long(z_ele); } else if (zend_string_equals_literal_ci(zkey, "force")) { - force = zval_is_true(z_ele); + force = zend_is_true(z_ele); } } } ZEND_HASH_FOREACH_END(); @@ -636,7 +677,7 @@ void redis_get_zcmd_options(redisZcmdOptions *dst, zval *src, int flags) { if (key) { if ((flags & REDIS_ZCMD_HAS_WITHSCORES) && zend_string_equals_literal_ci(key, "WITHSCORES")) - dst->withscores = zval_is_true(zv); + dst->withscores = zend_is_true(zv); else if ((flags & REDIS_ZCMD_HAS_LIMIT) && zend_string_equals_literal_ci(key, "LIMIT") && Z_TYPE_P(zv) == IS_ARRAY) { @@ -1124,7 +1165,7 @@ redis_zrandmember_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (zend_string_equals_literal_ci(zkey, "count")) { count = zval_get_long(z_ele); } else if (zend_string_equals_literal_ci(zkey, "withscores")) { - withscores = zval_is_true(z_ele); + withscores = zend_is_true(z_ele); } } } ZEND_HASH_FOREACH_END(); @@ -1918,15 +1959,31 @@ gen_vararg_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, return SUCCESS; } +static void +redis_cmd_append_sstr_mset_kvals(smart_string *cmdstr, RedisSock *redis_sock, + HashTable *kvals, short *slot) +{ + zend_string *key; + zend_ulong idx; + zval *zv; + + ZEND_HASH_FOREACH_KEY_VAL(kvals, idx, key, zv) { + ZVAL_DEREF(zv); + if (key) { + redis_cmd_append_sstr_key_zstr(cmdstr, key, redis_sock, slot); + } else { + redis_cmd_append_sstr_key_long(cmdstr, idx, redis_sock, slot); + } + redis_cmd_append_sstr_zval(cmdstr, zv, redis_sock); + } ZEND_HASH_FOREACH_END(); +} + int redis_mset_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char *kw, char **cmd, int *cmd_len, short *slot, void **ctx) { smart_string cmdstr = {0}; HashTable *kvals = NULL; - zend_string *key; - zend_ulong idx; - zval *zv; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ARRAY_HT(kvals) @@ -1935,17 +1992,9 @@ int redis_mset_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (zend_hash_num_elements(kvals) == 0) return FAILURE; - redis_cmd_init_sstr(&cmdstr, zend_hash_num_elements(kvals) * 2, kw, strlen(kw)); - - ZEND_HASH_FOREACH_KEY_VAL(kvals, idx, key, zv) { - ZVAL_DEREF(zv); - if (key) { - redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, NULL); - } else { - redis_cmd_append_sstr_key_long(&cmdstr, idx, redis_sock, NULL); - } - redis_cmd_append_sstr_zval(&cmdstr, zv, redis_sock); - } ZEND_HASH_FOREACH_END(); + redis_cmd_init_sstr(&cmdstr, zend_hash_num_elements(kvals) * 2, kw, + strlen(kw)); + redis_cmd_append_sstr_mset_kvals(&cmdstr, redis_sock, kvals, slot); *cmd = cmdstr.c; *cmd_len = cmdstr.len; @@ -2324,129 +2373,262 @@ static int redis_try_get_expiry(zval *zv, zend_long *lval) { } } -/* SET */ -int redis_set_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, - char **cmd, int *cmd_len, short *slot, void **ctx) -{ - char *key = NULL, *exp_type = NULL, *set_type = NULL; - zval *z_value, *z_opts = NULL, *ifeq = NULL; - zend_string *zstr = NULL, *tmp = NULL; - smart_string cmdstr = {0}; - zend_long expire = -1; - zend_bool get = 0; - long keep_ttl = 0; - size_t key_len; +static zend_bool zstr_to_expiry_type(redisExpiryType *dst, zend_string *src) { + redisExpiryType tmp = REDIS_EXPIRY_NONE; - #define setExpiryWarning(zv) \ - php_error_docref(NULL, E_WARNING, "%s passed as EXPIRY is invalid " \ - "(must be an int, float, or numeric string >= 1)", \ - zend_zval_type_name((zv))) + if (zend_string_equals_literal_ci(src, "EX")) { + tmp = REDIS_EXPIRY_EX; + } else if (zend_string_equals_literal_ci(src, "PX")) { + tmp = REDIS_EXPIRY_PX; + } else if (zend_string_equals_literal_ci(src, "EXAT")) { + tmp = REDIS_EXPIRY_EXAT; + } else if (zend_string_equals_literal_ci(src, "PXAT")) { + tmp = REDIS_EXPIRY_PXAT; + } else { + return 0; + } - // Make sure the function is being called correctly - if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|z", &key, &key_len, - &z_value, &z_opts) == FAILURE) - { - return FAILURE; + *dst = tmp; + return 1; +} + +static zend_bool zstr_to_eq_type(redisEqType *dst, zend_string *src) { + *dst = REDIS_IF_NONE; + + if (zend_string_equals_literal_ci(src, "IFEQ")) { + *dst = REDIS_IFEQ; + } else if (zend_string_equals_literal_ci(src, "IFNE")) { + *dst = REDIS_IFNE; + } else if (zend_string_equals_literal_ci(src, "IFDEQ")) { + *dst = REDIS_IFDEQ; + } else if (zend_string_equals_literal_ci(src, "IFDNE")) { + *dst = REDIS_IFDNE; + } else { + return 0; } - // Check for an options array - if (z_opts && Z_TYPE_P(z_opts) == IS_ARRAY) { - HashTable *kt = Z_ARRVAL_P(z_opts); - zend_string *zkey; - zval *v; + return 1; +} - /* Iterate our option array */ - ZEND_HASH_FOREACH_STR_KEY_VAL(kt, zkey, v) { - ZVAL_DEREF(v); - /* Detect PX or EX argument and validate timeout */ - if (zkey && (zend_string_equals_literal_ci(zkey, "EX") || - zend_string_equals_literal_ci(zkey, "PX") || - zend_string_equals_literal_ci(zkey, "EXAT") || - zend_string_equals_literal_ci(zkey, "PXAT")) - ) { - if (redis_try_get_expiry(v, &expire) == FAILURE || expire < 1) { - setExpiryWarning(v); - return FAILURE; - } +static void fill_set_options_ht(redisSetOptions *dst, HashTable *ht) { + zend_string *key; + zval *zv; - exp_type = ZSTR_VAL(zkey); - } else if (zkey && zend_string_equals_literal_ci(zkey, "IFEQ")) { - ifeq = v; - } else if (Z_TYPE_P(v) == IS_STRING) { - if (zend_string_equals_literal_ci(Z_STR_P(v), "KEEPTTL")) { - keep_ttl = 1; - } else if (zend_string_equals_literal_ci(Z_STR_P(v), "GET")) { - get = 1; - } else if (zend_string_equals_literal_ci(Z_STR_P(v), "NX") || - zend_string_equals_literal_ci(Z_STR_P(v), "XX")) - { - set_type = Z_STRVAL_P(v); - } + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, key, zv) { + if (key) { + if (zstr_to_expiry_type(&dst->expiry.type, key)) { + dst->expiry.ttl = zval_get_long(zv); + } else if (zstr_to_eq_type(&dst->eq.type, key)) { + dst->eq.zval = zv; + } else if (zend_string_equals_literal_ci(key, "GET")) { + dst->get = zend_is_true(zv); + } + } else if (Z_TYPE_P(zv) == IS_STRING) { + key = Z_STR_P(zv); + if (zend_string_equals_literal_ci(key, "NX")) { + dst->type = REDIS_SET_NX; + } else if (zend_string_equals_literal_ci(key, "XX")) { + dst->type = REDIS_SET_XX; + } else if (zend_string_equals_literal_ci(key, "GET")) { + dst->get = 1; + } else if (zend_string_equals_literal_ci(key, "KEEPTTL")) { + dst->expiry.type = REDIS_EXPIRY_NONE; + dst->expiry.keepttl = 1; } - } ZEND_HASH_FOREACH_END(); - } else if (z_opts && Z_TYPE_P(z_opts) != IS_NULL) { - if (redis_try_get_expiry(z_opts, &expire) == FAILURE || expire < 1) { - setExpiryWarning(z_opts); - return FAILURE; } + } ZEND_HASH_FOREACH_END(); +} + +static int +fill_set_options_zval(redisSetOptions *dst, zval *zv, zend_bool legacy_set) { + zend_long lval; + + memset(dst, 0, sizeof(*dst)); + + if (zv == NULL) + return SUCCESS; + + if (Z_TYPE_P(zv) == IS_ARRAY) { + fill_set_options_ht(dst, Z_ARRVAL_P(zv)); + return SUCCESS; + } else if (redis_try_get_expiry(zv, &lval) == SUCCESS && lval > 0) { + if (!legacy_set) + dst->expiry.type = REDIS_EXPIRY_EX; + dst->expiry.ttl = lval; + return SUCCESS; + } + + php_error_docref(NULL, E_WARNING, + "EXPIRY is invalid (must be an int, float, or numeric string >= 1)"); + + return FAILURE; +} + +static void +redis_cmd_append_sstr_expiry(smart_string *cmdstr, redisExpiryOptions *e) +{ + if (e->type == REDIS_EXPIRY_NONE && !e->keepttl) + return; + + if (e->keepttl) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "KEEPTTL"); + return; + } else if (e->type == REDIS_EXPIRY_EX) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "EX"); + } else if (e->type == REDIS_EXPIRY_PX) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "PX"); + } else if (e->type == REDIS_EXPIRY_EXAT) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "EXAT"); + } else if (e->type == REDIS_EXPIRY_PXAT) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "PXAT"); + } + + redis_cmd_append_sstr_zend_long(cmdstr, e->ttl); +} + +static void +redis_cmd_append_eq_clause(smart_string *cmdstr, RedisSock *redis_sock, + redisEqType type, zval *zv) +{ + zend_bool pack; + + if (type == REDIS_IF_NONE) + return; + + if (type == REDIS_IFEQ) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "IFEQ"); + } else if (type == REDIS_IFNE) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "IFNE"); + } else if (type == REDIS_IFDEQ) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "IFDEQ"); + } else if (type == REDIS_IFDNE) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "IFDNE"); + } + + pack = type == REDIS_IFEQ || type == REDIS_IFNE; + redis_cmd_append_sstr_zval(cmdstr, zv, pack ? redis_sock : NULL); +} + +static void +redis_cmd_append_sstr_set_type(smart_string *cmdstr, redisSetType type) { + if (type == REDIS_SET_NX) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "NX"); + } else if (type == REDIS_SET_XX) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "XX"); + } +} + +/* MSETEX */ +int redis_msetex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx) +{ + redisSetOptions opt = {0}; + smart_string cmdstr = {0}; + zval *zexp = NULL; + HashTable *kvals; + int argc; + + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ARRAY_HT(kvals) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(zexp) + ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); + + if (zend_hash_num_elements(kvals) == 0) { + php_error_docref(NULL, E_WARNING, "No key/value pairs provided"); + return FAILURE; } - /* Protect the user from syntax errors but give them some info about what's wrong */ - if (exp_type && keep_ttl) { - php_error_docref(NULL, E_WARNING, "KEEPTTL can't be combined with EX or PX option"); + if (fill_set_options_zval(&opt, zexp, 0) != SUCCESS) return FAILURE; + + argc = 1 + (2 * zend_hash_num_elements(kvals)) + !!opt.type; + if (opt.expiry.keepttl) { + argc += 1; + } else if (opt.expiry.type != REDIS_EXPIRY_NONE) { + argc += 2; } + REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, argc, "MSETEX"); + + redis_cmd_append_sstr_u64(&cmdstr, zend_hash_num_elements(kvals)); + redis_cmd_append_sstr_mset_kvals(&cmdstr, redis_sock, kvals, slot); + redis_cmd_append_sstr_set_type(&cmdstr, opt.type); + redis_cmd_append_sstr_expiry(&cmdstr, &opt.expiry); + + *cmd = cmdstr.c; + *cmd_len = cmdstr.len; + + return SUCCESS; +} + +/* SET */ +int redis_set_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx) +{ + zval *z_value = NULL, *z_opts = NULL; + smart_string cmdstr = {0}; + redisSetOptions opt = {0}; + zend_string *key; + int argc = 2; + + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_STR(key) + Z_PARAM_ZVAL(z_value) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(z_opts) + ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); + + if (fill_set_options_zval(&opt, z_opts, 1) != SUCCESS) + return FAILURE; + /* You can't use IFEQ with NX or XX */ - if (set_type && ifeq) { - php_error_docref(NULL, E_WARNING, "IFEQ can't be combined with NX or XX option"); + if (opt.type && opt.eq.type != REDIS_IF_NONE) { + php_error_docref(NULL, E_WARNING, + "IF clauses can't be combined with NX/XX"); return FAILURE; } /* Backward compatibility: If we are passed no options except an EXPIRE ttl, we - * actually execute a SETEX command */ - if (expire > 0 && !exp_type && !set_type && !keep_ttl) { - *cmd_len = REDIS_CMD_SPPRINTF(cmd, "SETEX", "klv", key, key_len, expire, z_value); + * actually execute the SETEX command */ + if (opt.expiry.ttl > 0 && opt.expiry.type == REDIS_EXPIRY_NONE && !opt.type) + { + *cmd_len = REDIS_CMD_SPPRINTF(cmd, "SETEX", "Klv", key, opt.expiry.ttl, + z_value); return SUCCESS; } - /* Calculate argc based on options set */ - int argc = 2 + (ifeq ? 2 : 0) + (exp_type ? 2 : 0) + (set_type != NULL) + - (keep_ttl != 0) + get; + /* Add additional argc depending on options */ + argc += (opt.eq.type != REDIS_IF_NONE ? 2 : 0) + !!opt.type + !!opt.get; + if (opt.expiry.keepttl) { + argc += 1; + } else if (opt.expiry.type != REDIS_EXPIRY_NONE) { + argc += 2; + } /* Initial SET */ - redis_cmd_init_sstr(&cmdstr, argc, ZEND_STRL("SET")); - redis_cmd_append_sstr_key(&cmdstr, key, key_len, redis_sock, slot); + REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, argc, "SET"); + redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, slot); redis_cmd_append_sstr_zval(&cmdstr, z_value, redis_sock); - if (ifeq) { - zstr = zval_get_tmp_string(ifeq, &tmp); - REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "IFEQ"); - redis_cmd_append_sstr_zstr(&cmdstr, zstr); - zend_tmp_string_release(tmp); - } else if (set_type) { - redis_cmd_append_sstr(&cmdstr, set_type, strlen(set_type)); + if (opt.eq.type != REDIS_IF_NONE) { + redis_cmd_append_eq_clause(&cmdstr, redis_sock, opt.eq.type, opt.eq.zval); + } else if (opt.type != REDIS_SET_NONE) { + redis_cmd_append_sstr_set_type(&cmdstr, opt.type); } - if (get) { + if (opt.get) { REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "GET"); *ctx = PHPREDIS_CTX_PTR; } - if (exp_type) { - redis_cmd_append_sstr(&cmdstr, exp_type, strlen(exp_type)); - redis_cmd_append_sstr_long(&cmdstr, (long)expire); - } else if (keep_ttl) { - REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "KEEPTTL"); - } + redis_cmd_append_sstr_expiry(&cmdstr, &opt.expiry); /* Push command and length to the caller */ *cmd = cmdstr.c; *cmd_len = cmdstr.len; return SUCCESS; - - #undef setExpiryWarning } /* MGET */ @@ -2511,13 +2693,13 @@ redis_getex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, expire = zval_get_long(z_ele); persist = 0; } else if (ZSTR_STRICMP_STATIC(zkey, "PERSIST")) { - persist = zval_is_true(z_ele); + persist = zend_is_true(z_ele); exp_type = NULL; } } else if (Z_TYPE_P(z_ele) == IS_STRING && zend_string_equals_literal_ci(Z_STR_P(z_ele), "PERSIST")) { - persist = zval_is_true(z_ele); + persist = zend_is_true(z_ele); exp_type = NULL; } } ZEND_HASH_FOREACH_END(); @@ -2640,6 +2822,53 @@ int redis_decr_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, TYPE_DECR, redis_sock, cmd, cmd_len, slot, ctx); } +typedef enum xdelExMode { + REDIS_XDELEX_NONE, + REDIS_XDELEX_KEEPREF, + REDIS_XDELEX_DELREF, + REDIS_XDELEX_ACKED, +} xdelExMode; + +int redis_delex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx) +{ + redisEqType type = REDIS_IF_NONE; + smart_string cmdstr = {0}; + zend_string *key, *ztype; + HashTable *ht = NULL; + zval *zv = NULL; + + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(key) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY_HT_OR_NULL(ht) + ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); + + if (ht != NULL) { + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, ztype, zv) { + if (ztype == NULL) + continue; + + ZVAL_DEREF(zv); + + if (zstr_to_eq_type(&type, ztype)) + break; + + php_error_docref(NULL, E_WARNING, "Unknown option '%s'", ZSTR_VAL(ztype)); + } ZEND_HASH_FOREACH_END(); + } + + REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, type != REDIS_IF_NONE ? 3 : 1, "DELEX"); + + redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, slot); + redis_cmd_append_eq_clause(&cmdstr, redis_sock, type, zv); + + *cmd = cmdstr.c; + *cmd_len = cmdstr.len; + + return SUCCESS; +} + /* HINCRBY */ int redis_hincrby_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx) @@ -2684,14 +2913,19 @@ int redis_hincrbyfloat_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, } static inline zval *coerce_hash_field(zval *zv, zval *aux) { + char buf[32]; zend_long lv; + size_t len; if (UNEXPECTED(Z_TYPE_P(zv) == IS_STRING && is_numeric_string(Z_STRVAL_P(zv), Z_STRLEN_P(zv), &lv, NULL, 0) == IS_LONG)) { - ZVAL_LONG(aux, lv); - return aux; + len = snprintf(buf, sizeof(buf), ZEND_LONG_FMT, lv); + if (len == Z_STRLEN_P(zv) && redis_strncmp(Z_STRVAL_P(zv), buf, len) == 0) { + ZVAL_LONG(aux, lv); + return aux; + } } return zv; @@ -2866,14 +3100,14 @@ static void redis_get_lcs_options(redisLcsOptions *dst, HashTable *ht) { if (key) { if (zend_string_equals_literal_ci(key, "LEN")) { dst->idx = 0; - dst->len = zval_is_true(zv); + dst->len = zend_is_true(zv); } else if (zend_string_equals_literal_ci(key, "IDX")) { dst->len = 0; - dst->idx = zval_is_true(zv); + dst->idx = zend_is_true(zv); } else if (zend_string_equals_literal_ci(key, "MINMATCHLEN")) { dst->minmatchlen = zval_get_long(zv); } else if (zend_string_equals_literal_ci(key, "WITHMATCHLEN")) { - dst->withmatchlen = zval_is_true(zv); + dst->withmatchlen = zend_is_true(zv); } else { php_error_docref(NULL, E_WARNING, "Unknown LCS option '%s'", ZSTR_VAL(key)); } @@ -3662,7 +3896,7 @@ redis_hrandfield_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (zend_string_equals_literal_ci(zkey, "count")) { count = zval_get_long(z_ele); } else if (zend_string_equals_literal_ci(zkey, "withvalues")) { - withvalues = zval_is_true(z_ele); + withvalues = zend_is_true(z_ele); } } else if (Z_TYPE_P(z_ele) == IS_STRING) { if (zend_string_equals_literal_ci(Z_STR_P(z_ele), "WITHVALUES")) { @@ -3809,7 +4043,7 @@ int redis_sort_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (slot) { php_error_docref(NULL, E_WARNING, "SORT BY option is not allowed in Redis Cluster"); - zval_dtor(&z_argv); + zval_ptr_dtor_nogc(&z_argv); return FAILURE; } @@ -3839,7 +4073,7 @@ int redis_sort_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (cross_slot) { php_error_docref(0, E_WARNING, "Error, SORT key and STORE key have different slots!"); - zval_dtor(&z_argv); + zval_ptr_dtor_nogc(&z_argv); return FAILURE; } @@ -3860,7 +4094,7 @@ int redis_sort_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (slot) { php_error_docref(NULL, E_WARNING, "GET option for SORT disabled in Redis Cluster"); - zval_dtor(&z_argv); + zval_ptr_dtor_nogc(&z_argv); return FAILURE; } @@ -3889,7 +4123,7 @@ int redis_sort_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (added == 0) { php_error_docref(NULL, E_WARNING, "Array of GET values requested, but none are valid"); - zval_dtor(&z_argv); + zval_ptr_dtor_nogc(&z_argv); return FAILURE; } } @@ -3898,7 +4132,7 @@ int redis_sort_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, // ALPHA if (((z_ele = zend_hash_str_find(ht_opts, "alpha", sizeof("alpha") - 1)) != NULL || (z_ele = zend_hash_str_find(ht_opts, "ALPHA", sizeof("ALPHA") - 1)) != NULL) && - zval_is_true(z_ele) + zend_is_true(z_ele) ) { add_next_index_stringl(&z_argv, "ALPHA", sizeof("ALPHA") - 1); } @@ -3919,7 +4153,7 @@ int redis_sort_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, ) { php_error_docref(NULL, E_WARNING, "LIMIT options on SORT command must be longs or strings"); - zval_dtor(&z_argv); + zval_ptr_dtor_nogc(&z_argv); return FAILURE; } @@ -3961,7 +4195,7 @@ int redis_sort_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, /* Clean up our arguments array. Note we don't have to free any prefixed * key as that we didn't duplicate the pointer if we prefixed */ - zval_dtor(&z_argv); + zval_ptr_dtor_nogc(&z_argv); // Push our length and command *cmd_len = cmdstr.len; @@ -4239,7 +4473,7 @@ static int get_georadius_count_options(zval *optval, geoOptions *opts) { z_tmp = zend_hash_index_find(Z_ARRVAL_P(optval), 1); if (z_tmp) { - opts->any = zval_is_true(z_tmp); + opts->any = zend_is_true(z_tmp); } } else { if (Z_LVAL_P(optval) <= 0) @@ -5405,13 +5639,13 @@ redis_build_client_tracking_command(smart_string *cmdstr, int argc, zval *z_args } prefix = z_ele; } else if (zend_string_equals_literal_ci(zkey, "bcast")) { - bcast = zval_is_true(z_ele); + bcast = zend_is_true(z_ele); } else if (zend_string_equals_literal_ci(zkey, "optin")) { - optin = zval_is_true(z_ele); + optin = zend_is_true(z_ele); } else if (zend_string_equals_literal_ci(zkey, "optout")) { - optout = zval_is_true(z_ele); + optout = zend_is_true(z_ele); } else if (zend_string_equals_literal_ci(zkey, "noloop")) { - noloop = zval_is_true(z_ele); + noloop = zend_is_true(z_ele); } } } ZEND_HASH_FOREACH_END(); @@ -5425,7 +5659,7 @@ redis_build_client_tracking_command(smart_string *cmdstr, int argc, zval *z_args ZVAL_STRICMP_STATIC(&z_args[0], "off") )) { redis_cmd_append_sstr(cmdstr, Z_STRVAL(z_args[0]), Z_STRLEN(z_args[0])); - } else if (zval_is_true(&z_args[0])) { + } else if (zend_is_true(&z_args[0])) { REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "ON"); } else { REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "OFF"); @@ -5500,7 +5734,7 @@ redis_client_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, ZVAL_STRICMP_STATIC(&z_args[0], "no") )) { redis_cmd_append_sstr(&cmdstr, Z_STRVAL(z_args[0]), Z_STRLEN(z_args[0])); - } else if (zval_is_true(&z_args[0])) { + } else if (zend_is_true(&z_args[0])) { REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "YES"); } else { REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "NO"); @@ -5530,7 +5764,7 @@ redis_client_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, ZVAL_STRICMP_STATIC(&z_args[0], "off") )) { redis_cmd_append_sstr(&cmdstr, Z_STRVAL(z_args[0]), Z_STRLEN(z_args[0])); - } else if (zval_is_true(&z_args[0])) { + } else if (zend_is_true(&z_args[0])) { REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "ON"); } else { REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "OFF"); @@ -5704,7 +5938,7 @@ redis_copy_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, if (zend_string_equals_literal_ci(zkey, "db")) { db = zval_get_long(zv); } else if (zend_string_equals_literal_ci(zkey, "replace")) { - replace = zval_is_true(zv); + replace = zend_is_true(zv); } } ZEND_HASH_FOREACH_END(); } @@ -5735,6 +5969,120 @@ redis_copy_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, return SUCCESS; } +static xdelExMode zstr_to_xdelex_mode(zend_string *s) { + if (s == NULL) + return REDIS_XDELEX_NONE; + else if (zend_string_equals_literal_ci(s, "KEEPREF")) + return REDIS_XDELEX_KEEPREF; + else if (zend_string_equals_literal_ci(s, "DELREF")) + return REDIS_XDELEX_DELREF; + else if (zend_string_equals_literal_ci(s, "ACKED")) + return REDIS_XDELEX_ACKED; + + php_error_docref(NULL, E_WARNING, "Unknown mode '%s'", ZSTR_VAL(s)); + + return REDIS_XDELEX_NONE; +} + +void redis_cmd_append_delex_mode(smart_string *cmdstr, xdelExMode mode) { + if (mode == REDIS_XDELEX_KEEPREF) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "KEEPREF"); + } else if (mode == REDIS_XDELEX_DELREF) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "DELREF"); + } else if (mode == REDIS_XDELEX_ACKED) { + REDIS_CMD_APPEND_SSTR_STATIC(cmdstr, "ACKED"); + } +} + +int redis_xdelex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx) +{ + xdelExMode mode = REDIS_XDELEX_NONE; + zend_string *key, *mstr = NULL; + smart_string cmdstr = {0}; + HashTable *ids; + int argc = 3; + zval *id; + + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_STR(key) + Z_PARAM_ARRAY_HT(ids) + Z_PARAM_OPTIONAL + Z_PARAM_STR(mstr) + ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); + + if (zend_hash_num_elements(ids) == 0) { + php_error_docref(NULL, E_WARNING, "At least one ID must be specified"); + return FAILURE; + } + + mode = zstr_to_xdelex_mode(mstr); + + argc += (mode != REDIS_XDELEX_NONE) + zend_hash_num_elements(ids); + redis_cmd_init_sstr(&cmdstr, argc, ZEND_STRL("XDELEX")); + redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, slot); + + redis_cmd_append_delex_mode(&cmdstr, mode); + + redis_cmd_append_sstr(&cmdstr, ZEND_STRL("IDS")); + redis_cmd_append_sstr_long(&cmdstr, zend_hash_num_elements(ids)); + + ZEND_HASH_FOREACH_VAL(ids, id) { + redis_cmd_append_sstr_zval(&cmdstr, id, NULL); + } ZEND_HASH_FOREACH_END(); + + *cmd = cmdstr.c; + *cmd_len = cmdstr.len; + return SUCCESS; +} + +// XACKDEL key group [KEEPREF | DELREF | ACKED] IDS numids id [id ...] +int redis_xackdel_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx) +{ + zend_string *key, *group, *mode = NULL; + xdelExMode dtype = REDIS_XDELEX_NONE; + smart_string cmdstr = {0}; + HashTable *ids; + int argc; + zval *id; + + ZEND_PARSE_PARAMETERS_START(3, 4) + Z_PARAM_STR(key) + Z_PARAM_STR(group) + Z_PARAM_ARRAY_HT(ids) + Z_PARAM_OPTIONAL + Z_PARAM_STR(mode) + ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); + + if (zend_hash_num_elements(ids) == 0) { + php_error_docref(NULL, E_WARNING, "At least one ID must be specified"); + return FAILURE; + } + + dtype = zstr_to_xdelex_mode(mode); + + argc = 4 + (dtype != REDIS_XDELEX_NONE) + zend_hash_num_elements(ids); + redis_cmd_init_sstr(&cmdstr, argc, ZEND_STRL("XACKDEL")); + + redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, slot); + redis_cmd_append_sstr_zstr(&cmdstr, group); + redis_cmd_append_delex_mode(&cmdstr, dtype); + + redis_cmd_append_sstr(&cmdstr, ZEND_STRL("IDS")); + redis_cmd_append_sstr_long(&cmdstr, zend_hash_num_elements(ids)); + + ZEND_HASH_FOREACH_VAL(ids, id) { + redis_cmd_append_sstr_zval(&cmdstr, id, NULL); + } ZEND_HASH_FOREACH_END(); + + *cmd = cmdstr.c; + *cmd_len = cmdstr.len; + + return SUCCESS; +} + + /* XADD */ int redis_xadd_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx) @@ -6700,9 +7048,9 @@ static void parse_vadd_options(redisVAddOptions *dst, HashTable *ht) { if (validate_vadd_integer(key, zv, 1)) dst->ef = Z_LVAL_P(zv); } else if (zend_string_equals_literal_ci(key, "CAS")) { - dst->cas = zval_is_true(zv); + dst->cas = zend_is_true(zv); } else if (zend_string_equals_literal_ci(key, "VALUES")) { - dst->values = zval_is_true(zv); + dst->values = zend_is_true(zv); } else if (zend_string_equals_literal_ci(key, "SETATTR")) { dst->attributes = zval_to_vattr(zv); } @@ -6897,7 +7245,7 @@ static void parse_vsim_options(redisVSimOptions *dst, HashTable *ht) { if (validate_vadd_integer(key, zv, 1)) dst->count = Z_LVAL_P(zv); } else if (zend_string_equals_literal_ci(key, "WITHSCORES")) { - dst->withscores = zval_is_true(zv); + dst->withscores = zend_is_true(zv); } } else if (Z_TYPE_P(zv) == IS_STRING) { if (zend_string_equals_literal_ci(Z_STR_P(zv), "FP32")) { @@ -7148,6 +7496,40 @@ redis_vsetattr_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, return SUCCESS; } +// GCRA key max-burst requests-per-period period [NUM_REQUESTS count] +int redis_gcra_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx) +{ + zend_long max_burst, req_per_period, period, tokens = 0; + smart_string cmdstr = {0}; + zend_string *key; + + ZEND_PARSE_PARAMETERS_START(4, 5) + Z_PARAM_STR(key) + Z_PARAM_LONG(max_burst) + Z_PARAM_LONG(req_per_period) + Z_PARAM_LONG(period) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(tokens) + ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); + + REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, 4 + (tokens > 0 ? 2 : 0), "GCRA"); + redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, slot); + redis_cmd_append_sstr_long(&cmdstr, max_burst); + redis_cmd_append_sstr_long(&cmdstr, req_per_period); + redis_cmd_append_sstr_long(&cmdstr, period); + + if (tokens > 0) { + REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "TOKENS"); + redis_cmd_append_sstr_long(&cmdstr, tokens); + } + + *cmd = cmdstr.c; + *cmd_len = cmdstr.len; + + return SUCCESS; +} + /* * Redis commands that don't deal with the server at all. The RedisSock* * pointer is the only thing retrieved differently, so we just take that @@ -7264,7 +7646,7 @@ void redis_setoption_handler(INTERNAL_FUNCTION_PARAMETERS, } break; case REDIS_OPT_PACK_IGNORE_NUMBERS: - redis_sock->pack_ignore_numbers = zval_is_true(val); + redis_sock->pack_ignore_numbers = zend_is_true(val); RETURN_TRUE; case REDIS_OPT_COMPRESSION_LEVEL: val_long = zval_get_long(val); @@ -7489,6 +7871,70 @@ void redis_pack_handler(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock) { if (valfree) efree(val); } +#if PHP_VERSION_ID >= 80100 +static zend_string *redis_xxh3_digest(RedisSock *redis_sock, zval *zv) { + zend_string *algo, *hex; + const php_hash_ops *ops; + unsigned char *digest; + int valfree; + size_t len; + char *val; + void *ctx; + + algo = zend_string_init(ZEND_STRL("XXH3"), 0); + ops = php_hash_fetch_ops(algo); + if (ops == NULL) { + zend_string_release(algo); + return NULL; + } + + valfree = redis_pack(redis_sock, zv, &val, &len); + + ctx = emalloc(ops->context_size); + ops->hash_init(ctx, NULL); + ops->hash_update(ctx, (const unsigned char *)val, len); + + digest = emalloc(ops->digest_size); + ops->hash_final(digest, ctx); + + hex = zend_string_safe_alloc(ops->digest_size, 2, 0, 0); + php_hash_bin2hex(ZSTR_VAL(hex), digest, ops->digest_size); + ZSTR_VAL(hex)[ZSTR_LEN(hex)] = '\0'; + + efree(ctx); + efree(digest); + if (valfree) efree(val); + zend_string_release(algo); + + return hex; +} +#endif + +void redis_digest_handler(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + zend_class_entry *exception_ce) +{ + zend_string *digest; + zval *zv; + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(zv) + ZEND_PARSE_PARAMETERS_END_EX(return ); + + #if PHP_VERSION_ID >= 80100 + digest = redis_xxh3_digest(redis_sock, zv); + + if (digest == NULL) { + zend_throw_exception(exception_ce, "XXH3 hashing not available?", 0); + RETURN_THROWS(); + } + + RETURN_STR(digest); + #else + zend_throw_exception(exception_ce, "Method requires PHP >= 8.1", 0); + RETURN_FALSE; + #endif +} + void redis_unpack_handler(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock) { zend_string *str; diff --git a/redis_commands.h b/redis_commands.h index 061b82bfe7..fee9f431ba 100644 --- a/redis_commands.h +++ b/redis_commands.h @@ -238,6 +238,9 @@ int redis_incr_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, int redis_decr_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx); +int redis_delex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx); + int redis_hincrby_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx); @@ -361,12 +364,18 @@ int redis_vgetattr_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, int redis_vsetattr_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx); +int redis_gcra_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx); + int redis_vlinks_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx); int redis_xadd_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx); +int redis_xdelex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx); + int redis_xautoclaim_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx); @@ -424,6 +433,9 @@ int redis_vararg_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, int redis_mset_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char *kw, char **cmd, int *cmd_len, short *slot, void **ctx); +int redis_msetex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + char **cmd, int *cmd_len, short *slot, void **ctx); + int redis_sentinel_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char *kw, char **cmd, int *cmd_len, short *slot, void **ctx); @@ -455,6 +467,8 @@ void redis_uncompress_handler(INTERNAL_FUNCTION_PARAMETERS, void redis_pack_handler(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock); void redis_unpack_handler(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock); +void redis_digest_handler(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, + zend_class_entry *exception_ce); #endif diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index 5a4b24296f..e74e2d6c4a 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: 358ec6a551a8da176ffa340e6f9696389b614758 */ + * Stub hash: 3ee3118802fef67d6bd7176f2a72f0568d962c8b */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) @@ -24,6 +24,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_Redis__pack arginfo_class_Redis__compress +#define arginfo_class_Redis__digest arginfo_class_Redis__compress + #define arginfo_class_Redis__unpack arginfo_class_Redis__compress ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_acl, 0, 0, 1) @@ -163,6 +165,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_del, 0, 0, 1) ZEND_ARG_VARIADIC_INFO(0, other_keys) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_delex, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, options) +ZEND_END_ARG_INFO() + #define arginfo_class_Redis_delifeq arginfo_class_Redis_append #define arginfo_class_Redis_delete arginfo_class_Redis_del @@ -312,10 +319,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_getBit, 0, 0, 2) ZEND_ARG_INFO(0, idx) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_getEx, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() +#define arginfo_class_Redis_getEx arginfo_class_Redis_delex #define arginfo_class_Redis_getDBNum arginfo_class_Redis___destruct @@ -413,7 +417,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_hMset, 0, 0, 2) ZEND_ARG_INFO(0, fieldvals) ZEND_END_ARG_INFO() -#define arginfo_class_Redis_hRandField arginfo_class_Redis_getEx +#define arginfo_class_Redis_hRandField arginfo_class_Redis_delex ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_hSet, 0, 0, 1) ZEND_ARG_INFO(0, key) @@ -585,6 +589,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_mset, 0, 0, 1) ZEND_ARG_INFO(0, key_values) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_msetex, 0, 0, 1) + ZEND_ARG_INFO(0, key_vals) + ZEND_ARG_INFO(0, expiry) +ZEND_END_ARG_INFO() + #define arginfo_class_Redis_msetnx arginfo_class_Redis_mset ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_multi, 0, 0, 0) @@ -791,9 +800,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_slowlog, 0, 0, 1) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() -#define arginfo_class_Redis_sort arginfo_class_Redis_getEx +#define arginfo_class_Redis_sort arginfo_class_Redis_delex -#define arginfo_class_Redis_sort_ro arginfo_class_Redis_getEx +#define arginfo_class_Redis_sort_ro arginfo_class_Redis_delex ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_sortAsc, 0, 0, 1) ZEND_ARG_INFO(0, key) @@ -890,6 +899,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_xdel, 0, 0, 2) ZEND_ARG_INFO(0, ids) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_xdelex, 0, 0, 2) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, ids) + ZEND_ARG_INFO(0, mode) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_xgroup, 0, 0, 1) ZEND_ARG_INFO(0, operation) ZEND_ARG_INFO(0, key) @@ -1001,6 +1016,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_vlinks, 0, 0, 2) ZEND_ARG_INFO(0, withscores) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_gcra, 0, 0, 4) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, maxBurst) + ZEND_ARG_INFO(0, requestsPerPeriod) + ZEND_ARG_INFO(0, period) + ZEND_ARG_INFO(0, tokens) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_xtrim, 0, 0, 2) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, threshold) @@ -1062,7 +1085,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_zrangestore, 0, 0, 4) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -#define arginfo_class_Redis_zRandMember arginfo_class_Redis_getEx +#define arginfo_class_Redis_zRandMember arginfo_class_Redis_delex #define arginfo_class_Redis_zRank arginfo_class_Redis_hGet @@ -1131,6 +1154,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_Redis_zunionstore arginfo_class_Redis_zinterstore +#define arginfo_class_Redis_digest arginfo_class_Redis__prefix + ZEND_METHOD(Redis, __construct); ZEND_METHOD(Redis, __destruct); ZEND_METHOD(Redis, _compress); @@ -1139,6 +1164,7 @@ ZEND_METHOD(Redis, _prefix); ZEND_METHOD(Redis, _serialize); ZEND_METHOD(Redis, _unserialize); ZEND_METHOD(Redis, _pack); +ZEND_METHOD(Redis, _digest); ZEND_METHOD(Redis, _unpack); ZEND_METHOD(Redis, acl); ZEND_METHOD(Redis, append); @@ -1170,6 +1196,7 @@ ZEND_METHOD(Redis, debug); ZEND_METHOD(Redis, decr); ZEND_METHOD(Redis, decrBy); ZEND_METHOD(Redis, del); +ZEND_METHOD(Redis, delex); ZEND_METHOD(Redis, delifeq); ZEND_METHOD(Redis, discard); ZEND_METHOD(Redis, dump); @@ -1279,6 +1306,7 @@ ZEND_METHOD(Redis, mget); ZEND_METHOD(Redis, migrate); ZEND_METHOD(Redis, move); ZEND_METHOD(Redis, mset); +ZEND_METHOD(Redis, msetex); ZEND_METHOD(Redis, msetnx); ZEND_METHOD(Redis, multi); ZEND_METHOD(Redis, object); @@ -1362,6 +1390,7 @@ ZEND_METHOD(Redis, xadd); ZEND_METHOD(Redis, xautoclaim); ZEND_METHOD(Redis, xclaim); ZEND_METHOD(Redis, xdel); +ZEND_METHOD(Redis, xdelex); ZEND_METHOD(Redis, xgroup); ZEND_METHOD(Redis, xinfo); ZEND_METHOD(Redis, xlen); @@ -1383,6 +1412,7 @@ ZEND_METHOD(Redis, vrem); ZEND_METHOD(Redis, vsetattr); ZEND_METHOD(Redis, vgetattr); ZEND_METHOD(Redis, vlinks); +ZEND_METHOD(Redis, gcra); ZEND_METHOD(Redis, xtrim); ZEND_METHOD(Redis, zAdd); ZEND_METHOD(Redis, zCard); @@ -1415,6 +1445,7 @@ ZEND_METHOD(Redis, zinterstore); ZEND_METHOD(Redis, zscan); ZEND_METHOD(Redis, zunion); ZEND_METHOD(Redis, zunionstore); +ZEND_METHOD(Redis, digest); static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, __construct, arginfo_class_Redis___construct, ZEND_ACC_PUBLIC) @@ -1425,6 +1456,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, _serialize, arginfo_class_Redis__serialize, ZEND_ACC_PUBLIC) ZEND_ME(Redis, _unserialize, arginfo_class_Redis__unserialize, ZEND_ACC_PUBLIC) ZEND_ME(Redis, _pack, arginfo_class_Redis__pack, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, _digest, arginfo_class_Redis__digest, ZEND_ACC_PUBLIC) ZEND_ME(Redis, _unpack, arginfo_class_Redis__unpack, ZEND_ACC_PUBLIC) ZEND_ME(Redis, acl, arginfo_class_Redis_acl, ZEND_ACC_PUBLIC) ZEND_ME(Redis, append, arginfo_class_Redis_append, ZEND_ACC_PUBLIC) @@ -1456,6 +1488,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, decr, arginfo_class_Redis_decr, ZEND_ACC_PUBLIC) ZEND_ME(Redis, decrBy, arginfo_class_Redis_decrBy, ZEND_ACC_PUBLIC) ZEND_ME(Redis, del, arginfo_class_Redis_del, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, delex, arginfo_class_Redis_delex, ZEND_ACC_PUBLIC) ZEND_ME(Redis, delifeq, arginfo_class_Redis_delifeq, ZEND_ACC_PUBLIC) #if (PHP_VERSION_ID >= 80400) ZEND_RAW_FENTRY("delete", zim_Redis_del, arginfo_class_Redis_delete, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL, NULL) @@ -1570,6 +1603,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, migrate, arginfo_class_Redis_migrate, ZEND_ACC_PUBLIC) ZEND_ME(Redis, move, arginfo_class_Redis_move, ZEND_ACC_PUBLIC) ZEND_ME(Redis, mset, arginfo_class_Redis_mset, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, msetex, arginfo_class_Redis_msetex, ZEND_ACC_PUBLIC) ZEND_ME(Redis, msetnx, arginfo_class_Redis_msetnx, ZEND_ACC_PUBLIC) ZEND_ME(Redis, multi, arginfo_class_Redis_multi, ZEND_ACC_PUBLIC) ZEND_ME(Redis, object, arginfo_class_Redis_object, ZEND_ACC_PUBLIC) @@ -1663,6 +1697,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, xautoclaim, arginfo_class_Redis_xautoclaim, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xclaim, arginfo_class_Redis_xclaim, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xdel, arginfo_class_Redis_xdel, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, xdelex, arginfo_class_Redis_xdelex, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xgroup, arginfo_class_Redis_xgroup, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xinfo, arginfo_class_Redis_xinfo, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xlen, arginfo_class_Redis_xlen, ZEND_ACC_PUBLIC) @@ -1684,6 +1719,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, vsetattr, arginfo_class_Redis_vsetattr, ZEND_ACC_PUBLIC) ZEND_ME(Redis, vgetattr, arginfo_class_Redis_vgetattr, ZEND_ACC_PUBLIC) ZEND_ME(Redis, vlinks, arginfo_class_Redis_vlinks, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, gcra, arginfo_class_Redis_gcra, ZEND_ACC_PUBLIC) ZEND_ME(Redis, xtrim, arginfo_class_Redis_xtrim, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zAdd, arginfo_class_Redis_zAdd, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zCard, arginfo_class_Redis_zCard, ZEND_ACC_PUBLIC) @@ -1716,6 +1752,7 @@ static const zend_function_entry class_Redis_methods[] = { ZEND_ME(Redis, zscan, arginfo_class_Redis_zscan, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zunion, arginfo_class_Redis_zunion, ZEND_ACC_PUBLIC) ZEND_ME(Redis, zunionstore, arginfo_class_Redis_zunionstore, ZEND_ACC_PUBLIC) + ZEND_ME(Redis, digest, arginfo_class_Redis_digest, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/redis_sentinel_arginfo.h b/redis_sentinel_arginfo.h index 98762fce6a..c813d2397b 100644 --- a/redis_sentinel_arginfo.h +++ b/redis_sentinel_arginfo.h @@ -33,7 +33,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_RedisSentinel_slaves arginfo_class_RedisSentinel_ckquorum - ZEND_METHOD(RedisSentinel, __construct); ZEND_METHOD(RedisSentinel, ckquorum); ZEND_METHOD(RedisSentinel, failover); @@ -47,7 +46,6 @@ ZEND_METHOD(RedisSentinel, reset); ZEND_METHOD(RedisSentinel, sentinels); ZEND_METHOD(RedisSentinel, slaves); - static const zend_function_entry class_RedisSentinel_methods[] = { ZEND_ME(RedisSentinel, __construct, arginfo_class_RedisSentinel___construct, ZEND_ACC_PUBLIC) ZEND_ME(RedisSentinel, ckquorum, arginfo_class_RedisSentinel_ckquorum, ZEND_ACC_PUBLIC) @@ -69,7 +67,11 @@ static zend_class_entry *register_class_RedisSentinel(void) zend_class_entry ce, *class_entry; INIT_CLASS_ENTRY(ce, "RedisSentinel", class_RedisSentinel_methods); +#if (PHP_VERSION_ID >= 80400) + class_entry = zend_register_internal_class_with_flags(&ce, NULL, 0); +#else class_entry = zend_register_internal_class_ex(&ce, NULL); +#endif return class_entry; } diff --git a/redis_sentinel_legacy_arginfo.h b/redis_sentinel_legacy_arginfo.h index c7582d6e01..f6a641ef91 100644 --- a/redis_sentinel_legacy_arginfo.h +++ b/redis_sentinel_legacy_arginfo.h @@ -32,7 +32,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_RedisSentinel_slaves arginfo_class_RedisSentinel_ckquorum - ZEND_METHOD(RedisSentinel, __construct); ZEND_METHOD(RedisSentinel, ckquorum); ZEND_METHOD(RedisSentinel, failover); @@ -46,7 +45,6 @@ ZEND_METHOD(RedisSentinel, reset); ZEND_METHOD(RedisSentinel, sentinels); ZEND_METHOD(RedisSentinel, slaves); - static const zend_function_entry class_RedisSentinel_methods[] = { ZEND_ME(RedisSentinel, __construct, arginfo_class_RedisSentinel___construct, ZEND_ACC_PUBLIC) ZEND_ME(RedisSentinel, ckquorum, arginfo_class_RedisSentinel_ckquorum, ZEND_ACC_PUBLIC) @@ -68,7 +66,11 @@ static zend_class_entry *register_class_RedisSentinel(void) zend_class_entry ce, *class_entry; INIT_CLASS_ENTRY(ce, "RedisSentinel", class_RedisSentinel_methods); +#if (PHP_VERSION_ID >= 80400) + class_entry = zend_register_internal_class_with_flags(&ce, NULL, 0); +#else class_entry = zend_register_internal_class_ex(&ce, NULL); +#endif return class_entry; } diff --git a/redis_session.c b/redis_session.c index 4628dc13de..e9cbc7f202 100644 --- a/redis_session.c +++ b/redis_session.c @@ -43,13 +43,37 @@ #define CLUSTER_SESSION_PREFIX "PHPREDIS_CLUSTER_SESSION:" /* Session lock LUA as well as its SHA1 hash */ -#define LOCK_RELEASE_LUA_STR "if redis.call(\"get\",KEYS[1]) == ARGV[1] then return redis.call(\"del\",KEYS[1]) else return 0 end" -#define LOCK_RELEASE_LUA_LEN (sizeof(LOCK_RELEASE_LUA_STR) - 1) -#define LOCK_RELEASE_SHA_STR "b70c2384248f88e6b75b9f89241a180f856ad852" -#define LOCK_RELEASE_SHA_LEN (sizeof(LOCK_RELEASE_SHA_STR) - 1) +#define LOCK_DEL_LUA_STR "if redis.call(\"get\",KEYS[1]) == ARGV[1] then return redis.call(\"del\",KEYS[1]) else return 0 end" +#define LOCK_DEL_SHA_STR "b70c2384248f88e6b75b9f89241a180f856ad852" + +typedef struct evalCmd { + char *kw; + char *str; + size_t len; +} evalCmd; + +static evalCmd lua_cmd[2] = { + {"EVALSHA", ZEND_STRL(LOCK_DEL_SHA_STR)}, + {"EVAL", ZEND_STRL(LOCK_DEL_LUA_STR)} +}; + +typedef enum lockDelCmd { + LOCK_DEL_EVAL, + LOCK_DEL_DELEX, + LOCK_DEL_DELIFEQ, +} lockDelCmd; + +typedef enum releaseResult { + DEL_SUCCESS, + DEL_FAILURE, + DEL_NO_CMD, +} delResult; + + +static inline zend_bool is_redis_ok(const char *str, size_t len) { + return len == 3 && !memcmp(str, "+OK", 3); +} -/* Check if a response is the Redis +OK status response */ -#define IS_REDIS_OK(r, len) (r != NULL && len == 3 && !memcmp(r, "+OK", 3)) #define NEGATIVE_LOCK_RESPONSE 1 #define CLUSTER_DEFAULT_PREFIX() \ @@ -79,22 +103,18 @@ typedef struct redis_pool_member_ { } redis_pool_member; typedef struct { - int totalWeight; int count; redis_pool_member *head; redis_session_lock_status lock_status; - + int buster; } redis_pool; -// static char *session_conf_string(HashTable *ht, const char *key, size_t keylen) { -// } - -PHP_REDIS_API void +static void redis_pool_add(redis_pool *pool, RedisSock *redis_sock, int weight) { - redis_pool_member *rpm = ecalloc(1, sizeof(redis_pool_member)); + redis_pool_member *rpm = ecalloc(1, sizeof(*rpm)); rpm->redis_sock = redis_sock; rpm->weight = weight; @@ -147,28 +167,40 @@ static int session_gc_maxlifetime(void) { /* Retrieve redis.session.compression from php.ini */ static int session_compression_type(void) { const char *compression = INI_STR("redis.session.compression"); - if(compression == NULL || *compression == '\0' || strncasecmp(compression, "none", sizeof("none") - 1) == 0) { + + if(compression == NULL || *compression == '\0' || + redis_strncasecmp(compression, ZEND_STRL("none")) == 0) + { return REDIS_COMPRESSION_NONE; } #ifdef HAVE_REDIS_LZF - if(strncasecmp(compression, "lzf", sizeof("lzf") - 1) == 0) { + if(redis_strncasecmp(compression, ZEND_STRL("lzf")) == 0) { return REDIS_COMPRESSION_LZF; } #endif #ifdef HAVE_REDIS_ZSTD - if(strncasecmp(compression, "zstd", sizeof("zstd") - 1) == 0) { + if(redis_strncasecmp(compression, ZEND_STRL("zstd")) == 0) { return REDIS_COMPRESSION_ZSTD; } #endif #ifdef HAVE_REDIS_LZ4 - if(strncasecmp(compression, "lz4", sizeof("lz4") - 1) == 0) { + if(redis_strncasecmp(compression, ZEND_STRL("lz4")) == 0) { return REDIS_COMPRESSION_LZ4; } #endif - // E_NOTICE when outside of valid values - php_error_docref(NULL, E_NOTICE, "redis.session.compression is outside of valid values, disabling"); + if (strcasecmp(compression, "lzf") || + strcasecmp(compression, "zstd") || + strcasecmp(compression, "lz4")) + { + php_error_docref(NULL, E_NOTICE, + "redis.session.compression: '%s' compression is not available. " + "Rebuild phpredis with %s support.", compression, compression); + } else { + php_error_docref(NULL, E_NOTICE, + "redis.session.compression: '%s' is invalid", compression); + } return REDIS_COMPRESSION_NONE; } @@ -208,7 +240,7 @@ session_uncompress_data(RedisSock *redis_sock, char *data, size_t len, /* Send a command to Redis. Returns byte count written to socket (-1 on failure) */ static int redis_simple_cmd(RedisSock *redis_sock, char *cmd, int cmdlen, - char **reply, int *replylen) + char **reply, int *replylen) { *reply = NULL; int len_written = redis_sock_write(redis_sock, cmd, cmdlen); @@ -220,14 +252,38 @@ static int redis_simple_cmd(RedisSock *redis_sock, char *cmd, int cmdlen, return len_written; } +static int +redis_simple_cmd_sstr(RedisSock *redis_sock, smart_string *cmd, + char **reply, int *replylen) +{ + return redis_simple_cmd(redis_sock, cmd->c, cmd->len, reply, replylen); +} + +static inline int weighted_seed(zend_string *key) { + /* In GCC the fast-path is one 32-bit load with a union */ + union { int pos; } u; + + if (EXPECTED(ZSTR_LEN(key) >= sizeof(u.pos))) { + memcpy(&u.pos, ZSTR_VAL(key), sizeof(u.pos)); + return u.pos; + } + + u.pos = 0; + + memcpy(&u.pos, ZSTR_VAL(key), ZSTR_LEN(key)); + + return u.pos; +} + PHP_REDIS_API redis_pool_member * -redis_pool_get_sock(redis_pool *pool, const char *key) { +redis_pool_get_sock(redis_pool *pool, zend_string *key) { + redis_pool_member *rpm; + int pos, i; - unsigned int pos, i; - memcpy(&pos, key, sizeof(pos)); - pos %= pool->totalWeight; + /* In the next release, ensure pool->totalWeight > 0 */ + pos = weighted_seed(key) % (pool->totalWeight ? pool->totalWeight : 1); - redis_pool_member *rpm = pool->head; + rpm = pool->head; for(i = 0; i < pool->totalWeight;) { if (pos >= i && pos < i + rpm->weight) { @@ -251,7 +307,7 @@ static int set_session_lock_key(RedisSock *redis_sock, char *cmd, int cmd_len sent_len = redis_simple_cmd(redis_sock, cmd, cmd_len, &reply, &reply_len); if (reply) { - if (IS_REDIS_OK(reply, reply_len)) { + if (is_redis_ok(reply, reply_len)) { efree(reply); return SUCCESS; } @@ -263,20 +319,41 @@ static int set_session_lock_key(RedisSock *redis_sock, char *cmd, int cmd_len return sent_len >= 0 ? NEGATIVE_LOCK_RESPONSE : FAILURE; } -static int lock_acquire(RedisSock *redis_sock, redis_session_lock_status *lock_status - ) -{ - char *cmd, hostname[HOST_NAME_MAX] = {0}, suffix[] = "_LOCK"; - int cmd_len, lock_wait_time, retries, i, set_lock_key_result, expiry; +static void generate_lock_key(redis_session_lock_status *status) { + static const char suffix[] = "_LOCK"; + + if (status->lock_key) + zend_string_release(status->lock_key); + + status->lock_key = zend_string_concat2(ZSTR_VAL(status->session_key), + ZSTR_LEN(status->session_key), + ZEND_STRL(suffix)); +} + +static void generate_lock_secret(redis_session_lock_status *status) { + char hostname[HOST_NAME_MAX] = {0}; + + gethostname(hostname, HOST_NAME_MAX); + if (status->lock_secret) + zend_string_release(status->lock_secret); + + status->lock_secret = strpprintf(0, "%s|%ld", hostname, (long)getpid()); +} + +static int +lock_acquire(RedisSock *redis_sock, redis_session_lock_status *lock_status) { + zend_long wait_time, expiry, retries, attempt = 0; + int cmd_len, result; + char *cmd; /* Short circuit if we are already locked or not using session locks */ if (lock_status->is_locked || !INI_INT("redis.session.locking_enabled")) return SUCCESS; /* How long to wait between attempts to acquire lock */ - lock_wait_time = INI_INT("redis.session.lock_wait_time"); - if (lock_wait_time == 0) { - lock_wait_time = 20000; + wait_time = INI_INT("redis.session.lock_wait_time"); + if (wait_time == 0) { + wait_time = 20000; } /* Maximum number of times to retry (-1 means infinite) */ @@ -291,16 +368,8 @@ static int lock_acquire(RedisSock *redis_sock, redis_session_lock_status *lock_s expiry = INI_INT("max_execution_time"); } - /* Generate our qualified lock key */ - if (lock_status->lock_key) zend_string_release(lock_status->lock_key); - lock_status->lock_key = zend_string_alloc(ZSTR_LEN(lock_status->session_key) + sizeof(suffix) - 1, 0); - memcpy(ZSTR_VAL(lock_status->lock_key), ZSTR_VAL(lock_status->session_key), ZSTR_LEN(lock_status->session_key)); - memcpy(ZSTR_VAL(lock_status->lock_key) + ZSTR_LEN(lock_status->session_key), suffix, sizeof(suffix) - 1); - - /* Calculate lock secret */ - gethostname(hostname, HOST_NAME_MAX); - if (lock_status->lock_secret) zend_string_release(lock_status->lock_secret); - lock_status->lock_secret = strpprintf(0, "%s|%ld", hostname, (long)getpid()); + generate_lock_key(lock_status); + generate_lock_secret(lock_status); if (expiry > 0) { cmd_len = REDIS_SPPRINTF(&cmd, "SET", "SSssd", lock_status->lock_key, @@ -312,22 +381,24 @@ static int lock_acquire(RedisSock *redis_sock, redis_session_lock_status *lock_s } /* Attempt to get our lock */ - for (i = 0; retries == -1 || i <= retries; i++) { - set_lock_key_result = set_session_lock_key(redis_sock, cmd, cmd_len); + for (;;) { + result = set_session_lock_key(redis_sock, cmd, cmd_len); - if (set_lock_key_result == SUCCESS) { + if (result == SUCCESS) { lock_status->is_locked = 1; break; - } else if (set_lock_key_result == FAILURE) { - /* In case of network problems, break the loop and report to userland */ - lock_status->is_locked = 0; + } else if (result == FAILURE) { + /* Network failure */ break; } - /* Sleep unless we're done making attempts */ - if (retries == -1 || i < retries) { - usleep(lock_wait_time); + /* Lock is busy */ + + if (retries >= 0 && attempt++ >= retries) { + break; } + + usleep(wait_time); } /* Cleanup SET command */ @@ -375,32 +446,96 @@ static int write_allowed(RedisSock *redis_sock, redis_session_lock_status *lock_ return lock_status->is_locked; } -/* Release any session lock we hold and cleanup allocated lock data. This function - * first attempts to use EVALSHA and then falls back to EVAL if EVALSHA fails. This - * will cause Redis to cache the script, so subsequent calls should then succeed - * using EVALSHA. */ -static void lock_release(RedisSock *redis_sock, redis_session_lock_status *lock_status) +static delResult +get_del_result(RedisSock *redis_sock, const char *reply, int len) { - char *cmd, *reply; - int i, cmdlen, replylen; + zend_bool nocmd = 0; + + #define NOCMD_PFX "ERR unknown command" - /* Keywords, command, and length fallbacks */ - const char *kwd[] = {"EVALSHA", "EVAL"}; - const char *lua[] = {LOCK_RELEASE_SHA_STR, LOCK_RELEASE_LUA_STR}; - int len[] = {LOCK_RELEASE_SHA_LEN, LOCK_RELEASE_LUA_LEN}; + if (reply == NULL) { + if (redis_sock->err) { + php_error_docref(NULL, E_WARNING, "%s", ZSTR_VAL(redis_sock->err)); + nocmd = zend_string_starts_with_cstr(redis_sock->err, + ZEND_STRL(NOCMD_PFX)); + redis_sock_clear_err(redis_sock); + } + return nocmd ? DEL_NO_CMD : DEL_FAILURE; + } else if (len == 4 && !redis_strncmp(reply, ZEND_STRL(":1"))) { + return DEL_SUCCESS; + } else { + return DEL_FAILURE; + } + + #undef NOCMD_PFX +} + +static delResult +lock_release_delex(RedisSock *redis_sock, redis_session_lock_status *status) { + smart_string cmd = {0}; + delResult result; + char *reply; + int len; + + REDIS_CMD_INIT_SSTR_STATIC(&cmd, 3, "DELEX"); + redis_cmd_append_sstr_zstr(&cmd, status->lock_key); + REDIS_CMD_APPEND_SSTR_STATIC(&cmd, "IFEQ"); + redis_cmd_append_sstr_zstr(&cmd, status->lock_secret); + + redis_simple_cmd_sstr(redis_sock, &cmd, &reply, &len); + + result = get_del_result(redis_sock, reply, len); + + if (reply) efree(reply); + smart_string_free(&cmd); + + return result; +} + +static delResult +lock_release_delifeq(RedisSock *redis_sock, redis_session_lock_status *status) { + smart_string cmd = {0}; + delResult result; + char *reply; + int len; + + REDIS_CMD_INIT_SSTR_STATIC(&cmd, 2, "DELIFEQ"); + + redis_cmd_append_sstr_zstr(&cmd, status->lock_key); + redis_cmd_append_sstr_zstr(&cmd, status->lock_secret); + + redis_simple_cmd_sstr(redis_sock, &cmd, &reply, &len); + + result = get_del_result(redis_sock, reply, len); + + if (reply) efree(reply); + smart_string_free(&cmd); + + return result; +} + +/* Release any session lock we hold and cleanup allocated lock data. This + * function first attempts to use EVALSHA and then falls back to EVAL if + * EVALSHA fails. This will cause Redis to cache the script, so subsequent + * calls should then succeed using EVALSHA. */ +static void +lock_release_lua(RedisSock *redis_sock, redis_session_lock_status *status) { + int i, cmdlen, replylen; + char *cmd, *reply; /* We first want to try EVALSHA and then fall back to EVAL */ - for (i = 0; lock_status->is_locked && i < sizeof(kwd)/sizeof(*kwd); i++) { - /* Construct our command */ - cmdlen = REDIS_SPPRINTF(&cmd, (char*)kwd[i], "sdSS", lua[i], len[i], 1, - lock_status->lock_key, lock_status->lock_secret); + for (i = 0; status->is_locked && i < sizeof(lua_cmd)/sizeof(*lua_cmd); i++) + { + cmdlen = REDIS_SPPRINTF(&cmd, lua_cmd[i].kw, "sdSS", lua_cmd[i].str, + lua_cmd[i].len, 1, status->lock_key, + status->lock_secret); /* Send it off */ redis_simple_cmd(redis_sock, cmd, cmdlen, &reply, &replylen); /* Release lock and cleanup reply if we got one */ if (reply != NULL) { - lock_status->is_locked = 0; + status->is_locked = 0; efree(reply); } @@ -409,31 +544,75 @@ static void lock_release(RedisSock *redis_sock, redis_session_lock_status *lock_ } /* Something has failed if we are still locked */ - if (lock_status->is_locked) { + if (status->is_locked) { php_error_docref(NULL, E_WARNING, "Failed to release session lock"); } } -#define REDIS_URL_STR(umem) ZSTR_VAL(umem) +static lockDelCmd lock_release_cmd(void) { + char *cmd; -/* {{{ PS_OPEN_FUNC - */ + cmd = INI_STR("redis.session.lock_release_cmd"); + + if (cmd == NULL) { + return LOCK_DEL_EVAL; + } else if (redis_strncasecmp(cmd, ZEND_STRL("DELEX")) == 0) { + return LOCK_DEL_DELEX; + } else if (redis_strncasecmp(cmd, ZEND_STRL("DELIFEQ")) == 0) { + return LOCK_DEL_DELIFEQ; + } + + return LOCK_DEL_EVAL; +} + +static void +lock_release(RedisSock *redis_sock, redis_session_lock_status *status) { + delResult res = DEL_NO_CMD; + + if (status->lock_key == NULL) + return; + + switch (lock_release_cmd()) { + case LOCK_DEL_DELEX: + res = lock_release_delex(redis_sock, status); + break; + case LOCK_DEL_DELIFEQ: + res = lock_release_delifeq(redis_sock, status); + break; + case LOCK_DEL_EVAL: + break; /* fallthrough */ + } + + /* If res == DEL_NO_CMD LUA is selected or the new command didn't exist */ + if (res == DEL_NO_CMD) + lock_release_lua(redis_sock, status); +} + +/* {{{ PS_OPEN_FUNC */ PS_OPEN_FUNC(redis) { php_url *url; zval params, context, *zv; int i, j, path_len; +#if PHP_VERSION_ID >= 80600 + const char *save_path_str = ZSTR_VAL(save_path); + size_t save_path_len = ZSTR_LEN(save_path); +#else + const char *save_path_str = save_path; + size_t save_path_len = strlen(save_path); +#endif + redis_pool *pool = ecalloc(1, sizeof(*pool)); - for (i = 0, j = 0, path_len = strlen(save_path); i < path_len; i = j + 1) { + for (i = 0, j = 0, path_len = save_path_len; i < path_len; i = j + 1) { /* find beginning of url */ - while ( i< path_len && (isspace(save_path[i]) || save_path[i] == ',')) + while ( i< path_len && (isspace(save_path_str[i]) || save_path_str[i] == ',')) i++; /* find end of url */ j = i; - while (jfragment) { - spprintf(&query, 0, "%s#%s", REDIS_URL_STR(url->query), REDIS_URL_STR(url->fragment)); + spprintf(&query, 0, "%s#%s", ZSTR_VAL(url->query), ZSTR_VAL(url->fragment)); } else { - query = estrdup(REDIS_URL_STR(url->query)); + query = estrdup(ZSTR_VAL(url->query)); } sapi_module.treat_data(PARSE_STRING, query, ¶ms); @@ -494,11 +673,11 @@ PS_OPEN_FUNC(redis) ZVAL_ZVAL(&context, zv, 1, 0); } - zval_dtor(¶ms); + zval_ptr_dtor_nogc(¶ms); } if ((url->path == NULL && url->host == NULL) || weight <= 0 || timeout <= 0) { - char *path = estrndup(save_path+i, j-i); + char *path = estrndup(save_path_str+i, j-i); php_error_docref(NULL, E_WARNING, "Failed to parse session.save_path (error at offset %d, url was '%s')", i, path); efree(path); @@ -517,14 +696,14 @@ PS_OPEN_FUNC(redis) size_t addrlen; int port, addr_free = 0; - scheme = url->scheme ? REDIS_URL_STR(url->scheme) : "tcp"; + scheme = url->scheme ? ZSTR_VAL(url->scheme) : "tcp"; if (url->host) { port = url->port; - addrlen = spprintf(&addr, 0, "%s://%s", scheme, REDIS_URL_STR(url->host)); + addrlen = spprintf(&addr, 0, "%s://%s", scheme, ZSTR_VAL(url->host)); addr_free = 1; } else { /* unix */ port = 0; - addr = REDIS_URL_STR(url->path); + addr = ZSTR_VAL(url->path); addrlen = strlen(addr); } @@ -539,9 +718,7 @@ PS_OPEN_FUNC(redis) redis_sock->compression = session_compression_type(); redis_sock->compression_level = INI_INT("redis.session.compression_level"); - if (Z_TYPE(context) == IS_ARRAY) { - redis_sock_set_stream_context(redis_sock, &context); - } + redis_sock_set_context_zval(redis_sock, &context); redis_pool_add(pool, redis_sock, weight); redis_sock->prefix = prefix; @@ -558,6 +735,9 @@ PS_OPEN_FUNC(redis) if (pool->head) { PS_SET_MOD_DATA(pool); return SUCCESS; + } else { + php_error_docref(NULL, E_WARNING, + "Unable to extract any servers from session.save_path"); } fail: @@ -575,7 +755,7 @@ PS_CLOSE_FUNC(redis) if (pool) { if (pool->lock_status.session_key) { - redis_pool_member *rpm = redis_pool_get_sock(pool, ZSTR_VAL(pool->lock_status.session_key)); + redis_pool_member *rpm = redis_pool_get_sock(pool, pool->lock_status.session_key); RedisSock *redis_sock = rpm ? rpm->redis_sock : NULL; if (redis_sock) { @@ -594,22 +774,13 @@ PS_CLOSE_FUNC(redis) static zend_string * redis_session_key(RedisSock *redis_sock, const char *key, int key_len) { - zend_string *session; - char default_prefix[] = REDIS_SESSION_PREFIX; - char *prefix = default_prefix; - size_t prefix_len = sizeof(default_prefix)-1; - - if (redis_sock->prefix) { - prefix = ZSTR_VAL(redis_sock->prefix); - prefix_len = ZSTR_LEN(redis_sock->prefix); + if (redis_sock->prefix == NULL) { + return zend_string_concat2(ZEND_STRL(REDIS_SESSION_PREFIX), + key, key_len); } - /* build session key */ - session = zend_string_alloc(key_len + prefix_len, 0); - memcpy(ZSTR_VAL(session), prefix, prefix_len); - memcpy(ZSTR_VAL(session) + prefix_len, key, key_len); - - return session; + return zend_string_concat2(ZSTR_VAL(redis_sock->prefix), + ZSTR_LEN(redis_sock->prefix), key, key_len); } /* {{{ PS_CREATE_SID_FUNC @@ -625,7 +796,7 @@ PS_CREATE_SID_FUNC(redis) while (retries-- > 0) { zend_string* sid = php_session_create_id((void **) &pool); - redis_pool_member *rpm = redis_pool_get_sock(pool, ZSTR_VAL(sid)); + redis_pool_member *rpm = redis_pool_get_sock(pool, sid); RedisSock *redis_sock = rpm ? rpm->redis_sock : NULL; @@ -635,7 +806,8 @@ PS_CREATE_SID_FUNC(redis) return php_session_create_id(NULL); } - if (pool->lock_status.session_key) zend_string_release(pool->lock_status.session_key); + if (pool->lock_status.session_key) + zend_string_release(pool->lock_status.session_key); pool->lock_status.session_key = redis_session_key(redis_sock, ZSTR_VAL(sid), ZSTR_LEN(sid)); if (lock_acquire(redis_sock, &pool->lock_status) == SUCCESS) { @@ -668,7 +840,7 @@ PS_VALIDATE_SID_FUNC(redis) if (!skeylen) return FAILURE; redis_pool *pool = PS_GET_MOD_DATA(); - redis_pool_member *rpm = redis_pool_get_sock(pool, skey); + redis_pool_member *rpm = redis_pool_get_sock(pool, key); RedisSock *redis_sock = rpm ? rpm->redis_sock : NULL; if (!redis_sock) { php_error_docref(NULL, E_WARNING, "Redis connection not available"); @@ -715,7 +887,7 @@ PS_UPDATE_TIMESTAMP_FUNC(redis) } redis_pool *pool = PS_GET_MOD_DATA(); - redis_pool_member *rpm = redis_pool_get_sock(pool, skey); + redis_pool_member *rpm = redis_pool_get_sock(pool, key); RedisSock *redis_sock = rpm ? rpm->redis_sock : NULL; if (!redis_sock) { php_error_docref(NULL, E_WARNING, "Redis connection not available"); @@ -757,7 +929,7 @@ PS_READ_FUNC(redis) if (!skeylen) return FAILURE; redis_pool *pool = PS_GET_MOD_DATA(); - redis_pool_member *rpm = redis_pool_get_sock(pool, skey); + redis_pool_member *rpm = redis_pool_get_sock(pool, key); RedisSock *redis_sock = rpm ? rpm->redis_sock : NULL; if (!redis_sock) { php_error_docref(NULL, E_WARNING, "Redis connection not available"); @@ -832,7 +1004,7 @@ PS_WRITE_FUNC(redis) if (!skeylen) return FAILURE; redis_pool *pool = PS_GET_MOD_DATA(); - redis_pool_member *rpm = redis_pool_get_sock(pool, skey); + redis_pool_member *rpm = redis_pool_get_sock(pool, key); RedisSock *redis_sock = rpm ? rpm->redis_sock : NULL; if (!redis_sock) { php_error_docref(NULL, E_WARNING, "Redis connection not available"); @@ -865,7 +1037,7 @@ PS_WRITE_FUNC(redis) efree(cmd); - if (IS_REDIS_OK(response, response_len)) { + if (is_redis_ok(response, response_len)) { efree(response); return SUCCESS; } else { @@ -886,7 +1058,7 @@ PS_DESTROY_FUNC(redis) size_t skeylen = ZSTR_LEN(key); redis_pool *pool = PS_GET_MOD_DATA(); - redis_pool_member *rpm = redis_pool_get_sock(pool, skey); + redis_pool_member *rpm = redis_pool_get_sock(pool, key); RedisSock *redis_sock = rpm ? rpm->redis_sock : NULL; if (!redis_sock) { php_error_docref(NULL, E_WARNING, "Redis connection not available"); @@ -953,14 +1125,20 @@ PS_OPEN_FUNC(rediscluster) { int persistent = 0, failover = REDIS_FAILOVER_NONE; zend_string *prefix = NULL, *user = NULL, *pass = NULL, *failstr = NULL; +#if PHP_VERSION_ID >= 80600 + const char *save_path_str = ZSTR_VAL(save_path); +#else + const char *save_path_str = save_path; +#endif + /* Parse configuration for session handler */ array_init(&z_conf); - sapi_module.treat_data(PARSE_STRING, estrdup(save_path), &z_conf); + sapi_module.treat_data(PARSE_STRING, estrdup(save_path_str), &z_conf); /* We need seeds */ zv = REDIS_HASH_STR_FIND_TYPE_STATIC(Z_ARRVAL(z_conf), "seed", IS_ARRAY); if (zv == NULL) { - zval_dtor(&z_conf); + zval_ptr_dtor_nogc(&z_conf); return FAILURE; } @@ -977,7 +1155,7 @@ PS_OPEN_FUNC(rediscluster) { if (timeout < 0 || read_timeout < 0) { php_error_docref(NULL, E_WARNING, "Can't set negative timeout values in session configuration"); - zval_dtor(&z_conf); + zval_ptr_dtor_nogc(&z_conf); return FAILURE; } @@ -1005,7 +1183,7 @@ PS_OPEN_FUNC(rediscluster) { if (user) zend_string_release(user); \ if (pass) zend_string_release(pass); \ free_seed_array(seeds, nseeds); \ - zval_dtor(&z_conf); \ + zval_ptr_dtor_nogc(&z_conf); \ /* Extract at least one valid seed or abort */ seeds = cluster_validate_args(timeout, read_timeout, ht_seeds, &nseeds, NULL); @@ -1029,7 +1207,7 @@ PS_OPEN_FUNC(rediscluster) { redis_sock_set_auth(c->flags, user, pass); if ((context = REDIS_HASH_STR_FIND_TYPE_STATIC(ht_conf, "stream", IS_ARRAY)) != NULL) { - redis_sock_set_stream_context(c->flags, context); + redis_sock_set_context_zval(c->flags, context); } /* First attempt to load from cache */ diff --git a/tests/RedisClusterTest.php b/tests/RedisClusterTest.php index 4e3ab61993..d271992b58 100644 --- a/tests/RedisClusterTest.php +++ b/tests/RedisClusterTest.php @@ -45,6 +45,7 @@ public function testDoublePipeNoOp() { $this->markTestSkipped(); } public function testSwapDB() { $this->markTestSkipped(); } public function testConnectException() { $this->markTestSkipped(); } public function testTlsConnect() { $this->markTestSkipped(); } + public function testTlsReconnect() { $this->markTestSkipped(); } public function testReset() { $this->markTestSkipped(); } public function testInvalidAuthArgs() { $this->markTestSkipped(); } public function testScanErrors() { $this->markTestSkipped(); } @@ -69,6 +70,40 @@ public function testSession_defaultLockRetryCount() { $this->markTestSkipped(); public function testSession_noUnlockOfOtherProcess() { $this->markTestSkipped(); } public function testSession_lockWaitTime() { $this->markTestSkipped(); } + /* Regression test for GH #2810 */ + public function testConstructNullSeeds() { + /* new RedisCluster(null, null) must not throw TypeError. + * $seeds is declared ?array so null is a valid argument. */ + $thrown = false; + try { + new RedisCluster(null, null); + } catch (\Throwable $e) { + $thrown = true; + $this->assertFalse($e instanceof \TypeError); + } + $this->assertTrue($thrown); + + /* Passing an empty array must also not throw TypeError (control). */ + $thrown = false; + try { + new RedisCluster(null, []); + } catch (\Throwable $e) { + $thrown = true; + $this->assertFalse($e instanceof \TypeError); + } + $this->assertTrue($thrown); + + /* Both (null) and (null, null) mean "no name, no seeds" and must + * produce the same exception type. */ + $ex1 = $ex2 = null; + try { new RedisCluster(null); } + catch (\Throwable $e) { $ex1 = get_class($e); } + try { new RedisCluster(null, null); } + catch (\Throwable $e) { $ex2 = get_class($e); } + $this->assertTrue($ex1 !== null); + $this->assertEquals($ex1, $ex2); + } + private function loadSeedsFromHostPort($host, $port) { try { $rc = new RedisCluster(NULL, ["$host:$port"], 1, 1, true, $this->getAuth()); @@ -124,8 +159,8 @@ private function loadSeeds($host, $port) { } /* Load our seeds on construction */ - public function __construct($host, $port, $auth) { - parent::__construct($host, $port, $auth); + public function __construct($host, $port, $auth, $tls_port = 6378) { + parent::__construct($host, $port, $auth, $tls_port); self::$seeds = $this->loadSeeds($host, $port); } diff --git a/tests/RedisTest.php b/tests/RedisTest.php index 9cec873659..e682e23f22 100644 --- a/tests/RedisTest.php +++ b/tests/RedisTest.php @@ -61,23 +61,28 @@ protected function getRightConstant() { return Redis::RIGHT; } - protected function detectKeyDB(array $info) { + protected function detectKeyDB($info) { + if (!is_array($info)) + return false; + return strpos($info['executable'] ?? '', 'keydb') !== false || - isset($info['keydb']) || - isset($info['mvcc_depth']); + isset($info['keydb']) || isset($info['mvcc_depth']); } - protected function detectValkey(array $info) { - return isset($info['server_name']) && $info['server_name'] === 'valkey'; + protected function detectValkey($info) { + return is_array($info) && ($info['executable'] ?? '') === 'valkey'; } public function setUp() { $this->redis = $this->newInstance(); + $info = $this->redis->info(); - $this->version = (isset($info['redis_version'])?$info['redis_version']:'0.0.0'); + + $this->version = $info['redis_version'] ?? '0.0.0'; + $this->valkey_version = $info['valkey_version'] ?? '0.0.0'; + $this->is_keydb = $this->detectKeyDB($info); $this->is_valkey = $this->detectValKey($info); - $this->valkey_version = $info['valkey_version'] ?? '0.0.0'; } protected function haveCommand(string $cmd): bool { @@ -1010,17 +1015,14 @@ public function testExists() { /* Add multiple keys */ $mkeys = []; for ($i = 0; $i < 10; $i++) { - if (rand(1, 2) == 1) { - $mkey = "{exists}key:$i"; - $this->redis->set($mkey, $i); - $mkeys[] = $mkey; - } + $mkey = "{exists}key:$i"; + $this->redis->set($mkey, $i); + $mkeys[] = $mkey; } /* Test passing an array as well as the keys variadic */ $this->assertEquals(count($mkeys), $this->redis->exists($mkeys)); - if (count($mkeys)) - $this->assertEquals(count($mkeys), $this->redis->exists(...$mkeys)); + $this->assertEquals(count($mkeys), $this->redis->exists(...$mkeys)); } public function testTouch() { @@ -2593,6 +2595,61 @@ public function testMset() { $this->redis->setOption(Redis::OPT_PREFIX, ''); } + public function testMSetEx() { + if ( ! $this->haveCommand('MSETEX')) + $this->markTestSkipped(); + + $kvals = ['{msetex}:1' => 'v1', '{msetex}:2' => 'v2']; + $keys = array_keys($kvals); + + // No options, same as MSET + $this->redis->del($keys); + $ret = $this->redis->msetex($kvals); + $this->assertEquals(1, $ret); + $this->assertGT(0, $ret); + $this->assertEquals(array_values($kvals), $this->redis->mget($keys)); + foreach ($keys as $key) { + $this->assertEquals(-1, $this->redis->ttl($key)); + } + + $options = [ + ['EX', 100, 'TTL'], + ['PX', 100000, 'PTTL'], + ['EXAT', time() + 100, 'EXPIRETIME'], + ['PXAT', $this->mstime() + 100000, 'PEXPIRETIME'] + ]; + + foreach ($options as [$opt, $val, $desc]) { + $this->assertIsInt($this->redis->del($keys)); + $this->redis->msetex($kvals, [$opt => $val]); + foreach ($keys as $key) { + /* Timiing tests on GitHub CI are atrocious so we just + want to verify that >= 1 and <= $val */ + $ttl = $this->redis->$desc($key); + $this->assertBetween($val, 1, $ttl + 1); + } + } + + /* KEEPTTL */ + $this->redis->set('{kt}:1', 'v1', 100); + $this->assertEquals(1, $this->redis->msetex(['{kt}:1' => 'v2'], + ['KEEPTTL'])); + $this->assertBetween($this->redis->ttl('{kt}:1'), 1, 100); + + $keys = ['{xxnx}:1' => '1', '{xxnx}:2' => '2']; + $this->assertTrue($this->redis->mset($keys)); + + /* XX: Only set if they all already exist */ + $this->assertEquals(1, $this->redis->msetex($keys, ['XX'])); + $this->assertEquals(1, $this->redis->del(array_rand($keys))); + $this->assertEquals(0, $this->redis->msetex($keys, ['XX'])); + + /* NX: Only if none exist. Right now one does */ + $this->assertEquals(0, $this->redis->msetex($keys, ['NX'])); + $this->assertGT(0, $this->redis->del(array_keys($keys))); + $this->assertEquals(1, $this->redis->msetex($keys, ['NX'])); + } + public function testMsetNX() { $this->redis->del('x', 'y', 'z'); // remove x y z $this->assertTrue($this->redis->msetnx(['x' => 'a', 'y' => 'b', 'z' => 'c'])); // set x y z @@ -3014,6 +3071,23 @@ public function testZX() { $this->assertEquals(0, $this->redis->zRevRank('z', 'five')); } + /* Regression for GitHub issue #2791 */ + public function testZSetSerialization() { + $this->redis->del('zs_f', 'zs_a'); + $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); + + $this->redis->zAdd('zs_f', 3.14, 3.14); + $this->redis->zAdd('zs_a', 1, ['foo', 'bar']); + + $res_float = $this->redis->zRange('zs_f', 0, -1, true); + $this->assertEquals(['3.14' => 3.14], $res_float); + + $res_array = @$this->redis->zRange('zs_a', 0, -1, true); + $this->assertEquals(['Array' => 1.0], $res_array); + + $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE); + } + public function testZRangeScoreArg() { $this->redis->del('{z}'); @@ -3413,6 +3487,37 @@ public function testNumericPrefixHashFields() { $this->assertEqualsCanonicalizing(array_keys($hash), array_keys($res)); } + /* Regression test for GitHub issue 2795 / PR 2796 */ + public function testNumericStringEncoding() { + $fields = [ + '0001', '0010', '-0005', '+0005', '1e3', '1E+3', '1e-3', '-1E-3', + '+1.5e2', '-2.25E+4', '0001e-2', + ]; + + $hashKey = 'hash:numeric-strings'; + $this->assertIsInt($this->redis->del($hashKey)); + + $payload = []; + foreach ($fields as $index => $field) { + $payload[$field] = "value-{$index}"; + } + + $this->assertTrue($this->redis->hMset($hashKey, $payload)); + + $hmget = $this->redis->hMget($hashKey, $fields); + $this->assertEquals($payload, $hmget); + + foreach ($payload as $key => $value) { + $this->assertTrue($this->redis->mset([$key => $value])); + $this->assertEquals([$value], $this->redis->mget([$key])); + } + + $this->redis->del($hashKey); + if ($payload !== []) { + $this->redis->del(...array_keys($payload)); + } + } + public function testHRandField() { if (version_compare($this->version, '6.2.0') < 0) $this->MarkTestSkipped(); @@ -7468,6 +7573,27 @@ public function testXDel() { $this->assertFalse(@$this->redis->xDel('s', [])); } + public function testXDelex() { + if ( ! $this->haveCommand('XDELEX')) + $this->markTestSkipped(); + + $stream = 'xdelex-stream'; + $missing = '9999999999999-0'; + $modes = [NULL, 'KEEPREF', 'DELREF', 'ACKED']; + + foreach ($modes as $mode) { + $ids = $this->addStreamEntries($stream, 2); + $targets = [$ids[0], $missing]; + + $response = $mode === NULL + ? $this->redis->xdelex($stream, $targets) + : $this->redis->xdelex($stream, $targets, $mode); + + $this->assertIsArray($response, 2); + $this->assertEquals([1, -1], array_values($response)); + } + } + public function testXTrim() { if ( ! $this->minVersionCheck('5.0')) $this->markTestSkipped(); @@ -7992,6 +8118,23 @@ public function testVRange() { $this->assertEquals(3, count($res)); } + public function testGcra() { + if ( ! $this->haveCommand('GCRA')) + $this->markTestSkipped(); + + $this->assertIsInt($this->redis->del('gcra')); + + $res = $this->redis->gcra('gcra', 5, 1, 1000); + $this->assertIsArray($res); + $this->assertEquals(5, count($res)); + $this->assertEquals(5, count(array_filter($res, 'is_int'))); + + $res = $this->redis->gcra('gcra', 5, 1, 1000, 5); + $this->assertIsArray($res); + $this->assertEquals(5, count($res)); + $this->assertEquals(5, count(array_filter($res, 'is_int'))); + } + public function testInvalidAuthArgs() { $client = $this->newInstance(); @@ -8495,15 +8638,45 @@ public function testConnectException() { } } + /* Regression test for GitHub PR #2802). Make sure we don't leak the + * context array when explicitly reconnecting in a loop */ + public function testTlsReconnect() { + $tls_port = $this->getTlsPort(); + if (($fp = @fsockopen($this->getHost(), $tls_port)) == NULL) + $this->markTestSkipped(); + + fclose($fp); + + $redis = new Redis; + + $context = ['stream' => [ + 'verify_peer_name' => false, + 'verify_peer' => false, + ]]; + + $base = memory_get_usage(true); + + for ($i = 0; $i < 20; $i++) { + $redis->connect('tls://' . $this->getHost(), $tls_port, 0, null, 0, + 0, $context); + } + + $final = memory_get_usage(true); + + $this->assertLTE(10000, $final - $base); + } + public function testTlsConnect() { - if (($fp = @fsockopen($this->getHost(), 6378)) == NULL) + $tls_port = $this->getTlsPort(); + + if (($fp = @fsockopen($this->getHost(), $tls_port)) == NULL) $this->markTestSkipped(); fclose($fp); foreach (['localhost' => true, '127.0.0.1' => false] as $host => $verify) { $redis = new Redis(); - $this->assertTrue($redis->connect('tls://' . $host, 6378, 0, null, 0, 0, [ + $this->assertTrue($redis->connect('tls://' . $host, $tls_port, 0, null, 0, 0, [ 'stream' => ['verify_peer_name' => $verify, 'verify_peer' => false] ])); } @@ -8679,5 +8852,78 @@ public function testSession_ttl_resetOnRead() { $this->assertEquals($data, $runner->getData()); $this->assertEquals(600, $this->redis->ttl($runner->getSessionKey())); } + + public function testDigest() { + if ( ! $this->haveCommand('DIGEST')) + $this->markTestSkipped(); + + $key = 'foo'; + $val = 'bar'; + + $this->redis->set($key, $val); + $digest = $this->redis->digest($key); + $this->assertTrue(is_string($digest) && strlen($digest) == 16); + + /* In PHP >= 8.1 we can verify the value */ + if (PHP_VERSION_ID >= 80100) { + $this->assertEquals($this->redis->_digest($val), $digest); + + $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); + + $this->assertTrue($this->redis->set($key, $val)); + $this->assertEquals( + $this->redis->_digest($val), + $this->redis->digest($key) + ); + + $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE); + } else { + /* Make sure we don't crash when XXH3 isn't available */ + try { + $this->redis->_digest('foo'); + } catch (Exception $ex) { + + } + } + } + + public function testDelEx() { + if ( ! $this->haveCommand('DELEX')) + $this->markTestSkipped(); + + $this->assertIsInt($this->redis->del('captain')); + $this->assertTrue($this->redis->set('captain', 'picard')); + + $this->assertEquals(0, $this->redis->delex('captain', ['ifeq' => 'not-picard'])); + $this->assertEquals(0, $this->redis->delex('captain', ['ifne' => 'picard'])); + $this->assertEquals(1, $this->redis->delex('captain', ['ifeq' => 'picard'])); + + $this->assertTrue($this->redis->set('captain', 'Sisko')); + $digest = $this->redis->digest('captain'); + $this->assertEquals(0, $this->redis->delex('captain', ['ifdne' => $digest])); + $this->assertEquals(1, $this->redis->delex('captain', ['ifdeq' => $digest])); + + $this->assertTrue($this->redis->set('captain', 'Janeway')); + $this->assertEquals(1, $this->redis->delex('captain')); + + foreach ([[], null] as $arg) { + $this->assertTrue($this->redis->set('captain', 'Archer')); + $this->assertEquals(1, $this->redis->delex('captain', $arg)); + } + } + + public function testAnonymousClassSerializationFailure() { + $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); + + $obj = new class() {}; + + $this->assertThrowsMatch(null, function () use ($obj) { + $this->redis->set('payload', $obj); + }, "/Serialization of 'class@anonymous' is not allowed/"); + + /* Ensure extension remains stable after failure */ + $this->assertTrue($this->redis->set('after_failure', 'ok')); + $this->assertEquals('ok', $this->redis->get('after_failure')); + } } ?> diff --git a/tests/TestRedis.php b/tests/TestRedis.php index 7ddb231574..303d05b951 100644 --- a/tests/TestRedis.php +++ b/tests/TestRedis.php @@ -53,7 +53,7 @@ function raHosts($host, $ports) { ini_set( 'display_errors','1'); /* Grab options */ -$opt = getopt('', ['host:', 'port:', 'class:', 'test:', 'nocolors', 'user:', 'auth:']); +$opt = getopt('', ['host:', 'port:', 'tls-port:', 'class:', 'test:', 'nocolors', 'user:', 'auth:']); /* The test class(es) we want to run */ $classes = getClassArray($opt['class'] ?? 'redis'); @@ -66,6 +66,7 @@ function raHosts($host, $ports) { /* Grab override host/port if it was passed */ $host = $opt['host'] ?? '127.0.0.1'; $port = $opt['port'] ?? 6379; +$tls_port = $opt['tls-port'] ?? 6378; /* Get optional username and auth (password) */ $user = $opt['user'] ?? NULL; @@ -116,7 +117,7 @@ function raHosts($host, $ports) { } } else { echo TestSuite::make_bold($class) . "\n"; - if (TestSuite::run("$class", $filter, $host, $port, $auth)) + if (TestSuite::run("$class", $filter, $host, $port, $auth, $tls_port)) exit(1); } } diff --git a/tests/TestSuite.php b/tests/TestSuite.php index 47a8714457..30cde97beb 100644 --- a/tests/TestSuite.php +++ b/tests/TestSuite.php @@ -9,6 +9,7 @@ class TestSuite /* Host and port the unit tests will use */ private string $host; private ?int $port = 6379; + private ?int $tls_port = 6378; /* Redis authentication we'll use */ private $auth; @@ -35,14 +36,16 @@ class TestSuite public static array $errors = []; public static array $warnings = []; - public function __construct(string $host, ?int $port, $auth) { + public function __construct(string $host, ?int $port, $auth, ?int $tls_port = 6378) { $this->host = $host; $this->port = $port; $this->auth = $auth; + $this->tls_port = $tls_port; } public function getHost() { return $this->host; } public function getPort() { return $this->port; } + public function getTlsPort() { return $this->tls_port; } public function getAuth() { return $this->auth; } public static function errorMessage(string $fmt, ...$args) { @@ -574,7 +577,7 @@ public static function flagColorization(bool $override) { public static function run($class_name, ?string $limit = NULL, ?string $host = NULL, ?int $port = NULL, - $auth = NULL) + $auth = NULL, ?int $tls_port = 6378) { if ($limit) $limit = strtolower($limit); @@ -599,7 +602,7 @@ public static function run($class_name, ?string $limit = NULL, echo self::make_bold($padded_name); $count = count($class_name::$errors); - $rt = new $class_name($host, $port, $auth); + $rt = new $class_name($host, $port, $auth, $tls_port); try { $rt->setUp();