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 MULTI mode.

SUBSCRIBED

Integer representing we're SUBSCRIBED. Note that this constant can only really be accessed when true is passed to getMask() telling relay to return the complete bitmasked mode.

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:

  1. Return null when a key doesn't exist, instead of false
  2. Throw exceptions when an error occurs, instead of returning false

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 INVALIDATE message. The invalidation occurs only in the same FPM pool.

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.

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 command at a time, sometimes returning an empty array of results.

SCAN_RETRY

Retry the SCAN command until keys come back, or iterator of zero is returned.

SCAN_PREFIX

Prepend the set prefix to any MATCH pattern.

SCAN_NOPREFIX

Do not prepend the set prefix to any MATCH pattern.

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 string type.

REDIS_SET

Integer representing Redis set type.

REDIS_LIST

Integer representing Redis list type.

REDIS_ZSET

Integer representing Redis zset type.

REDIS_HASH

Integer representing Redis hash type.

REDIS_STREAM

Integer representing Redis stream type.

REDIS_VECTORSET

Integer representing Redis vectorset type.

Properties

AdaptiveCache read-only $adaptiveCache

The adaptive cache object.

Methods

__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.

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.

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.

bool
close()

Closes the current connection, even if it's persistent.

bool
pclose() deprecated

Closes the current connection

bool
listen(callable|null $callback)

Registers a new event listener.

bool
onFlushed(callable|null $callback)

Registers a new flushed event listener.

bool
onInvalidated(callable|null $callback, string|null $pattern = null)

Registers a new invalidated event listener.

int|false
dispatchEvents()

Dispatches all pending events.

mixed
getOption(int $option)

Returns a client option.

mixed
option(int $option, mixed $value = null)

Returns or sets a client option.

bool
setOption(int $option, mixed $value)

Sets a client option.

int
addIgnorePatterns(string ...$pattern)

Adds ignore pattern(s). Matching keys will not be cached in memory.

int
addAllowPatterns(string ...$pattern)

Adds allow pattern(s). Only matching keys will be cached in memory.

float|false
getTimeout()

Returns the connection timeout.

float|false
timeout()

No description

float|false
getReadTimeout()

Returns the read timeout.

float|false
readTimeout()

No description

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.

array
bytes()

No description

string|false
getHost()

Returns the host or unix socket.

bool
isConnected()

Whether Relay is connected to Redis.

int|false
getPort()

Returns the port.

mixed
getAuth()

Returns the authentication information.

mixed
getDbNum()

Returns the currently selected database.

mixed
_serialize(mixed $value)

Returns the serialized value.

mixed
_unserialize(mixed $value)

Returns the unserialized value.

string
_compress(string $value)

Compress data with Relay's currently configured compression algorithm.

string
_uncompress(string $value)

Uncompress data with Relay's currently configured compression algorithm.

string
_pack(mixed $value)

Returns the serialized and compressed value.

string
_digest(mixed $value)

Returns the XXH3 digest for a given value. This returns the same value Redis' DIGEST command would return.

mixed
_unpack(mixed $value)

Returns the unserialized and decompressed value.

string
_prefix(mixed $value)

Returns the value with the prefix.

string|null
getLastError()

Returns the last error message, if any.

bool
clearLastError()

Clears the last error that is set, if any.

string|false
endpointId()

Returns the connection's endpoint identifier.

string|false
getPersistentID()

No description

string|false
socketId()

Returns a unique representation of the underlying socket connection identifier.

static array
stats()

Returns statistics about Relay.

static int
maxMemory()

Returns the number of bytes allocated, or 0 in client-only mode.

static int
memory() deprecated

Returns the number of bytes allocated, or 0 in client-only mode.

mixed
rawCommand(string $cmd, mixed ...$args)

Execute any command against Redis, without applying the prefix, compression and serialization.

Relay|bool|string
select(int $db)

Select the Redis logical database having the specified zero-based numeric index.

bool
auth(mixed $auth)

Authenticate the connection using a password or an ACL username and password.

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.

Relay|bool
flushdb(bool|null $sync = null)

Deletes all the keys of the currently selected database.

Relay|bool
flushall(bool|null $sync = null)

Deletes all the keys of all the existing databases, not just the currently selected one.

mixed
fcall(string $name, array $keys = [], array $argv = [], callable|null $handler = null)

Invokes a Redis function.

mixed
fcall_ro(string $name, array $keys = [], array $argv = [], callable|null $handler = null)

Invokes a read-only Redis function.

mixed
function(string $op, string ...$args)

Calls FUNCTION sub-command.

static bool
flushMemory(string|null $endpointId = null, int|null $db = null)

Flushes Relay's in-memory cache of all databases.

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.

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.

Relay|bool
ftAliasAdd(mixed $index, string $alias)

Add an alias to an index.

Relay|bool
ftAliasDel(string $alias)

Remove an alias from an index.

Relay|bool
ftAliasUpdate(mixed $index, string $alias)

Add an alias to an index.

Relay|bool
ftAlter(mixed $index, array $schema, bool $skipinitialscan = false)

Add a new attribute to the index.

Relay|array|bool
ftConfig(string $operation, string $option, mixed $value = null)

Container command for get/set RediSearch configuration parameter.

Relay|bool
ftCreate(mixed $index, array $schema, array|null $options = null)

Create an index with the given specification.

Relay|array|bool
ftCursor(string $operation, mixed $index, mixed $cursor, array|null $options = null)

Container command for del/read existing cursor.

Relay|int|false
ftDictAdd(mixed $dict, mixed $term, mixed ...$other_terms)

Add terms to a dictionary.

Relay|int|false
ftDictDel(mixed $dict, mixed $term, mixed ...$other_terms)

Delete terms from a dictionary.

Relay|array|false
ftDictDump(mixed $dict)

Dump all terms in the given dictionary.

Relay|bool
ftDropIndex(mixed $index, bool $dd = false)

Delete an index.

Relay|string|false
ftExplain(mixed $index, string $query, int $dialect = 0)

Return the execution plan for a complex query.

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.

Relay|array|false
ftInfo(mixed $index)

Returns information and statistics about a given index.

Relay|array|false
ftProfile(mixed $index, string $command, string $query, bool $limited = false)

Apply FT.SEARCH or FT.AGGREGATE command to collect performance details.

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.

Relay|array|false
ftSpellCheck(mixed $index, string $query, array|null $options = null)

Perform spelling correction on a query, returning suggestions for misspelled terms.

Relay|array|false
ftSynDump(mixed $index)

Dump the contents of a synonym group.

Relay|bool
ftSynUpdate(mixed $index, string $synonym, mixed $term_or_terms, bool $skipinitialscan = false)

Update a synonym group.

Relay|array|false
ftTagVals(mixed $index, string $tag)

Return a distinct set of values indexed in a Tag field.

Relay|int|false
dbsize()

Returns the number of keys in the currently-selected database.

Relay|string|null|false
digest(mixed $key)

Returns the XX3 hash of a string key's value.

Relay|string|null|false
dump(mixed $key)

Serialize and return the value stored at key in a Redis-specific format.

Relay|bool
replicaof(string|null $host = null, int $port = 0)

Attach or detach the instance as a replica of another instance.

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.

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.

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.

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.

Relay|bool|string
echo(string $arg)

Asks Redis to echo back the provided string.

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.

Relay|int|false
idleTime()

Returns the number of milliseoconds since Relay has seen activity from the server.

Relay|string|null|bool
randomkey()

Returns a random key from Redis.

Relay|array|false
time()

Returns the current time from Redis.

Relay|bool
bgrewriteaof()

Asynchronously rewrite the append-only file.

Relay|int|false
lastsave()

Returns the UNIX time stamp of the last successful save to disk.

mixed
lcs(mixed $key1, mixed $key2, array|null $options = null)

Get the longest common subsequence between two string keys.

Relay|bool
bgsave(null|string $arg = null)

Asynchronously save the dataset to disk.

Relay|bool
save()

Synchronously save the dataset to disk.

Relay|array|false
role()

Returns the role of the instance in the context of replication.

Relay|int|false
ttl(mixed $key)

Returns the remaining time to live of a key that has a timeout in seconds.

Relay|int|false
pttl(mixed $key)

Returns the remaining time to live of a key that has a timeout in milliseconds.

Relay|bool|int
exists(mixed ...$keys)

Returns if key(s) exists.

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

Evaluate script using the Lua interpreter.

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.

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

Evaluates a script cached on the server-side by its SHA1 digest.

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.

mixed
client(string $operation, mixed ...$args)

Executes CLIENT command operations.

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.

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.

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

Retrieve one or more GeoHash encoded strings for members of the set.

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.

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.

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.

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.

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.

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.

mixed
get(mixed $key)

Get the value of key.

Relay|array|false
getWithMeta(mixed $key)

Get the value and metadata of key.

mixed
getset(mixed $key, mixed $value)

Atomically sets key to value and returns the old value stored at key.

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

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.

Relay|int|false
getbit(mixed $key, int $pos)

Returns the bit value at offset in the string value stored at key.

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.

Relay|array|false
bitfield(mixed $key, mixed ...$args)

Perform various bitfield operations on a string key, such as getting/setting bit ranges, incrementing, etc.

Relay|array|bool
config(string $operation, mixed $key = null, string|null $value = null)

This is a container command for runtime configuration commands.

Relay|array|int|false
command(mixed ...$args)

Return an array with details about every Redis command.

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.

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.

Relay|int|false
setbit(mixed $key, int $pos, int $val)

Sets or clears the bit at offset in the string value stored at key.

mixed
acl(string $cmd, string ...$args)

Interact with ACLs.

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.

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.

mixed
getex(mixed $key, array|null $options = null)

Get the value of key and optionally set its expiration.

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

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.

Relay|int|false
pfadd(string $key, array $elements)

Adds the specified elements to the specified HyperLogLog.

Relay|int|false
pfcount(string|array $key_or_keys)

Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).

Relay|bool
pfmerge(string $dst, array $srckeys)

Merge given HyperLogLogs into a single one.

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.

Relay|int|false
publish(string $channel, string $message)

Posts a message to the given channel.

mixed
pubsub(string $operation, mixed ...$args)

A container command for Pub/Sub introspection commands.

Relay|int|false
spublish(string $channel, string $message)

Posts a message to the given shard channel.

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.

Relay|array|false
mget(array $keys)

Returns the values of all specified keys.

Relay|int|false
move(mixed $key, int $db)

Move key from the currently selected database to the specified destination database.

Relay|bool
mset(array $kvals)

Sets the given keys to their respective values.

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.

Relay|bool
msetnx(array $kvals)

Sets the given keys to their respective values.

Relay|bool
rename(mixed $key, mixed $newkey)

Renames key.

Relay|bool
renamenx(mixed $key, mixed $newkey)

Renames key if the new key does not yet exist.

Relay|int|bool
del(mixed ...$keys)

Removes the specified keys.

Relay|int|false
delex(mixed $key, array|null $options = null)

Removes the key if it matches or does not match a value or hash.

Relay|int|false
delifeq(mixed $key, mixed $value)

Remove a key if it equals the provided value.

Relay|int|false
unlink(mixed ...$keys)

Removes the specified keys without blocking Redis.

Relay|bool
expire(mixed $key, int $seconds, string|null $mode = null)

Set a timeout on key.

Relay|bool
pexpire(mixed $key, int $milliseconds)

Set a key's time to live in milliseconds.

Relay|bool
expireat(mixed $key, int $timestamp)

Set a timeout on key using a unix timestamp.

Relay|int|false
expiretime(mixed $key)

Returns the absolute Unix timestamp in seconds at which the given key will expire.

Relay|bool
pexpireat(mixed $key, int $timestamp_ms)

Set the expiration for a key as a UNIX timestamp specified in milliseconds.

Relay|int|false
pexpiretime(mixed $key)

Semantic the same as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds.

Relay|bool
persist(mixed $key)

Remove the existing timeout on key, turning the key from volatile to persistent.

Relay|int|string|bool
type(mixed $key)

Returns the type of a given key.

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.

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.

Relay|array|false
lrange(mixed $key, int $start, int $stop)

Returns the specified elements of the list stored at key.

Relay|int|false
lpush(mixed $key, mixed $mem, mixed ...$mems)

Insert all the specified values at the head of the list stored at key.

Relay|int|false
rpush(mixed $key, mixed $mem, mixed ...$mems)

Insert all the specified values at the tail of the list stored at key.

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.

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.

Relay|bool
lset(mixed $key, int $index, mixed $mem)

Sets the list element at index to element.

mixed
lpop(mixed $key, int $count = 1)

Removes and returns the first elements of the list stored at key.

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.

mixed
rpop(mixed $key, int $count = 1)

Removes and returns the last elements of the list stored at key.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

mixed
object(string $op, mixed $key)

This is a container command for object introspection commands.

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.

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.

mixed
lindex(mixed $key, int $index)

Returns the element at index index in the list stored at key.

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.

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.

mixed
hget(mixed $hash, mixed $member)

Returns the value associated with field in the hash stored at key.

Relay|array|false
hgetex(mixed $hash, array $fields, mixed $expiry = null)

Returns one or more fields while also setting an expiration on them.

Relay|array|false
hgetWithMeta(mixed $hash, mixed $member)

Returns the value associated with field in the hash stored at key.

Relay|int|false
hstrlen(mixed $hash, mixed $member)

Returns the string length of the value associated with field in the hash stored at key.

Relay|array|false
hgetall(mixed $hash)

Returns all fields and values of the hash stored at key.

Relay|array|false
hkeys(mixed $hash)

Returns all field names in the hash stored at key.

Relay|array|false
hvals(mixed $hash)

Returns all values in the hash stored at key.

Relay|array|false
hmget(mixed $hash, array $members)

Returns the values associated with the specified fields in the hash stored at key.

Relay|array|false
hgetdel(mixed $key, array $fields)

Gets and deletes one or more hash fields.

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.

Relay|bool
hmset(mixed $hash, array $members)

Sets the specified fields to their respective values in the hash stored at key.

Relay|bool
hexists(mixed $hash, mixed $member)

Returns if field is an existing field in the hash stored at key.

Relay|array|false
hexpire(mixed $hash, int $ttl, array $fields, string|null $mode = null)

Se an expiration for one or more hash fields.

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.

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.

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.

Relay|array|false
httl(mixed $hash, array $fields)

Get the expire time in seconds for one or more hash fields.

Relay|array|false
hpttl(mixed $hash, array $fields)

Get the expire time in milliseconds for one or more hash fields.

Relay|array|false
hexpiretime(mixed $hash, array $fields)

Get the unix timestamp expiration time for one or more hash fields.

Relay|array|false
hpexpiretime(mixed $hash, array $fields)

Get the millisecond precision unix timestamp expiration time for one or more hash fields.

Relay|array|false
hpersist(mixed $hash, array $fields)

Persist one or more hash fields.

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.

Relay|int|false
hset(mixed $key, mixed ...$keys_and_vals)

Sets field in the hash stored at key to value.

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.

Relay|int|false
hdel(mixed $key, mixed $mem, string ...$mems)

Removes the specified fields from the hash stored at key.

Relay|int|false
hincrby(mixed $key, mixed $mem, int $value)

Increments the number stored at field in the hash stored at key by increment.

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.

Relay|int|false
incr(mixed $key, int $by = 1)

Increments the number stored at key by one.

Relay|int|false
decr(mixed $key, int $by = 1)

Decrements the number stored at key by one.

Relay|int|false
incrby(mixed $key, int $value)

Increments the number stored at key by increment.

Relay|int|false
decrby(mixed $key, int $value)

Decrements the number stored at key by decrement.

Relay|float|false
incrbyfloat(mixed $key, float $value)

Increment the string representing a floating point number stored at key by the specified increment.

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.

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.

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

Relay|array|false
jsonArrLen(mixed $key, string|null $path = null)

Report the length of the JSON array at path in key.

Relay|array|false
jsonArrPop(mixed $key, string|null $path = null, int $index = -1)

Remove and return an element from the index in the array.

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.

Relay|int|false
jsonClear(mixed $key, string|null $path = null)

Clear container values (arrays/objects) and set numeric values to 0.

Relay|int|false
jsonDebug(string $command, mixed $key, string|null $path = null)

Container command for JSON debugging related tasks.

Relay|int|false
jsonDel(mixed $key, string|null $path = null)

Delete a value.

Relay|int|false
jsonForget(mixed $key, string|null $path = null)

No description

mixed
jsonGet(mixed $key, array $options = [], string ...$paths)

Return the value at path in JSON serialized form.

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.

Relay|array|false
jsonMget(mixed $key_or_array, string $path)

Return the values at path from multiple key arguments.

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.

Relay|array|false
jsonNumIncrBy(mixed $key, string $path, int $value)

Increment the number value stored at path by number.

Relay|array|false
jsonNumMultBy(mixed $key, string $path, int $value)

Multiply the number value stored at path by number.

Relay|array|false
jsonObjKeys(mixed $key, string|null $path = null)

Return the keys in the object that's referenced by path.

Relay|array|false
jsonObjLen(mixed $key, string|null $path = null)

Report the number of keys in the JSON object at path in key.

Relay|array|string|int|false
jsonResp(mixed $key, string|null $path = null)

Return the JSON in key in RESP specification form.

Relay|bool
jsonSet(mixed $key, string $path, mixed $value, string|null $condition = null)

Set the JSON value at path in key.

Relay|array|false
jsonStrAppend(mixed $key, mixed $value, string|null $path = null)

Append the json-string values to the string at path.

Relay|array|false
jsonStrLen(mixed $key, string|null $path = null)

Report the length of the JSON String at path in key.

Relay|array|false
jsonToggle(mixed $key, string $path)

Toggle a Boolean value stored at path.

Relay|array|false
jsonType(mixed $key, string|null $path = null)

Report the type of JSON value at path.

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.

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.

Relay|array|false
sinter(mixed $key, mixed ...$other_keys)

Returns the members of the set resulting from the intersection of all the given sets.

Relay|int|false
sintercard(array $keys, int $limit = -1)

Intersect multiple sets and return the cardinality of the result.

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.

Relay|array|false
sunion(mixed $key, mixed ...$other_keys)

Returns the members of the set resulting from the union of all the given sets.

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.

bool
subscribe(array $channels, callable $callback)

Subscribes to the specified channels.

bool
unsubscribe(array $channels = [])

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

bool
psubscribe(array $patterns, callable $callback)

Subscribes to the given patterns.

bool
punsubscribe(array $patterns = [])

Unsubscribes from the given patterns, or from all of them if none is given.

bool
ssubscribe(array $channels, callable $callback)

Subscribes to the specified shard channels.

bool
sunsubscribe(array $channels = [])

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

Relay|int|false
touch(array|string $key_or_array, mixed ...$more_keys)

Alters the last access time of a key(s).

Relay|bool
pipeline()

A pipeline block is simply transmitted faster to the server (like MULTI), but without any guarantee of atomicity.

Relay|bool
multi(int $mode = 0)

Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC.

Relay|array|bool
exec()

Executes all previously queued commands in a transaction and restores the connection state to normal.

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.

Relay|bool|string
watch(mixed $key, mixed ...$other_keys)

Marks the given keys to be watched for conditional execution of a transaction.

Relay|bool
unwatch()

Flushes all the previously watched keys for a transaction.

bool
discard()

Flushes all previously queued commands in a transaction and restores the connection state to normal.

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.

int
getMode(bool $masked = false)

Get the mode Relay is currently in.

void
clearBytes()

Clear the accumulated sent and received bytes.

array|false
scan(mixed $iterator, mixed $match = null, int $count = 0, string|null $type = null)

Scan the keyspace for matching keys.

array|false
hscan(mixed $key, mixed $iterator, mixed $match = null, int $count = 0)

Iterates fields of Hash types and their associated values.

array|false
sscan(mixed $key, mixed $iterator, mixed $match = null, int $count = 0)

Iterates elements of Sets types.

array|false
zscan(mixed $key, mixed $iterator, mixed $match = null, int $count = 0)

Iterates elements of Sorted Set types and their associated scores.

Relay|array|false
keys(mixed $pattern)

Returns all keys matching pattern.

Relay|array|int|bool
commandlog(string $subcmd, mixed ...$args)

Interact with Valkey's COMMANDLOG command.

Relay|array|int|bool
slowlog(string $operation, string ...$extra_args)

Interact with the Redis slowlog.

Relay|array|false
smembers(mixed $set)

Returns all the members of the set value stored at $key.

Relay|bool
sismember(mixed $set, mixed $member)

Returns if $member is a member of the set stored at $key.

Relay|array|false
smismember(mixed $set, mixed ...$members)

Returns whether each member is a member of the set stored at $key.

Relay|int|false
srem(mixed $set, mixed $member, mixed ...$members)

Remove the specified members from the set stored at $key.

Relay|int|false
sadd(mixed $set, mixed $member, mixed ...$members)

Add the specified members to the set stored at $key.

Relay|array|int|false
sort(mixed $key, array $options = [])

Sort the elements in a list, set or sorted set.

Relay|array|false
sort_ro(mixed $key, array $options = [])

Sort the elements in a list, set or sorted set. Read-only variant of SORT.

Relay|bool
smove(mixed $srcset, mixed $dstset, mixed $member)

Move member from the set at source to the set at destination.

mixed
spop(mixed $set, int $count = 1)

Removes and returns one or more random members from the set value store at $key.

mixed
srandmember(mixed $set, int $count = 1)

Returns one or multiple random members from a set.

Relay|int|false
scard(mixed $key)

Returns the set cardinality (number of elements) of the set stored at $key.

mixed
script(string $command, string ...$args)

Execute a script management command.

Relay|int|false
strlen(mixed $key)

Returns the length of the string value stored at $key.

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.

Relay|int|false
hlen(mixed $key)

Returns the number of fields contained in the hash stored at $key.

Relay|int|false
llen(mixed $key)

Returns the length of the list stored at $key.

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

Add an element to a vector set.

Relay|int|false
vcard(mixed $key)

Return the cardinality (number of elements) in a vector set.

Relay|int|false
vdim(mixed $key)

Return the dimensionality of vectors in a vector set.

Relay|array|false
vemb(mixed $key, mixed $element, bool $raw = false)

Get the embedding for a given vector set member.

Relay|array|string|false
vgetattr(mixed $key, mixed $element, bool $raw = false)

Get any attributes for a given vector set member.

Relay|array|false
vinfo(mixed $key)

Return metadata about a vector set.

Relay|bool
vismember(mixed $key, mixed $element)

Returns whether or not the element is a member of a vectorset.

Relay|array|false
vlinks(mixed $key, mixed $element, bool $withscores)

Get neighbors for a given vector element optionally withscores.

Relay|array|string|false
vrandmember(mixed $key, int $count = 0)

Get one or more random members from a vector set.

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

Get a lexicographical range of elements from a vector set.

Relay|int|false
vrem(mixed $key, mixed $element)

Remove an element from a vector set.

Relay|int|false
vsetattr(mixed $key, mixed $element, array|string $attributes)

Set attributes for a given vector set member.

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.

Relay|int|false
xack(mixed $key, string $group, array $ids)

Acknowledge one or more IDs as having been processed by the consumer group.

Relay|array|false
xackdel(string $key, string $group, array $ids, string|null $mode = null)

Awknowledge and delete one or more IDs in a stream.

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.

Relay|array|bool
xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options)

Claim ownership of stream message(s).

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.

Relay|int|false
xlen(string $key)

Get the length of a stream.

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.

Relay|int|false
xdel(string $key, array $ids)

Remove one or more specific IDs from a stream.

Relay|array|false
xdelex(string $key, array $ids, string|null $mode = null)

Remove one or more IDs from a stream with optional mode argument.

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

Retrieve information about a stream key.

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.

Relay|array|false
xrange(mixed $key, string $start, string $end, int $count = -1)

Lists elements in a stream.

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.

Relay|array|bool|null
xread(array $streams, int $count = -1, int $block = -1)

Read messages from a stream.

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.

Relay|int|false
xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1)

Truncate a STREAM key in various ways.

mixed
zadd(mixed $key, mixed ...$args)

Adds all the specified members with the specified scores to the sorted set stored at key.

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.

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.

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.

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

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

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

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.

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.

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.

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.

Relay|int|false
zrem(mixed $key, mixed ...$args)

Removes the specified members from the sorted set stored at key.

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.

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.

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

Relay|int|false
zcard(mixed $key)

Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

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.

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.

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.

Relay|float|false
zincrby(mixed $key, float $score, mixed $mem)

Increments the score of member in the sorted set stored at key by increment.

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.

Relay|array|false
zmscore(mixed $key, mixed ...$mems)

Returns the scores associated with the specified members in the sorted set stored at key.

Relay|float|null|false
zscore(mixed $key, mixed $member)

Returns the score of member in the sorted set at key.

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.

Relay|int|false
zintercard(array $keys, int $limit = -1)

Intersect multiple sorted sets and return the cardinality of the result.

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.

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.

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.

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.

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.

Relay|bool
cmsInitByDim(mixed $key, int $width, int $depth)

Initialize a Redis CMS (Count-Min Sketch) by dimensions.

Relay|bool
cmsInitByProb(mixed $key, float $error, float $probability)

Initialize a Redis CMS (Count-Min Sketch) by desired probabilities.

Relay|array|false
cmsInfo(mixed $key)

Get information about a Count-Min Sketch key.

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.

Relay|bool
cmsMerge(mixed $dstkey, array $keys, array $weights = [])

Merge one or more Count-Min Sketch keys with optional weights.

Relay|array|false
cmsQuery(mixed $key, mixed ...$fields)

Query a Count-Min Sketch key.

mixed
_getKeys()

Returns keys cached in runtime memory.

bool
isTracked(string $key)

Returns whether a key is tracked in memory.

static array
license()

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.

Parameters

string|array|null $host
int $port
float $connect_timeout
float $command_timeout
array $context
int $database

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.

Parameters

string $host
int $port
float $timeout
string|null $persistent_id
int $retry_interval
float $read_timeout
array $context
int $database

Return Value

bool

See also

\Relay\self::__construct() for context options.

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.

Parameters

string $host
int $port
float $timeout
string|null $persistent_id
int $retry_interval
float $read_timeout
array $context
int $database

Return Value

bool

See also

\Relay\self::__construct() for context options.

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.

Return Value

bool

at line 759
bool pclose() deprecated

deprecated 0.12.1 Use `Relay::close()`

Closes the current connection

Return Value

bool

at line 768
bool listen(callable|null $callback)

Registers a new event listener.

Parameters

callable|null $callback

Return Value

bool

at line 777
bool onFlushed(callable|null $callback)

Registers a new flushed event listener.

Parameters

callable|null $callback

Return Value

bool

at line 787
bool onInvalidated(callable|null $callback, string|null $pattern = null)

Registers a new invalidated event listener.

Parameters

callable|null $callback
string|null $pattern

Return Value

bool

at line 795
int|false dispatchEvents()

Dispatches all pending events.

Return Value

int|false

at line 804
mixed getOption(int $option)

Returns a client option.

Parameters

int $option

Return Value

mixed

at line 814
mixed option(int $option, mixed $value = null)

Returns or sets a client option.

Parameters

int $option
mixed $value

Return Value

mixed

at line 846
bool setOption(int $option, mixed $value)

Sets a client option.

Relay specific options:

  • OPT_ALLOW_PATTERNS
  • OPT_IGNORE_PATTERNS
  • OPT_THROW_ON_ERROR
  • OPT_CLIENT_INVALIDATIONS
  • OPT_PHPREDIS_COMPATIBILITY

Supported PhpRedis options:

  • OPT_PREFIX
  • OPT_READ_TIMEOUT
  • OPT_COMPRESSION
  • OPT_COMPRESSION_LEVEL
  • OPT_MAX_RETRIES
  • OPT_BACKOFF_ALGORITHM
  • OPT_BACKOFF_BASE
  • OPT_BACKOFF_CAP
  • OPT_SCAN
  • OPT_REPLY_LITERAL
  • OPT_NULL_MULTIBULK_AS_NULL

Parameters

int $option
mixed $value

Return Value

bool

at line 855
int addIgnorePatterns(string ...$pattern)

Adds ignore pattern(s). Matching keys will not be cached in memory.

Parameters

string ...$pattern ,...

Return Value

int

at line 864
int addAllowPatterns(string ...$pattern)

Adds allow pattern(s). Only matching keys will be cached in memory.

Parameters

string ...$pattern ,...

Return Value

int

at line 872
float|false getTimeout()

Returns the connection timeout.

Return Value

float|false

at line 880
float|false timeout()

No description

Return Value

float|false

at line 888
float|false getReadTimeout()

Returns the read timeout.

Return Value

float|false

at line 896
float|false readTimeout()

No description

Return Value

float|false

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.

Return Value

array

at line 913
array bytes()

No description

Return Value

array

at line 921
string|false getHost()

Returns the host or unix socket.

Return Value

string|false

at line 929
bool isConnected()

Whether Relay is connected to Redis.

Return Value

bool

at line 937
int|false getPort()

Returns the port.

Return Value

int|false

at line 946
mixed getAuth()

Returns the authentication information.

In PhpRedis compatibility mode this method returns any configured password in plain-text.

Return Value

mixed

at line 954
mixed getDbNum()

Returns the currently selected database.

Return Value

mixed

at line 963
mixed _serialize(mixed $value)

Returns the serialized value.

Parameters

mixed $value

Return Value

mixed

at line 972
mixed _unserialize(mixed $value)

Returns the unserialized value.

Parameters

mixed $value

Return Value

mixed

at line 981
string _compress(string $value)

Compress data with Relay's currently configured compression algorithm.

Parameters

string $value

Return Value

string

at line 990
string _uncompress(string $value)

Uncompress data with Relay's currently configured compression algorithm.

Parameters

string $value

Return Value

string

at line 999
string _pack(mixed $value)

Returns the serialized and compressed value.

Parameters

mixed $value

Return Value

string

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.

Parameters

mixed $value

Return Value

string

at line 1018
mixed _unpack(mixed $value)

Returns the unserialized and decompressed value.

Parameters

mixed $value

Return Value

mixed

at line 1027
string _prefix(mixed $value)

Returns the value with the prefix.

Parameters

mixed $value

Return Value

string

at line 1035
string|null getLastError()

Returns the last error message, if any.

Return Value

string|null

at line 1043
bool clearLastError()

Clears the last error that is set, if any.

Return Value

bool

at line 1051
string|false endpointId()

Returns the connection's endpoint identifier.

Return Value

string|false

at line 1059
string|false getPersistentID()

No description

Return Value

string|false

at line 1066
string|false socketId()

Returns a unique representation of the underlying socket connection identifier.

Return Value

string|false

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 a null response 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

Return Value

array

at line 1111
static int maxMemory()

Returns the number of bytes allocated, or 0 in client-only mode.

Return Value

int

at line 1121
static int memory() deprecated

deprecated 0.5.0 Use `Relay:maxMemory()`

Returns the number of bytes allocated, or 0 in client-only mode.

Return Value

int

at line 1132
mixed rawCommand(string $cmd, mixed ...$args)

Execute any command against Redis, without applying the prefix, compression and serialization.

Parameters

string $cmd
mixed ...$args ,...

Return Value

mixed

at line 1141
Relay|bool|string select(int $db)

Select the Redis logical database having the specified zero-based numeric index.

Parameters

int $db

Return Value

Relay|bool|string

at line 1150
bool auth(mixed $auth)

Authenticate the connection using a password or an ACL username and password.

Parameters

mixed $auth

Return Value

bool

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.

Parameters

string ...$sections ,...

Return Value

Relay|array|false

See also

https://redis.io/commands/info

at line 1171
Relay|bool flushdb(bool|null $sync = null)

Deletes all the keys of the currently selected database.

Parameters

bool|null $sync

Return Value

Relay|bool

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.

Parameters

bool|null $sync

Return Value

Relay|bool

at line 1192
mixed fcall(string $name, array $keys = [], array $argv = [], callable|null $handler = null)

Invokes a Redis function.

Parameters

string $name
array $keys
array $argv
callable|null $handler

Return Value

mixed

at line 1204
mixed fcall_ro(string $name, array $keys = [], array $argv = [], callable|null $handler = null)

Invokes a read-only Redis function.

Parameters

string $name
array $keys
array $argv
callable|null $handler

Return Value

mixed

at line 1214
mixed function(string $op, string ...$args)

Calls FUNCTION sub-command.

Parameters

string $op
string ...$args ,...

Return Value

mixed

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.

Parameters

string|null $endpointId
int|null $db

Return Value

bool

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.

Parameters

string|null $endpointId
int|null $db

Return Value

float|false

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.

Parameters

mixed $index
string $query
array|null $options

Return Value

Relay|array|false

at line 1264
Relay|bool ftAliasAdd(mixed $index, string $alias)

Add an alias to an index.

Parameters

mixed $index
string $alias

Return Value

Relay|bool

at line 1273
Relay|bool ftAliasDel(string $alias)

Remove an alias from an index.

Parameters

string $alias

Return Value

Relay|bool

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.

Parameters

mixed $index
string $alias

Return Value

Relay|bool

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.

Parameters

mixed $index
array $schema
bool $skipinitialscan

Return Value

Relay|bool

at line 1309
Relay|array|bool ftConfig(string $operation, string $option, mixed $value = null)

Container command for get/set RediSearch configuration parameter.

Parameters

string $operation
string $option
mixed $value

Return Value

Relay|array|bool

at line 1320
Relay|bool ftCreate(mixed $index, array $schema, array|null $options = null)

Create an index with the given specification.

Parameters

mixed $index
array $schema
array|null $options

Return Value

Relay|bool

at line 1332
Relay|array|bool ftCursor(string $operation, mixed $index, mixed $cursor, array|null $options = null)

Container command for del/read existing cursor.

Parameters

string $operation
mixed $index
mixed $cursor
array|null $options

Return Value

Relay|array|bool

at line 1343
Relay|int|false ftDictAdd(mixed $dict, mixed $term, mixed ...$other_terms)

Add terms to a dictionary.

Parameters

mixed $dict
mixed $term
mixed ...$other_terms ,...

Return Value

Relay|int|false

at line 1354
Relay|int|false ftDictDel(mixed $dict, mixed $term, mixed ...$other_terms)

Delete terms from a dictionary.

Parameters

mixed $dict
mixed $term
mixed ...$other_terms ,...

Return Value

Relay|int|false

at line 1363
Relay|array|false ftDictDump(mixed $dict)

Dump all terms in the given dictionary.

Parameters

mixed $dict

Return Value

Relay|array|false

at line 1373
Relay|bool ftDropIndex(mixed $index, bool $dd = false)

Delete an index.

Parameters

mixed $index
bool $dd

Return Value

Relay|bool

at line 1384
Relay|string|false ftExplain(mixed $index, string $query, int $dialect = 0)

Return the execution plan for a complex query.

Parameters

mixed $index
string $query
int $dialect

Return Value

Relay|string|false

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.

Parameters

mixed $index
string $query
int $dialect

Return Value

Relay|array|false

at line 1404
Relay|array|false ftInfo(mixed $index)

Returns information and statistics about a given index.

Parameters

mixed $index

Return Value

Relay|array|false

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.

Parameters

mixed $index
string $command
string $query
bool $limited

Return Value

Relay|array|false

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.

Parameters

mixed $index
string $query
array|null $options

Return Value

Relay|array|false

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.

Parameters

mixed $index
string $query
array|null $options

Return Value

Relay|array|false

at line 1447
Relay|array|false ftSynDump(mixed $index)

Dump the contents of a synonym group.

Parameters

mixed $index

Return Value

Relay|array|false

at line 1459
Relay|bool ftSynUpdate(mixed $index, string $synonym, mixed $term_or_terms, bool $skipinitialscan = false)

Update a synonym group.

Parameters

mixed $index
string $synonym
mixed $term_or_terms
bool $skipinitialscan

Return Value

Relay|bool

at line 1469
Relay|array|false ftTagVals(mixed $index, string $tag)

Return a distinct set of values indexed in a Tag field.

Parameters

mixed $index
string $tag

Return Value

Relay|array|false

at line 1477
Relay|int|false dbsize()

Returns the number of keys in the currently-selected database.

Return Value

Relay|int|false

at line 1486
Relay|string|null|false digest(mixed $key)

Returns the XX3 hash of a string key's value.

Parameters

mixed $key

Return Value

Relay|string|null|false

at line 1495
Relay|string|null|false dump(mixed $key)

Serialize and return the value stored at key in a Redis-specific format.

Parameters

mixed $key

Return Value

Relay|string|null|false

at line 1505
Relay|bool replicaof(string|null $host = null, int $port = 0)

Attach or detach the instance as a replica of another instance.

Parameters

string|null $host
int $port

Return Value

Relay|bool

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.

Parameters

int $numlocal
int $numremote
int $timeout

Return Value

Relay|array|false

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.

Parameters

mixed $key
int $ttl
string $value
array|null $options

Return Value

Relay|bool

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.

Parameters

string $host
int $port
string|array $key
int $dstdb
int $timeout
bool $copy
bool $replace
mixed $credentials

Return Value

Relay|bool

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.

Parameters

mixed $src
mixed $dst
array|null $options

Return Value

Relay|bool

at line 1572
Relay|bool|string echo(string $arg)

Asks Redis to echo back the provided string.

Parameters

string $arg

Return Value

Relay|bool|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.

Parameters

string|null $arg

Return Value

Relay|bool|string

at line 1589
Relay|int|false idleTime()

Returns the number of milliseoconds since Relay has seen activity from the server.

Return Value

Relay|int|false

at line 1597
Relay|string|null|bool randomkey()

Returns a random key from Redis.

Return Value

Relay|string|null|bool

at line 1605
Relay|array|false time()

Returns the current time from Redis.

Return Value

Relay|array|false

at line 1613
Relay|bool bgrewriteaof()

Asynchronously rewrite the append-only file.

Return Value

Relay|bool

at line 1621
Relay|int|false lastsave()

Returns the UNIX time stamp of the last successful save to disk.

Return Value

Relay|int|false

at line 1632
mixed lcs(mixed $key1, mixed $key2, array|null $options = null)

Get the longest common subsequence between two string keys.

Parameters

mixed $key1
mixed $key2
array|null $options

Return Value

mixed

at line 1641
Relay|bool bgsave(null|string $arg = null)

Asynchronously save the dataset to disk.

Parameters

null|string $arg

Return Value

Relay|bool

at line 1649
Relay|bool save()

Synchronously save the dataset to disk.

Return Value

Relay|bool

at line 1657
Relay|array|false role()

Returns the role of the instance in the context of replication.

Return Value

Relay|array|false

at line 1666
Relay|int|false ttl(mixed $key)

Returns the remaining time to live of a key that has a timeout in seconds.

Parameters

mixed $key

Return Value

Relay|int|false

at line 1675
Relay|int|false pttl(mixed $key)

Returns the remaining time to live of a key that has a timeout in milliseconds.

Parameters

mixed $key

Return Value

Relay|int|false

at line 1684
Relay|bool|int exists(mixed ...$keys)

Returns if key(s) exists.

Parameters

mixed ...$keys ,...

Return Value

Relay|bool|int

at line 1697
mixed eval(mixed $script, array $args = [], int $num_keys = 0)

Evaluate script using the Lua interpreter.

Parameters

mixed $script
array $args
int $num_keys

Return Value

mixed

See also

https://redis.io/commands/eval

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.

Parameters

mixed $script
array $args
int $num_keys

Return Value

mixed

See also

https://redis.io/commands/eval_ro

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.

Parameters

string $sha
array $args
int $num_keys

Return Value

mixed

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.

Parameters

string $sha
array $args
int $num_keys

Return Value

mixed

at line 1745
mixed client(string $operation, mixed ...$args)

Executes CLIENT command operations.

Parameters

string $operation
mixed ...$args ,...

Return Value

mixed

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.

Parameters

string $key
float $lng
float $lat
string $member
mixed ...$other_triples_and_options ,...

Return Value

Relay|int|false

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.

Parameters

string $key
string $src
string $dst
string|null $unit

Return Value

Relay|float|null|false

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.

Parameters

string $key
string $member
string ...$other_members ,...

Return Value

Relay|array|false

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.

Parameters

string $key
float $lng
float $lat
float $radius
string $unit
array $options

Return Value

mixed

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.

Parameters

string $key
string $member
float $radius
string $unit
array $options

Return Value

mixed

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.

Parameters

string $key
string $member
float $radius
string $unit
array $options

Return Value

mixed

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.

Parameters

string $key
float $lng
float $lat
float $radius
string $unit
array $options

Return Value

mixed

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.

Parameters

string $key
array|string $position
array|int|float $shape
string $unit
array $options

Return Value

Relay|array|false

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.

Parameters

string $dst
string $src
array|string $position
array|int|float $shape
string $unit
array $options

Return Value

Relay|int|false

at line 1891
mixed get(mixed $key)

Get the value of key.

Parameters

mixed $key

Return Value

mixed

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

Parameters

mixed $key

Return Value

Relay|array|false

at line 1915
mixed getset(mixed $key, mixed $value)

Atomically sets key to value and returns the old value stored at key.

Parameters

mixed $key
mixed $value

Return Value

mixed

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

Parameters

mixed $key
int $start
int $end

Return Value

mixed

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.

Parameters

mixed $key
int $start
mixed $value

Return Value

Relay|int|false

at line 1949
Relay|int|false getbit(mixed $key, int $pos)

Returns the bit value at offset in the string value stored at key.

Parameters

mixed $key
int $pos

Return Value

Relay|int|false

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.

Parameters

mixed $key
int $start
int $end
bool $by_bit

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed ...$args ,...

Return Value

Relay|array|false

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.

Parameters

string $operation
mixed $key
string|null $value

Return Value

Relay|array|bool

at line 1992
Relay|array|int|false command(mixed ...$args)

Return an array with details about every Redis command.

Parameters

mixed ...$args ,...

Return Value

Relay|array|int|false

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.

Parameters

string $operation
string $dstkey
string $srckey
string ...$other_keys ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
int $bit
int|null $start
int|null $end
bool $bybit

Return Value

Relay|int|false

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.

Parameters

mixed $key
int $pos
int $val

Return Value

Relay|int|false

at line 2038
mixed acl(string $cmd, string ...$args)

Interact with ACLs.

Parameters

string $cmd
string ...$args ,...

Return Value

mixed

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.

Parameters

mixed $key
mixed $value

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $value
mixed $options

Return Value

mixed

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.

Parameters

mixed $key
array|null $options

Return Value

mixed

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

Parameters

mixed $key

Return Value

mixed

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.

Parameters

mixed $key
int $seconds
mixed $value

Return Value

Relay|bool

at line 2106
Relay|int|false pfadd(string $key, array $elements)

Adds the specified elements to the specified HyperLogLog.

Parameters

string $key
array $elements

Return Value

Relay|int|false

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

Parameters

string|array $key_or_keys

Return Value

Relay|int|false

at line 2125
Relay|bool pfmerge(string $dst, array $srckeys)

Merge given HyperLogLogs into a single one.

Parameters

string $dst
array $srckeys

Return Value

Relay|bool

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.

Parameters

mixed $key
int $milliseconds
mixed $value

Return Value

Relay|bool

at line 2146
Relay|int|false publish(string $channel, string $message)

Posts a message to the given channel.

Parameters

string $channel
string $message

Return Value

Relay|int|false

at line 2156
mixed pubsub(string $operation, mixed ...$args)

A container command for Pub/Sub introspection commands.

Parameters

string $operation
mixed ...$args ,...

Return Value

mixed

at line 2166
Relay|int|false spublish(string $channel, string $message)

Posts a message to the given shard channel.

Parameters

string $channel
string $message

Return Value

Relay|int|false

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".

Parameters

mixed $key
mixed $value

Return Value

Relay|bool

at line 2187
Relay|array|false mget(array $keys)

Returns the values of all specified keys.

Parameters

array $keys

Return Value

Relay|array|false

at line 2197
Relay|int|false move(mixed $key, int $db)

Move key from the currently selected database to the specified destination database.

Parameters

mixed $key
int $db

Return Value

Relay|int|false

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.

Parameters

array $kvals

Return Value

Relay|bool

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.

Parameters

mixed $kvals
int|float|array|null $ttl

Return Value

Relay|int|false

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.

Parameters

array $kvals

Return Value

Relay|bool

at line 2238
Relay|bool rename(mixed $key, mixed $newkey)

Renames key.

Parameters

mixed $key
mixed $newkey

Return Value

Relay|bool

at line 2248
Relay|bool renamenx(mixed $key, mixed $newkey)

Renames key if the new key does not yet exist.

Parameters

mixed $key
mixed $newkey

Return Value

Relay|bool

at line 2257
Relay|int|bool del(mixed ...$keys)

Removes the specified keys.

Parameters

mixed ...$keys ,...

Return Value

Relay|int|bool

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.

Parameters

mixed $key
array|null $options

Return Value

Relay|int|false

at line 2277
Relay|int|false delifeq(mixed $key, mixed $value)

Remove a key if it equals the provided value.

Parameters

mixed $key
mixed $value

Return Value

Relay|int|false

Removes the specified keys without blocking Redis.

Parameters

mixed ...$keys ,...

Return Value

Relay|int|false

at line 2297
Relay|bool expire(mixed $key, int $seconds, string|null $mode = null)

Set a timeout on key.

Parameters

mixed $key
int $seconds
string|null $mode

Return Value

Relay|bool

at line 2307
Relay|bool pexpire(mixed $key, int $milliseconds)

Set a key's time to live in milliseconds.

Parameters

mixed $key
int $milliseconds

Return Value

Relay|bool

at line 2317
Relay|bool expireat(mixed $key, int $timestamp)

Set a timeout on key using a unix timestamp.

Parameters

mixed $key
int $timestamp

Return Value

Relay|bool

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.

Parameters

mixed $key

Return Value

Relay|int|false

at line 2338
Relay|bool pexpireat(mixed $key, int $timestamp_ms)

Set the expiration for a key as a UNIX timestamp specified in milliseconds.

Parameters

mixed $key
int $timestamp_ms

Return Value

Relay|bool

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.

Parameters

mixed $key

Return Value

Relay|int|false

at line 2357
Relay|bool persist(mixed $key)

Remove the existing timeout on key, turning the key from volatile to persistent.

Parameters

mixed $key

Return Value

Relay|bool

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_) constants. Otherwise it will return the string that Redis returns.

Parameters

mixed $key

Return Value

Relay|int|string|bool

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.

Parameters

mixed $srckey
mixed $dstkey
string $srcpos
string $dstpos

Return Value

mixed

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.

Parameters

mixed $srckey
mixed $dstkey
string $srcpos
string $dstpos
float $timeout

Return Value

mixed

at line 2410
Relay|array|false lrange(mixed $key, int $start, int $stop)

Returns the specified elements of the list stored at key.

Parameters

mixed $key
int $start
int $stop

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed $mem
mixed ...$mems ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $mem
mixed ...$mems ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $mem
mixed ...$mems ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $mem
mixed ...$mems ,...

Return Value

Relay|int|false

at line 2467
Relay|bool lset(mixed $key, int $index, mixed $mem)

Sets the list element at index to element.

Parameters

mixed $key
int $index
mixed $mem

Return Value

Relay|bool

at line 2477
mixed lpop(mixed $key, int $count = 1)

Removes and returns the first elements of the list stored at key.

Parameters

mixed $key
int $count

Return Value

mixed

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.

Parameters

mixed $key
mixed $value
array|null $options

Return Value

Relay|int|array|false|null

at line 2498
mixed rpop(mixed $key, int $count = 1)

Removes and returns the last elements of the list stored at key.

Parameters

mixed $key
int $count

Return Value

mixed

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.

Parameters

mixed $source
mixed $dest

Return Value

mixed

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.

Parameters

mixed $source
mixed $dest
float $timeout

Return Value

mixed

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.

Parameters

string|array $key
string|float $timeout_or_key
mixed ...$extra_args ,...

Return Value

Relay|array|null|false

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.

Parameters

float $timeout
array $keys
string $from
int $count

Return Value

Relay|array|null|false

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.

Parameters

float $timeout
array $keys
string $from
int $count

Return Value

Relay|array|null|false

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.

Parameters

array $keys
string $from
int $count

Return Value

Relay|array|null|false

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.

Parameters

array $keys
string $from
int $count

Return Value

Relay|array|null|false

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.

Parameters

string|array $key
string|float $timeout_or_key
mixed ...$extra_args ,...

Return Value

Relay|array|null|false

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.

Parameters

string|array $key
string|float $timeout_or_key
mixed ...$extra_args ,...

Return Value

Relay|array|null|false

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.

Parameters

string|array $key
string|float $timeout_or_key
mixed ...$extra_args ,...

Return Value

Relay|array|null|false

at line 2625
mixed object(string $op, mixed $key)

This is a container command for object introspection commands.

Parameters

string $op
mixed $key

Return Value

mixed

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.

Parameters

mixed $key
mixed ...$members ,...

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed $mem
int $count

Return Value

Relay|int|false

at line 2657
mixed lindex(mixed $key, int $index)

Returns the element at index index in the list stored at key.

Parameters

mixed $key
int $index

Return Value

mixed

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.

Parameters

mixed $key
string $op
mixed $pivot
mixed $element

Return Value

Relay|int|false

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.

Parameters

mixed $key
int $start
int $end

Return Value

Relay|bool

at line 2690
mixed hget(mixed $hash, mixed $member)

Returns the value associated with field in the hash stored at key.

Parameters

mixed $hash
mixed $member

Return Value

mixed

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.

Parameters

mixed $hash
array $fields
mixed $expiry

= null

Return Value

Relay|array|false

at line 2712
Relay|array|false hgetWithMeta(mixed $hash, mixed $member)

Returns the value associated with field in the hash stored at key.

Parameters

mixed $hash
mixed $member

Return Value

Relay|array|false

See also

\Relay\self::getWithMeta()

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.

Parameters

mixed $hash
mixed $member

Return Value

Relay|int|false

at line 2731
Relay|array|false hgetall(mixed $hash)

Returns all fields and values of the hash stored at key.

Parameters

mixed $hash

Return Value

Relay|array|false

at line 2740
Relay|array|false hkeys(mixed $hash)

Returns all field names in the hash stored at key.

Parameters

mixed $hash

Return Value

Relay|array|false

at line 2749
Relay|array|false hvals(mixed $hash)

Returns all values in the hash stored at key.

Parameters

mixed $hash

Return Value

Relay|array|false

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.

Parameters

mixed $hash
array $members

Return Value

Relay|array|false

at line 2769
Relay|array|false hgetdel(mixed $key, array $fields)

Gets and deletes one or more hash fields.

Parameters

mixed $key
array $fields

Return Value

Relay|array|false

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.

Parameters

mixed $hash
array|null $options

Return Value

Relay|array|string|null|false

at line 2789
Relay|bool hmset(mixed $hash, array $members)

Sets the specified fields to their respective values in the hash stored at key.

Parameters

mixed $hash
array $members

Return Value

Relay|bool

at line 2799
Relay|bool hexists(mixed $hash, mixed $member)

Returns if field is an existing field in the hash stored at key.

Parameters

mixed $hash
mixed $member

Return Value

Relay|bool

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.

Parameters

mixed $hash
int $ttl
array $fields
string|null $mode

Return Value

Relay|array|false

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.

Parameters

mixed $hash
int $ttl
array $fields
string|null $mode

Return Value

Relay|array|false

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.

Parameters

mixed $hash
int $ttl
array $fields
string|null $mode

Return Value

Relay|array|false

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.

Parameters

mixed $hash
int $ttl
array $fields
string|null $mode

Return Value

Relay|array|false

at line 2857
Relay|array|false httl(mixed $hash, array $fields)

Get the expire time in seconds for one or more hash fields.

Parameters

mixed $hash
array $fields

Return Value

Relay|array|false

at line 2867
Relay|array|false hpttl(mixed $hash, array $fields)

Get the expire time in milliseconds for one or more hash fields.

Parameters

mixed $hash
array $fields

Return Value

Relay|array|false

at line 2877
Relay|array|false hexpiretime(mixed $hash, array $fields)

Get the unix timestamp expiration time for one or more hash fields.

Parameters

mixed $hash
array $fields

Return Value

Relay|array|false

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.

Parameters

mixed $hash
array $fields

Return Value

Relay|array|false

at line 2898
Relay|array|false hpersist(mixed $hash, array $fields)

Persist one or more hash fields.

Parameters

mixed $hash
array $fields

Return Value

Relay|array|false

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.

Parameters

mixed $hash
mixed $member
mixed $value

Return Value

Relay|bool

at line 2918
Relay|int|false hset(mixed $key, mixed ...$keys_and_vals)

Sets field in the hash stored at key to value.

Parameters

mixed $key
mixed ...$keys_and_vals ...

Return Value

Relay|int|false

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.

Parameters

mixed $key
array $fields
null|int|float|array $expiry

= null

Return Value

Relay|int|false

at line 2940
Relay|int|false hdel(mixed $key, mixed $mem, string ...$mems)

Removes the specified fields from the hash stored at key.

Parameters

mixed $key
mixed $mem
string ...$mems ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $mem
int $value

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $mem
float $value

Return Value

Relay|float|bool

at line 2973
Relay|int|false incr(mixed $key, int $by = 1)

Increments the number stored at key by one.

Parameters

mixed $key
int $by

Return Value

Relay|int|false

at line 2983
Relay|int|false decr(mixed $key, int $by = 1)

Decrements the number stored at key by one.

Parameters

mixed $key
int $by

Return Value

Relay|int|false

at line 2993
Relay|int|false incrby(mixed $key, int $value)

Increments the number stored at key by increment.

Parameters

mixed $key
int $value

Return Value

Relay|int|false

at line 3003
Relay|int|false decrby(mixed $key, int $value)

Decrements the number stored at key by decrement.

Parameters

mixed $key
int $value

Return Value

Relay|int|false

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.

Parameters

mixed $key
float $value

Return Value

Relay|float|false

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.

Parameters

mixed $key
mixed $value_or_array
string|null $path

Return Value

Relay|array|false

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.

Parameters

mixed $key
string $path
mixed $value
int|null $start
int|null $stop

Return Value

Relay|array|false

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

Parameters

mixed $key
string $path
int $index
mixed $value
mixed ...$other_values ,...

Return Value

Relay|array|false

at line 3059
Relay|array|false jsonArrLen(mixed $key, string|null $path = null)

Report the length of the JSON array at path in key.

Parameters

mixed $key
string|null $path

Return Value

Relay|array|false

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.

Parameters

mixed $key
string|null $path
int $index

Return Value

Relay|array|false

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.

Parameters

mixed $key
string $path
int $start
int $stop

Return Value

Relay|array|false

at line 3092
Relay|int|false jsonClear(mixed $key, string|null $path = null)

Clear container values (arrays/objects) and set numeric values to 0.

Parameters

mixed $key
string|null $path

Return Value

Relay|int|false

at line 3103
Relay|int|false jsonDebug(string $command, mixed $key, string|null $path = null)

Container command for JSON debugging related tasks.

Parameters

string $command
mixed $key
string|null $path

Return Value

Relay|int|false

at line 3113
Relay|int|false jsonDel(mixed $key, string|null $path = null)

Delete a value.

Parameters

mixed $key
string|null $path

Return Value

Relay|int|false

at line 3119
Relay|int|false jsonForget(mixed $key, string|null $path = null)

No description

Parameters

mixed $key
string|null $path

Return Value

Relay|int|false

at line 3130
mixed jsonGet(mixed $key, array $options = [], string ...$paths)

Return the value at path in JSON serialized form.

Parameters

mixed $key
array $options
string ...$paths ,...

Return Value

mixed

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.

Parameters

mixed $key
string $path
mixed $value

Return Value

Relay|bool

at line 3152
Relay|array|false jsonMget(mixed $key_or_array, string $path)

Return the values at path from multiple key arguments.

Parameters

mixed $key_or_array
string $path

Return Value

Relay|array|false

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.

Parameters

mixed $key
string $path
mixed $value
mixed ...$other_triples

Return Value

Relay|bool

at line 3175
Relay|array|false jsonNumIncrBy(mixed $key, string $path, int $value)

Increment the number value stored at path by number.

Parameters

mixed $key
string $path
int $value

Return Value

Relay|array|false

at line 3186
Relay|array|false jsonNumMultBy(mixed $key, string $path, int $value)

Multiply the number value stored at path by number.

Parameters

mixed $key
string $path
int $value

Return Value

Relay|array|false

at line 3196
Relay|array|false jsonObjKeys(mixed $key, string|null $path = null)

Return the keys in the object that's referenced by path.

Parameters

mixed $key
string|null $path

Return Value

Relay|array|false

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.

Parameters

mixed $key
string|null $path

Return Value

Relay|array|false

at line 3216
Relay|array|string|int|false jsonResp(mixed $key, string|null $path = null)

Return the JSON in key in RESP specification form.

Parameters

mixed $key
string|null $path

Return Value

Relay|array|string|int|false

at line 3228
Relay|bool jsonSet(mixed $key, string $path, mixed $value, string|null $condition = null)

Set the JSON value at path in key.

Parameters

mixed $key
string $path
mixed $value
string|null $condition

Return Value

Relay|bool

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.

Parameters

mixed $key
mixed $value
string|null $path

Return Value

Relay|array|false

at line 3249
Relay|array|false jsonStrLen(mixed $key, string|null $path = null)

Report the length of the JSON String at path in key.

Parameters

mixed $key
string|null $path

Return Value

Relay|array|false

at line 3259
Relay|array|false jsonToggle(mixed $key, string $path)

Toggle a Boolean value stored at path.

Parameters

mixed $key
string $path

Return Value

Relay|array|false

at line 3269
Relay|array|false jsonType(mixed $key, string|null $path = null)

Report the type of JSON value at path.

Parameters

mixed $key
string|null $path

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed ...$other_keys ,...

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed ...$other_keys ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed ...$other_keys ,...

Return Value

Relay|array|false

at line 3311
Relay|int|false sintercard(array $keys, int $limit = -1)

Intersect multiple sets and return the cardinality of the result.

Parameters

array $keys
int $limit

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed ...$other_keys ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed ...$other_keys ,...

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed ...$other_keys ,...

Return Value

Relay|int|false

at line 3353
bool subscribe(array $channels, callable $callback)

Subscribes to the specified channels.

Parameters

array $channels
callable $callback

Return Value

bool

at line 3362
bool unsubscribe(array $channels = [])

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

Parameters

array $channels

Return Value

bool

at line 3372
bool psubscribe(array $patterns, callable $callback)

Subscribes to the given patterns.

Parameters

array $patterns
callable $callback

Return Value

bool

at line 3381
bool punsubscribe(array $patterns = [])

Unsubscribes from the given patterns, or from all of them if none is given.

Parameters

array $patterns

Return Value

bool

at line 3391
bool ssubscribe(array $channels, callable $callback)

Subscribes to the specified shard channels.

Parameters

array $channels
callable $callback

Return Value

bool

at line 3400
bool sunsubscribe(array $channels = [])

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

Parameters

array $channels

Return Value

bool

at line 3410
Relay|int|false touch(array|string $key_or_array, mixed ...$more_keys)

Alters the last access time of a key(s).

Parameters

array|string $key_or_array
mixed ...$more_keys ,...

Return Value

Relay|int|false

at line 3418
Relay|bool pipeline()

A pipeline block is simply transmitted faster to the server (like MULTI), but without any guarantee of atomicity.

Return Value

Relay|bool

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.

Parameters

int $mode

Return Value

Relay|bool

at line 3437
Relay|array|bool exec()

Executes all previously queued commands in a transaction and restores the connection state to normal.

Return Value

Relay|array|bool

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.

Parameters

int $replicas
int $timeout

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed ...$other_keys ,...

Return Value

Relay|bool|string

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.

Return Value

Relay|bool

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.

Return Value

bool

at line 3484
string|false serverName()

Get the server name as reported by the HELLO response.

Return Value

string|false

at line 3492
string|false serverVersion()

Get the server version as reported by the HELLO response.

Return Value

string|false

at line 3502
int getMode(bool $masked = false)

Get the mode Relay is currently in.

Relay::ATOMIC, Relay::PIPELINE or Relay::MULTI.

Parameters

bool $masked

Return Value

int

at line 3510
void clearBytes()

Clear the accumulated sent and received bytes.

Return Value

void

at line 3522
array|false scan(mixed $iterator, mixed $match = null, int $count = 0, string|null $type = null)

Scan the keyspace for matching keys.

Parameters

mixed $iterator
mixed $match
int $count
string|null $type

Return Value

array|false

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.

Parameters

mixed $key
mixed $iterator
mixed $match
int $count

Return Value

array|false

at line 3546
array|false sscan(mixed $key, mixed $iterator, mixed $match = null, int $count = 0)

Iterates elements of Sets types.

Parameters

mixed $key
mixed $iterator
mixed $match
int $count

Return Value

array|false

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.

Parameters

mixed $key
mixed $iterator
mixed $match
int $count

Return Value

array|false

at line 3567
Relay|array|false keys(mixed $pattern)

Returns all keys matching pattern.

Parameters

mixed $pattern

Return Value

Relay|array|false

at line 3577
Relay|array|int|bool commandlog(string $subcmd, mixed ...$args)

Interact with Valkey's COMMANDLOG command.

Parameters

string $subcmd
mixed ...$args ...

Return Value

Relay|array|int|bool

at line 3587
Relay|array|int|bool slowlog(string $operation, string ...$extra_args)

Interact with the Redis slowlog.

Parameters

string $operation
string ...$extra_args ,...

Return Value

Relay|array|int|bool

at line 3596
Relay|array|false smembers(mixed $set)

Returns all the members of the set value stored at $key.

Parameters

mixed $set

Return Value

Relay|array|false

at line 3606
Relay|bool sismember(mixed $set, mixed $member)

Returns if $member is a member of the set stored at $key.

Parameters

mixed $set
mixed $member

Return Value

Relay|bool

at line 3616
Relay|array|false smismember(mixed $set, mixed ...$members)

Returns whether each member is a member of the set stored at $key.

Parameters

mixed $set
mixed ...$members ,...

Return Value

Relay|array|false

at line 3627
Relay|int|false srem(mixed $set, mixed $member, mixed ...$members)

Remove the specified members from the set stored at $key.

Parameters

mixed $set
mixed $member
mixed ...$members ,...

Return Value

Relay|int|false

at line 3638
Relay|int|false sadd(mixed $set, mixed $member, mixed ...$members)

Add the specified members to the set stored at $key.

Parameters

mixed $set
mixed $member
mixed ...$members ,...

Return Value

Relay|int|false

at line 3648
Relay|array|int|false sort(mixed $key, array $options = [])

Sort the elements in a list, set or sorted set.

Parameters

mixed $key
array $options

Return Value

Relay|array|int|false

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.

Parameters

mixed $key
array $options

Return Value

Relay|array|false

at line 3669
Relay|bool smove(mixed $srcset, mixed $dstset, mixed $member)

Move member from the set at source to the set at destination.

Parameters

mixed $srcset
mixed $dstset
mixed $member

Return Value

Relay|bool

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.

Parameters

mixed $set
int $count

Return Value

mixed

at line 3689
mixed srandmember(mixed $set, int $count = 1)

Returns one or multiple random members from a set.

Parameters

mixed $set
int $count

Return Value

mixed

at line 3698
Relay|int|false scard(mixed $key)

Returns the set cardinality (number of elements) of the set stored at $key.

Parameters

mixed $key

Return Value

Relay|int|false

at line 3708
mixed script(string $command, string ...$args)

Execute a script management command.

Parameters

string $command
string ...$args ,...

Return Value

mixed

at line 3717
Relay|int|false strlen(mixed $key)

Returns the length of the string value stored at $key.

Parameters

mixed $key

Return Value

Relay|int|false

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.

Parameters

int $index1
int $index2

Return Value

Relay|bool

at line 3738
Relay|int|false hlen(mixed $key)

Returns the number of fields contained in the hash stored at $key.

Parameters

mixed $key

Return Value

Relay|int|false

at line 3747
Relay|int|false llen(mixed $key)

Returns the length of the list stored at $key.

Parameters

mixed $key

Return Value

Relay|int|false

at line 3759
Relay|int|false vadd(mixed $key, array $values, mixed $element, array|null $options = null)

Add an element to a vector set.

Parameters

mixed $key
array $values
mixed $element
array|null $options

Return Value

Relay|int|false

at line 3768
Relay|int|false vcard(mixed $key)

Return the cardinality (number of elements) in a vector set.

Parameters

mixed $key

Return Value

Relay|int|false

at line 3777
Relay|int|false vdim(mixed $key)

Return the dimensionality of vectors in a vector set.

Parameters

mixed $key

Return Value

Relay|int|false

at line 3788
Relay|array|false vemb(mixed $key, mixed $element, bool $raw = false)

Get the embedding for a given vector set member.

Parameters

mixed $key
mixed $element
bool $raw

Return Value

Relay|array|false

at line 3799
Relay|array|string|false vgetattr(mixed $key, mixed $element, bool $raw = false)

Get any attributes for a given vector set member.

Parameters

mixed $key
mixed $element
bool $raw

Return Value

Relay|array|string|false

at line 3808
Relay|array|false vinfo(mixed $key)

Return metadata about a vector set.

Parameters

mixed $key

Return Value

Relay|array|false

at line 3818
Relay|bool vismember(mixed $key, mixed $element)

Returns whether or not the element is a member of a vectorset.

Parameters

mixed $key
mixed $element

Return Value

Relay|bool

Get neighbors for a given vector element optionally withscores.

Parameters

mixed $key
mixed $element
bool $withscores

Return Value

Relay|array|false

at line 3839
Relay|array|string|false vrandmember(mixed $key, int $count = 0)

Get one or more random members from a vector set.

Parameters

mixed $key
int $count

Return Value

Relay|array|string|false

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.

Parameters

mixed $key
string $min
string $max
int $count

= 0

Return Value

Relay|array|false

at line 3860
Relay|int|false vrem(mixed $key, mixed $element)

Remove an element from a vector set.

Parameters

mixed $key
mixed $element

Return Value

Relay|int|false

at line 3871
Relay|int|false vsetattr(mixed $key, mixed $element, array|string $attributes)

Set attributes for a given vector set member.

Parameters

mixed $key
mixed $element
array|string $attributes

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $member
array|null $options

Return Value

Relay|array|false

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.

Parameters

mixed $key
string $group
array $ids

Return Value

Relay|int|false

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.

Parameters

string $key
string $group
array $ids
string|null $mode

Return Value

Relay|array|false

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.

Parameters

string $key
string $id
array $values
int $maxlen
bool $approx
bool $nomkstream

Return Value

Relay|string|null|false

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

Parameters

string $key
string $group
string $consumer
int $min_idle
array $ids
array $options

Return Value

Relay|array|bool

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.

Parameters

string $key
string $group
string $consumer
int $min_idle
string $start
int $count
bool $justid

Return Value

Relay|bool|array

at line 3977
Relay|int|false xlen(string $key)

Get the length of a stream.

Parameters

string $key

Return Value

Relay|int|false

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.

Parameters

string $operation
mixed $key
string|null $group
string|null $id_or_consumer
bool $mkstream
int $entries_read

Return Value

mixed

at line 4008
Relay|int|false xdel(string $key, array $ids)

Remove one or more specific IDs from a stream.

Parameters

string $key
array $ids

Return Value

Relay|int|false

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.

Parameters

string $key
array $ids
string|null $mode

Return Value

Relay|array|false

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

Retrieve information about a stream key.

Parameters

string $operation
string|null $arg1
string|null $arg2
int $count

Return Value

mixed

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.

Parameters

string $key
string $group
string|null $start
string|null $end
int $count
string|null $consumer
int $idle

Return Value

Relay|array|false

at line 4066
Relay|array|false xrange(mixed $key, string $start, string $end, int $count = -1)

Lists elements in a stream.

Parameters

mixed $key
string $start
string $end
int $count

= -1

Return Value

Relay|array|false

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.

Parameters

string $key
string $end
string $start
int $count

Return Value

Relay|array|bool

at line 4089
Relay|array|bool|null xread(array $streams, int $count = -1, int $block = -1)

Read messages from a stream.

Parameters

array $streams
int $count
int $block

Return Value

Relay|array|bool|null

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.

Parameters

string $group
string $consumer
array $streams
int $count
int $block

Return Value

Relay|array|bool|null

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.

Parameters

string $key
string $threshold
bool $approx
bool $minid
int $limit

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed ...$args ,...

Return Value

mixed

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.

Parameters

mixed $key
array|null $options

Return Value

mixed

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.

Parameters

mixed $key
string|int $start
string|int $end
mixed $options

Return Value

Relay|array|false

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.

Parameters

mixed $key
int $start
int $end
mixed $options

Return Value

Relay|array|false

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

Parameters

mixed $key
mixed $start
mixed $end
mixed $options

Return Value

Relay|array|false

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

Parameters

mixed $key
mixed $start
mixed $end
mixed $options

Return Value

Relay|array|false

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

Parameters

mixed $dst
mixed $src
mixed $start
mixed $end
mixed $options

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $min
mixed $max
int $offset
int $count

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed $max
mixed $min
int $offset
int $count

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed $rank
bool $withscore

Return Value

Relay|array|int|null|false

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.

Parameters

mixed $key
mixed $rank
bool $withscore

Return Value

Relay|array|int|null|false

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.

Parameters

mixed $key
mixed ...$args ,...

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $min
mixed $max

Return Value

Relay|int|false

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.

Parameters

mixed $key
int $start
int $end

Return Value

Relay|int|false

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

Parameters

mixed $key
mixed $min
mixed $max

Return Value

Relay|int|false

at line 4327
Relay|int|false zcard(mixed $key)

Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

Parameters

mixed $key

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed $min
mixed $max

Return Value

Relay|int|false

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.

Parameters

array $keys
array|null $options

Return Value

Relay|array|false

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.

Parameters

mixed $dst
array $keys

Return Value

Relay|int|false

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.

Parameters

mixed $key
float $score
mixed $mem

Return Value

Relay|float|false

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.

Parameters

mixed $key
mixed $min
mixed $max

Return Value

Relay|int|false

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.

Parameters

mixed $key
mixed ...$mems ,...

Return Value

Relay|array|false

at line 4404
Relay|float|null|false zscore(mixed $key, mixed $member)

Returns the score of member in the sorted set at key.

Parameters

mixed $key
mixed $member

Return Value

Relay|float|null|false

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.

Parameters

array $keys
array|null $weights
mixed $options

Return Value

Relay|array|false

at line 4426
Relay|int|false zintercard(array $keys, int $limit = -1)

Intersect multiple sorted sets and return the cardinality of the result.

Parameters

array $keys
int $limit

Return Value

Relay|int|false

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.

Parameters

mixed $dst
array $keys
array|null $weights
mixed $options

Return Value

Relay|int|false

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.

Parameters

array $keys
array|null $weights
mixed $options

Return Value

Relay|array|false

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.

Parameters

mixed $dst
array $keys
array|null $weights
mixed $options

Return Value

Relay|int|false

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.

Parameters

mixed $key
int $count

Return Value

Relay|array|false

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.

Parameters

mixed $key
int $count

Return Value

Relay|array|false

at line 4497
Relay|bool cmsInitByDim(mixed $key, int $width, int $depth)

Initialize a Redis CMS (Count-Min Sketch) by dimensions.

Parameters

mixed $key
int $width
int $depth

Return Value

Relay|bool

at line 4508
Relay|bool cmsInitByProb(mixed $key, float $error, float $probability)

Initialize a Redis CMS (Count-Min Sketch) by desired probabilities.

Parameters

mixed $key
float $error
float $probability

Return Value

Relay|bool

at line 4517
Relay|array|false cmsInfo(mixed $key)

Get information about a Count-Min Sketch key.

Parameters

mixed $key

Return Value

Relay|array|false

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.

Parameters

mixed $key
mixed $field
int $value
mixed ...$fields_and_falues ,...

Return Value

Relay|array|false

at line 4539
Relay|bool cmsMerge(mixed $dstkey, array $keys, array $weights = [])

Merge one or more Count-Min Sketch keys with optional weights.

Parameters

mixed $dstkey
array $keys
array $weights

= []

Return Value

Relay|bool

at line 4548
Relay|array|false cmsQuery(mixed $key, mixed ...$fields)

Query a Count-Min Sketch key.

Parameters

mixed $key
mixed ...$fields ,...

Return Value

Relay|array|false

at line 4557
mixed _getKeys()

internal  Temporary debug helper. Do not use.
 

Returns keys cached in runtime memory.

Return Value

mixed

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.

Parameters

string $key

Return Value

bool

at line 4577
static array license()

Returns information about the license.

Return Value

array