RedisConnection
abstract class RedisConnection extends Connection implements NonCopyableContext
Abstract base class for pooled Redis connections with Laravel-style method transformations.
Traits
Constants
| private CONNECTION_LEVEL_PHPREDIS_OPTIONS |
Top-level connection config keys that should be applied through setOption. |
Properties
| protected float | $lastUseTime | from Connection | |
| protected float | $lastReleaseTime | from Connection | |
| protected bool | $invalid | from Connection | |
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected Redis|RedisCluster|null | $connection | ||
| protected float | $createdAt | ||
| protected float|null | $lifetimeExpiresAt | ||
| protected bool | $availableForReuse | ||
| protected Dispatcher|null | $eventDispatcher | ||
| protected array | $config | ||
| protected int|null | $database | Current redis database. |
|
| protected bool | $watching | Determine if the native connection is watching keys. |
|
| protected bool | $shouldTransform | Determine if the connection calls should be transformed to Laravel style. |
Methods
Create a new Redis connection instance.
Release the connection back to pool.
Check if the connection is still valid.
Get the active connection.
Mix another object into the class.
Dynamically handle calls to the class.
Pass other method calls down to the underlying client.
Mark the connection invalid before its next use.
Get the connection name.
Get the event dispatcher instance.
Reconnect to Redis.
Mark the underlying Redis client as freshly connected.
Set configured options on a Redis or RedisCluster client.
Get the phpredis options configured on the connection.
Resolve a phpredis option name to its native option constant.
Parse a friendly phpredis backoff algorithm name.
Close the current connection.
Check the Redis client for heartbeat health.
Execute the native Redis DISCARD command.
Clear the tracked watch state after callback-form transaction completion.
Determine if this connection has been idle long enough to be evicted.
Get the connection generation creation time.
Determine if this connection generation has reached its maximum lifetime.
Determine whether a failed command left the connection unsafe to reuse.
Determine if the underlying Redis client is in pipeline/multi mode.
Determine if the connection is to a Redis Cluster.
Determine if the given key contains a Redis Cluster hash tag.
Ping Redis for heartbeat health without shadowing the public Redis PING command.
Log a redis connection message.
Determine if the connection calls should be transformed to Laravel style.
Get the current transformation state.
Returns the value of the given key.
Get the values of all the given keys.
Prepare arguments for the set command.
Set the string value in the argument as the value of the key.
Set the given key if it doesn't exist.
Prepare arguments for the hmget command.
Get the value of the given hash fields.
Prepare arguments for the hmset command.
Set the given hash fields to their respective values.
Set the given hash field if it doesn't exist.
Prepare arguments for the lrem command.
Removes the first count occurrences of the value element from the list.
Removes and returns the first element of the list stored at key.
Removes and returns the last element of the list stored at key.
Removes and returns random elements from the set value at key.
Prepare arguments for the xadd command.
Add an entry to a stream.
Prepare arguments for the xautoclaim command.
Claim pending stream entries that have been idle long enough.
Prepare arguments for the xgroup command.
Manage stream consumer groups.
Prepare arguments for the xpending command.
Get pending entries in a stream consumer group.
Prepare arguments for the xrange command.
Get stream entries within the given ID range.
Prepare arguments for the xrevrange command.
Get stream entries within the given ID range in reverse order.
Prepare arguments for the xtrim command.
Trim a stream by its length or minimum ID.
Prepare arguments for the zadd command.
Add one or more members to a sorted set or update its score if it already exists.
Prepare arguments for the zcount command.
Count sorted set members within the given score range.
Prepare arguments for the zremrangebyscore command.
Remove sorted set members within the given score range.
Prepare arguments for the zrangebyscore command.
Return elements with score between $min and $max.
Prepare arguments for the zrevrangebyscore command.
Return elements with score between $max and $min in reverse order.
Prepare arguments for the zinterstore command.
Find the intersection between sets and store in a new set.
Prepare arguments for the zunionstore command.
Find the union between sets and store in a new set.
Get the Redis scan options.
Scan all keys based on options.
Execute the transformed SCAN command.
Scan the given set for all values based on options.
Execute the transformed ZSCAN command.
Scan the given hash for all values based on options.
Execute the transformed HSCAN command.
Scan the given set for all values based on options.
Execute the transformed SSCAN command.
Prepare arguments for the eval command.
Evaluate a script and return its result.
Prepare arguments for the evalsha command.
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
Prepare arguments for the executeRaw command.
Execute a raw command.
Reject subscriptions on raw pooled connections.
Determine if a custom serializer is configured on the connection.
Determine if compression is configured on the connection.
Determine if LZF compression is enabled.
Determine if ZSTD compression is enabled.
Determine if LZ4 compression is enabled.
Execute the given callback without prefixing scan patterns.
Execute the given callback without serialization or compression.
Pack values for use in Lua script ARGV parameters.
No description
Execute a Lua script using evalSha with automatic fallback to eval.
Create an exception for a Lua script error.
Normalize topology-specific null replies.
Safely scan the Redis keyspace for keys matching a pattern.
Flush (delete) all Redis keys matching a pattern.
Get the value of a key
Set the value of a key
Get the values of multiple keys
Set key if not exists
Set key if not exists
Get hash field values
Set hash field values
Set hash field if not exists
Get hash field value
Set hash field values
Remove list elements
Get list length
Blocking left pop from list
Blocking right pop from list
Remove and return random set member
Remove members from set
Add members to sorted set
Get sorted set cardinality
Count sorted set members by score range
Get sorted set members by score range
No description
Intersect sorted sets
Union sorted sets
Evaluate Lua script
Evaluate Lua script by SHA1
Flush database
Execute raw Redis command
Execute commands in a pipeline
Get all set members
Delete hash fields
Remove sorted set members
Get number of hash fields
Get all hash field names
Serialize a value using configured serializer
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Blocking left pop from list
Blocking right pop from list
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Flush database
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Delete hash fields
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get hash field value
No description
No description
No description
No description
No description
No description
Get all hash field names
Get number of hash fields
Get hash field values
Set hash field values
No description
Set hash field values
Set hash field if not exists
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get list length
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get all set members
No description
No description
Remove and return random set member
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Remove members from set
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Add members to sorted set
Get sorted set cardinality
Count sorted set members by score range
No description
No description
No description
No description
No description
No description
No description
Get sorted set members by score range
No description
No description
No description
Remove sorted set members
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
at line 379
__construct(Container $container, ConnectionPool $pool, array $config)
Create a new Redis connection instance.
at line 782
void
release()
Release the connection back to pool.
in
Connection at line 99
void
discard()
Discard the connection from its pool.
in
Connection at line 107
mixed
getConnection()
Get the underlying connection.
at line 491
bool
check()
Check if the connection is still valid.
in
Connection at line 134
float
getLastUseTime()
Get the last use time.
in
Connection at line 142
float
getLastReleaseTime()
Get the last release time.
in
Connection at line 150
protected void
markInvalid()
Mark the connection as invalid.
in
Connection at line 158
protected void
markValid()
Mark the connection as valid.
at line 473
mixed
getActiveConnection()
Get the active connection.
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 388
mixed
__call(string $name, array $arguments)
Pass other method calls down to the underlying client.
at line 524
void
invalidate()
| internal |
Mark the connection invalid before its next use.
at line 532
string
getName()
Get the connection name.
at line 540
Dispatcher|null
getEventDispatcher()
Get the event dispatcher instance.
at line 551
abstract bool
reconnect()
Reconnect to Redis.
at line 556
protected void
markReconnected()
Mark the underlying Redis client as freshly connected.
at line 570
protected void
setOptions(Redis|RedisCluster $redis)
Set configured options on a Redis or RedisCluster client.
at line 613
protected array
configuredPhpRedisOptions()
Get the phpredis options configured on the connection.
at line 633
protected int
phpRedisOption(string $name)
Resolve a phpredis option name to its native option constant.
at line 659
protected int
parseBackoffAlgorithm(mixed $algorithm)
Parse a friendly phpredis backoff algorithm name.
at line 688
bool
close()
Close the current connection.
Calling the native phpredis close() releases the underlying socket deterministically rather than relying on PHP refcount destruction - connections trapped in pool/connection reference cycles would otherwise keep their FDs open until the cycle collector runs.
at line 714
bool
heartbeatCheck(float $timeout)
Check the Redis client for heartbeat health.
at line 928
bool|Redis
discardTransaction()
Execute the native Redis DISCARD command.
Use this method on a held connection because discard() removes the connection from its pool.
at line 944
void
clearWatchState()
| internal |
Clear the tracked watch state after callback-form transaction completion.
at line 952
bool
isIdleExpired(float|null $now = null)
Determine if this connection has been idle long enough to be evicted.
at line 967
float
getCreatedAt()
Get the connection generation creation time.
at line 975
bool
isLifetimeExpired(float|null $now = null)
Determine if this connection generation has reached its maximum lifetime.
at line 987
protected bool
shouldInvalidateAfter(RedisException|RedisClusterException|ErrorException $exception)
Determine whether a failed command left the connection unsafe to reuse.
at line 1014
protected bool
isQueueingMode()
Determine if the underlying Redis client is in pipeline/multi mode.
Returns false by default. PhpRedisConnection overrides to check the actual mode on the \Redis client.
at line 1022
bool
isCluster()
Determine if the connection is to a Redis Cluster.
at line 1030
static bool
hasHashTag(string $key)
Determine if the given key contains a Redis Cluster hash tag.
at line 1046
protected bool
pingForHeartbeat()
Ping Redis for heartbeat health without shadowing the public Redis PING command.
at line 1085
protected void
log(string $message, string $level = LogLevel::WARNING)
Log a redis connection message.
at line 1095
RedisConnection
shouldTransform(bool $shouldTransform = true)
Determine if the connection calls should be transformed to Laravel style.
at line 1105
bool
getShouldTransform()
Get the current transformation state.
at line 1113
protected mixed
callGet(string $key)
Returns the value of the given key.
at line 1123
protected array|false
callMget(array $keys)
Get the values of all the given keys.
at line 1146
protected array
prepareSet(mixed ...$arguments)
Prepare arguments for the set command.
at line 1159
protected mixed
callSet(string $key, mixed $value, mixed $expireResolution = null, int|null $expireTTL = null, string|null $flag = null)
Set the string value in the argument as the value of the key.
at line 1170
protected int
callSetnx(string $key, mixed $value)
Set the given key if it doesn't exist.
at line 1180
protected array
prepareHmget(mixed ...$arguments)
Prepare arguments for the hmget command.
at line 1191
protected array|false
callHmget(string $key, mixed ...$dictionary)
Get the value of the given hash fields.
at line 1209
protected array
prepareHmset(mixed ...$arguments)
Prepare arguments for the hmset command.
at line 1227
protected bool
callHmset(string $key, mixed ...$dictionary)
Set the given hash fields to their respective values.
at line 1237
protected int
callHsetnx(string $hash, string $key, mixed $value)
Set the given hash field if it doesn't exist.
at line 1247
protected array
prepareLrem(mixed ...$arguments)
Prepare arguments for the lrem command.
at line 1257
protected false|int
callLrem(string $key, int $count, mixed $value)
Removes the first count occurrences of the value element from the list.
at line 1267
protected array|null
callBlpop(mixed ...$arguments)
Removes and returns the first element of the list stored at key.
at line 1277
protected array|null
callBrpop(mixed ...$arguments)
Removes and returns the last element of the list stored at key.
at line 1290
protected mixed
callSpop(string $key, int|null $count = null)
Removes and returns random elements from the set value at key.
When called without count, returns a single element (string|false). When called with count, returns an array of elements.
at line 1324
protected array
prepareXadd(mixed ...$arguments)
Prepare arguments for the xadd command.
at line 1332
protected false|string
callXadd(mixed ...$arguments)
Add an entry to a stream.
at line 1344
protected array
prepareXautoclaim(mixed ...$arguments)
Prepare arguments for the xautoclaim command.
at line 1352
protected array|bool
callXautoclaim(mixed ...$arguments)
Claim pending stream entries that have been idle long enough.
at line 1364
protected array
prepareXgroup(mixed ...$arguments)
Prepare arguments for the xgroup command.
at line 1372
protected mixed
callXgroup(mixed ...$arguments)
Manage stream consumer groups.
at line 1384
protected array
prepareXpending(mixed ...$arguments)
Prepare arguments for the xpending command.
at line 1392
protected array|false
callXpending(mixed ...$arguments)
Get pending entries in a stream consumer group.
at line 1404
protected array
prepareXrange(mixed ...$arguments)
Prepare arguments for the xrange command.
at line 1412
protected array|bool
callXrange(mixed ...$arguments)
Get stream entries within the given ID range.
at line 1424
protected array
prepareXrevrange(mixed ...$arguments)
Prepare arguments for the xrevrange command.
at line 1432
protected array|bool
callXrevrange(mixed ...$arguments)
Get stream entries within the given ID range in reverse order.
at line 1444
protected array
prepareXtrim(mixed ...$arguments)
Prepare arguments for the xtrim command.
at line 1452
protected false|int
callXtrim(mixed ...$arguments)
Trim a stream by its length or minimum ID.
at line 1464
protected array
prepareZadd(mixed ...$arguments)
Prepare arguments for the zadd command.
at line 1492
protected false|float|int
callZadd(string $key, mixed ...$dictionary)
Add one or more members to a sorted set or update its score if it already exists.
at line 1504
protected array
prepareZcount(mixed ...$arguments)
Prepare arguments for the zcount command.
at line 1512
protected false|int
callZcount(mixed ...$arguments)
Count sorted set members within the given score range.
at line 1524
protected array
prepareZremrangebyscore(mixed ...$arguments)
Prepare arguments for the zremrangebyscore command.
at line 1532
protected false|int
callZremrangebyscore(mixed ...$arguments)
Remove sorted set members within the given score range.
at line 1544
protected array
prepareZrangebyscore(mixed ...$arguments)
Prepare arguments for the zrangebyscore command.
at line 1562
protected array|false
callZrangebyscore(string $key, float|int|string $min, float|int|string $max, array $options = [])
Return elements with score between $min and $max.
at line 1574
protected array
prepareZrevrangebyscore(mixed ...$arguments)
Prepare arguments for the zrevrangebyscore command.
at line 1592
protected array|false
callZrevrangebyscore(string $key, float|int|string $max, float|int|string $min, array $options = [])
Return elements with score between $max and $min in reverse order.
at line 1604
protected array
prepareZinterstore(mixed ...$arguments)
Prepare arguments for the zinterstore command.
at line 1615
protected false|int
callZinterstore(string $output, array $keys, array $options = [])
Find the intersection between sets and store in a new set.
at line 1627
protected array
prepareZunionstore(mixed ...$arguments)
Prepare arguments for the zunionstore command.
at line 1638
protected false|int
callZunionstore(string $output, array $keys, array $options = [])
Find the union between sets and store in a new set.
at line 1648
protected array
getScanOptions(array $arguments)
Get the Redis scan options.
at line 1661
mixed
scan(mixed $cursor, mixed ...$arguments)
Scan all keys based on options.
at line 1669
protected mixed
callScan(mixed $cursor, mixed ...$arguments)
Execute the transformed SCAN command.
at line 1691
mixed
zscan(mixed $key, mixed $cursor, mixed ...$arguments)
Scan the given set for all values based on options.
at line 1699
protected mixed
callZscan(mixed $key, mixed $cursor, mixed ...$arguments)
Execute the transformed ZSCAN command.
at line 1722
mixed
hscan(mixed $key, mixed $cursor, mixed ...$arguments)
Scan the given hash for all values based on options.
at line 1730
protected mixed
callHscan(mixed $key, mixed $cursor, mixed ...$arguments)
Execute the transformed HSCAN command.
at line 1753
mixed
sscan(mixed $key, mixed $cursor, mixed ...$arguments)
Scan the given set for all values based on options.
at line 1761
protected mixed
callSscan(mixed $key, mixed $cursor, mixed ...$arguments)
Execute the transformed SSCAN command.
at line 1784
protected array
prepareEval(mixed ...$arguments)
Prepare arguments for the eval command.
at line 1796
protected mixed
callEval(string $script, int $numberOfKeys, mixed ...$arguments)
Evaluate a script and return its result.
at line 1811
protected array
prepareEvalsha(mixed ...$arguments)
Prepare arguments for the evalsha command.
Falls back to eval in MULTI/PIPELINE mode because script('load') cannot execute synchronously while the connection is queueing.
at line 1823
protected mixed
callEvalsha(string $script, int $numkeys, mixed ...$arguments)
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
at line 1837
protected array
prepareExecuteRaw(mixed ...$arguments)
Prepare arguments for the executeRaw command.
at line 1845
protected mixed
callExecuteRaw(array $parameters)
Execute a raw command.
at line 1864
protected never
callSubscribe(string $name, array $arguments)
Reject subscriptions on raw pooled connections.
Pub/sub requires a dedicated, long-lived connection that is incompatible with connection pooling. Use the coroutine-native subscriber instead:
Redis::subscribe($channels, $callback);
Redis::psubscribe($channels, $callback);
$subscriber = Redis::subscriber();
at line 1875
bool
serialized()
Determine if a custom serializer is configured on the connection.
at line 1883
bool
compressed()
Determine if compression is configured on the connection.
at line 1891
bool
lzfCompressed()
Determine if LZF compression is enabled.
at line 1900
bool
zstdCompressed()
Determine if ZSTD compression is enabled.
at line 1909
bool
lz4Compressed()
Determine if LZ4 compression is enabled.
at line 1926
mixed
withoutScanPrefix(callable $callback)
Execute the given callback without prefixing scan patterns.
Key prefixing remains unchanged. Hold this connection until the callback finishes so its scan options are restored before returning it to the pool.
at line 1954
mixed
withoutSerializationOrCompression(callable $callback)
Execute the given callback without serialization or compression.
Temporarily disables phpredis serialization and compression on the raw connection for operations that require raw integer values (e.g., rate limiter counters), then restores the original settings.
at line 1995
array
pack(array $values)
Pack values for use in Lua script ARGV parameters.
Unlike regular Redis commands where phpredis auto-serializes, Lua ARGV parameters must be pre-serialized strings.
Requires phpredis 6.0+ which provides the _pack() method.
at line 329
mixed
client(string $opt = '\'\'', mixed ...$args)
No description
at line 2034
mixed
evalWithShaCache(string $script, array $keys = [], array $args = [])
Execute a Lua script using evalSha with automatic fallback to eval.
Redis caches compiled Lua scripts by SHA1 hash. This method tries evalSha first (uses cached compiled script), and falls back to eval if the script isn't cached yet (NOSCRIPT error).
Unlike naive implementations that treat any false return as NOSCRIPT,
this method wraps script and data errors returned by phpredis as false
while native server, cluster, authentication, and transport exceptions
propagate unchanged.
at line 2086
protected Throwable
scriptException(string $error)
Create an exception for a Lua script error.
at line 2094
protected mixed
normalizeNullReplies(mixed $result)
Normalize topology-specific null replies.
at line 2114
Generator
safeScan(string $pattern, int $count = 1000)
Safely scan the Redis keyspace for keys matching a pattern.
This method handles the phpredis OPT_PREFIX complexity correctly:
- Applies OPT_PREFIX to the scan pattern exactly once, respecting SCAN_PREFIX
- Strips OPT_PREFIX from returned keys so they work with other commands
The connection must be held with transform disabled so SCAN retains its native phpredis cursor and result shape.
at line 2140
int
flushByPattern(string $pattern)
Flush (delete) all Redis keys matching a pattern.
Use this inside withConnection(..., transform: false) when doing multiple operations on the same connection. No connection lifecycle overhead since you're operating on an existing connection.
For standalone/one-off operations, use Redis::flushByPattern() instead, which handles connection lifecycle automatically.
Uses SCAN to iterate keys efficiently and deletes them in batches. Correctly handles OPT_PREFIX to avoid the double-prefixing bug.
at line 329
mixed
get(string $key)
Get the value of a key
at line 329
mixed
set(string $key, mixed $value, mixed $expireResolution = 'null', int|null $expireTTL = 'null', string|null $flag = 'null')
Set the value of a key
at line 329
RedisCluster
mget(array $keys)
Get the values of multiple keys
at line 329
RedisCluster
setnx(string $key, mixed $value)
Set key if not exists
at line 329
RedisCluster
setNx(string $key, mixed $value)
Set key if not exists
at line 329
RedisCluster
hmget(string $key, array $fields)
Get hash field values
at line 329
RedisCluster
hmset(string $key, array $fieldValues)
Set hash field values
at line 329
RedisCluster
hsetnx(string $hash, string $key, mixed $value)
Set hash field if not exists
at line 329
mixed
hget(string $key, string $member)
Get hash field value
at line 329
RedisCluster
hset(string $key, mixed ...$fields_and_vals)
Set hash field values
at line 329
false|int
lrem(string $key, int $count, mixed $value)
Remove list elements
at line 329
RedisCluster
llen(string $key)
Get list length
at line 329
RedisCluster
blpop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)
Blocking left pop from list
at line 329
RedisCluster
brpop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)
Blocking right pop from list
at line 329
mixed
spop(string $key, int $count = '0')
Remove and return random set member
at line 329
RedisCluster
sRem(string $key, mixed $value, mixed ...$other_values)
Remove members from set
at line 329
RedisCluster
zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)
Add members to sorted set
at line 329
RedisCluster
zcard(string $key)
Get sorted set cardinality
at line 329
RedisCluster
zcount(string $key, float|int|string $start, float|int|string $end)
Count sorted set members by score range
at line 329
RedisCluster
zrangebyscore(string $key, float|int|string $min, float|int|string $max, array $options = '[]')
Get sorted set members by score range
at line 329
RedisCluster
zrevrangebyscore(string $key, float|int|string $max, float|int|string $min, array $options = '[]') Get sorted set members by score range (reverse)
No description
at line 329
RedisCluster
zinterstore(string $output, array $keys, array $options = '[]')
Intersect sorted sets
at line 329
RedisCluster
zunionstore(string $output, array $keys, array $options = '[]')
Union sorted sets
at line 329
mixed
eval(string $script, int $numberOfKeys, mixed ...$arguments)
Evaluate Lua script
at line 329
mixed
evalsha(string $script, int $numkeys, mixed ...$arguments)
Evaluate Lua script by SHA1
at line 329
mixed
flushdb(mixed ...$arguments)
Flush database
at line 329
mixed
executeRaw(array $parameters)
Execute raw Redis command
at line 329
mixed
pipeline(callable|null $callback = 'null')
Execute commands in a pipeline
at line 329
RedisCluster
smembers(string $key)
Get all set members
at line 329
RedisCluster
hdel(string $key, string $field, string ...$other_fields)
Delete hash fields
at line 329
RedisCluster
zrem(mixed $key, mixed $member, mixed ...$other_members)
Remove sorted set members
at line 329
RedisCluster
hlen(string $key)
Get number of hash fields
at line 329
RedisCluster
hkeys(string $key)
Get all hash field names
at line 329
string
_serialize(mixed $value)
Serialize a value using configured serializer
at line 329
string
_digest(mixed $value)
No description
at line 329
string
_pack(mixed $value)
No description
at line 329
mixed
_unpack(string $value)
No description
at line 329
mixed
acl(string $subcmd, string ...$args)
No description
at line 329
RedisCluster
append(string $key, mixed $value)
No description
at line 329
Redis
auth(mixed $credentials)
No description
at line 329
RedisCluster
bgSave()
No description
at line 329
RedisCluster
bgrewriteaof()
No description
at line 329
RedisCluster
waitaof(int $numlocal, int $numreplicas, int $timeout)
No description
at line 329
RedisCluster
bitcount(string $key, int $start = '0', int $end = '-1', bool $bybit = 'false')
No description
at line 329
RedisCluster
bitop(string $operation, string $deskey, string $srckey, string ...$other_keys)
No description
at line 329
RedisCluster
bitpos(string $key, bool $bit, int $start = '0', int $end = '-1', bool $bybit = 'false')
No description
at line 329
RedisCluster
blPop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)
Blocking left pop from list
at line 329
RedisCluster
brPop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)
Blocking right pop from list
at line 329
RedisCluster|string
brpoplpush(string $src, string $dst, float|int $timeout)
No description
at line 329
RedisCluster
bzPopMax(array|string $key, int|string $timeout_or_key, mixed ...$extra_args)
No description
at line 329
RedisCluster
bzPopMin(array|string $key, int|string $timeout_or_key, mixed ...$extra_args)
No description
at line 329
RedisCluster
bzmpop(float $timeout, array $keys, string $from, int $count = '1')
No description
at line 329
RedisCluster
zmpop(array $keys, string $from, int $count = '1')
No description
at line 329
RedisCluster
blmpop(float $timeout, array $keys, string $from, int $count = '1')
No description
at line 329
RedisCluster
lmpop(array $keys, string $from, int $count = '1')
No description
at line 329
bool
clearLastError()
No description
at line 329
mixed
command(string|null $opt = 'null', mixed ...$args)
No description
at line 329
mixed
config(string $operation, array|string|null $key_or_settings = 'null', string|null $value = 'null')
No description
at line 329
bool
connect(string $host, int $port = '6379', float $timeout = '0', string|null $persistent_id = 'null', int $retry_interval = '0', float $read_timeout = '0', array|null $context = 'null')
No description
at line 329
RedisCluster
copy(string $src, string $dst, array|null $options = 'null')
No description
at line 329
RedisCluster
dbSize()
No description
at line 329
Redis|string
debug(string $key)
No description
at line 329
RedisCluster
decr(string $key, int $by = '1')
No description
at line 329
RedisCluster
decrBy(string $key, int $value)
No description
at line 329
RedisCluster
del(array|string $key, string ...$other_keys)
No description
at line 329
RedisCluster
delex(string $key, array|null $options = 'null')
No description
at line 329
RedisCluster
delifeq(string $key, mixed $value)
No description
at line 329
RedisCluster|string
digest(string $key)
No description
at line 329
RedisCluster|string
dump(string $key)
No description
at line 329
RedisCluster|string
echo(string $str)
No description
at line 329
mixed
eval_ro(string $script_sha, array $args = '[]', int $num_keys = '0')
No description
at line 329
mixed
evalsha_ro(string $sha1, array $args = '[]', int $num_keys = '0')
No description
at line 329
Redis
exec()
No description
at line 329
RedisCluster
exists(mixed $key, mixed ...$other_keys)
No description
at line 329
RedisCluster
expire(string $key, int $timeout, string|null $mode = 'null')
No description
at line 329
RedisCluster
expireAt(string $key, int $timestamp, string|null $mode = 'null')
No description
at line 329
Redis
failover(array|null $to = 'null', bool $abort = 'false', int $timeout = '0')
No description
at line 329
RedisCluster
expiretime(string $key)
No description
at line 329
RedisCluster
pexpiretime(string $key)
No description
at line 329
mixed
fcall(string $fn, array $keys = '[]', array $args = '[]')
No description
at line 329
mixed
fcall_ro(string $fn, array $keys = '[]', array $args = '[]')
No description
at line 329
RedisCluster
flushAll(bool|null $sync = 'null')
No description
at line 329
mixed
flushDB(mixed ...$arguments)
Flush database
at line 329
Redis|string
function(string $operation, mixed ...$args)
No description
at line 329
RedisCluster
geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options)
No description
at line 329
RedisCluster
geodist(string $key, string $src, string $dst, string|null $unit = 'null')
No description
at line 329
RedisCluster
geohash(string $key, string $member, string ...$other_members)
No description
at line 329
RedisCluster
geopos(string $key, string $member, string ...$other_members)
No description
at line 329
mixed
georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = '[]')
No description
at line 329
mixed
georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = '[]')
No description
at line 329
mixed
georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = '[]')
No description
at line 329
mixed
georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = '[]')
No description
at line 329
array
geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = '[]')
No description
at line 329
RedisCluster
geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = '[]')
No description
at line 329
mixed
getAuth()
No description
at line 329
RedisCluster
getBit(string $key, int $idx)
No description
at line 329
RedisCluster|string
getEx(string $key, array $options = '[]')
No description
at line 329
int
getDBNum()
No description
at line 329
RedisCluster|string
getDel(string $key)
No description
at line 329
string
getHost()
No description
at line 329
null|string
getLastError()
No description
at line 329
int
getMode()
No description
at line 329
mixed
getOption(int $option)
No description
at line 329
null|string
getPersistentID()
No description
at line 329
int
getPort()
No description
at line 329
RedisCluster|string
getRange(string $key, int $start, int $end)
No description
at line 329
RedisCluster|string
lcs(string $key1, string $key2, array|null $options = 'null')
No description
at line 329
float
getReadTimeout()
No description
at line 329
RedisCluster|string
getset(string $key, mixed $value)
No description
at line 329
false|float
getTimeout()
No description
at line 329
array
getTransferredBytes()
No description
at line 329
void
clearTransferredBytes()
No description
at line 329
RedisCluster
getWithMeta(string $key)
No description
at line 329
RedisCluster
hDel(string $key, string $field, string ...$other_fields)
Delete hash fields
at line 329
RedisCluster
hexpire(string $key, int $ttl, array $fields, string|null $mode = 'null')
No description
at line 329
RedisCluster
hpexpire(string $key, int $ttl, array $fields, string|null $mode = 'null')
No description
at line 329
RedisCluster
hexpireat(string $key, int $time, array $fields, string|null $mode = 'null')
No description
at line 329
RedisCluster
hpexpireat(string $key, int $mstime, array $fields, string|null $mode = 'null')
No description
at line 329
RedisCluster
httl(string $key, array $fields)
No description
at line 329
RedisCluster
hpttl(string $key, array $fields)
No description
at line 329
RedisCluster
hexpiretime(string $key, array $fields)
No description
at line 329
RedisCluster
hpexpiretime(string $key, array $fields)
No description
at line 329
RedisCluster
hpersist(string $key, array $fields)
No description
at line 329
RedisCluster
hExists(string $key, string $field)
No description
at line 329
mixed
hGet(string $key, string $member)
Get hash field value
at line 329
RedisCluster
hGetAll(string $key)
No description
at line 329
mixed
hGetWithMeta(string $key, string $member)
No description
at line 329
RedisCluster
hgetdel(string $key, array $fields)
No description
at line 329
RedisCluster
hgetex(string $key, array $fields, string|array|null $expiry = 'null')
No description
at line 329
RedisCluster
hIncrBy(string $key, string $field, int $value)
No description
at line 329
RedisCluster
hIncrByFloat(string $key, string $field, float $value)
No description
at line 329
RedisCluster
hKeys(string $key)
Get all hash field names
at line 329
RedisCluster
hLen(string $key)
Get number of hash fields
at line 329
RedisCluster
hMget(string $key, array $fields)
Get hash field values
at line 329
RedisCluster
hMset(string $key, array $fieldValues)
Set hash field values
at line 329
RedisCluster|string
hRandField(string $key, array|null $options = 'null')
No description
at line 329
RedisCluster
hSet(string $key, mixed ...$fields_and_vals)
Set hash field values
at line 329
RedisCluster
hSetNx(string $hash, string $key, mixed $value)
Set hash field if not exists
at line 329
RedisCluster
hsetex(string $key, array $fields, array|null $expiry = 'null')
No description
at line 329
RedisCluster
hStrLen(string $key, string $field)
No description
at line 329
RedisCluster
hVals(string $key)
No description
at line 329
RedisCluster
incr(string $key, int $by = '1')
No description
at line 329
RedisCluster
incrBy(string $key, int $value)
No description
at line 329
RedisCluster
incrByFloat(string $key, float $value)
No description
at line 329
RedisCluster
info(string ...$sections)
No description
at line 329
bool
isConnected()
No description
at line 329
RedisCluster
keys(string $pattern)
No description
at line 329
RedisCluster
lInsert(string $key, string $pos, mixed $pivot, mixed $value)
No description
at line 329
RedisCluster
lLen(string $key)
Get list length
at line 329
RedisCluster|string
lMove(string $src, string $dst, string $wherefrom, string $whereto)
No description
at line 329
RedisCluster|string
blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout)
No description
at line 329
RedisCluster|string
lPop(string $key, int $count = '0')
No description
at line 329
RedisCluster
lPos(string $key, mixed $value, array|null $options = 'null')
No description
at line 329
RedisCluster
lPush(string $key, mixed ...$elements)
No description
at line 329
RedisCluster
rPush(string $key, mixed ...$elements)
No description
at line 329
RedisCluster
lPushx(string $key, mixed $value)
No description
at line 329
RedisCluster
rPushx(string $key, mixed $value)
No description
at line 329
RedisCluster
lSet(string $key, int $index, mixed $value)
No description
at line 329
int
lastSave()
No description
at line 329
mixed
lindex(string $key, int $index)
No description
at line 329
RedisCluster
lrange(string $key, int $start, int $end)
No description
at line 329
RedisCluster
ltrim(string $key, int $start, int $end)
No description
at line 329
Redis
migrate(string $host, int $port, array|string $key, int $dstdb, int $timeout, bool $copy = 'false', bool $replace = 'false', mixed $credentials = 'null')
No description
at line 329
Redis
move(string $key, int $index)
No description
at line 329
RedisCluster
mset(array $key_values)
No description
at line 329
RedisCluster
msetex(array $key_values, int|float|array|null $expiry = 'null')
No description
at line 329
RedisCluster
msetnx(array $key_values)
No description
at line 329
RedisCluster
multi(int $value = '1')
No description
at line 329
RedisCluster|string
object(string $subcommand, string $key)
No description
at line 329
bool
pconnect(string $host, int $port = '6379', float $timeout = '0', string|null $persistent_id = 'null', int $retry_interval = '0', float $read_timeout = '0', array|null $context = 'null')
No description
at line 329
RedisCluster
persist(string $key)
No description
at line 329
bool
pexpire(string $key, int $timeout, string|null $mode = 'null')
No description
at line 329
RedisCluster
pexpireAt(string $key, int $timestamp, string|null $mode = 'null')
No description
at line 329
RedisCluster
pfadd(string $key, array $elements)
No description
at line 329
RedisCluster
pfcount(array|string $key_or_keys)
No description
at line 329
RedisCluster
pfmerge(string $dst, array $srckeys)
No description
at line 329
RedisCluster|string
ping(string|null $message = 'null')
No description
at line 329
RedisCluster
psetex(string $key, int $expire, mixed $value)
No description
at line 329
RedisCluster
pttl(string $key)
No description
at line 329
RedisCluster
publish(string $channel, string $message)
No description
at line 329
mixed
pubsub(string $command, mixed $arg = 'null')
No description
at line 329
Redis
punsubscribe(array $patterns)
No description
at line 329
RedisCluster|string
rPop(string $key, int $count = '0')
No description
at line 329
RedisCluster|string
randomKey()
No description
at line 329
mixed
rawcommand(string $command, mixed ...$args)
No description
at line 329
RedisCluster
rename(string $old_name, string $new_name)
No description
at line 329
RedisCluster
renameNx(string $key_src, string $key_dst)
No description
at line 329
RedisCluster
restore(string $key, int $ttl, string $value, array|null $options = 'null')
No description
at line 329
mixed
role()
No description
at line 329
RedisCluster|string
rpoplpush(string $srckey, string $dstkey)
No description
at line 329
RedisCluster
sAdd(string $key, mixed $value, mixed ...$other_values)
No description
at line 329
int
sAddArray(string $key, array $values)
No description
at line 329
RedisCluster
sDiff(string $key, string ...$other_keys)
No description
at line 329
RedisCluster
sDiffStore(string $dst, string $key, string ...$other_keys)
No description
at line 329
RedisCluster
sInter(array|string $key, string ...$other_keys)
No description
at line 329
RedisCluster
sintercard(array $keys, int $limit = '-1')
No description
at line 329
RedisCluster
sInterStore(array|string $key, string ...$other_keys)
No description
at line 329
RedisCluster
sMembers(string $key)
Get all set members
at line 329
RedisCluster
sMisMember(string $key, string $member, string ...$other_members)
No description
at line 329
RedisCluster
sMove(string $src, string $dst, mixed $value)
No description
at line 329
mixed
sPop(string $key, int $count = '0')
Remove and return random set member
at line 329
mixed
sRandMember(string $key, int $count = '0')
No description
at line 329
RedisCluster
sUnion(string $key, string ...$other_keys)
No description
at line 329
RedisCluster
sUnionStore(string $dst, string $key, string ...$other_keys)
No description
at line 329
RedisCluster
save()
No description
at line 329
RedisCluster
scard(string $key)
No description
at line 329
mixed
script(string $command, mixed ...$args)
No description
at line 329
Redis
select(int $db)
No description
at line 329
false|string
serverName()
No description
at line 329
false|string
serverVersion()
No description
at line 329
RedisCluster
setBit(string $key, int $idx, bool $value)
No description
at line 329
RedisCluster
setRange(string $key, int $index, string $value)
No description
at line 329
bool
setOption(int $option, mixed $value)
No description
at line 329
RedisCluster
setex(string $key, int $expire, mixed $value)
No description
at line 329
RedisCluster
sismember(string $key, mixed $value)
No description
at line 329
Redis
replicaof(string|null $host = 'null', int $port = '6379')
No description
at line 329
RedisCluster
touch(array|string $key_or_array, string ...$more_keys)
No description
at line 329
mixed
slowlog(string $operation, int $length = '0')
No description
at line 329
mixed
sort(string $key, array|null $options = 'null')
No description
at line 329
mixed
sort_ro(string $key, array|null $options = 'null')
No description
at line 329
RedisCluster
srem(string $key, mixed $value, mixed ...$other_values)
Remove members from set
at line 329
RedisCluster
strlen(string $key)
No description
at line 329
Redis
sunsubscribe(array $channels)
No description
at line 329
Redis
swapdb(int $src, int $dst)
No description
at line 329
RedisCluster
time()
No description
at line 329
RedisCluster
ttl(string $key)
No description
at line 329
RedisCluster
type(string $key)
No description
at line 329
RedisCluster
unlink(array|string $key, string ...$other_keys)
No description
at line 329
Redis
unsubscribe(array $channels)
No description
at line 329
Redis
unwatch()
No description
at line 329
RedisCluster
vadd(string $key, array $values, mixed $element, array|null $options = 'null')
No description
at line 329
RedisCluster
vcard(string $key)
No description
at line 329
RedisCluster
vdim(string $key)
No description
at line 329
RedisCluster
vemb(string $key, mixed $member, bool $raw = 'false')
No description
at line 329
RedisCluster|string
vgetattr(string $key, mixed $member, bool $decode = 'true')
No description
at line 329
RedisCluster
vinfo(string $key)
No description
at line 329
RedisCluster
vismember(string $key, mixed $member)
No description
at line 329
RedisCluster
vlinks(string $key, mixed $member, bool $withscores = 'false')
No description
at line 329
RedisCluster|string
vrandmember(string $key, int $count = '0')
No description
at line 329
RedisCluster
vrange(string $key, string $min, string $max, int $count = '-1')
No description
at line 329
RedisCluster
vrem(string $key, mixed $member)
No description
at line 329
RedisCluster
vsetattr(string $key, mixed $member, array|string $attributes)
No description
at line 329
RedisCluster
vsim(string $key, mixed $member, array|null $options = 'null')
No description
at line 329
RedisCluster
watch(array|string $key, string ...$other_keys)
No description
at line 329
false|int
wait(int $numreplicas, int $timeout)
No description
at line 329
false|int
xack(string $key, string $group, array $ids)
No description
at line 329
RedisCluster|string
xadd(string $key, int|string $id, array $values, int $maxlen = '0', bool $approx = 'false', bool $nomkstream = 'false')
No description
at line 329
RedisCluster
xautoclaim(string $key, string $group, string $consumer, int $min_idle, int|string $start, int $count = '-1', bool $justid = 'false')
No description
at line 329
RedisCluster
xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options)
No description
at line 329
RedisCluster
xdel(string $key, array $ids)
No description
at line 329
RedisCluster
xdelex(string $key, array $ids, string|null $mode = 'null')
No description
at line 329
mixed
xgroup(string $operation, string|null $key = 'null', string|null $group = 'null', int|string|null $id_or_consumer = 'null', bool $mkstream = 'false', int $entries_read = '-2')
No description
at line 329
mixed
xinfo(string $operation, string|null $arg1 = 'null', string|null $arg2 = 'null', int $count = '-1')
No description
at line 329
RedisCluster
xlen(string $key)
No description
at line 329
RedisCluster
xpending(string $key, string $group, int|string|null $start = 'null', int|string|null $end = 'null', int $count = '-1', string|null $consumer = 'null')
No description
at line 329
RedisCluster
xrange(string $key, int|string $start, int|string $end, int $count = '-1')
No description
at line 329
RedisCluster
xread(array $streams, int $count = '-1', int $block = '-1')
No description
at line 329
RedisCluster
xreadgroup(string $group, string $consumer, array $streams, int $count = '1', int $block = '1')
No description
at line 329
RedisCluster
xrevrange(string $key, int|string $end, int|string $start, int $count = '-1')
No description
at line 329
RedisCluster
xtrim(string $key, int|string $threshold, bool $approx = 'false', bool $minid = 'false', int $limit = '-1')
No description
at line 329
RedisCluster
zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)
Add members to sorted set
at line 329
RedisCluster
zCard(string $key)
Get sorted set cardinality
at line 329
RedisCluster
zCount(string $key, float|int|string $start, float|int|string $end)
Count sorted set members by score range
at line 329
RedisCluster
zIncrBy(string $key, float $value, mixed $member)
No description
at line 329
RedisCluster
zLexCount(string $key, string $min, string $max)
No description
at line 329
RedisCluster
zMscore(string $key, mixed $member, mixed ...$other_members)
No description
at line 329
RedisCluster
zPopMax(string $key, int|null $count = 'null')
No description
at line 329
RedisCluster
zPopMin(string $key, int|null $count = 'null')
No description
at line 329
RedisCluster
zRange(string $key, string|int $start, string|int $end, array|bool|null $options = 'null')
No description
at line 329
RedisCluster
zRangeByLex(string $key, string $min, string $max, int $offset = '-1', int $count = '-1')
No description
at line 329
RedisCluster
zRangeByScore(string $key, float|int|string $min, float|int|string $max, array $options = '[]')
Get sorted set members by score range
at line 329
RedisCluster
zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = 'null')
No description
at line 329
RedisCluster|string
zRandMember(string $key, array|null $options = 'null')
No description
at line 329
RedisCluster
zRank(string $key, mixed $member)
No description
at line 329
RedisCluster
zRem(mixed $key, mixed $member, mixed ...$other_members)
Remove sorted set members
at line 329
RedisCluster
zRemRangeByLex(string $key, string $min, string $max)
No description
at line 329
RedisCluster
zRemRangeByRank(string $key, int $start, int $end)
No description
at line 329
RedisCluster
zRemRangeByScore(string $key, float|int|string $start, float|int|string $end)
No description
at line 329
RedisCluster
zRevRange(string $key, int $start, int $end, mixed $scores = 'null')
No description
at line 329
RedisCluster
zRevRangeByLex(string $key, string $max, string $min, int $offset = '-1', int $count = '-1')
No description
at line 329
RedisCluster
zRevRangeByScore(string $key, float|int|string $max, float|int|string $min, array $options = '[]') Get sorted set members by score range (reverse)
No description
at line 329
RedisCluster
zRevRank(string $key, mixed $member)
No description
at line 329
RedisCluster
zScore(string $key, mixed $member)
No description
at line 329
RedisCluster
zdiff(array $keys, array|null $options = 'null')
No description
at line 329
RedisCluster
zdiffstore(string $dst, array $keys)
No description
at line 329
RedisCluster
zinter(array $keys, array|null $weights = 'null', array|null $options = 'null')
No description
at line 329
RedisCluster
zintercard(array $keys, int $limit = '-1')
No description
at line 329
RedisCluster
zunion(array $keys, array|null $weights = 'null', array|null $options = 'null')
No description