class PhpRedisConnection extends Connection mixin Redis

Properties

protected Client $client

The Predis client.

from  Connection

Methods

void
createSubscription(array|string $channels, Closure $callback, string $method = 'subscribe')

Subscribe to a set of given channels for messages.

mixed
client()

Get the underlying Redis client.

void
subscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels for messages.

void
psubscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels with wildcards.

mixed
command(string $method, array $parameters = [])

Run a command against the Redis database.

mixed
__call(string $method, array $parameters)

Pass other method calls down to the underlying client.

void
__construct(Redis $client)

Create a new PhpRedis connection.

string|null
get(string $key)

Returns the value of the given key.

array
mget(array $keys)

Get the values of all the given keys.

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

Set the string value in argument as value of the key.

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

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

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

Removes and returns a random element from the set value at key.

int
zadd(string $key, mixed ...$dictionary)

Add one or more members to a sorted set or update its score if it already exists.

array|Redis
pipeline(callable $callback = null)

Execute commands in a pipeline.

array|Redis
transaction(callable $callback = null)

Execute commands in a transaction.

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

Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.

mixed
proxyToEval(array $parameters)

Proxy a call to the eval function of PhpRedis.

mixed
executeRaw(array $parameters)

Execute a raw command.

void
disconnect()

Disconnects from the Redis instance.

Details

at line 212
void createSubscription(array|string $channels, Closure $callback, string $method = 'subscribe')

Subscribe to a set of given channels for messages.

Parameters

array|string $channels
Closure $callback
string $method

Return Value

void

in Connection at line 34
mixed client()

Get the underlying Redis client.

Return Value

mixed

at line 183
void subscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels for messages.

Parameters

array|string $channels
Closure $callback

Return Value

void

at line 197
void psubscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels with wildcards.

Parameters

array|string $channels
Closure $callback

Return Value

void

in Connection at line 70
mixed command(string $method, array $parameters = [])

Run a command against the Redis database.

Parameters

string $method
array $parameters

Return Value

mixed

at line 245
mixed __call(string $method, array $parameters)

Pass other method calls down to the underlying client.

Parameters

string $method
array $parameters

Return Value

mixed

at line 18
void __construct(Redis $client)

Create a new PhpRedis connection.

Parameters

Redis $client

Return Value

void

at line 29
string|null get(string $key)

Returns the value of the given key.

Parameters

string $key

Return Value

string|null

at line 42
array mget(array $keys)

Get the values of all the given keys.

Parameters

array $keys

Return Value

array

at line 59
bool set(string $key, mixed $value, string|null $expireResolution = null, int|null $expireTTL = null, string|null $flag = null)

Set the string value in argument as value of the key.

Parameters

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

Return Value

bool

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

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

Parameters

string $key
int $count
$value $value

Return Value

int|false

at line 88
mixed|false spop(string $key, int|null $count = null)

Removes and returns a random element from the set value at key.

Parameters

string $key
int|null $count

Return Value

mixed|false

at line 100
int zadd(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

int

at line 122
array|Redis pipeline(callable $callback = null)

Execute commands in a pipeline.

Parameters

callable $callback

Return Value

array|Redis

at line 137
array|Redis transaction(callable $callback = null)

Execute commands in a transaction.

Parameters

callable $callback

Return Value

array|Redis

at line 154
mixed evalsha(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 167
protected mixed proxyToEval(array $parameters)

Proxy a call to the eval function of PhpRedis.

Parameters

array $parameters

Return Value

mixed

at line 223
mixed executeRaw(array $parameters)

Execute a raw command.

Parameters

array $parameters

Return Value

mixed

at line 233
void disconnect()

Disconnects from the Redis instance.

Return Value

void