Relay
class Relay
Relay client.
Constants
| VERSION |
Relay's version. |
| Version |
Relay's version. |
| COMPRESSION_NONE |
Integer representing no compression algorithm. |
| COMPRESSION_LZF |
Integer representing the LZF compression algorithm. |
| COMPRESSION_ZSTD |
Integer representing the Zstandard compression algorithm. |
| COMPRESSION_LZ4 |
Integer representing the LZ4 compression algorithm. |
| SERIALIZER_NONE |
Integer representing no serializer. |
| SERIALIZER_PHP |
Integer representing the PHP serializer. |
| SERIALIZER_IGBINARY |
Integer representing the igbinary serializer. |
| SERIALIZER_MSGPACK |
Integer representing the MessagePack serializer. |
| SERIALIZER_JSON |
Integer representing the JSON serializer. |
| ATOMIC |
Integer representing the atomic mode. |
| PIPELINE |
Integer representing the pipeline mode. |
| MULTI |
Integer representing the |
| SUBSCRIBED |
Integer representing we're SUBSCRIBED. Note that this constant can
only really be accessed when |
| OPT_PREFIX |
Integer representing the prefix option. |
| OPT_READ_TIMEOUT |
Integer representing the read timeout option. |
| OPT_MAX_RETRIES |
Integer representing the maximum retries option. |
| OPT_BACKOFF_ALGORITHM |
Integer representing the backoff algorithm. |
| OPT_TCP_KEEPALIVE |
Toggle TCP_KEEPALIVE on a connection. |
| BACKOFF_ALGORITHM_DEFAULT |
Integer representing the default backoff algorithm. |
| BACKOFF_ALGORITHM_DECORRELATED_JITTER |
Integer representing the decorrelated jitter backoff algorithm. |
| BACKOFF_ALGORITHM_FULL_JITTER |
Integer representing the full jitter backoff algorithm. |
| OPT_BACKOFF_BASE |
Integer representing the base for backoff computation. |
| OPT_BACKOFF_CAP |
Integer representing the backoff time cap. |
| OPT_PHPREDIS_COMPATIBILITY |
Integer representing the PhpRedis compatibility mode option. Enabled by default. Disabling will cause Relay to:
|
| OPT_SERIALIZER |
Integer representing the serializer option. |
| OPT_COMPRESSION |
Integer representing the compression option. |
| OPT_COMPRESSION_LEVEL |
Integer representing the compression level option. |
| OPT_REPLY_LITERAL |
Integer representing the reply literal option. |
| OPT_NULL_MULTIBULK_AS_NULL |
Integer representing the null-multi-bulk-as-null option. |
| OPT_PACK_IGNORE_NUMBERS |
|
| OPT_THROW_ON_ERROR |
Integer representing the throw-on-error option. Disabled by default. When enabled, Relay will throw exceptions when errors occur. |
| OPT_CLIENT_INVALIDATIONS |
Integer representing Relay’s invalidation option. Enabled by default. When disabled will prevent Relay from
performing instantaneous client-side invalidation when a key
is changed without waiting for Redis to send an |
| OPT_ALLOW_PATTERNS |
Integer representing Relay’s allow patterns option. When set only keys matching these patterns will be cached,
unless they also match an |
| OPT_IGNORE_PATTERNS |
Integer representing Relay’s ignore patterns option. When set keys matching these patterns will not be cached. |
| OPT_USE_CACHE |
Whether use in-memory caching. Enabled by default. |
| OPT_CLIENT_TRACKING |
Whether to enable client tracking for the connection. |
| OPT_SCAN |
Integer representing the scan option. |
| OPT_CAPA_REDIRECT |
Whether client capable of handling redirect messages. |
| OPT_RESTORE_PUBSUB |
Should we restore subscriptions after reconnecting. |
| OPT_ADAPTIVE_CACHE |
Adaptive caching configuration. |
| SCAN_NORETRY |
Issue one |
| SCAN_RETRY |
Retry the |
| SCAN_PREFIX |
Prepend the set prefix to any |
| SCAN_NOPREFIX |
Do not prepend the set prefix to any |
| internal BEFORE |
Redis command argument. |
| internal AFTER |
Redis command argument. |
| internal LEFT |
Redis command argument. |
| internal RIGHT |
Redis command argument. |
| REDIS_NOT_FOUND |
Integer representing "key not found". |
| REDIS_STRING |
Integer representing Redis |
| REDIS_SET |
Integer representing Redis |
| REDIS_LIST |
Integer representing Redis |
| REDIS_ZSET |
Integer representing Redis |
| REDIS_HASH |
Integer representing Redis |
| REDIS_STREAM |
Integer representing Redis |
| REDIS_VECTORSET |
Integer representing Redis |
Properties
| AdaptiveCache read-only | $adaptiveCache | The adaptive cache object. |
Methods
Establishes a new connection to Redis, or reuses already opened connection.
Establishes a new connection to Redis, or reuses already opened connection.
Establishes a persistent connection to Redis.
Closes the current connection, even if it's persistent.
Registers a new event listener.
Registers a new flushed event listener.
Registers a new invalidated event listener.
Dispatches all pending events.
Returns a client option.
Returns or sets a client option.
Sets a client option.
Adds ignore pattern(s). Matching keys will not be cached in memory.
Adds allow pattern(s). Only matching keys will be cached in memory.
Returns the connection timeout.
No description
Returns the read timeout.
No description
Returns the number of bytes sent and received over the network during the Relay object's lifetime, or since the last time Relay::clearBytes() was called.
No description
Returns the host or unix socket.
Whether Relay is connected to Redis.
Returns the port.
Returns the authentication information.
Returns the currently selected database.
Returns the serialized value.
Returns the unserialized value.
Compress data with Relay's currently configured compression algorithm.
Uncompress data with Relay's currently configured compression algorithm.
Returns the serialized and compressed value.
Returns the XXH3 digest for a given value. This returns the same value
Redis' DIGEST command would return.
Returns the unserialized and decompressed value.
Returns the value with the prefix.
Returns the last error message, if any.
Clears the last error that is set, if any.
Returns the connection's endpoint identifier.
No description
Returns a unique representation of the underlying socket connection identifier.
Returns statistics about Relay.
Returns the number of bytes allocated, or 0 in client-only mode.
Execute any command against Redis, without applying the prefix, compression and serialization.
Select the Redis logical database having the specified zero-based numeric index.
Authenticate the connection using a password or an ACL username and password.
The INFO command returns information and statistics about Redis in a format that is simple to parse by computers and easy to read by humans.
Deletes all the keys of all the existing databases, not just the currently selected one.
Invokes a Redis function.
Invokes a read-only Redis function.
Calls FUNCTION sub-command.
Flushes Relay's in-memory cache of all databases.
Retrieve the timestamp of the last user initiated flush of the in-memory cache.
Run a search query on an index, and perform aggregate transformations on the results, extracting statistics etc from them.
Add an alias to an index.
Remove an alias from an index.
Add an alias to an index.
Add a new attribute to the index.
Container command for get/set RediSearch configuration parameter.
Create an index with the given specification.
Container command for del/read existing cursor.
Add terms to a dictionary.
Delete terms from a dictionary.
Dump all terms in the given dictionary.
Delete an index.
Return the execution plan for a complex query.
Return the execution plan for a complex query but formatted for easier reading from CLI.
Apply FT.SEARCH or FT.AGGREGATE command to collect performance details.
Search the index with a textual query, returning either documents or just ids.
Perform spelling correction on a query, returning suggestions for misspelled terms.
Update a synonym group.
Return a distinct set of values indexed in a Tag field.
Serialize and return the value stored at key in a Redis-specific format.
Attach or detach the instance as a replica of another instance.
Pause the client until sufficient local and/or remote AOF data has been flushed to disk.
Create a key associated with a value that is obtained by deserializing the provided serialized value.
Atomically transfer a key from a Redis instance to another one.
This command copies the value stored at the source key to the destination key.
Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk.
Returns the number of milliseoconds since Relay has seen activity from the server.
Asynchronously rewrite the append-only file.
Get the longest common subsequence between two string keys.
Returns the remaining time to live of a key that has a timeout in seconds.
Returns the remaining time to live of a key that has a timeout in milliseconds.
Evaluate script using the Lua interpreter.
Evaluate script using the Lua interpreter. This is just the "read-only" variant of EVAL meaning it can be run on read-only replicas.
Evaluates a script cached on the server-side by its SHA1 digest.
Evaluates a script cached on the server-side by its SHA1 digest. This is just the "read-only" variant
of EVALSHA meaning it can be run on read-only replicas.
Executes CLIENT command operations.
Add one or more members to a geospacial sorted set.
Get the distance between two members of a geospacially encoded sorted set.
Retrieve one or more GeoHash encoded strings for members of the set.
Retrieve members of a geospacially sorted set that are within a certain radius of a location.
Similar to GEORADIUS except it uses a member as the center of the query.
Similar to GEORADIUS except it uses a member as the center of the query.
Retrieve members of a geospacially sorted set that are within a certain radius of a location.
Search a geospacial sorted set for members in various ways.
Search a geospacial sorted set for members within a given area or range, storing the results into a new set.
Get the value of key.
Get the value and metadata of key.
Atomically sets key to value and returns the old value stored at key.
Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).
Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
Returns the bit value at offset in the string value stored at key.
Count the number of set bits (population counting) in a string.
Perform various bitfield operations on a string key, such as getting/setting bit ranges, incrementing, etc.
This is a container command for runtime configuration commands.
Return an array with details about every Redis command.
Perform a bitwise operation on one or more keys, storing the result in a new key.
Return the position of the first bit set to 1 or 0 in a string.
Sets or clears the bit at offset in the string value stored at key.
Interact with ACLs.
If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type.
Get the value of key and optionally set its expiration.
Get the value of key and delete the key. This command is similar to GET, except for the fact that it also deletes the key on success (if and only if the key's value type is a string).
Set key to hold the string value and set key to timeout after a given number of seconds.
Adds the specified elements to the specified HyperLogLog.
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
Set key to hold the string value and set key to timeout after a given number of milliseconds.
A container command for Pub/Sub introspection commands.
Posts a message to the given shard channel.
Set key to hold string value if key does not exist. In that case, it is equal to SET.
Move key from the currently selected database to the specified destination database.
Set's the given keys to their respective values with optional TTL information.
Removes the key if it matches or does not match a value or hash.
Returns the absolute Unix timestamp in seconds at which the given key will expire.
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
Semantic the same as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds.
Remove the existing timeout on key, turning the key from volatile to persistent.
Atomically returns and removes the first/last element of the list stored at source, and pushes the element at the first/last element of the list stored at destination.
BLMOVE is the blocking variant of LMOVE. When source contains elements, this command behaves exactly like LMOVE. When used inside a MULTI/EXEC block, this command behaves exactly like LMOVE.
Returns the specified elements of the list stored at key.
Insert all the specified values at the head of the list stored at key.
Insert all the specified values at the tail of the list stored at key.
Inserts specified values at the head of the list stored at key, only if key already exists and holds a list.
Inserts specified values at the tail of the list stored at key, only if key already exists and holds a list.
Removes and returns the first elements of the list stored at key.
The command returns the index of matching elements inside a Redis list.
Removes and returns the last elements of the list stored at key.
Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.
Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.
BLPOP is a blocking list pop primitive. It is the blocking version of LPOP because it blocks the connection when there are no elements to pop from any of the given lists.
Pop elements from a list, or block until one is available.
Remove and return members with scores in a sorted set or block until one is available.
Pops one or more elements from the first non-empty list key from the list of provided key names.
Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names.
BRPOP is a blocking list pop primitive. It is the blocking version of RPOP because it blocks the connection when there are no elements to pop from any of the given lists.
BZPOPMAX is the blocking variant of the sorted set ZPOPMAX primitive.
BZPOPMIN is the blocking variant of the sorted set ZPOPMIN primitive.
This is a container command for object introspection commands.
Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key.
Removes the first count occurrences of elements equal to element from the list stored at key.
Returns the element at index index in the list stored at key.
Inserts element in the list stored at key either before or after the reference value pivot.
Trim an existing list so that it will contain only the specified range of elements specified.
Returns the value associated with field in the hash stored at key.
Returns one or more fields while also setting an expiration on them.
Returns the value associated with field in the hash stored at key.
Returns the string length of the value associated with field in the hash stored at key.
Returns the values associated with the specified fields in the hash stored at key.
When called with just the key argument, return a random field from the hash value stored at key.
Sets the specified fields to their respective values in the hash stored at key.
Returns if field is an existing field in the hash stored at key.
Se an expiration for one or more hash fields.
Set a millisecond resolution expiry on one or more hash fields.
Set a unix timestamp expiration for one or more hash fields.
Set a millisecond resolution unix timestamp expiration for one or more hash fields.
Get the expire time in seconds for one or more hash fields.
Get the expire time in milliseconds for one or more hash fields.
Get the unix timestamp expiration time for one or more hash fields.
Get the millisecond precision unix timestamp expiration time for one or more hash fields.
Sets field in the hash stored at key to value, only if field does not yet exist.
Sets field in the hash stored at key to value.
Set one or more hash fields and values with expiration options.
Removes the specified fields from the hash stored at key.
Increments the number stored at field in the hash stored at key by increment.
Increment the specified field of a hash stored at key, and representing a floating point number, by the specified increment.
Increment the string representing a floating point number stored at key by the specified increment.
Append the json values into the array at path after the last element in it.
Search for the first occurrence of a JSON value in an array.
Insert the json values into the array at path before the index (shifts to the right).
Report the length of the JSON array at path in key.
Remove and return an element from the index in the array.
Trim an array so that it contains only the specified inclusive range of elements.
Clear container values (arrays/objects) and set numeric values to 0.
Container command for JSON debugging related tasks.
No description
Return the value at path in JSON serialized form.
Merge a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children.
Return the values at path from multiple key arguments.
Set or update one or more JSON values according to the specified key-path-value triplets.
Increment the number value stored at path by number.
Multiply the number value stored at path by number.
Return the keys in the object that's referenced by path.
Report the number of keys in the JSON object at path in key.
Return the JSON in key in RESP specification form.
Set the JSON value at path in key.
Append the json-string values to the string at path.
Report the length of the JSON String at path in key.
Toggle a Boolean value stored at path.
Report the type of JSON value at path.
Returns the members of the set resulting from the difference between the first set and all the successive sets.
This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination. If destination already exists, it is overwritten.
Returns the members of the set resulting from the intersection of all the given sets.
Intersect multiple sets and return the cardinality of the result.
This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination. If destination already exists, it is overwritten.
Returns the members of the set resulting from the union of all the given sets.
This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination. If destination already exists, it is overwritten.
Subscribes to the specified channels.
Unsubscribes from the given channels, or from all of them if none is given.
Subscribes to the given patterns.
Unsubscribes from the given patterns, or from all of them if none is given.
Subscribes to the specified shard channels.
Unsubscribes from the given shard channels, or from all of them if none is given.
Alters the last access time of a key(s).
A pipeline block is simply transmitted faster to the server (like MULTI), but without any guarantee of atomicity.
Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC.
Executes all previously queued commands in a transaction and restores the connection state to normal.
Wait for the synchronous replication of all the write commands sent in the context of the current connection.
Marks the given keys to be watched for conditional execution of a transaction.
Flushes all previously queued commands in a transaction and restores the connection state to normal.
Get the server name as reported by the HELLO response.
Get the server version as reported by the HELLO response.
Get the mode Relay is currently in.
Clear the accumulated sent and received bytes.
Scan the keyspace for matching keys.
Iterates fields of Hash types and their associated values.
Iterates elements of Sets types.
Iterates elements of Sorted Set types and their associated scores.
Interact with Valkey's COMMANDLOG command.
Interact with the Redis slowlog.
Returns if $member is a member of the set stored at $key.
Returns whether each member is a member of the set stored at $key.
Remove the specified members from the set stored at $key.
Add the specified members to the set stored at $key.
Sort the elements in a list, set or sorted set.
Sort the elements in a list, set or sorted set. Read-only variant of SORT.
Move member from the set at source to the set at destination.
Removes and returns one or more random members from the set value store at $key.
Returns one or multiple random members from a set.
Returns the set cardinality (number of elements) of the set stored at $key.
Execute a script management command.
This command swaps two Redis databases, so that immediately all the clients connected to a given database will see the data of the other database, and the other way around.
Add an element to a vector set.
Get the embedding for a given vector set member.
Get any attributes for a given vector set member.
Returns whether or not the element is a member of a vectorset.
Get neighbors for a given vector element optionally withscores.
Get one or more random members from a vector set.
Get a lexicographical range of elements from a vector set.
Set attributes for a given vector set member.
Do a similarity search on encodings or an element of a vector set.
Acknowledge one or more IDs as having been processed by the consumer group.
Awknowledge and delete one or more IDs in a stream.
Append a message to a stream.
Claim ownership of stream message(s).
Automatically take ownership of stream message(s) by metrics.
Perform utility operations having to do with consumer groups.
Remove one or more IDs from a stream with optional mode argument.
Retrieve information about a stream key.
Query pending entries in a stream.
Lists elements in a stream.
Get a range of entries from a STREAM ke in reverse chronological order.
Read messages from a stream.
Read messages from a stream using a consumer group.
Truncate a STREAM key in various ways.
Adds all the specified members with the specified scores to the sorted set stored at key.
When called with just the key argument, return a random element from the sorted set value stored at key.
Returns the specified range of elements in the sorted set stored at key.
Returns the specified range of elements in the sorted set stored at key.
Returns all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).
Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between max and min.
Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. The rank (or index) is 0-based, which means that the member with the lowest score has rank 0.
Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. The rank (or index) is 0-based, which means that the member with the highest score has rank 0.
Removes the specified members from the sorted set stored at key.
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.
Removes all elements in the sorted set stored at key with rank between start and stop. Both start and stop are 0 -based indexes with 0 being the element with the lowest score.
Removes all elements in the sorted set stored at key with a score between min and max (inclusive).
Returns the sorted set cardinality (number of elements) of the sorted set stored at key.
Returns the number of elements in the sorted set at key with a score between min and max.
This command is similar to ZDIFFSTORE, but instead of storing the resulting sorted set, it is returned to the client.
Computes the difference between the first and all successive input sorted sets and stores the result in destination.
Increments the score of member in the sorted set stored at key by increment.
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.
Returns the scores associated with the specified members in the sorted set stored at key.
Returns the score of member in the sorted set at key.
This command is similar to ZINTERSTORE, but instead of storing the resulting sorted set, it is returned to the client.
Intersect multiple sorted sets and return the cardinality of the result.
Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.
This command is similar to ZUNIONSTORE, but instead of storing the resulting sorted set, it is returned to the client.
Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.
Removes and returns up to count members with the lowest scores in the sorted set stored at key.
Removes and returns up to count members with the highest scores in the sorted set stored at key.
Initialize a Redis CMS (Count-Min Sketch) by dimensions.
Initialize a Redis CMS (Count-Min Sketch) by desired probabilities.
Increment one or more fields in a Count-Min Sketch key.
Merge one or more Count-Min Sketch keys with optional weights.
Returns keys cached in runtime memory.
Returns whether a key is tracked in memory.
Returns information about the license.
Details
at line 676
__construct(string|array|null $host = null, int $port = 6379, float $connect_timeout = 0.0, float $command_timeout = 0.0, array $context = [], int $database = 0)
Establishes a new connection to Redis, or reuses already opened connection.
at line 701
bool
connect(string $host, int $port = 6379, float $timeout = 0.0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0.0, array $context = [], int $database = 0)
Establishes a new connection to Redis, or reuses already opened connection.
at line 728
bool
pconnect(string $host, int $port = 6379, float $timeout = 0.0, string|null $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0.0, array $context = [], int $database = 0)
Establishes a persistent connection to Redis.
at line 748
bool
close()
Closes the current connection, even if it's persistent.
Relay defaults to persistent connections and calling close() is not necessary
because connections are stashed and reused automatically.
at line 759
bool
pclose()
deprecated
deprecated
Closes the current connection
at line 768
bool
listen(callable|null $callback)
Registers a new event listener.
at line 777
bool
onFlushed(callable|null $callback)
Registers a new flushed event listener.
at line 787
bool
onInvalidated(callable|null $callback, string|null $pattern = null)
Registers a new invalidated event listener.
at line 795
int|false
dispatchEvents()
Dispatches all pending events.
at line 804
mixed
getOption(int $option)
Returns a client option.
at line 814
mixed
option(int $option, mixed $value = null)
Returns or sets a client option.
at line 846
bool
setOption(int $option, mixed $value)
Sets a client option.
Relay specific options:
OPT_ALLOW_PATTERNSOPT_IGNORE_PATTERNSOPT_THROW_ON_ERROROPT_CLIENT_INVALIDATIONSOPT_PHPREDIS_COMPATIBILITY
Supported PhpRedis options:
OPT_PREFIXOPT_READ_TIMEOUTOPT_COMPRESSIONOPT_COMPRESSION_LEVELOPT_MAX_RETRIESOPT_BACKOFF_ALGORITHMOPT_BACKOFF_BASEOPT_BACKOFF_CAPOPT_SCANOPT_REPLY_LITERALOPT_NULL_MULTIBULK_AS_NULL
at line 855
int
addIgnorePatterns(string ...$pattern)
Adds ignore pattern(s). Matching keys will not be cached in memory.
at line 864
int
addAllowPatterns(string ...$pattern)
Adds allow pattern(s). Only matching keys will be cached in memory.
at line 872
float|false
getTimeout()
Returns the connection timeout.
at line 880
float|false
timeout()
No description
at line 888
float|false
getReadTimeout()
Returns the read timeout.
at line 896
float|false
readTimeout()
No description
at line 905
array
getBytes()
Returns the number of bytes sent and received over the network during the Relay object's lifetime, or since the last time Relay::clearBytes() was called.
at line 913
array
bytes()
No description
at line 921
string|false
getHost()
Returns the host or unix socket.
at line 929
bool
isConnected()
Whether Relay is connected to Redis.
at line 937
int|false
getPort()
Returns the port.
at line 946
mixed
getAuth()
Returns the authentication information.
In PhpRedis compatibility mode this method returns any configured password in plain-text.
at line 954
mixed
getDbNum()
Returns the currently selected database.
at line 963
mixed
_serialize(mixed $value)
Returns the serialized value.
at line 972
mixed
_unserialize(mixed $value)
Returns the unserialized value.
at line 981
string
_compress(string $value)
Compress data with Relay's currently configured compression algorithm.
at line 990
string
_uncompress(string $value)
Uncompress data with Relay's currently configured compression algorithm.
at line 999
string
_pack(mixed $value)
Returns the serialized and compressed value.
at line 1009
string
_digest(mixed $value)
Returns the XXH3 digest for a given value. This returns the same value
Redis' DIGEST command would return.
at line 1018
mixed
_unpack(mixed $value)
Returns the unserialized and decompressed value.
at line 1027
string
_prefix(mixed $value)
Returns the value with the prefix.
at line 1035
string|null
getLastError()
Returns the last error message, if any.
at line 1043
bool
clearLastError()
Clears the last error that is set, if any.
at line 1051
string|false
endpointId()
Returns the connection's endpoint identifier.
at line 1059
string|false
getPersistentID()
No description
at line 1066
string|false
socketId()
Returns a unique representation of the underlying socket connection identifier.
at line 1103
static array
stats()
Returns statistics about Relay.
-
usage.total_requests: The total number of requests we've seen -
usage.active_requests: The number of requests currently in-flight -
usage.max_active_requests: The most concurrent in-flight requests we've seen -
usage.free_epoch_records: The estimated number of free epoch reclamation records -
stats.requests: The total number of requests the cache has received -
stats.misses: Requests where we had to ask Redis for a value -
stats.hits: Requests where we did not have to ask redis for the value -
stats.dirty_skips: The number of times Relay has skipped an entire database because it was dirty. -
stats.errors: How many times a 'severe' error occurs (presently this is only incremented if we get anullresponse from hiredis) -
stats.empty: How many times we've run out of free requests (indicating the size of the ring buffers should be increased) -
stats.oom: The number of times we've run out of memory -
stats.ops_per_sec: The number of commands processed per second -
stats.bytes_sent: The number of bytes Relay has written to the network -
stats.bytes_received: The number of bytes Relay has read from the network -
stats.command_usec: Deprecated -
stats.rinit_usec: The number of microseconds Relay has spent in request initialization -
stats.rshutdown_usec: The number of microseconds Relay has spent in request shutdown -
stats.sigio_usec: The number of microseconds Relay has spent in its SIGIO handler -
memory.total: The total bytes of allocated memory -
memory.limit: The capped number of bytes Relay has available to use -
memory.active: The total amount of memory mapped into the allocator -
memory.used: The amount of memory pointing to live objects including metadata -
endpoints.*.redis: Information about the connected Redis server of that endpoint -
endpoints.*.connections: Information about the connection of each worker -
endpoints.*.adaptive_cache: Information about the adaptive cache for each endpoint
at line 1111
static int
maxMemory()
Returns the number of bytes allocated, or 0 in client-only mode.
at line 1121
static int
memory()
deprecated
deprecated
Returns the number of bytes allocated, or 0 in client-only mode.
at line 1132
mixed
rawCommand(string $cmd, mixed ...$args)
Execute any command against Redis, without applying the prefix, compression and serialization.
at line 1141
Relay|bool|string
select(int $db)
Select the Redis logical database having the specified zero-based numeric index.
at line 1150
bool
auth(mixed $auth)
Authenticate the connection using a password or an ACL username and password.
at line 1162
Relay|array|false
info(string ...$sections)
The INFO command returns information and statistics about Redis in a format that is simple to parse by computers and easy to read by humans.
at line 1171
Relay|bool
flushdb(bool|null $sync = null)
Deletes all the keys of the currently selected database.
at line 1180
Relay|bool
flushall(bool|null $sync = null)
Deletes all the keys of all the existing databases, not just the currently selected one.
at line 1192
mixed
fcall(string $name, array $keys = [], array $argv = [], callable|null $handler = null)
Invokes a Redis function.
at line 1204
mixed
fcall_ro(string $name, array $keys = [], array $argv = [], callable|null $handler = null)
Invokes a read-only Redis function.
at line 1214
mixed
function(string $op, string ...$args)
Calls FUNCTION sub-command.
at line 1227
static bool
flushMemory(string|null $endpointId = null, int|null $db = null)
Flushes Relay's in-memory cache of all databases.
When given an endpoint, only that connection will be flushed. When given an endpoint and database index, only that database for that connection will be flushed.
at line 1242
static float|false
lastMemoryFlush(string|null $endpointId = null, int|null $db = null)
Retrieve the timestamp of the last user initiated flush of the in-memory cache.
User initiated flushes can be done globally, specific to a single endpoint, or specific to a single endpoint and database.
Since flushes at higher levels imply flushes at lower levels, Relay will return the highest level relevant flush given which level was requested.
at line 1254
Relay|array|false
ftAggregate(mixed $index, string $query, array|null $options = null)
Run a search query on an index, and perform aggregate transformations on the results, extracting statistics etc from them.
at line 1264
Relay|bool
ftAliasAdd(mixed $index, string $alias)
Add an alias to an index.
at line 1273
Relay|bool
ftAliasDel(string $alias)
Remove an alias from an index.
at line 1285
Relay|bool
ftAliasUpdate(mixed $index, string $alias)
Add an alias to an index.
If the alias is already associated with another index, removes the alias association with the previous index.
at line 1298
Relay|bool
ftAlter(mixed $index, array $schema, bool $skipinitialscan = false)
Add a new attribute to the index.
Adding an attribute to the index causes any future doacument updates to use the new attribute when indexing and reindexing existing documents.
at line 1309
Relay|array|bool
ftConfig(string $operation, string $option, mixed $value = null)
Container command for get/set RediSearch configuration parameter.
at line 1320
Relay|bool
ftCreate(mixed $index, array $schema, array|null $options = null)
Create an index with the given specification.
at line 1332
Relay|array|bool
ftCursor(string $operation, mixed $index, mixed $cursor, array|null $options = null)
Container command for del/read existing cursor.
at line 1343
Relay|int|false
ftDictAdd(mixed $dict, mixed $term, mixed ...$other_terms)
Add terms to a dictionary.
at line 1354
Relay|int|false
ftDictDel(mixed $dict, mixed $term, mixed ...$other_terms)
Delete terms from a dictionary.
at line 1363
Relay|array|false
ftDictDump(mixed $dict)
Dump all terms in the given dictionary.
at line 1373
Relay|bool
ftDropIndex(mixed $index, bool $dd = false)
Delete an index.
at line 1384
Relay|string|false
ftExplain(mixed $index, string $query, int $dialect = 0)
Return the execution plan for a complex query.
at line 1395
Relay|array|false
ftExplainCli(mixed $index, string $query, int $dialect = 0)
Return the execution plan for a complex query but formatted for easier reading from CLI.
at line 1404
Relay|array|false
ftInfo(mixed $index)
Returns information and statistics about a given index.
at line 1416
Relay|array|false
ftProfile(mixed $index, string $command, string $query, bool $limited = false)
Apply FT.SEARCH or FT.AGGREGATE command to collect performance details.
at line 1427
Relay|array|false
ftSearch(mixed $index, string $query, array|null $options = null)
Search the index with a textual query, returning either documents or just ids.
at line 1438
Relay|array|false
ftSpellCheck(mixed $index, string $query, array|null $options = null)
Perform spelling correction on a query, returning suggestions for misspelled terms.
at line 1447
Relay|array|false
ftSynDump(mixed $index)
Dump the contents of a synonym group.
at line 1459
Relay|bool
ftSynUpdate(mixed $index, string $synonym, mixed $term_or_terms, bool $skipinitialscan = false)
Update a synonym group.
at line 1469
Relay|array|false
ftTagVals(mixed $index, string $tag)
Return a distinct set of values indexed in a Tag field.
at line 1477
Relay|int|false
dbsize()
Returns the number of keys in the currently-selected database.
at line 1486
Relay|string|null|false
digest(mixed $key)
Returns the XX3 hash of a string key's value.
at line 1495
Relay|string|null|false
dump(mixed $key)
Serialize and return the value stored at key in a Redis-specific format.
at line 1505
Relay|bool
replicaof(string|null $host = null, int $port = 0)
Attach or detach the instance as a replica of another instance.
at line 1515
Relay|array|false
waitaof(int $numlocal, int $numremote, int $timeout)
Pause the client until sufficient local and/or remote AOF data has been flushed to disk.
at line 1527
Relay|bool
restore(mixed $key, int $ttl, string $value, array|null $options = null)
Create a key associated with a value that is obtained by deserializing the provided serialized value.
at line 1543
Relay|bool
migrate(string $host, int $port, string|array $key, int $dstdb, int $timeout, bool $copy = false, bool $replace = false, mixed $credentials = null)
Atomically transfer a key from a Redis instance to another one.
at line 1563
Relay|bool
copy(mixed $src, mixed $dst, array|null $options = null)
This command copies the value stored at the source key to the destination key.
at line 1572
Relay|bool|string
echo(string $arg)
Asks Redis to echo back the provided string.
at line 1581
Relay|bool|string
ping(string|null $arg = null)
Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk.
at line 1589
Relay|int|false
idleTime()
Returns the number of milliseoconds since Relay has seen activity from the server.
at line 1597
Relay|string|null|bool
randomkey()
Returns a random key from Redis.
at line 1605
Relay|array|false
time()
Returns the current time from Redis.
at line 1613
Relay|bool
bgrewriteaof()
Asynchronously rewrite the append-only file.
at line 1621
Relay|int|false
lastsave()
Returns the UNIX time stamp of the last successful save to disk.
at line 1632
mixed
lcs(mixed $key1, mixed $key2, array|null $options = null)
Get the longest common subsequence between two string keys.
at line 1641
Relay|bool
bgsave(null|string $arg = null)
Asynchronously save the dataset to disk.
at line 1649
Relay|bool
save()
Synchronously save the dataset to disk.
at line 1657
Relay|array|false
role()
Returns the role of the instance in the context of replication.
at line 1666
Relay|int|false
ttl(mixed $key)
Returns the remaining time to live of a key that has a timeout in seconds.
at line 1675
Relay|int|false
pttl(mixed $key)
Returns the remaining time to live of a key that has a timeout in milliseconds.
at line 1684
Relay|bool|int
exists(mixed ...$keys)
Returns if key(s) exists.
at line 1697
mixed
eval(mixed $script, array $args = [], int $num_keys = 0)
Evaluate script using the Lua interpreter.
at line 1711
mixed
eval_ro(mixed $script, array $args = [], int $num_keys = 0)
Evaluate script using the Lua interpreter. This is just the "read-only" variant of EVAL meaning it can be run on read-only replicas.
at line 1723
mixed
evalsha(string $sha, array $args = [], int $num_keys = 0)
Evaluates a script cached on the server-side by its SHA1 digest.
at line 1735
mixed
evalsha_ro(string $sha, array $args = [], int $num_keys = 0)
Evaluates a script cached on the server-side by its SHA1 digest. This is just the "read-only" variant
of EVALSHA meaning it can be run on read-only replicas.
at line 1745
mixed
client(string $operation, mixed ...$args)
Executes CLIENT command operations.
at line 1758
Relay|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.
at line 1776
Relay|float|null|false
geodist(string $key, string $src, string $dst, string|null $unit = null)
Get the distance between two members of a geospacially encoded sorted set.
at line 1787
Relay|array|false
geohash(string $key, string $member, string ...$other_members)
Retrieve one or more GeoHash encoded strings for members of the set.
at line 1801
mixed
georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])
Retrieve members of a geospacially sorted set that are within a certain radius of a location.
at line 1814
mixed
georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = [])
Similar to GEORADIUS except it uses a member as the center of the query.
at line 1827
mixed
georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = [])
Similar to GEORADIUS except it uses a member as the center of the query.
at line 1841
mixed
georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])
Retrieve members of a geospacially sorted set that are within a certain radius of a location.
at line 1854
Relay|array|false
geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = [])
Search a geospacial sorted set for members in various ways.
at line 1875
Relay|int|false
geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = [])
Search a geospacial sorted set for members within a given area or range, storing the results into a new set.
at line 1891
mixed
get(mixed $key)
Get the value of key.
at line 1905
Relay|array|false
getWithMeta(mixed $key)
Get the value and metadata of key.
Result is an array with value and metadata or false in case of error.
Currently metadata contains following elements:
- cached whether value comes from in-memory cache or from server
- length number of bytes used to store value
at line 1915
mixed
getset(mixed $key, mixed $value)
Atomically sets key to value and returns the old value stored at key.
at line 1927
mixed
getrange(mixed $key, int $start, int $end)
Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).
at line 1939
Relay|int|false
setrange(mixed $key, int $start, mixed $value)
Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
at line 1949
Relay|int|false
getbit(mixed $key, int $pos)
Returns the bit value at offset in the string value stored at key.
at line 1961
Relay|int|false
bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit = false)
Count the number of set bits (population counting) in a string.
at line 1972
Relay|array|false
bitfield(mixed $key, mixed ...$args)
Perform various bitfield operations on a string key, such as getting/setting bit ranges, incrementing, etc.
at line 1983
Relay|array|bool
config(string $operation, mixed $key = null, string|null $value = null)
This is a container command for runtime configuration commands.
at line 1992
Relay|array|int|false
command(mixed ...$args)
Return an array with details about every Redis command.
at line 2004
Relay|int|false
bitop(string $operation, string $dstkey, string $srckey, string ...$other_keys)
Perform a bitwise operation on one or more keys, storing the result in a new key.
at line 2017
Relay|int|false
bitpos(mixed $key, int $bit, int|null $start = null, int|null $end = null, bool $bybit = false)
Return the position of the first bit set to 1 or 0 in a string.
at line 2028
Relay|int|false
setbit(mixed $key, int $pos, int $val)
Sets or clears the bit at offset in the string value stored at key.
at line 2038
mixed
acl(string $cmd, string ...$args)
Interact with ACLs.
at line 2051
Relay|int|false
append(mixed $key, mixed $value)
If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
at line 2063
mixed
set(mixed $key, mixed $value, mixed $options = null)
Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type.
at line 2074
mixed
getex(mixed $key, array|null $options = null)
Get the value of key and optionally set its expiration.
GETEX is similar to GET, but is a write command with additional options.
at line 2085
mixed
getdel(mixed $key)
Get the value of key and delete the key. This command is similar to GET, except for the fact that it also deletes the key on success (if and only if the key's value type is a string).
at line 2096
Relay|bool
setex(mixed $key, int $seconds, mixed $value)
Set key to hold the string value and set key to timeout after a given number of seconds.
at line 2106
Relay|int|false
pfadd(string $key, array $elements)
Adds the specified elements to the specified HyperLogLog.
at line 2115
Relay|int|false
pfcount(string|array $key_or_keys)
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
at line 2125
Relay|bool
pfmerge(string $dst, array $srckeys)
Merge given HyperLogLogs into a single one.
at line 2136
Relay|bool
psetex(mixed $key, int $milliseconds, mixed $value)
Set key to hold the string value and set key to timeout after a given number of milliseconds.
at line 2146
Relay|int|false
publish(string $channel, string $message)
Posts a message to the given channel.
at line 2156
mixed
pubsub(string $operation, mixed ...$args)
A container command for Pub/Sub introspection commands.
at line 2166
Relay|int|false
spublish(string $channel, string $message)
Posts a message to the given shard channel.
at line 2178
Relay|bool
setnx(mixed $key, mixed $value)
Set key to hold string value if key does not exist. In that case, it is equal to SET.
When key already holds a value, no operation is performed. SETNX is short for "SET if Not eXists".
at line 2187
Relay|array|false
mget(array $keys)
Returns the values of all specified keys.
at line 2197
Relay|int|false
move(mixed $key, int $db)
Move key from the currently selected database to the specified destination database.
at line 2207
Relay|bool
mset(array $kvals)
Sets the given keys to their respective values.
MSET replaces existing values with new values, just as regular SET.
at line 2218
Relay|int|false
msetex(mixed $kvals, int|float|array|null $ttl = null)
Set's the given keys to their respective values with optional TTL information.
at line 2228
Relay|bool
msetnx(array $kvals)
Sets the given keys to their respective values.
MSETNX will not perform any operation at all even if just a single key already exists.
at line 2238
Relay|bool
rename(mixed $key, mixed $newkey)
Renames key.
at line 2248
Relay|bool
renamenx(mixed $key, mixed $newkey)
Renames key if the new key does not yet exist.
at line 2257
Relay|int|bool
del(mixed ...$keys)
Removes the specified keys.
at line 2267
Relay|int|false
delex(mixed $key, array|null $options = null)
Removes the key if it matches or does not match a value or hash.
at line 2277
Relay|int|false
delifeq(mixed $key, mixed $value)
Remove a key if it equals the provided value.
at line 2286
Relay|int|false
unlink(mixed ...$keys)
Removes the specified keys without blocking Redis.
at line 2297
Relay|bool
expire(mixed $key, int $seconds, string|null $mode = null)
Set a timeout on key.
at line 2307
Relay|bool
pexpire(mixed $key, int $milliseconds)
Set a key's time to live in milliseconds.
at line 2317
Relay|bool
expireat(mixed $key, int $timestamp)
Set a timeout on key using a unix timestamp.
at line 2328
Relay|int|false
expiretime(mixed $key)
Returns the absolute Unix timestamp in seconds at which the given key will expire.
If the key exists but doesn't have a TTL this function return -1. If the key does not exist -2.
at line 2338
Relay|bool
pexpireat(mixed $key, int $timestamp_ms)
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
at line 2348
Relay|int|false
pexpiretime(mixed $key)
Semantic the same as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds.
at line 2357
Relay|bool
persist(mixed $key)
Remove the existing timeout on key, turning the key from volatile to persistent.
at line 2370
Relay|int|string|bool
type(mixed $key)
Returns the type of a given key.
In PhpRedis compatibility mode this will return an integer
(one of the REDIS_
at line 2384
mixed
lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos)
Atomically returns and removes the first/last element of the list stored at source, and pushes the element at the first/last element of the list stored at destination.
at line 2399
mixed
blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout)
BLMOVE is the blocking variant of LMOVE. When source contains elements, this command behaves exactly like LMOVE. When used inside a MULTI/EXEC block, this command behaves exactly like LMOVE.
at line 2410
Relay|array|false
lrange(mixed $key, int $start, int $stop)
Returns the specified elements of the list stored at key.
at line 2421
Relay|int|false
lpush(mixed $key, mixed $mem, mixed ...$mems)
Insert all the specified values at the head of the list stored at key.
at line 2432
Relay|int|false
rpush(mixed $key, mixed $mem, mixed ...$mems)
Insert all the specified values at the tail of the list stored at key.
at line 2444
Relay|int|false
lpushx(mixed $key, mixed $mem, mixed ...$mems)
Inserts specified values at the head of the list stored at key, only if key already exists and holds a list.
at line 2456
Relay|int|false
rpushx(mixed $key, mixed $mem, mixed ...$mems)
Inserts specified values at the tail of the list stored at key, only if key already exists and holds a list.
at line 2467
Relay|bool
lset(mixed $key, int $index, mixed $mem)
Sets the list element at index to element.
at line 2477
mixed
lpop(mixed $key, int $count = 1)
Removes and returns the first elements of the list stored at key.
at line 2488
Relay|int|array|false|null
lpos(mixed $key, mixed $value, array|null $options = null)
The command returns the index of matching elements inside a Redis list.
at line 2498
mixed
rpop(mixed $key, int $count = 1)
Removes and returns the last elements of the list stored at key.
at line 2509
mixed
rpoplpush(mixed $source, mixed $dest)
Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.
at line 2522
mixed
brpoplpush(mixed $source, mixed $dest, float $timeout)
Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.
This command will block for an element up to the provided timeout.
at line 2534
Relay|array|null|false
blpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args)
BLPOP is a blocking list pop primitive. It is the blocking version of LPOP because it blocks the connection when there are no elements to pop from any of the given lists.
at line 2546
Relay|array|null|false
blmpop(float $timeout, array $keys, string $from, int $count = 1)
Pop elements from a list, or block until one is available.
at line 2558
Relay|array|null|false
bzmpop(float $timeout, array $keys, string $from, int $count = 1)
Remove and return members with scores in a sorted set or block until one is available.
at line 2569
Relay|array|null|false
lmpop(array $keys, string $from, int $count = 1)
Pops one or more elements from the first non-empty list key from the list of provided key names.
at line 2581
Relay|array|null|false
zmpop(array $keys, string $from, int $count = 1)
Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names.
at line 2593
Relay|array|null|false
brpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args)
BRPOP is a blocking list pop primitive. It is the blocking version of RPOP because it blocks the connection when there are no elements to pop from any of the given lists.
at line 2604
Relay|array|null|false
bzpopmax(string|array $key, string|float $timeout_or_key, mixed ...$extra_args)
BZPOPMAX is the blocking variant of the sorted set ZPOPMAX primitive.
at line 2615
Relay|array|null|false
bzpopmin(string|array $key, string|float $timeout_or_key, mixed ...$extra_args)
BZPOPMIN is the blocking variant of the sorted set ZPOPMIN primitive.
at line 2625
mixed
object(string $op, mixed $key)
This is a container command for object introspection commands.
at line 2636
Relay|array|false
geopos(mixed $key, mixed ...$members)
Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key.
at line 2647
Relay|int|false
lrem(mixed $key, mixed $mem, int $count = 0)
Removes the first count occurrences of elements equal to element from the list stored at key.
at line 2657
mixed
lindex(mixed $key, int $index)
Returns the element at index index in the list stored at key.
at line 2669
Relay|int|false
linsert(mixed $key, string $op, mixed $pivot, mixed $element)
Inserts element in the list stored at key either before or after the reference value pivot.
at line 2680
Relay|bool
ltrim(mixed $key, int $start, int $end)
Trim an existing list so that it will contain only the specified range of elements specified.
at line 2690
mixed
hget(mixed $hash, mixed $member)
Returns the value associated with field in the hash stored at key.
at line 2701
Relay|array|false
hgetex(mixed $hash, array $fields, mixed $expiry = null)
Returns one or more fields while also setting an expiration on them.
at line 2712
Relay|array|false
hgetWithMeta(mixed $hash, mixed $member)
Returns the value associated with field in the hash stored at key.
at line 2722
Relay|int|false
hstrlen(mixed $hash, mixed $member)
Returns the string length of the value associated with field in the hash stored at key.
at line 2731
Relay|array|false
hgetall(mixed $hash)
Returns all fields and values of the hash stored at key.
at line 2740
Relay|array|false
hkeys(mixed $hash)
Returns all field names in the hash stored at key.
at line 2749
Relay|array|false
hvals(mixed $hash)
Returns all values in the hash stored at key.
at line 2759
Relay|array|false
hmget(mixed $hash, array $members)
Returns the values associated with the specified fields in the hash stored at key.
at line 2769
Relay|array|false
hgetdel(mixed $key, array $fields)
Gets and deletes one or more hash fields.
at line 2779
Relay|array|string|null|false
hrandfield(mixed $hash, array|null $options = null)
When called with just the key argument, return a random field from the hash value stored at key.
at line 2789
Relay|bool
hmset(mixed $hash, array $members)
Sets the specified fields to their respective values in the hash stored at key.
at line 2799
Relay|bool
hexists(mixed $hash, mixed $member)
Returns if field is an existing field in the hash stored at key.
at line 2811
Relay|array|false
hexpire(mixed $hash, int $ttl, array $fields, string|null $mode = null)
Se an expiration for one or more hash fields.
at line 2823
Relay|array|false
hpexpire(mixed $hash, int $ttl, array $fields, string|null $mode = null)
Set a millisecond resolution expiry on one or more hash fields.
at line 2835
Relay|array|false
hexpireat(mixed $hash, int $ttl, array $fields, string|null $mode = null)
Set a unix timestamp expiration for one or more hash fields.
at line 2847
Relay|array|false
hpexpireat(mixed $hash, int $ttl, array $fields, string|null $mode = null)
Set a millisecond resolution unix timestamp expiration for one or more hash fields.
at line 2857
Relay|array|false
httl(mixed $hash, array $fields)
Get the expire time in seconds for one or more hash fields.
at line 2867
Relay|array|false
hpttl(mixed $hash, array $fields)
Get the expire time in milliseconds for one or more hash fields.
at line 2877
Relay|array|false
hexpiretime(mixed $hash, array $fields)
Get the unix timestamp expiration time for one or more hash fields.
at line 2888
Relay|array|false
hpexpiretime(mixed $hash, array $fields)
Get the millisecond precision unix timestamp expiration time for one or more hash fields.
at line 2898
Relay|array|false
hpersist(mixed $hash, array $fields)
Persist one or more hash fields.
at line 2908
Relay|bool
hsetnx(mixed $hash, mixed $member, mixed $value)
Sets field in the hash stored at key to value, only if field does not yet exist.
at line 2918
Relay|int|false
hset(mixed $key, mixed ...$keys_and_vals)
Sets field in the hash stored at key to value.
at line 2929
Relay|int|false
hsetex(mixed $key, array $fields, null|int|float|array $expiry = null)
Set one or more hash fields and values with expiration options.
at line 2940
Relay|int|false
hdel(mixed $key, mixed $mem, string ...$mems)
Removes the specified fields from the hash stored at key.
at line 2951
Relay|int|false
hincrby(mixed $key, mixed $mem, int $value)
Increments the number stored at field in the hash stored at key by increment.
at line 2963
Relay|float|bool
hincrbyfloat(mixed $key, mixed $mem, float $value)
Increment the specified field of a hash stored at key, and representing a floating point number, by the specified increment.
at line 2973
Relay|int|false
incr(mixed $key, int $by = 1)
Increments the number stored at key by one.
at line 2983
Relay|int|false
decr(mixed $key, int $by = 1)
Decrements the number stored at key by one.
at line 2993
Relay|int|false
incrby(mixed $key, int $value)
Increments the number stored at key by increment.
at line 3003
Relay|int|false
decrby(mixed $key, int $value)
Decrements the number stored at key by decrement.
at line 3013
Relay|float|false
incrbyfloat(mixed $key, float $value)
Increment the string representing a floating point number stored at key by the specified increment.
at line 3023
Relay|array|false
jsonArrAppend(mixed $key, mixed $value_or_array, string|null $path = null)
Append the json values into the array at path after the last element in it.
at line 3036
Relay|array|false
jsonArrIndex(mixed $key, string $path, mixed $value, int|null $start = 0, int|null $stop = -1)
Search for the first occurrence of a JSON value in an array.
at line 3049
Relay|array|false
jsonArrInsert(mixed $key, string $path, int $index, mixed $value, mixed ...$other_values)
Insert the json values into the array at path before the index (shifts to the right).
at line 3059
Relay|array|false
jsonArrLen(mixed $key, string|null $path = null)
Report the length of the JSON array at path in key.
at line 3070
Relay|array|false
jsonArrPop(mixed $key, string|null $path = null, int $index = -1)
Remove and return an element from the index in the array.
at line 3082
Relay|array|false
jsonArrTrim(mixed $key, string $path, int $start, int $stop)
Trim an array so that it contains only the specified inclusive range of elements.
at line 3092
Relay|int|false
jsonClear(mixed $key, string|null $path = null)
Clear container values (arrays/objects) and set numeric values to 0.
at line 3103
Relay|int|false
jsonDebug(string $command, mixed $key, string|null $path = null)
Container command for JSON debugging related tasks.
at line 3113
Relay|int|false
jsonDel(mixed $key, string|null $path = null)
Delete a value.
at line 3119
Relay|int|false
jsonForget(mixed $key, string|null $path = null)
No description
at line 3130
mixed
jsonGet(mixed $key, array $options = [], string ...$paths)
Return the value at path in JSON serialized form.
at line 3142
Relay|bool
jsonMerge(mixed $key, string $path, mixed $value)
Merge a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children.
at line 3152
Relay|array|false
jsonMget(mixed $key_or_array, string $path)
Return the values at path from multiple key arguments.
at line 3164
Relay|bool
jsonMset(mixed $key, string $path, mixed $value, mixed ...$other_triples)
Set or update one or more JSON values according to the specified key-path-value triplets.
at line 3175
Relay|array|false
jsonNumIncrBy(mixed $key, string $path, int $value)
Increment the number value stored at path by number.
at line 3186
Relay|array|false
jsonNumMultBy(mixed $key, string $path, int $value)
Multiply the number value stored at path by number.
at line 3196
Relay|array|false
jsonObjKeys(mixed $key, string|null $path = null)
Return the keys in the object that's referenced by path.
at line 3206
Relay|array|false
jsonObjLen(mixed $key, string|null $path = null)
Report the number of keys in the JSON object at path in key.
at line 3216
Relay|array|string|int|false
jsonResp(mixed $key, string|null $path = null)
Return the JSON in key in RESP specification form.
at line 3228
Relay|bool
jsonSet(mixed $key, string $path, mixed $value, string|null $condition = null)
Set the JSON value at path in key.
at line 3239
Relay|array|false
jsonStrAppend(mixed $key, mixed $value, string|null $path = null)
Append the json-string values to the string at path.
at line 3249
Relay|array|false
jsonStrLen(mixed $key, string|null $path = null)
Report the length of the JSON String at path in key.
at line 3259
Relay|array|false
jsonToggle(mixed $key, string $path)
Toggle a Boolean value stored at path.
at line 3269
Relay|array|false
jsonType(mixed $key, string|null $path = null)
Report the type of JSON value at path.
at line 3280
Relay|array|false
sdiff(mixed $key, mixed ...$other_keys)
Returns the members of the set resulting from the difference between the first set and all the successive sets.
at line 3291
Relay|int|false
sdiffstore(mixed $key, mixed ...$other_keys)
This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination. If destination already exists, it is overwritten.
at line 3301
Relay|array|false
sinter(mixed $key, mixed ...$other_keys)
Returns the members of the set resulting from the intersection of all the given sets.
at line 3311
Relay|int|false
sintercard(array $keys, int $limit = -1)
Intersect multiple sets and return the cardinality of the result.
at line 3322
Relay|int|false
sinterstore(mixed $key, mixed ...$other_keys)
This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination. If destination already exists, it is overwritten.
at line 3332
Relay|array|false
sunion(mixed $key, mixed ...$other_keys)
Returns the members of the set resulting from the union of all the given sets.
at line 3343
Relay|int|false
sunionstore(mixed $key, mixed ...$other_keys)
This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination. If destination already exists, it is overwritten.
at line 3353
bool
subscribe(array $channels, callable $callback)
Subscribes to the specified channels.
at line 3362
bool
unsubscribe(array $channels = [])
Unsubscribes from the given channels, or from all of them if none is given.
at line 3372
bool
psubscribe(array $patterns, callable $callback)
Subscribes to the given patterns.
at line 3381
bool
punsubscribe(array $patterns = [])
Unsubscribes from the given patterns, or from all of them if none is given.
at line 3391
bool
ssubscribe(array $channels, callable $callback)
Subscribes to the specified shard channels.
at line 3400
bool
sunsubscribe(array $channels = [])
Unsubscribes from the given shard channels, or from all of them if none is given.
at line 3410
Relay|int|false
touch(array|string $key_or_array, mixed ...$more_keys)
Alters the last access time of a key(s).
at line 3418
Relay|bool
pipeline()
A pipeline block is simply transmitted faster to the server (like MULTI), but without any guarantee of atomicity.
at line 3429
Relay|bool
multi(int $mode = 0)
Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC.
Accepts Relay::MULTI and Relay::PIPELINE modes.
at line 3437
Relay|array|bool
exec()
Executes all previously queued commands in a transaction and restores the connection state to normal.
at line 3448
Relay|int|false
wait(int $replicas, int $timeout)
Wait for the synchronous replication of all the write commands sent in the context of the current connection.
at line 3458
Relay|bool|string
watch(mixed $key, mixed ...$other_keys)
Marks the given keys to be watched for conditional execution of a transaction.
at line 3467
Relay|bool
unwatch()
Flushes all the previously watched keys for a transaction.
If you call EXEC or DISCARD, there's no need to manually call UNWATCH.
at line 3476
bool
discard()
Flushes all previously queued commands in a transaction and restores the connection state to normal.
If WATCH was used, DISCARD unwatches all keys watched by the connection.
at line 3484
string|false
serverName()
Get the server name as reported by the HELLO response.
at line 3492
string|false
serverVersion()
Get the server version as reported by the HELLO response.
at line 3502
int
getMode(bool $masked = false)
Get the mode Relay is currently in.
Relay::ATOMIC, Relay::PIPELINE or Relay::MULTI.
at line 3510
void
clearBytes()
Clear the accumulated sent and received bytes.
at line 3522
array|false
scan(mixed $iterator, mixed $match = null, int $count = 0, string|null $type = null)
Scan the keyspace for matching keys.
at line 3534
array|false
hscan(mixed $key, mixed $iterator, mixed $match = null, int $count = 0)
Iterates fields of Hash types and their associated values.
at line 3546
array|false
sscan(mixed $key, mixed $iterator, mixed $match = null, int $count = 0)
Iterates elements of Sets types.
at line 3558
array|false
zscan(mixed $key, mixed $iterator, mixed $match = null, int $count = 0)
Iterates elements of Sorted Set types and their associated scores.
at line 3567
Relay|array|false
keys(mixed $pattern)
Returns all keys matching pattern.
at line 3577
Relay|array|int|bool
commandlog(string $subcmd, mixed ...$args)
Interact with Valkey's COMMANDLOG command.
at line 3587
Relay|array|int|bool
slowlog(string $operation, string ...$extra_args)
Interact with the Redis slowlog.
at line 3596
Relay|array|false
smembers(mixed $set)
Returns all the members of the set value stored at $key.
at line 3606
Relay|bool
sismember(mixed $set, mixed $member)
Returns if $member is a member of the set stored at $key.
at line 3616
Relay|array|false
smismember(mixed $set, mixed ...$members)
Returns whether each member is a member of the set stored at $key.
at line 3627
Relay|int|false
srem(mixed $set, mixed $member, mixed ...$members)
Remove the specified members from the set stored at $key.
at line 3638
Relay|int|false
sadd(mixed $set, mixed $member, mixed ...$members)
Add the specified members to the set stored at $key.
at line 3648
Relay|array|int|false
sort(mixed $key, array $options = [])
Sort the elements in a list, set or sorted set.
at line 3658
Relay|array|false
sort_ro(mixed $key, array $options = [])
Sort the elements in a list, set or sorted set. Read-only variant of SORT.
at line 3669
Relay|bool
smove(mixed $srcset, mixed $dstset, mixed $member)
Move member from the set at source to the set at destination.
at line 3679
mixed
spop(mixed $set, int $count = 1)
Removes and returns one or more random members from the set value store at $key.
at line 3689
mixed
srandmember(mixed $set, int $count = 1)
Returns one or multiple random members from a set.
at line 3698
Relay|int|false
scard(mixed $key)
Returns the set cardinality (number of elements) of the set stored at $key.
at line 3708
mixed
script(string $command, string ...$args)
Execute a script management command.
at line 3717
Relay|int|false
strlen(mixed $key)
Returns the length of the string value stored at $key.
at line 3729
Relay|bool
swapdb(int $index1, int $index2)
This command swaps two Redis databases, so that immediately all the clients connected to a given database will see the data of the other database, and the other way around.
at line 3738
Relay|int|false
hlen(mixed $key)
Returns the number of fields contained in the hash stored at $key.
at line 3747
Relay|int|false
llen(mixed $key)
Returns the length of the list stored at $key.
at line 3759
Relay|int|false
vadd(mixed $key, array $values, mixed $element, array|null $options = null)
Add an element to a vector set.
at line 3768
Relay|int|false
vcard(mixed $key)
Return the cardinality (number of elements) in a vector set.
at line 3777
Relay|int|false
vdim(mixed $key)
Return the dimensionality of vectors in a vector set.
at line 3788
Relay|array|false
vemb(mixed $key, mixed $element, bool $raw = false)
Get the embedding for a given vector set member.
at line 3799
Relay|array|string|false
vgetattr(mixed $key, mixed $element, bool $raw = false)
Get any attributes for a given vector set member.
at line 3808
Relay|array|false
vinfo(mixed $key)
Return metadata about a vector set.
at line 3818
Relay|bool
vismember(mixed $key, mixed $element)
Returns whether or not the element is a member of a vectorset.
at line 3829
Relay|array|false
vlinks(mixed $key, mixed $element, bool $withscores)
Get neighbors for a given vector element optionally withscores.
at line 3839
Relay|array|string|false
vrandmember(mixed $key, int $count = 0)
Get one or more random members from a vector set.
at line 3850
Relay|array|false
vrange(mixed $key, string $min, string $max, int $count = -1)
Get a lexicographical range of elements from a vector set.
at line 3860
Relay|int|false
vrem(mixed $key, mixed $element)
Remove an element from a vector set.
at line 3871
Relay|int|false
vsetattr(mixed $key, mixed $element, array|string $attributes)
Set attributes for a given vector set member.
at line 3882
Relay|array|false
vsim(mixed $key, mixed $member, array|null $options = null)
Do a similarity search on encodings or an element of a vector set.
at line 3893
Relay|int|false
xack(mixed $key, string $group, array $ids)
Acknowledge one or more IDs as having been processed by the consumer group.
at line 3905
Relay|array|false
xackdel(string $key, string $group, array $ids, string|null $mode = null)
Awknowledge and delete one or more IDs in a stream.
at line 3918
Relay|string|null|false
xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false, bool $nomkstream = false)
Append a message to a stream.
at line 3938
Relay|array|bool
xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options)
Claim ownership of stream message(s).
at line 3960
Relay|bool|array
xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false)
Automatically take ownership of stream message(s) by metrics.
at line 3977
Relay|int|false
xlen(string $key)
Get the length of a stream.
at line 3991
mixed
xgroup(string $operation, mixed $key = null, string|null $group = null, string|null $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2)
Perform utility operations having to do with consumer groups.
at line 4008
Relay|int|false
xdel(string $key, array $ids)
Remove one or more specific IDs from a stream.
at line 4019
Relay|array|false
xdelex(string $key, array $ids, string|null $mode = null)
Remove one or more IDs from a stream with optional mode argument.
at line 4031
mixed
xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1)
Retrieve information about a stream key.
at line 4046
Relay|array|false
xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null, int $idle = 0)
Query pending entries in a stream.
at line 4066
Relay|array|false
xrange(mixed $key, string $start, string $end, int $count = -1)
Lists elements in a stream.
at line 4078
Relay|array|bool
xrevrange(string $key, string $end, string $start, int $count = -1)
Get a range of entries from a STREAM ke in reverse chronological order.
at line 4089
Relay|array|bool|null
xread(array $streams, int $count = -1, int $block = -1)
Read messages from a stream.
at line 4102
Relay|array|bool|null
xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1)
Read messages from a stream using a consumer group.
at line 4121
Relay|int|false
xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1)
Truncate a STREAM key in various ways.
at line 4137
mixed
zadd(mixed $key, mixed ...$args)
Adds all the specified members with the specified scores to the sorted set stored at key.
at line 4148
mixed
zrandmember(mixed $key, array|null $options = null)
When called with just the key argument, return a random element from the sorted set value stored at key.
If the provided count argument is positive, return an array of distinct elements.
at line 4160
Relay|array|false
zrange(mixed $key, string|int $start, string|int $end, mixed $options = null)
Returns the specified range of elements in the sorted set stored at key.
at line 4172
Relay|array|false
zrevrange(mixed $key, int $start, int $end, mixed $options = null)
Returns the specified range of elements in the sorted set stored at key.
at line 4185
Relay|array|false
zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null)
Returns all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
at line 4198
Relay|array|false
zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null)
Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).
at line 4212
Relay|int|false
zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mixed $options = null)
Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).
at line 4227
Relay|array|false
zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1)
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.
at line 4242
Relay|array|false
zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = -1, int $count = -1)
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between max and min.
at line 4255
Relay|array|int|null|false
zrank(mixed $key, mixed $rank, bool $withscore = false)
Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. The rank (or index) is 0-based, which means that the member with the lowest score has rank 0.
at line 4268
Relay|array|int|null|false
zrevrank(mixed $key, mixed $rank, bool $withscore = false)
Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. The rank (or index) is 0-based, which means that the member with the highest score has rank 0.
at line 4279
Relay|int|false
zrem(mixed $key, mixed ...$args)
Removes the specified members from the sorted set stored at key.
Non existing members are ignored.
at line 4293
Relay|int|false
zremrangebylex(mixed $key, mixed $min, mixed $max)
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.
at line 4306
Relay|int|false
zremrangebyrank(mixed $key, int $start, int $end)
Removes all elements in the sorted set stored at key with rank between start and stop. Both start and stop are 0 -based indexes with 0 being the element with the lowest score.
at line 4318
Relay|int|false
zremrangebyscore(mixed $key, mixed $min, mixed $max)
Removes all elements in the sorted set stored at key with a score between min and max (inclusive).
at line 4327
Relay|int|false
zcard(mixed $key)
Returns the sorted set cardinality (number of elements) of the sorted set stored at key.
at line 4338
Relay|int|false
zcount(mixed $key, mixed $min, mixed $max)
Returns the number of elements in the sorted set at key with a score between min and max.
at line 4349
Relay|array|false
zdiff(array $keys, array|null $options = null)
This command is similar to ZDIFFSTORE, but instead of storing the resulting sorted set, it is returned to the client.
at line 4360
Relay|int|false
zdiffstore(mixed $dst, array $keys)
Computes the difference between the first and all successive input sorted sets and stores the result in destination.
at line 4371
Relay|float|false
zincrby(mixed $key, float $score, mixed $mem)
Increments the score of member in the sorted set stored at key by increment.
at line 4384
Relay|int|false
zlexcount(mixed $key, mixed $min, mixed $max)
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.
at line 4394
Relay|array|false
zmscore(mixed $key, mixed ...$mems)
Returns the scores associated with the specified members in the sorted set stored at key.
at line 4404
Relay|float|null|false
zscore(mixed $key, mixed $member)
Returns the score of member in the sorted set at key.
at line 4416
Relay|array|false
zinter(array $keys, array|null $weights = null, mixed $options = null)
This command is similar to ZINTERSTORE, but instead of storing the resulting sorted set, it is returned to the client.
at line 4426
Relay|int|false
zintercard(array $keys, int $limit = -1)
Intersect multiple sorted sets and return the cardinality of the result.
at line 4439
Relay|int|false
zinterstore(mixed $dst, array $keys, array|null $weights = null, mixed $options = null)
Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.
at line 4451
Relay|array|false
zunion(array $keys, array|null $weights = null, mixed $options = null)
This command is similar to ZUNIONSTORE, but instead of storing the resulting sorted set, it is returned to the client.
at line 4464
Relay|int|false
zunionstore(mixed $dst, array $keys, array|null $weights = null, mixed $options = null)
Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.
at line 4475
Relay|array|false
zpopmin(mixed $key, int $count = 1)
Removes and returns up to count members with the lowest scores in the sorted set stored at key.
at line 4486
Relay|array|false
zpopmax(mixed $key, int $count = 1)
Removes and returns up to count members with the highest scores in the sorted set stored at key.
at line 4497
Relay|bool
cmsInitByDim(mixed $key, int $width, int $depth)
Initialize a Redis CMS (Count-Min Sketch) by dimensions.
at line 4508
Relay|bool
cmsInitByProb(mixed $key, float $error, float $probability)
Initialize a Redis CMS (Count-Min Sketch) by desired probabilities.
at line 4517
Relay|array|false
cmsInfo(mixed $key)
Get information about a Count-Min Sketch key.
at line 4529
Relay|array|false
cmsIncrBy(mixed $key, mixed $field, int $value, mixed ...$fields_and_falues)
Increment one or more fields in a Count-Min Sketch key.
at line 4539
Relay|bool
cmsMerge(mixed $dstkey, array $keys, array $weights = [])
Merge one or more Count-Min Sketch keys with optional weights.
at line 4548
Relay|array|false
cmsQuery(mixed $key, mixed ...$fields)
Query a Count-Min Sketch key.
at line 4557
mixed
_getKeys()
| internal | Temporary debug helper. Do not use. |
Returns keys cached in runtime memory.
at line 4569
bool
isTracked(string $key)
Returns whether a key is tracked in memory.
This can mean the entire key is cached in-memory or that we are tracking the existence or length of the key.
at line 4577
static array
license()
Returns information about the license.