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

__construct(Container $container, ConnectionPool $pool, array $config)

Create a new Redis connection instance.

void
release()

Release the connection back to pool.

void
discard()

Discard the connection from its pool.

mixed
getConnection()

Get the underlying connection.

bool
check()

Check if the connection is still valid.

float
getLastUseTime()

Get the last use time.

float
getLastReleaseTime()

Get the last release time.

void
markInvalid()

Mark the connection as invalid.

void
markValid()

Mark the connection as valid.

mixed
getActiveConnection()

Get the active connection.

static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $name, array $arguments)

Pass other method calls down to the underlying client.

void
invalidate()

Mark the connection invalid before its next use.

string
getName()

Get the connection name.

Dispatcher|null
getEventDispatcher()

Get the event dispatcher instance.

bool
reconnect()

Reconnect to Redis.

void
markReconnected()

Mark the underlying Redis client as freshly connected.

void
setOptions(Redis|RedisCluster $redis)

Set configured options on a Redis or RedisCluster client.

array
configuredPhpRedisOptions()

Get the phpredis options configured on the connection.

int
phpRedisOption(string $name)

Resolve a phpredis option name to its native option constant.

int
parseBackoffAlgorithm(mixed $algorithm)

Parse a friendly phpredis backoff algorithm name.

bool
close()

Close the current connection.

bool
heartbeatCheck(float $timeout)

Check the Redis client for heartbeat health.

bool|Redis
discardTransaction()

Execute the native Redis DISCARD command.

void
clearWatchState()

Clear the tracked watch state after callback-form transaction completion.

bool
isIdleExpired(float|null $now = null)

Determine if this connection has been idle long enough to be evicted.

float
getCreatedAt()

Get the connection generation creation time.

bool
isLifetimeExpired(float|null $now = null)

Determine if this connection generation has reached its maximum lifetime.

bool
shouldInvalidateAfter(RedisException|RedisClusterException|ErrorException $exception)

Determine whether a failed command left the connection unsafe to reuse.

bool
isQueueingMode()

Determine if the underlying Redis client is in pipeline/multi mode.

bool
isCluster()

Determine if the connection is to a Redis Cluster.

static bool
hasHashTag(string $key)

Determine if the given key contains a Redis Cluster hash tag.

bool
pingForHeartbeat()

Ping Redis for heartbeat health without shadowing the public Redis PING command.

void
log(string $message, string $level = LogLevel::WARNING)

Log a redis connection message.

shouldTransform(bool $shouldTransform = true)

Determine if the connection calls should be transformed to Laravel style.

bool
getShouldTransform()

Get the current transformation state.

mixed
callGet(string $key)

Returns the value of the given key.

array|false
callMget(array $keys)

Get the values of all the given keys.

array
prepareSet(mixed ...$arguments)

Prepare arguments for the set command.

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.

int
callSetnx(string $key, mixed $value)

Set the given key if it doesn't exist.

array
prepareHmget(mixed ...$arguments)

Prepare arguments for the hmget command.

array|false
callHmget(string $key, mixed ...$dictionary)

Get the value of the given hash fields.

array
prepareHmset(mixed ...$arguments)

Prepare arguments for the hmset command.

bool
callHmset(string $key, mixed ...$dictionary)

Set the given hash fields to their respective values.

int
callHsetnx(string $hash, string $key, mixed $value)

Set the given hash field if it doesn't exist.

array
prepareLrem(mixed ...$arguments)

Prepare arguments for the lrem command.

false|int
callLrem(string $key, int $count, mixed $value)

Removes the first count occurrences of the value element from the list.

array|null
callBlpop(mixed ...$arguments)

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

array|null
callBrpop(mixed ...$arguments)

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

mixed
callSpop(string $key, int|null $count = null)

Removes and returns random elements from the set value at key.

array
prepareXadd(mixed ...$arguments)

Prepare arguments for the xadd command.

false|string
callXadd(mixed ...$arguments)

Add an entry to a stream.

array
prepareXautoclaim(mixed ...$arguments)

Prepare arguments for the xautoclaim command.

array|bool
callXautoclaim(mixed ...$arguments)

Claim pending stream entries that have been idle long enough.

array
prepareXgroup(mixed ...$arguments)

Prepare arguments for the xgroup command.

mixed
callXgroup(mixed ...$arguments)

Manage stream consumer groups.

array
prepareXpending(mixed ...$arguments)

Prepare arguments for the xpending command.

array|false
callXpending(mixed ...$arguments)

Get pending entries in a stream consumer group.

array
prepareXrange(mixed ...$arguments)

Prepare arguments for the xrange command.

array|bool
callXrange(mixed ...$arguments)

Get stream entries within the given ID range.

array
prepareXrevrange(mixed ...$arguments)

Prepare arguments for the xrevrange command.

array|bool
callXrevrange(mixed ...$arguments)

Get stream entries within the given ID range in reverse order.

array
prepareXtrim(mixed ...$arguments)

Prepare arguments for the xtrim command.

false|int
callXtrim(mixed ...$arguments)

Trim a stream by its length or minimum ID.

array
prepareZadd(mixed ...$arguments)

Prepare arguments for the zadd command.

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.

array
prepareZcount(mixed ...$arguments)

Prepare arguments for the zcount command.

false|int
callZcount(mixed ...$arguments)

Count sorted set members within the given score range.

array
prepareZremrangebyscore(mixed ...$arguments)

Prepare arguments for the zremrangebyscore command.

false|int
callZremrangebyscore(mixed ...$arguments)

Remove sorted set members within the given score range.

array
prepareZrangebyscore(mixed ...$arguments)

Prepare arguments for the zrangebyscore command.

array|false
callZrangebyscore(string $key, float|int|string $min, float|int|string $max, array $options = [])

Return elements with score between $min and $max.

array
prepareZrevrangebyscore(mixed ...$arguments)

Prepare arguments for the zrevrangebyscore command.

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.

array
prepareZinterstore(mixed ...$arguments)

Prepare arguments for the zinterstore command.

false|int
callZinterstore(string $output, array $keys, array $options = [])

Find the intersection between sets and store in a new set.

array
prepareZunionstore(mixed ...$arguments)

Prepare arguments for the zunionstore command.

false|int
callZunionstore(string $output, array $keys, array $options = [])

Find the union between sets and store in a new set.

array
getScanOptions(array $arguments)

Get the Redis scan options.

mixed
scan(mixed $cursor, mixed ...$arguments)

Scan all keys based on options.

mixed
callScan(mixed $cursor, mixed ...$arguments)

Execute the transformed SCAN command.

mixed
zscan(mixed $key, mixed $cursor, mixed ...$arguments)

Scan the given set for all values based on options.

mixed
callZscan(mixed $key, mixed $cursor, mixed ...$arguments)

Execute the transformed ZSCAN command.

mixed
hscan(mixed $key, mixed $cursor, mixed ...$arguments)

Scan the given hash for all values based on options.

mixed
callHscan(mixed $key, mixed $cursor, mixed ...$arguments)

Execute the transformed HSCAN command.

mixed
sscan(mixed $key, mixed $cursor, mixed ...$arguments)

Scan the given set for all values based on options.

mixed
callSscan(mixed $key, mixed $cursor, mixed ...$arguments)

Execute the transformed SSCAN command.

array
prepareEval(mixed ...$arguments)

Prepare arguments for the eval command.

mixed
callEval(string $script, int $numberOfKeys, mixed ...$arguments)

Evaluate a script and return its result.

array
prepareEvalsha(mixed ...$arguments)

Prepare arguments for the evalsha command.

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.

array
prepareExecuteRaw(mixed ...$arguments)

Prepare arguments for the executeRaw command.

mixed
callExecuteRaw(array $parameters)

Execute a raw command.

never
callSubscribe(string $name, array $arguments)

Reject subscriptions on raw pooled connections.

bool
serialized()

Determine if a custom serializer is configured on the connection.

bool
compressed()

Determine if compression is configured on the connection.

bool
lzfCompressed()

Determine if LZF compression is enabled.

bool
zstdCompressed()

Determine if ZSTD compression is enabled.

bool
lz4Compressed()

Determine if LZ4 compression is enabled.

mixed
withoutScanPrefix(callable $callback)

Execute the given callback without prefixing scan patterns.

mixed
withoutSerializationOrCompression(callable $callback)

Execute the given callback without serialization or compression.

array
pack(array $values)

Pack values for use in Lua script ARGV parameters.

mixed
client(string $opt = '\'\'', mixed ...$args)

No description

mixed
evalWithShaCache(string $script, array $keys = [], array $args = [])

Execute a Lua script using evalSha with automatic fallback to eval.

scriptException(string $error)

Create an exception for a Lua script error.

mixed
normalizeNullReplies(mixed $result)

Normalize topology-specific null replies.

safeScan(string $pattern, int $count = 1000)

Safely scan the Redis keyspace for keys matching a pattern.

int
flushByPattern(string $pattern)

Flush (delete) all Redis keys matching a pattern.

mixed
get(string $key)

Get the value of a key

mixed
set(string $key, mixed $value, mixed $expireResolution = 'null', int|null $expireTTL = 'null', string|null $flag = 'null')

Set the value of a key

RedisCluster
mget(array $keys)

Get the values of multiple keys

RedisCluster
setnx(string $key, mixed $value)

Set key if not exists

RedisCluster
setNx(string $key, mixed $value)

Set key if not exists

RedisCluster
hmget(string $key, array $fields)

Get hash field values

RedisCluster
hmset(string $key, array $fieldValues)

Set hash field values

RedisCluster
hsetnx(string $hash, string $key, mixed $value)

Set hash field if not exists

mixed
hget(string $key, string $member)

Get hash field value

RedisCluster
hset(string $key, mixed ...$fields_and_vals)

Set hash field values

false|int
lrem(string $key, int $count, mixed $value)

Remove list elements

RedisCluster
llen(string $key)

Get list length

RedisCluster
blpop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking left pop from list

RedisCluster
brpop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking right pop from list

mixed
spop(string $key, int $count = '0')

Remove and return random set member

RedisCluster
sRem(string $key, mixed $value, mixed ...$other_values)

Remove members from set

RedisCluster
zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)

Add members to sorted set

RedisCluster
zcard(string $key)

Get sorted set cardinality

RedisCluster
zcount(string $key, float|int|string $start, float|int|string $end)

Count sorted set members by score range

RedisCluster
zrangebyscore(string $key, float|int|string $min, float|int|string $max, array $options = '[]')

Get sorted set members by score range

RedisCluster
zrevrangebyscore(string $key, float|int|string $max, float|int|string $min, array $options = '[]') Get sorted set members by score range (reverse)

No description

RedisCluster
zinterstore(string $output, array $keys, array $options = '[]')

Intersect sorted sets

RedisCluster
zunionstore(string $output, array $keys, array $options = '[]')

Union sorted sets

mixed
eval(string $script, int $numberOfKeys, mixed ...$arguments)

Evaluate Lua script

mixed
evalsha(string $script, int $numkeys, mixed ...$arguments)

Evaluate Lua script by SHA1

mixed
flushdb(mixed ...$arguments)

Flush database

mixed
executeRaw(array $parameters)

Execute raw Redis command

mixed
pipeline(callable|null $callback = 'null')

Execute commands in a pipeline

RedisCluster
smembers(string $key)

Get all set members

RedisCluster
hdel(string $key, string $field, string ...$other_fields)

Delete hash fields

RedisCluster
zrem(mixed $key, mixed $member, mixed ...$other_members)

Remove sorted set members

RedisCluster
hlen(string $key)

Get number of hash fields

RedisCluster
hkeys(string $key)

Get all hash field names

string
_serialize(mixed $value)

Serialize a value using configured serializer

string
_digest(mixed $value)

No description

string
_pack(mixed $value)

No description

mixed
_unpack(string $value)

No description

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

No description

RedisCluster
append(string $key, mixed $value)

No description

Redis
auth(mixed $credentials)

No description

RedisCluster
bgSave()

No description

RedisCluster
bgrewriteaof()

No description

RedisCluster
waitaof(int $numlocal, int $numreplicas, int $timeout)

No description

RedisCluster
bitcount(string $key, int $start = '0', int $end = '-1', bool $bybit = 'false')

No description

RedisCluster
bitop(string $operation, string $deskey, string $srckey, string ...$other_keys)

No description

RedisCluster
bitpos(string $key, bool $bit, int $start = '0', int $end = '-1', bool $bybit = 'false')

No description

RedisCluster
blPop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking left pop from list

RedisCluster
brPop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking right pop from list

RedisCluster|string
brpoplpush(string $src, string $dst, float|int $timeout)

No description

RedisCluster
bzPopMax(array|string $key, int|string $timeout_or_key, mixed ...$extra_args)

No description

RedisCluster
bzPopMin(array|string $key, int|string $timeout_or_key, mixed ...$extra_args)

No description

RedisCluster
bzmpop(float $timeout, array $keys, string $from, int $count = '1')

No description

RedisCluster
zmpop(array $keys, string $from, int $count = '1')

No description

RedisCluster
blmpop(float $timeout, array $keys, string $from, int $count = '1')

No description

RedisCluster
lmpop(array $keys, string $from, int $count = '1')

No description

bool
clearLastError()

No description

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

No description

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

No description

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

RedisCluster
copy(string $src, string $dst, array|null $options = 'null')

No description

RedisCluster
dbSize()

No description

Redis|string
debug(string $key)

No description

RedisCluster
decr(string $key, int $by = '1')

No description

RedisCluster
decrBy(string $key, int $value)

No description

RedisCluster
del(array|string $key, string ...$other_keys)

No description

RedisCluster
delex(string $key, array|null $options = 'null')

No description

RedisCluster
delifeq(string $key, mixed $value)

No description

RedisCluster|string
digest(string $key)

No description

RedisCluster|string
dump(string $key)

No description

RedisCluster|string
echo(string $str)

No description

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

No description

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

No description

Redis
exec()

No description

RedisCluster
exists(mixed $key, mixed ...$other_keys)

No description

RedisCluster
expire(string $key, int $timeout, string|null $mode = 'null')

No description

RedisCluster
expireAt(string $key, int $timestamp, string|null $mode = 'null')

No description

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

No description

RedisCluster
expiretime(string $key)

No description

RedisCluster
pexpiretime(string $key)

No description

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

No description

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

No description

RedisCluster
flushAll(bool|null $sync = 'null')

No description

mixed
flushDB(mixed ...$arguments)

Flush database

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

No description

RedisCluster
geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options)

No description

RedisCluster
geodist(string $key, string $src, string $dst, string|null $unit = 'null')

No description

RedisCluster
geohash(string $key, string $member, string ...$other_members)

No description

RedisCluster
geopos(string $key, string $member, string ...$other_members)

No description

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

No description

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

No description

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

No description

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

No description

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

No description

RedisCluster
geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = '[]')

No description

mixed
getAuth()

No description

RedisCluster
getBit(string $key, int $idx)

No description

RedisCluster|string
getEx(string $key, array $options = '[]')

No description

int
getDBNum()

No description

RedisCluster|string
getDel(string $key)

No description

string
getHost()

No description

null|string
getLastError()

No description

int
getMode()

No description

mixed
getOption(int $option)

No description

null|string
getPersistentID()

No description

int
getPort()

No description

RedisCluster|string
getRange(string $key, int $start, int $end)

No description

RedisCluster|string
lcs(string $key1, string $key2, array|null $options = 'null')

No description

float
getReadTimeout()

No description

RedisCluster|string
getset(string $key, mixed $value)

No description

false|float
getTimeout()

No description

array
getTransferredBytes()

No description

void
clearTransferredBytes()

No description

RedisCluster
getWithMeta(string $key)

No description

RedisCluster
hDel(string $key, string $field, string ...$other_fields)

Delete hash fields

RedisCluster
hexpire(string $key, int $ttl, array $fields, string|null $mode = 'null')

No description

RedisCluster
hpexpire(string $key, int $ttl, array $fields, string|null $mode = 'null')

No description

RedisCluster
hexpireat(string $key, int $time, array $fields, string|null $mode = 'null')

No description

RedisCluster
hpexpireat(string $key, int $mstime, array $fields, string|null $mode = 'null')

No description

RedisCluster
httl(string $key, array $fields)

No description

RedisCluster
hpttl(string $key, array $fields)

No description

RedisCluster
hexpiretime(string $key, array $fields)

No description

RedisCluster
hpexpiretime(string $key, array $fields)

No description

RedisCluster
hpersist(string $key, array $fields)

No description

RedisCluster
hExists(string $key, string $field)

No description

mixed
hGet(string $key, string $member)

Get hash field value

RedisCluster
hGetAll(string $key)

No description

mixed
hGetWithMeta(string $key, string $member)

No description

RedisCluster
hgetdel(string $key, array $fields)

No description

RedisCluster
hgetex(string $key, array $fields, string|array|null $expiry = 'null')

No description

RedisCluster
hIncrBy(string $key, string $field, int $value)

No description

RedisCluster
hIncrByFloat(string $key, string $field, float $value)

No description

RedisCluster
hKeys(string $key)

Get all hash field names

RedisCluster
hLen(string $key)

Get number of hash fields

RedisCluster
hMget(string $key, array $fields)

Get hash field values

RedisCluster
hMset(string $key, array $fieldValues)

Set hash field values

RedisCluster|string
hRandField(string $key, array|null $options = 'null')

No description

RedisCluster
hSet(string $key, mixed ...$fields_and_vals)

Set hash field values

RedisCluster
hSetNx(string $hash, string $key, mixed $value)

Set hash field if not exists

RedisCluster
hsetex(string $key, array $fields, array|null $expiry = 'null')

No description

RedisCluster
hStrLen(string $key, string $field)

No description

RedisCluster
hVals(string $key)

No description

RedisCluster
incr(string $key, int $by = '1')

No description

RedisCluster
incrBy(string $key, int $value)

No description

RedisCluster
incrByFloat(string $key, float $value)

No description

RedisCluster
info(string ...$sections)

No description

bool
isConnected()

No description

RedisCluster
keys(string $pattern)

No description

RedisCluster
lInsert(string $key, string $pos, mixed $pivot, mixed $value)

No description

RedisCluster
lLen(string $key)

Get list length

RedisCluster|string
lMove(string $src, string $dst, string $wherefrom, string $whereto)

No description

RedisCluster|string
blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout)

No description

RedisCluster|string
lPop(string $key, int $count = '0')

No description

RedisCluster
lPos(string $key, mixed $value, array|null $options = 'null')

No description

RedisCluster
lPush(string $key, mixed ...$elements)

No description

RedisCluster
rPush(string $key, mixed ...$elements)

No description

RedisCluster
lPushx(string $key, mixed $value)

No description

RedisCluster
rPushx(string $key, mixed $value)

No description

RedisCluster
lSet(string $key, int $index, mixed $value)

No description

int
lastSave()

No description

mixed
lindex(string $key, int $index)

No description

RedisCluster
lrange(string $key, int $start, int $end)

No description

RedisCluster
ltrim(string $key, int $start, int $end)

No description

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

No description

Redis
move(string $key, int $index)

No description

RedisCluster
mset(array $key_values)

No description

RedisCluster
msetex(array $key_values, int|float|array|null $expiry = 'null')

No description

RedisCluster
msetnx(array $key_values)

No description

RedisCluster
multi(int $value = '1')

No description

RedisCluster|string
object(string $subcommand, string $key)

No description

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

RedisCluster
persist(string $key)

No description

bool
pexpire(string $key, int $timeout, string|null $mode = 'null')

No description

RedisCluster
pexpireAt(string $key, int $timestamp, string|null $mode = 'null')

No description

RedisCluster
pfadd(string $key, array $elements)

No description

RedisCluster
pfcount(array|string $key_or_keys)

No description

RedisCluster
pfmerge(string $dst, array $srckeys)

No description

RedisCluster|string
ping(string|null $message = 'null')

No description

RedisCluster
psetex(string $key, int $expire, mixed $value)

No description

RedisCluster
pttl(string $key)

No description

RedisCluster
publish(string $channel, string $message)

No description

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

No description

Redis
punsubscribe(array $patterns)

No description

RedisCluster|string
rPop(string $key, int $count = '0')

No description

RedisCluster|string
randomKey()

No description

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

No description

RedisCluster
rename(string $old_name, string $new_name)

No description

RedisCluster
renameNx(string $key_src, string $key_dst)

No description

RedisCluster
restore(string $key, int $ttl, string $value, array|null $options = 'null')

No description

mixed
role()

No description

RedisCluster|string
rpoplpush(string $srckey, string $dstkey)

No description

RedisCluster
sAdd(string $key, mixed $value, mixed ...$other_values)

No description

int
sAddArray(string $key, array $values)

No description

RedisCluster
sDiff(string $key, string ...$other_keys)

No description

RedisCluster
sDiffStore(string $dst, string $key, string ...$other_keys)

No description

RedisCluster
sInter(array|string $key, string ...$other_keys)

No description

RedisCluster
sintercard(array $keys, int $limit = '-1')

No description

RedisCluster
sInterStore(array|string $key, string ...$other_keys)

No description

RedisCluster
sMembers(string $key)

Get all set members

RedisCluster
sMisMember(string $key, string $member, string ...$other_members)

No description

RedisCluster
sMove(string $src, string $dst, mixed $value)

No description

mixed
sPop(string $key, int $count = '0')

Remove and return random set member

mixed
sRandMember(string $key, int $count = '0')

No description

RedisCluster
sUnion(string $key, string ...$other_keys)

No description

RedisCluster
sUnionStore(string $dst, string $key, string ...$other_keys)

No description

RedisCluster
save()

No description

RedisCluster
scard(string $key)

No description

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

No description

Redis
select(int $db)

No description

false|string
serverName()

No description

false|string
serverVersion()

No description

RedisCluster
setBit(string $key, int $idx, bool $value)

No description

RedisCluster
setRange(string $key, int $index, string $value)

No description

bool
setOption(int $option, mixed $value)

No description

RedisCluster
setex(string $key, int $expire, mixed $value)

No description

RedisCluster
sismember(string $key, mixed $value)

No description

Redis
replicaof(string|null $host = 'null', int $port = '6379')

No description

RedisCluster
touch(array|string $key_or_array, string ...$more_keys)

No description

mixed
slowlog(string $operation, int $length = '0')

No description

mixed
sort(string $key, array|null $options = 'null')

No description

mixed
sort_ro(string $key, array|null $options = 'null')

No description

RedisCluster
srem(string $key, mixed $value, mixed ...$other_values)

Remove members from set

RedisCluster
strlen(string $key)

No description

Redis
sunsubscribe(array $channels)

No description

Redis
swapdb(int $src, int $dst)

No description

RedisCluster
time()

No description

RedisCluster
ttl(string $key)

No description

RedisCluster
type(string $key)

No description

RedisCluster
unlink(array|string $key, string ...$other_keys)

No description

Redis
unsubscribe(array $channels)

No description

Redis
unwatch()

No description

RedisCluster
vadd(string $key, array $values, mixed $element, array|null $options = 'null')

No description

RedisCluster
vcard(string $key)

No description

RedisCluster
vdim(string $key)

No description

RedisCluster
vemb(string $key, mixed $member, bool $raw = 'false')

No description

RedisCluster|string
vgetattr(string $key, mixed $member, bool $decode = 'true')

No description

RedisCluster
vinfo(string $key)

No description

RedisCluster
vismember(string $key, mixed $member)

No description

RedisCluster
vlinks(string $key, mixed $member, bool $withscores = 'false')

No description

RedisCluster|string
vrandmember(string $key, int $count = '0')

No description

RedisCluster
vrange(string $key, string $min, string $max, int $count = '-1')

No description

RedisCluster
vrem(string $key, mixed $member)

No description

RedisCluster
vsetattr(string $key, mixed $member, array|string $attributes)

No description

RedisCluster
vsim(string $key, mixed $member, array|null $options = 'null')

No description

RedisCluster
watch(array|string $key, string ...$other_keys)

No description

false|int
wait(int $numreplicas, int $timeout)

No description

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

No description

RedisCluster|string
xadd(string $key, int|string $id, array $values, int $maxlen = '0', bool $approx = 'false', bool $nomkstream = 'false')

No description

RedisCluster
xautoclaim(string $key, string $group, string $consumer, int $min_idle, int|string $start, int $count = '-1', bool $justid = 'false')

No description

RedisCluster
xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options)

No description

RedisCluster
xdel(string $key, array $ids)

No description

RedisCluster
xdelex(string $key, array $ids, string|null $mode = 'null')

No description

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

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

No description

RedisCluster
xlen(string $key)

No description

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

RedisCluster
xrange(string $key, int|string $start, int|string $end, int $count = '-1')

No description

RedisCluster
xread(array $streams, int $count = '-1', int $block = '-1')

No description

RedisCluster
xreadgroup(string $group, string $consumer, array $streams, int $count = '1', int $block = '1')

No description

RedisCluster
xrevrange(string $key, int|string $end, int|string $start, int $count = '-1')

No description

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

No description

RedisCluster
zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)

Add members to sorted set

RedisCluster
zCard(string $key)

Get sorted set cardinality

RedisCluster
zCount(string $key, float|int|string $start, float|int|string $end)

Count sorted set members by score range

RedisCluster
zIncrBy(string $key, float $value, mixed $member)

No description

RedisCluster
zLexCount(string $key, string $min, string $max)

No description

RedisCluster
zMscore(string $key, mixed $member, mixed ...$other_members)

No description

RedisCluster
zPopMax(string $key, int|null $count = 'null')

No description

RedisCluster
zPopMin(string $key, int|null $count = 'null')

No description

RedisCluster
zRange(string $key, string|int $start, string|int $end, array|bool|null $options = 'null')

No description

RedisCluster
zRangeByLex(string $key, string $min, string $max, int $offset = '-1', int $count = '-1')

No description

RedisCluster
zRangeByScore(string $key, float|int|string $min, float|int|string $max, array $options = '[]')

Get sorted set members by score range

RedisCluster
zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = 'null')

No description

RedisCluster|string
zRandMember(string $key, array|null $options = 'null')

No description

RedisCluster
zRank(string $key, mixed $member)

No description

RedisCluster
zRem(mixed $key, mixed $member, mixed ...$other_members)

Remove sorted set members

RedisCluster
zRemRangeByLex(string $key, string $min, string $max)

No description

RedisCluster
zRemRangeByRank(string $key, int $start, int $end)

No description

RedisCluster
zRemRangeByScore(string $key, float|int|string $start, float|int|string $end)

No description

RedisCluster
zRevRange(string $key, int $start, int $end, mixed $scores = 'null')

No description

RedisCluster
zRevRangeByLex(string $key, string $max, string $min, int $offset = '-1', int $count = '-1')

No description

RedisCluster
zRevRangeByScore(string $key, float|int|string $max, float|int|string $min, array $options = '[]') Get sorted set members by score range (reverse)

No description

RedisCluster
zRevRank(string $key, mixed $member)

No description

RedisCluster
zScore(string $key, mixed $member)

No description

RedisCluster
zdiff(array $keys, array|null $options = 'null')

No description

RedisCluster
zdiffstore(string $dst, array $keys)

No description

RedisCluster
zinter(array $keys, array|null $weights = 'null', array|null $options = 'null')

No description

RedisCluster
zintercard(array $keys, int $limit = '-1')

No description

RedisCluster
zunion(array $keys, array|null $weights = 'null', array|null $options = 'null')

No description

Details

at line 379
__construct(Container $container, ConnectionPool $pool, array $config)

Create a new Redis connection instance.

Parameters

Container $container
ConnectionPool $pool
array $config

at line 782
void release()

Release the connection back to pool.

Return Value

void

in Connection at line 99
void discard()

Discard the connection from its pool.

Return Value

void

in Connection at line 107
mixed getConnection()

Get the underlying connection.

Return Value

mixed

at line 491
bool check()

Check if the connection is still valid.

Return Value

bool

in Connection at line 134
float getLastUseTime()

Get the last use time.

Return Value

float

in Connection at line 142
float getLastReleaseTime()

Get the last release time.

Return Value

float

in Connection at line 150
protected void markInvalid()

Mark the connection as invalid.

Return Value

void

in Connection at line 158
protected void markValid()

Mark the connection as valid.

Return Value

void

at line 473
mixed getActiveConnection()

Get the active connection.

Return Value

mixed

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.

Parameters

string $name
callable|object $macro

Return Value

void

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.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 57
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

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.

Return Value

void

in Macroable at line 78
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

at line 388
mixed __call(string $name, array $arguments)

Pass other method calls down to the underlying client.

Parameters

string $name
array $arguments

Return Value

mixed

at line 524
void invalidate()

internal  
 

Mark the connection invalid before its next use.

Return Value

void

at line 532
string getName()

Get the connection name.

Return Value

string

at line 540
Dispatcher|null getEventDispatcher()

Get the event dispatcher instance.

Return Value

Dispatcher|null

at line 551
abstract bool reconnect()

Reconnect to Redis.

Return Value

bool

at line 556
protected void markReconnected()

Mark the underlying Redis client as freshly connected.

Return Value

void

at line 570
protected void setOptions(Redis|RedisCluster $redis)

Set configured options on a Redis or RedisCluster client.

Parameters

Redis|RedisCluster $redis

Return Value

void

at line 613
protected array configuredPhpRedisOptions()

Get the phpredis options configured on the connection.

Return Value

array

at line 633
protected int phpRedisOption(string $name)

Resolve a phpredis option name to its native option constant.

Parameters

string $name

Return Value

int

at line 659
protected int parseBackoffAlgorithm(mixed $algorithm)

Parse a friendly phpredis backoff algorithm name.

Parameters

mixed $algorithm

Return Value

int

Exceptions

InvalidRedisOptionException

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.

Return Value

bool

Exceptions

CanceledException

at line 714
bool heartbeatCheck(float $timeout)

Check the Redis client for heartbeat health.

Parameters

float $timeout

Return Value

bool

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.

Return Value

bool|Redis

at line 944
void clearWatchState()

internal  
 

Clear the tracked watch state after callback-form transaction completion.

Return Value

void

at line 952
bool isIdleExpired(float|null $now = null)

Determine if this connection has been idle long enough to be evicted.

Parameters

float|null $now

Return Value

bool

at line 967
float getCreatedAt()

Get the connection generation creation time.

Return Value

float

at line 975
bool isLifetimeExpired(float|null $now = null)

Determine if this connection generation has reached its maximum lifetime.

Parameters

float|null $now

Return Value

bool

at line 987
protected bool shouldInvalidateAfter(RedisException|RedisClusterException|ErrorException $exception)

Determine whether a failed command left the connection unsafe to reuse.

Parameters

RedisException|RedisClusterException|ErrorException $exception

Return Value

bool

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.

Return Value

bool

at line 1022
bool isCluster()

Determine if the connection is to a Redis Cluster.

Return Value

bool

at line 1030
static bool hasHashTag(string $key)

Determine if the given key contains a Redis Cluster hash tag.

Parameters

string $key

Return Value

bool

at line 1046
protected bool pingForHeartbeat()

Ping Redis for heartbeat health without shadowing the public Redis PING command.

Return Value

bool

at line 1085
protected void log(string $message, string $level = LogLevel::WARNING)

Log a redis connection message.

Parameters

string $message
string $level

Return Value

void

at line 1095
RedisConnection shouldTransform(bool $shouldTransform = true)

Determine if the connection calls should be transformed to Laravel style.

Parameters

bool $shouldTransform

Return Value

RedisConnection

at line 1105
bool getShouldTransform()

Get the current transformation state.

Return Value

bool

at line 1113
protected mixed callGet(string $key)

Returns the value of the given key.

Parameters

string $key

Return Value

mixed

at line 1123
protected array|false callMget(array $keys)

Get the values of all the given keys.

Parameters

array $keys

Return Value

array|false

at line 1146
protected array prepareSet(mixed ...$arguments)

Prepare arguments for the set command.

Parameters

mixed ...$arguments

Return Value

array

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.

Parameters

string $key
mixed $value
mixed $expireResolution
int|null $expireTTL
string|null $flag

Return Value

mixed

at line 1170
protected int callSetnx(string $key, mixed $value)

Set the given key if it doesn't exist.

Parameters

string $key
mixed $value

Return Value

int

at line 1180
protected array prepareHmget(mixed ...$arguments)

Prepare arguments for the hmget command.

Parameters

mixed ...$arguments

Return Value

array

at line 1191
protected array|false callHmget(string $key, mixed ...$dictionary)

Get the value of the given hash fields.

Parameters

string $key
mixed ...$dictionary

Return Value

array|false

at line 1209
protected array prepareHmset(mixed ...$arguments)

Prepare arguments for the hmset command.

Parameters

mixed ...$arguments

Return Value

array

at line 1227
protected bool callHmset(string $key, mixed ...$dictionary)

Set the given hash fields to their respective values.

Parameters

string $key
mixed ...$dictionary

Return Value

bool

at line 1237
protected int callHsetnx(string $hash, string $key, mixed $value)

Set the given hash field if it doesn't exist.

Parameters

string $hash
string $key
mixed $value

Return Value

int

at line 1247
protected array prepareLrem(mixed ...$arguments)

Prepare arguments for the lrem command.

Parameters

mixed ...$arguments

Return Value

array

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.

Parameters

string $key
int $count
mixed $value

Return Value

false|int

at line 1267
protected array|null callBlpop(mixed ...$arguments)

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

Parameters

mixed ...$arguments

Return Value

array|null

at line 1277
protected array|null callBrpop(mixed ...$arguments)

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

Parameters

mixed ...$arguments

Return Value

array|null

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.

Parameters

string $key
int|null $count

Return Value

mixed

at line 1324
protected array prepareXadd(mixed ...$arguments)

Prepare arguments for the xadd command.

Parameters

mixed ...$arguments

Return Value

array

at line 1332
protected false|string callXadd(mixed ...$arguments)

Add an entry to a stream.

Parameters

mixed ...$arguments

Return Value

false|string

at line 1344
protected array prepareXautoclaim(mixed ...$arguments)

Prepare arguments for the xautoclaim command.

Parameters

mixed ...$arguments

Return Value

array

at line 1352
protected array|bool callXautoclaim(mixed ...$arguments)

Claim pending stream entries that have been idle long enough.

Parameters

mixed ...$arguments

Return Value

array|bool

at line 1364
protected array prepareXgroup(mixed ...$arguments)

Prepare arguments for the xgroup command.

Parameters

mixed ...$arguments

Return Value

array

at line 1372
protected mixed callXgroup(mixed ...$arguments)

Manage stream consumer groups.

Parameters

mixed ...$arguments

Return Value

mixed

at line 1384
protected array prepareXpending(mixed ...$arguments)

Prepare arguments for the xpending command.

Parameters

mixed ...$arguments

Return Value

array

at line 1392
protected array|false callXpending(mixed ...$arguments)

Get pending entries in a stream consumer group.

Parameters

mixed ...$arguments

Return Value

array|false

at line 1404
protected array prepareXrange(mixed ...$arguments)

Prepare arguments for the xrange command.

Parameters

mixed ...$arguments

Return Value

array

at line 1412
protected array|bool callXrange(mixed ...$arguments)

Get stream entries within the given ID range.

Parameters

mixed ...$arguments

Return Value

array|bool

at line 1424
protected array prepareXrevrange(mixed ...$arguments)

Prepare arguments for the xrevrange command.

Parameters

mixed ...$arguments

Return Value

array

at line 1432
protected array|bool callXrevrange(mixed ...$arguments)

Get stream entries within the given ID range in reverse order.

Parameters

mixed ...$arguments

Return Value

array|bool

at line 1444
protected array prepareXtrim(mixed ...$arguments)

Prepare arguments for the xtrim command.

Parameters

mixed ...$arguments

Return Value

array

at line 1452
protected false|int callXtrim(mixed ...$arguments)

Trim a stream by its length or minimum ID.

Parameters

mixed ...$arguments

Return Value

false|int

at line 1464
protected array prepareZadd(mixed ...$arguments)

Prepare arguments for the zadd command.

Parameters

mixed ...$arguments

Return Value

array

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.

Parameters

string $key
mixed ...$dictionary

Return Value

false|float|int

at line 1504
protected array prepareZcount(mixed ...$arguments)

Prepare arguments for the zcount command.

Parameters

mixed ...$arguments

Return Value

array

at line 1512
protected false|int callZcount(mixed ...$arguments)

Count sorted set members within the given score range.

Parameters

mixed ...$arguments

Return Value

false|int

at line 1524
protected array prepareZremrangebyscore(mixed ...$arguments)

Prepare arguments for the zremrangebyscore command.

Parameters

mixed ...$arguments

Return Value

array

at line 1532
protected false|int callZremrangebyscore(mixed ...$arguments)

Remove sorted set members within the given score range.

Parameters

mixed ...$arguments

Return Value

false|int

at line 1544
protected array prepareZrangebyscore(mixed ...$arguments)

Prepare arguments for the zrangebyscore command.

Parameters

mixed ...$arguments

Return Value

array

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.

Parameters

string $key
float|int|string $min
float|int|string $max
array $options

Return Value

array|false

at line 1574
protected array prepareZrevrangebyscore(mixed ...$arguments)

Prepare arguments for the zrevrangebyscore command.

Parameters

mixed ...$arguments

Return Value

array

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.

Parameters

string $key
float|int|string $max
float|int|string $min
array $options

Return Value

array|false

at line 1604
protected array prepareZinterstore(mixed ...$arguments)

Prepare arguments for the zinterstore command.

Parameters

mixed ...$arguments

Return Value

array

at line 1615
protected false|int callZinterstore(string $output, array $keys, array $options = [])

Find the intersection between sets and store in a new set.

Parameters

string $output
array $keys
array $options

Return Value

false|int

at line 1627
protected array prepareZunionstore(mixed ...$arguments)

Prepare arguments for the zunionstore command.

Parameters

mixed ...$arguments

Return Value

array

at line 1638
protected false|int callZunionstore(string $output, array $keys, array $options = [])

Find the union between sets and store in a new set.

Parameters

string $output
array $keys
array $options

Return Value

false|int

at line 1648
protected array getScanOptions(array $arguments)

Get the Redis scan options.

Parameters

array $arguments

Return Value

array

at line 1661
mixed scan(mixed $cursor, mixed ...$arguments)

Scan all keys based on options.

Parameters

mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1669
protected mixed callScan(mixed $cursor, mixed ...$arguments)

Execute the transformed SCAN command.

Parameters

mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1691
mixed zscan(mixed $key, mixed $cursor, mixed ...$arguments)

Scan the given set for all values based on options.

Parameters

mixed $key
mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1699
protected mixed callZscan(mixed $key, mixed $cursor, mixed ...$arguments)

Execute the transformed ZSCAN command.

Parameters

mixed $key
mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1722
mixed hscan(mixed $key, mixed $cursor, mixed ...$arguments)

Scan the given hash for all values based on options.

Parameters

mixed $key
mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1730
protected mixed callHscan(mixed $key, mixed $cursor, mixed ...$arguments)

Execute the transformed HSCAN command.

Parameters

mixed $key
mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1753
mixed sscan(mixed $key, mixed $cursor, mixed ...$arguments)

Scan the given set for all values based on options.

Parameters

mixed $key
mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1761
protected mixed callSscan(mixed $key, mixed $cursor, mixed ...$arguments)

Execute the transformed SSCAN command.

Parameters

mixed $key
mixed $cursor
mixed ...$arguments

Return Value

mixed

at line 1784
protected array prepareEval(mixed ...$arguments)

Prepare arguments for the eval command.

Parameters

mixed ...$arguments

Return Value

array

at line 1796
protected mixed callEval(string $script, int $numberOfKeys, mixed ...$arguments)

Evaluate a script and return its result.

Parameters

string $script
int $numberOfKeys
mixed ...$arguments

Return Value

mixed

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.

Parameters

mixed ...$arguments

Return Value

array

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.

Parameters

string $script
int $numkeys
mixed ...$arguments

Return Value

mixed

at line 1837
protected array prepareExecuteRaw(mixed ...$arguments)

Prepare arguments for the executeRaw command.

Parameters

mixed ...$arguments

Return Value

array

at line 1845
protected mixed callExecuteRaw(array $parameters)

Execute a raw command.

Parameters

array $parameters

Return Value

mixed

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();

Parameters

string $name
array $arguments

Return Value

never

Exceptions

BadMethodCallException

at line 1875
bool serialized()

Determine if a custom serializer is configured on the connection.

Return Value

bool

at line 1883
bool compressed()

Determine if compression is configured on the connection.

Return Value

bool

at line 1891
bool lzfCompressed()

Determine if LZF compression is enabled.

Return Value

bool

at line 1900
bool zstdCompressed()

Determine if ZSTD compression is enabled.

Return Value

bool

at line 1909
bool lz4Compressed()

Determine if LZ4 compression is enabled.

Return Value

bool

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.

Parameters

callable $callback

Return Value

mixed

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.

Parameters

callable $callback

Return Value

mixed

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.

Parameters

array $values

Return Value

array

at line 329
mixed client(string $opt = '\'\'', mixed ...$args)

No description

Parameters

string $opt
mixed ...$args

Return Value

mixed

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.

Parameters

string $script

The Lua script to execute

array $keys

Redis keys (passed as KEYS[] in Lua)

array $args

Additional arguments (passed as ARGV[] in Lua)

Return Value

mixed

The script's return value

Exceptions

LuaScriptException
RedisException

at line 2086
protected Throwable scriptException(string $error)

Create an exception for a Lua script error.

Parameters

string $error

Return Value

Throwable

at line 2094
protected mixed normalizeNullReplies(mixed $result)

Normalize topology-specific null replies.

Parameters

mixed $result

Return Value

mixed

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.

Parameters

string $pattern

The logical key pattern (e.g., "cache:users:*"). OPT_PREFIX is added automatically; the pattern is preserved even when it starts with the same bytes as OPT_PREFIX.

int $count

The COUNT hint for SCAN (not a limit, just a hint to Redis)

Return Value

Generator

Yields keys with OPT_PREFIX stripped

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.

Parameters

string $pattern

The logical key pattern (e.g., "cache:test:*"). OPT_PREFIX is added automatically; the pattern is preserved even when it starts with the same bytes as OPT_PREFIX.

Return Value

int

Number of keys deleted

Exceptions

RedisException

at line 329
mixed get(string $key)

Get the value of a key

Parameters

string $key

Return Value

mixed

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

Parameters

string $key
mixed $value
mixed $expireResolution
int|null $expireTTL
string|null $flag

Return Value

mixed

at line 329
RedisCluster mget(array $keys)

Get the values of multiple keys

Parameters

array $keys

Return Value

RedisCluster

at line 329
RedisCluster setnx(string $key, mixed $value)

Set key if not exists

Parameters

string $key
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster setNx(string $key, mixed $value)

Set key if not exists

Parameters

string $key
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster hmget(string $key, array $fields)

Get hash field values

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hmset(string $key, array $fieldValues)

Set hash field values

Parameters

string $key
array $fieldValues

Return Value

RedisCluster

at line 329
RedisCluster hsetnx(string $hash, string $key, mixed $value)

Set hash field if not exists

Parameters

string $hash
string $key
mixed $value

Return Value

RedisCluster

at line 329
mixed hget(string $key, string $member)

Get hash field value

Parameters

string $key
string $member

Return Value

mixed

at line 329
RedisCluster hset(string $key, mixed ...$fields_and_vals)

Set hash field values

Parameters

string $key
mixed ...$fields_and_vals

Return Value

RedisCluster

at line 329
false|int lrem(string $key, int $count, mixed $value)

Remove list elements

Parameters

string $key
int $count
mixed $value

Return Value

false|int

at line 329
RedisCluster llen(string $key)

Get list length

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster blpop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking left pop from list

Parameters

array|string $key_or_keys
float|int|string $timeout_or_key
mixed ...$extra_args

Return Value

RedisCluster

at line 329
RedisCluster brpop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking right pop from list

Parameters

array|string $key_or_keys
float|int|string $timeout_or_key
mixed ...$extra_args

Return Value

RedisCluster

at line 329
mixed spop(string $key, int $count = '0')

Remove and return random set member

Parameters

string $key
int $count

Return Value

mixed

at line 329
RedisCluster sRem(string $key, mixed $value, mixed ...$other_values)

Remove members from set

Parameters

string $key
mixed $value
mixed ...$other_values

Return Value

RedisCluster

at line 329
RedisCluster zadd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)

Add members to sorted set

Parameters

string $key
array|float $score_or_options
mixed ...$more_scores_and_mems

Return Value

RedisCluster

at line 329
RedisCluster zcard(string $key)

Get sorted set cardinality

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster zcount(string $key, float|int|string $start, float|int|string $end)

Count sorted set members by score range

Parameters

string $key
float|int|string $start
float|int|string $end

Return Value

RedisCluster

at line 329
RedisCluster zrangebyscore(string $key, float|int|string $min, float|int|string $max, array $options = '[]')

Get sorted set members by score range

Parameters

string $key
float|int|string $min
float|int|string $max
array $options

Return Value

RedisCluster

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

Parameters

string $key
float|int|string $max
float|int|string $min
array $options

Return Value

RedisCluster

at line 329
RedisCluster zinterstore(string $output, array $keys, array $options = '[]')

Intersect sorted sets

Parameters

string $output
array $keys
array $options

Return Value

RedisCluster

at line 329
RedisCluster zunionstore(string $output, array $keys, array $options = '[]')

Union sorted sets

Parameters

string $output
array $keys
array $options

Return Value

RedisCluster

at line 329
mixed eval(string $script, int $numberOfKeys, mixed ...$arguments)

Evaluate Lua script

Parameters

string $script
int $numberOfKeys
mixed ...$arguments

Return Value

mixed

at line 329
mixed evalsha(string $script, int $numkeys, mixed ...$arguments)

Evaluate Lua script by SHA1

Parameters

string $script
int $numkeys
mixed ...$arguments

Return Value

mixed

at line 329
mixed flushdb(mixed ...$arguments)

Flush database

Parameters

mixed ...$arguments

Return Value

mixed

at line 329
mixed executeRaw(array $parameters)

Execute raw Redis command

Parameters

array $parameters

Return Value

mixed

at line 329
mixed pipeline(callable|null $callback = 'null')

Execute commands in a pipeline

Parameters

callable|null $callback

Return Value

mixed

at line 329
RedisCluster smembers(string $key)

Get all set members

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster hdel(string $key, string $field, string ...$other_fields)

Delete hash fields

Parameters

string $key
string $field
string ...$other_fields

Return Value

RedisCluster

at line 329
RedisCluster zrem(mixed $key, mixed $member, mixed ...$other_members)

Remove sorted set members

Parameters

mixed $key
mixed $member
mixed ...$other_members

Return Value

RedisCluster

at line 329
RedisCluster hlen(string $key)

Get number of hash fields

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster hkeys(string $key)

Get all hash field names

Parameters

string $key

Return Value

RedisCluster

at line 329
string _serialize(mixed $value)

Serialize a value using configured serializer

Parameters

mixed $value

Return Value

string

at line 329
string _digest(mixed $value)

No description

Parameters

mixed $value

Return Value

string

at line 329
string _pack(mixed $value)

No description

Parameters

mixed $value

Return Value

string

at line 329
mixed _unpack(string $value)

No description

Parameters

string $value

Return Value

mixed

at line 329
mixed acl(string $subcmd, string ...$args)

No description

Parameters

string $subcmd
string ...$args

Return Value

mixed

at line 329
RedisCluster append(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

RedisCluster

at line 329
Redis auth(mixed $credentials)

No description

Parameters

mixed $credentials

Return Value

Redis

at line 329
RedisCluster bgSave()

No description

Return Value

RedisCluster

at line 329
RedisCluster bgrewriteaof()

No description

Return Value

RedisCluster

at line 329
RedisCluster waitaof(int $numlocal, int $numreplicas, int $timeout)

No description

Parameters

int $numlocal
int $numreplicas
int $timeout

Return Value

RedisCluster

at line 329
RedisCluster bitcount(string $key, int $start = '0', int $end = '-1', bool $bybit = 'false')

No description

Parameters

string $key
int $start
int $end
bool $bybit

Return Value

RedisCluster

at line 329
RedisCluster bitop(string $operation, string $deskey, string $srckey, string ...$other_keys)

No description

Parameters

string $operation
string $deskey
string $srckey
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster bitpos(string $key, bool $bit, int $start = '0', int $end = '-1', bool $bybit = 'false')

No description

Parameters

string $key
bool $bit
int $start
int $end
bool $bybit

Return Value

RedisCluster

at line 329
RedisCluster blPop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking left pop from list

Parameters

array|string $key_or_keys
float|int|string $timeout_or_key
mixed ...$extra_args

Return Value

RedisCluster

at line 329
RedisCluster brPop(array|string $key_or_keys, float|int|string $timeout_or_key, mixed ...$extra_args)

Blocking right pop from list

Parameters

array|string $key_or_keys
float|int|string $timeout_or_key
mixed ...$extra_args

Return Value

RedisCluster

at line 329
RedisCluster|string brpoplpush(string $src, string $dst, float|int $timeout)

No description

Parameters

string $src
string $dst
float|int $timeout

Return Value

RedisCluster|string

at line 329
RedisCluster bzPopMax(array|string $key, int|string $timeout_or_key, mixed ...$extra_args)

No description

Parameters

array|string $key
int|string $timeout_or_key
mixed ...$extra_args

Return Value

RedisCluster

at line 329
RedisCluster bzPopMin(array|string $key, int|string $timeout_or_key, mixed ...$extra_args)

No description

Parameters

array|string $key
int|string $timeout_or_key
mixed ...$extra_args

Return Value

RedisCluster

at line 329
RedisCluster bzmpop(float $timeout, array $keys, string $from, int $count = '1')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster zmpop(array $keys, string $from, int $count = '1')

No description

Parameters

array $keys
string $from
int $count

Return Value

RedisCluster

at line 329
RedisCluster blmpop(float $timeout, array $keys, string $from, int $count = '1')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster lmpop(array $keys, string $from, int $count = '1')

No description

Parameters

array $keys
string $from
int $count

Return Value

RedisCluster

at line 329
bool clearLastError()

No description

Return Value

bool

at line 329
mixed command(string|null $opt = 'null', mixed ...$args)

No description

Parameters

string|null $opt
mixed ...$args

Return Value

mixed

at line 329
mixed config(string $operation, array|string|null $key_or_settings = 'null', string|null $value = 'null')

No description

Parameters

string $operation
array|string|null $key_or_settings
string|null $value

Return Value

mixed

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

Parameters

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

Return Value

bool

at line 329
RedisCluster copy(string $src, string $dst, array|null $options = 'null')

No description

Parameters

string $src
string $dst
array|null $options

Return Value

RedisCluster

at line 329
RedisCluster dbSize()

No description

Return Value

RedisCluster

at line 329
Redis|string debug(string $key)

No description

Parameters

string $key

Return Value

Redis|string

at line 329
RedisCluster decr(string $key, int $by = '1')

No description

Parameters

string $key
int $by

Return Value

RedisCluster

at line 329
RedisCluster decrBy(string $key, int $value)

No description

Parameters

string $key
int $value

Return Value

RedisCluster

at line 329
RedisCluster del(array|string $key, string ...$other_keys)

No description

Parameters

array|string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster delex(string $key, array|null $options = 'null')

No description

Parameters

string $key
array|null $options

Return Value

RedisCluster

at line 329
RedisCluster delifeq(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster|string digest(string $key)

No description

Parameters

string $key

Return Value

RedisCluster|string

at line 329
RedisCluster|string dump(string $key)

No description

Parameters

string $key

Return Value

RedisCluster|string

at line 329
RedisCluster|string echo(string $str)

No description

Parameters

string $str

Return Value

RedisCluster|string

at line 329
mixed eval_ro(string $script_sha, array $args = '[]', int $num_keys = '0')

No description

Parameters

string $script_sha
array $args
int $num_keys

Return Value

mixed

at line 329
mixed evalsha_ro(string $sha1, array $args = '[]', int $num_keys = '0')

No description

Parameters

string $sha1
array $args
int $num_keys

Return Value

mixed

at line 329
Redis exec()

No description

Return Value

Redis

at line 329
RedisCluster exists(mixed $key, mixed ...$other_keys)

No description

Parameters

mixed $key
mixed ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster expire(string $key, int $timeout, string|null $mode = 'null')

No description

Parameters

string $key
int $timeout
string|null $mode

Return Value

RedisCluster

at line 329
RedisCluster expireAt(string $key, int $timestamp, string|null $mode = 'null')

No description

Parameters

string $key
int $timestamp
string|null $mode

Return Value

RedisCluster

at line 329
Redis failover(array|null $to = 'null', bool $abort = 'false', int $timeout = '0')

No description

Parameters

array|null $to
bool $abort
int $timeout

Return Value

Redis

at line 329
RedisCluster expiretime(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster pexpiretime(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
mixed fcall(string $fn, array $keys = '[]', array $args = '[]')

No description

Parameters

string $fn
array $keys
array $args

Return Value

mixed

at line 329
mixed fcall_ro(string $fn, array $keys = '[]', array $args = '[]')

No description

Parameters

string $fn
array $keys
array $args

Return Value

mixed

at line 329
RedisCluster flushAll(bool|null $sync = 'null')

No description

Parameters

bool|null $sync

Return Value

RedisCluster

at line 329
mixed flushDB(mixed ...$arguments)

Flush database

Parameters

mixed ...$arguments

Return Value

mixed

at line 329
Redis|string function(string $operation, mixed ...$args)

No description

Parameters

string $operation
mixed ...$args

Return Value

Redis|string

at line 329
RedisCluster geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options)

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster geodist(string $key, string $src, string $dst, string|null $unit = 'null')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster geohash(string $key, string $member, string ...$other_members)

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster geopos(string $key, string $member, string ...$other_members)

No description

Parameters

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

Return Value

RedisCluster

at line 329
mixed georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = '[]')

No description

Parameters

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

Return Value

mixed

at line 329
mixed georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = '[]')

No description

Parameters

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

Return Value

mixed

at line 329
mixed georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = '[]')

No description

Parameters

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

Return Value

mixed

at line 329
mixed georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = '[]')

No description

Parameters

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

Return Value

mixed

at line 329
array geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = '[]')

No description

Parameters

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

Return Value

array

at line 329
RedisCluster geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = '[]')

No description

Parameters

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

Return Value

RedisCluster

at line 329
mixed getAuth()

No description

Return Value

mixed

at line 329
RedisCluster getBit(string $key, int $idx)

No description

Parameters

string $key
int $idx

Return Value

RedisCluster

at line 329
RedisCluster|string getEx(string $key, array $options = '[]')

No description

Parameters

string $key
array $options

Return Value

RedisCluster|string

at line 329
int getDBNum()

No description

Return Value

int

at line 329
RedisCluster|string getDel(string $key)

No description

Parameters

string $key

Return Value

RedisCluster|string

at line 329
string getHost()

No description

Return Value

string

at line 329
null|string getLastError()

No description

Return Value

null|string

at line 329
int getMode()

No description

Return Value

int

at line 329
mixed getOption(int $option)

No description

Parameters

int $option

Return Value

mixed

at line 329
null|string getPersistentID()

No description

Return Value

null|string

at line 329
int getPort()

No description

Return Value

int

at line 329
RedisCluster|string getRange(string $key, int $start, int $end)

No description

Parameters

string $key
int $start
int $end

Return Value

RedisCluster|string

at line 329
RedisCluster|string lcs(string $key1, string $key2, array|null $options = 'null')

No description

Parameters

string $key1
string $key2
array|null $options

Return Value

RedisCluster|string

at line 329
float getReadTimeout()

No description

Return Value

float

at line 329
RedisCluster|string getset(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

RedisCluster|string

at line 329
false|float getTimeout()

No description

Return Value

false|float

at line 329
array getTransferredBytes()

No description

Return Value

array

at line 329
void clearTransferredBytes()

No description

Return Value

void

at line 329
RedisCluster getWithMeta(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster hDel(string $key, string $field, string ...$other_fields)

Delete hash fields

Parameters

string $key
string $field
string ...$other_fields

Return Value

RedisCluster

at line 329
RedisCluster hexpire(string $key, int $ttl, array $fields, string|null $mode = 'null')

No description

Parameters

string $key
int $ttl
array $fields
string|null $mode

Return Value

RedisCluster

at line 329
RedisCluster hpexpire(string $key, int $ttl, array $fields, string|null $mode = 'null')

No description

Parameters

string $key
int $ttl
array $fields
string|null $mode

Return Value

RedisCluster

at line 329
RedisCluster hexpireat(string $key, int $time, array $fields, string|null $mode = 'null')

No description

Parameters

string $key
int $time
array $fields
string|null $mode

Return Value

RedisCluster

at line 329
RedisCluster hpexpireat(string $key, int $mstime, array $fields, string|null $mode = 'null')

No description

Parameters

string $key
int $mstime
array $fields
string|null $mode

Return Value

RedisCluster

at line 329
RedisCluster httl(string $key, array $fields)

No description

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hpttl(string $key, array $fields)

No description

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hexpiretime(string $key, array $fields)

No description

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hpexpiretime(string $key, array $fields)

No description

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hpersist(string $key, array $fields)

No description

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hExists(string $key, string $field)

No description

Parameters

string $key
string $field

Return Value

RedisCluster

at line 329
mixed hGet(string $key, string $member)

Get hash field value

Parameters

string $key
string $member

Return Value

mixed

at line 329
RedisCluster hGetAll(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
mixed hGetWithMeta(string $key, string $member)

No description

Parameters

string $key
string $member

Return Value

mixed

at line 329
RedisCluster hgetdel(string $key, array $fields)

No description

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hgetex(string $key, array $fields, string|array|null $expiry = 'null')

No description

Parameters

string $key
array $fields
string|array|null $expiry

Return Value

RedisCluster

at line 329
RedisCluster hIncrBy(string $key, string $field, int $value)

No description

Parameters

string $key
string $field
int $value

Return Value

RedisCluster

at line 329
RedisCluster hIncrByFloat(string $key, string $field, float $value)

No description

Parameters

string $key
string $field
float $value

Return Value

RedisCluster

at line 329
RedisCluster hKeys(string $key)

Get all hash field names

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster hLen(string $key)

Get number of hash fields

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster hMget(string $key, array $fields)

Get hash field values

Parameters

string $key
array $fields

Return Value

RedisCluster

at line 329
RedisCluster hMset(string $key, array $fieldValues)

Set hash field values

Parameters

string $key
array $fieldValues

Return Value

RedisCluster

at line 329
RedisCluster|string hRandField(string $key, array|null $options = 'null')

No description

Parameters

string $key
array|null $options

Return Value

RedisCluster|string

at line 329
RedisCluster hSet(string $key, mixed ...$fields_and_vals)

Set hash field values

Parameters

string $key
mixed ...$fields_and_vals

Return Value

RedisCluster

at line 329
RedisCluster hSetNx(string $hash, string $key, mixed $value)

Set hash field if not exists

Parameters

string $hash
string $key
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster hsetex(string $key, array $fields, array|null $expiry = 'null')

No description

Parameters

string $key
array $fields
array|null $expiry

Return Value

RedisCluster

at line 329
RedisCluster hStrLen(string $key, string $field)

No description

Parameters

string $key
string $field

Return Value

RedisCluster

at line 329
RedisCluster hVals(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster incr(string $key, int $by = '1')

No description

Parameters

string $key
int $by

Return Value

RedisCluster

at line 329
RedisCluster incrBy(string $key, int $value)

No description

Parameters

string $key
int $value

Return Value

RedisCluster

at line 329
RedisCluster incrByFloat(string $key, float $value)

No description

Parameters

string $key
float $value

Return Value

RedisCluster

at line 329
RedisCluster info(string ...$sections)

No description

Parameters

string ...$sections

Return Value

RedisCluster

at line 329
bool isConnected()

No description

Return Value

bool

at line 329
RedisCluster keys(string $pattern)

No description

Parameters

string $pattern

Return Value

RedisCluster

at line 329
RedisCluster lInsert(string $key, string $pos, mixed $pivot, mixed $value)

No description

Parameters

string $key
string $pos
mixed $pivot
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster lLen(string $key)

Get list length

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster|string lMove(string $src, string $dst, string $wherefrom, string $whereto)

No description

Parameters

string $src
string $dst
string $wherefrom
string $whereto

Return Value

RedisCluster|string

at line 329
RedisCluster|string blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout)

No description

Parameters

string $src
string $dst
string $wherefrom
string $whereto
float $timeout

Return Value

RedisCluster|string

at line 329
RedisCluster|string lPop(string $key, int $count = '0')

No description

Parameters

string $key
int $count

Return Value

RedisCluster|string

at line 329
RedisCluster lPos(string $key, mixed $value, array|null $options = 'null')

No description

Parameters

string $key
mixed $value
array|null $options

Return Value

RedisCluster

at line 329
RedisCluster lPush(string $key, mixed ...$elements)

No description

Parameters

string $key
mixed ...$elements

Return Value

RedisCluster

at line 329
RedisCluster rPush(string $key, mixed ...$elements)

No description

Parameters

string $key
mixed ...$elements

Return Value

RedisCluster

at line 329
RedisCluster lPushx(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster rPushx(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster lSet(string $key, int $index, mixed $value)

No description

Parameters

string $key
int $index
mixed $value

Return Value

RedisCluster

at line 329
int lastSave()

No description

Return Value

int

at line 329
mixed lindex(string $key, int $index)

No description

Parameters

string $key
int $index

Return Value

mixed

at line 329
RedisCluster lrange(string $key, int $start, int $end)

No description

Parameters

string $key
int $start
int $end

Return Value

RedisCluster

at line 329
RedisCluster ltrim(string $key, int $start, int $end)

No description

Parameters

string $key
int $start
int $end

Return Value

RedisCluster

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

Parameters

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

Return Value

Redis

at line 329
Redis move(string $key, int $index)

No description

Parameters

string $key
int $index

Return Value

Redis

at line 329
RedisCluster mset(array $key_values)

No description

Parameters

array $key_values

Return Value

RedisCluster

at line 329
RedisCluster msetex(array $key_values, int|float|array|null $expiry = 'null')

No description

Parameters

array $key_values
int|float|array|null $expiry

Return Value

RedisCluster

at line 329
RedisCluster msetnx(array $key_values)

No description

Parameters

array $key_values

Return Value

RedisCluster

at line 329
RedisCluster multi(int $value = '1')

No description

Parameters

int $value

Return Value

RedisCluster

at line 329
RedisCluster|string object(string $subcommand, string $key)

No description

Parameters

string $subcommand
string $key

Return Value

RedisCluster|string

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

Parameters

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

Return Value

bool

at line 329
RedisCluster persist(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
bool pexpire(string $key, int $timeout, string|null $mode = 'null')

No description

Parameters

string $key
int $timeout
string|null $mode

Return Value

bool

at line 329
RedisCluster pexpireAt(string $key, int $timestamp, string|null $mode = 'null')

No description

Parameters

string $key
int $timestamp
string|null $mode

Return Value

RedisCluster

at line 329
RedisCluster pfadd(string $key, array $elements)

No description

Parameters

string $key
array $elements

Return Value

RedisCluster

at line 329
RedisCluster pfcount(array|string $key_or_keys)

No description

Parameters

array|string $key_or_keys

Return Value

RedisCluster

at line 329
RedisCluster pfmerge(string $dst, array $srckeys)

No description

Parameters

string $dst
array $srckeys

Return Value

RedisCluster

at line 329
RedisCluster|string ping(string|null $message = 'null')

No description

Parameters

string|null $message

Return Value

RedisCluster|string

at line 329
RedisCluster psetex(string $key, int $expire, mixed $value)

No description

Parameters

string $key
int $expire
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster pttl(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster publish(string $channel, string $message)

No description

Parameters

string $channel
string $message

Return Value

RedisCluster

at line 329
mixed pubsub(string $command, mixed $arg = 'null')

No description

Parameters

string $command
mixed $arg

Return Value

mixed

at line 329
Redis punsubscribe(array $patterns)

No description

Parameters

array $patterns

Return Value

Redis

at line 329
RedisCluster|string rPop(string $key, int $count = '0')

No description

Parameters

string $key
int $count

Return Value

RedisCluster|string

at line 329
RedisCluster|string randomKey()

No description

Return Value

RedisCluster|string

at line 329
mixed rawcommand(string $command, mixed ...$args)

No description

Parameters

string $command
mixed ...$args

Return Value

mixed

at line 329
RedisCluster rename(string $old_name, string $new_name)

No description

Parameters

string $old_name
string $new_name

Return Value

RedisCluster

at line 329
RedisCluster renameNx(string $key_src, string $key_dst)

No description

Parameters

string $key_src
string $key_dst

Return Value

RedisCluster

at line 329
RedisCluster restore(string $key, int $ttl, string $value, array|null $options = 'null')

No description

Parameters

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

Return Value

RedisCluster

at line 329
mixed role()

No description

Return Value

mixed

at line 329
RedisCluster|string rpoplpush(string $srckey, string $dstkey)

No description

Parameters

string $srckey
string $dstkey

Return Value

RedisCluster|string

at line 329
RedisCluster sAdd(string $key, mixed $value, mixed ...$other_values)

No description

Parameters

string $key
mixed $value
mixed ...$other_values

Return Value

RedisCluster

at line 329
int sAddArray(string $key, array $values)

No description

Parameters

string $key
array $values

Return Value

int

at line 329
RedisCluster sDiff(string $key, string ...$other_keys)

No description

Parameters

string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster sDiffStore(string $dst, string $key, string ...$other_keys)

No description

Parameters

string $dst
string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster sInter(array|string $key, string ...$other_keys)

No description

Parameters

array|string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster sintercard(array $keys, int $limit = '-1')

No description

Parameters

array $keys
int $limit

Return Value

RedisCluster

at line 329
RedisCluster sInterStore(array|string $key, string ...$other_keys)

No description

Parameters

array|string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster sMembers(string $key)

Get all set members

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster sMisMember(string $key, string $member, string ...$other_members)

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster sMove(string $src, string $dst, mixed $value)

No description

Parameters

string $src
string $dst
mixed $value

Return Value

RedisCluster

at line 329
mixed sPop(string $key, int $count = '0')

Remove and return random set member

Parameters

string $key
int $count

Return Value

mixed

at line 329
mixed sRandMember(string $key, int $count = '0')

No description

Parameters

string $key
int $count

Return Value

mixed

at line 329
RedisCluster sUnion(string $key, string ...$other_keys)

No description

Parameters

string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster sUnionStore(string $dst, string $key, string ...$other_keys)

No description

Parameters

string $dst
string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
RedisCluster save()

No description

Return Value

RedisCluster

at line 329
RedisCluster scard(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

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

No description

Parameters

string $command
mixed ...$args

Return Value

mixed

at line 329
Redis select(int $db)

No description

Parameters

int $db

Return Value

Redis

at line 329
false|string serverName()

No description

Return Value

false|string

at line 329
false|string serverVersion()

No description

Return Value

false|string

at line 329
RedisCluster setBit(string $key, int $idx, bool $value)

No description

Parameters

string $key
int $idx
bool $value

Return Value

RedisCluster

at line 329
RedisCluster setRange(string $key, int $index, string $value)

No description

Parameters

string $key
int $index
string $value

Return Value

RedisCluster

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

No description

Parameters

int $option
mixed $value

Return Value

bool

at line 329
RedisCluster setex(string $key, int $expire, mixed $value)

No description

Parameters

string $key
int $expire
mixed $value

Return Value

RedisCluster

at line 329
RedisCluster sismember(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

RedisCluster

at line 329
Redis replicaof(string|null $host = 'null', int $port = '6379')

No description

Parameters

string|null $host
int $port

Return Value

Redis

at line 329
RedisCluster touch(array|string $key_or_array, string ...$more_keys)

No description

Parameters

array|string $key_or_array
string ...$more_keys

Return Value

RedisCluster

at line 329
mixed slowlog(string $operation, int $length = '0')

No description

Parameters

string $operation
int $length

Return Value

mixed

at line 329
mixed sort(string $key, array|null $options = 'null')

No description

Parameters

string $key
array|null $options

Return Value

mixed

at line 329
mixed sort_ro(string $key, array|null $options = 'null')

No description

Parameters

string $key
array|null $options

Return Value

mixed

at line 329
RedisCluster srem(string $key, mixed $value, mixed ...$other_values)

Remove members from set

Parameters

string $key
mixed $value
mixed ...$other_values

Return Value

RedisCluster

at line 329
RedisCluster strlen(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
Redis sunsubscribe(array $channels)

No description

Parameters

array $channels

Return Value

Redis

at line 329
Redis swapdb(int $src, int $dst)

No description

Parameters

int $src
int $dst

Return Value

Redis

at line 329
RedisCluster time()

No description

Return Value

RedisCluster

at line 329
RedisCluster ttl(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster type(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

No description

Parameters

array|string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
Redis unsubscribe(array $channels)

No description

Parameters

array $channels

Return Value

Redis

at line 329
Redis unwatch()

No description

Return Value

Redis

at line 329
RedisCluster vadd(string $key, array $values, mixed $element, array|null $options = 'null')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster vcard(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster vdim(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster vemb(string $key, mixed $member, bool $raw = 'false')

No description

Parameters

string $key
mixed $member
bool $raw

Return Value

RedisCluster

at line 329
RedisCluster|string vgetattr(string $key, mixed $member, bool $decode = 'true')

No description

Parameters

string $key
mixed $member
bool $decode

Return Value

RedisCluster|string

at line 329
RedisCluster vinfo(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster vismember(string $key, mixed $member)

No description

Parameters

string $key
mixed $member

Return Value

RedisCluster

No description

Parameters

string $key
mixed $member
bool $withscores

Return Value

RedisCluster

at line 329
RedisCluster|string vrandmember(string $key, int $count = '0')

No description

Parameters

string $key
int $count

Return Value

RedisCluster|string

at line 329
RedisCluster vrange(string $key, string $min, string $max, int $count = '-1')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster vrem(string $key, mixed $member)

No description

Parameters

string $key
mixed $member

Return Value

RedisCluster

at line 329
RedisCluster vsetattr(string $key, mixed $member, array|string $attributes)

No description

Parameters

string $key
mixed $member
array|string $attributes

Return Value

RedisCluster

at line 329
RedisCluster vsim(string $key, mixed $member, array|null $options = 'null')

No description

Parameters

string $key
mixed $member
array|null $options

Return Value

RedisCluster

at line 329
RedisCluster watch(array|string $key, string ...$other_keys)

No description

Parameters

array|string $key
string ...$other_keys

Return Value

RedisCluster

at line 329
false|int wait(int $numreplicas, int $timeout)

No description

Parameters

int $numreplicas
int $timeout

Return Value

false|int

at line 329
false|int xack(string $key, string $group, array $ids)

No description

Parameters

string $key
string $group
array $ids

Return Value

false|int

at line 329
RedisCluster|string xadd(string $key, int|string $id, array $values, int $maxlen = '0', bool $approx = 'false', bool $nomkstream = 'false')

No description

Parameters

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

Return Value

RedisCluster|string

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

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster xclaim(string $key, string $group, string $consumer, int $min_idle, array $ids, array $options)

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster xdel(string $key, array $ids)

No description

Parameters

string $key
array $ids

Return Value

RedisCluster

at line 329
RedisCluster xdelex(string $key, array $ids, string|null $mode = 'null')

No description

Parameters

string $key
array $ids
string|null $mode

Return Value

RedisCluster

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

Parameters

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

Return Value

mixed

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

No description

Parameters

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

Return Value

mixed

at line 329
RedisCluster xlen(string $key)

No description

Parameters

string $key

Return Value

RedisCluster

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

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster xrange(string $key, int|string $start, int|string $end, int $count = '-1')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster xread(array $streams, int $count = '-1', int $block = '-1')

No description

Parameters

array $streams
int $count
int $block

Return Value

RedisCluster

at line 329
RedisCluster xreadgroup(string $group, string $consumer, array $streams, int $count = '1', int $block = '1')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster xrevrange(string $key, int|string $end, int|string $start, int $count = '-1')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster xtrim(string $key, int|string $threshold, bool $approx = 'false', bool $minid = 'false', int $limit = '-1')

No description

Parameters

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

Return Value

RedisCluster

at line 329
RedisCluster zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)

Add members to sorted set

Parameters

string $key
array|float $score_or_options
mixed ...$more_scores_and_mems

Return Value

RedisCluster

at line 329
RedisCluster zCard(string $key)

Get sorted set cardinality

Parameters

string $key

Return Value

RedisCluster

at line 329
RedisCluster zCount(string $key, float|int|string $start, float|int|string $end)

Count sorted set members by score range

Parameters

string $key
float|int|string $start
float|int|string $end

Return Value

RedisCluster

at line 329
RedisCluster zIncrBy(string $key, float $value, mixed $member)

No description

Parameters

string $key
float $value
mixed $member

Return Value

RedisCluster

at line 329
RedisCluster zLexCount(string $key, string $min, string $max)

No description

Parameters

string $key
string $min
string $max

Return Value

RedisCluster

at line 329
RedisCluster zMscore(string $key, mixed $member, mixed ...$other_members)

No description

Parameters

string $key
mixed $member
mixed ...$other_members

Return Value

RedisCluster

at line 329
RedisCluster zPopMax(string $key, int|null $count = 'null')

No description

Parameters

string $key
int|null $count

Return Value

RedisCluster

at line 329
RedisCluster zPopMin(string $key, int|null $count = 'null')

No description

Parameters

string $key
int|null $count

Return Value

RedisCluster

at line 329
RedisCluster zRange(string $key, string|int $start, string|int $end, array|bool|null $options = 'null')

No description

Parameters

string $key
string|int $start
string|int $end
array|bool|null $options

Return Value

RedisCluster

at line 329
RedisCluster zRangeByLex(string $key, string $min, string $max, int $offset = '-1', int $count = '-1')

No description

Parameters

string $key
string $min
string $max
int $offset
int $count

Return Value

RedisCluster

at line 329
RedisCluster zRangeByScore(string $key, float|int|string $min, float|int|string $max, array $options = '[]')

Get sorted set members by score range

Parameters

string $key
float|int|string $min
float|int|string $max
array $options

Return Value

RedisCluster

at line 329
RedisCluster zrangestore(string $dstkey, string $srckey, string $start, string $end, array|bool|null $options = 'null')

No description

Parameters

string $dstkey
string $srckey
string $start
string $end
array|bool|null $options

Return Value

RedisCluster

at line 329
RedisCluster|string zRandMember(string $key, array|null $options = 'null')

No description

Parameters

string $key
array|null $options

Return Value

RedisCluster|string

at line 329
RedisCluster zRank(string $key, mixed $member)

No description

Parameters

string $key
mixed $member

Return Value

RedisCluster

at line 329
RedisCluster zRem(mixed $key, mixed $member, mixed ...$other_members)

Remove sorted set members

Parameters

mixed $key
mixed $member
mixed ...$other_members

Return Value

RedisCluster

at line 329
RedisCluster zRemRangeByLex(string $key, string $min, string $max)

No description

Parameters

string $key
string $min
string $max

Return Value

RedisCluster

at line 329
RedisCluster zRemRangeByRank(string $key, int $start, int $end)

No description

Parameters

string $key
int $start
int $end

Return Value

RedisCluster

at line 329
RedisCluster zRemRangeByScore(string $key, float|int|string $start, float|int|string $end)

No description

Parameters

string $key
float|int|string $start
float|int|string $end

Return Value

RedisCluster

at line 329
RedisCluster zRevRange(string $key, int $start, int $end, mixed $scores = 'null')

No description

Parameters

string $key
int $start
int $end
mixed $scores

Return Value

RedisCluster

at line 329
RedisCluster zRevRangeByLex(string $key, string $max, string $min, int $offset = '-1', int $count = '-1')

No description

Parameters

string $key
string $max
string $min
int $offset
int $count

Return Value

RedisCluster

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

Parameters

string $key
float|int|string $max
float|int|string $min
array $options

Return Value

RedisCluster

at line 329
RedisCluster zRevRank(string $key, mixed $member)

No description

Parameters

string $key
mixed $member

Return Value

RedisCluster

at line 329
RedisCluster zScore(string $key, mixed $member)

No description

Parameters

string $key
mixed $member

Return Value

RedisCluster

at line 329
RedisCluster zdiff(array $keys, array|null $options = 'null')

No description

Parameters

array $keys
array|null $options

Return Value

RedisCluster

at line 329
RedisCluster zdiffstore(string $dst, array $keys)

No description

Parameters

string $dst
array $keys

Return Value

RedisCluster

at line 329
RedisCluster zinter(array $keys, array|null $weights = 'null', array|null $options = 'null')

No description

Parameters

array $keys
array|null $weights
array|null $options

Return Value

RedisCluster

at line 329
RedisCluster zintercard(array $keys, int $limit = '-1')

No description

Parameters

array $keys
int $limit

Return Value

RedisCluster

at line 329
RedisCluster zunion(array $keys, array|null $weights = 'null', array|null $options = 'null')

No description

Parameters

array $keys
array|null $weights
array|null $options

Return Value

RedisCluster