PhpRedisClusterConnection
extends PhpRedisConnection
in package
Table of Contents
- $client : Client
- The Predis client.
- __call() : mixed
- Pass other method calls down to the underlying client.
- __construct() : void
- Create a new PhpRedis connection.
- client() : mixed
- Get the underlying Redis client.
- command() : mixed
- Run a command against the Redis database.
- createSubscription() : void
- Subscribe to a set of given channels for messages.
- disconnect() : void
- Disconnects from the Redis instance.
- eval() : mixed
- Evaluate a script and return its result.
- evalsha() : mixed
- Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
- executeRaw() : mixed
- Execute a raw command.
- exists() : int
- Determine if the given keys exist.
- funnel() : ConcurrencyLimiterBuilder
- Funnel a callback for a maximum number of simultaneous executions.
- get() : string|null
- Returns the value of the given key.
- hmget() : int
- Get the value of the given hash fields.
- hmset() : int
- Set the given hash fields to their respective values.
- hsetnx() : int
- Set the given hash field if it doesn't exist.
- lrem() : int|false
- Removes the first count occurrences of the value element from the list.
- mget() : array<string|int, mixed>
- Get the values of all the given keys.
- pipeline() : Redis|array<string|int, mixed>
- Execute commands in a pipeline.
- psubscribe() : void
- Subscribe to a set of given channels with wildcards.
- set() : bool
- Set the string value in argument as value of the key.
- setnx() : int
- Set the given key if it doesn't exist.
- spop() : mixed|false
- Removes and returns a random element from the set value at key.
- subscribe() : void
- Subscribe to a set of given channels for messages.
- throttle() : DurationLimiterBuilder
- Throttle a callback for a maximum number of executions over a given duration.
- transaction() : Redis|array<string|int, mixed>
- Execute commands in a transaction.
- zadd() : int
- Add one or more members to a sorted set or update its score if it already exists.
- zinterstore() : int
- Find the intersection between sets and store in a new set.
- zrangebyscore() : int
- Return elements with score between $min and $max.
- zrevrangebyscore() : int
- Return elements with score between $min and $max.
- zunionstore() : int
- Find the union between sets and store in a new set.
- applyPrefix() : string
- Apply prefix to the given key if necessary.
Properties
$client
The Predis client.
protected
Client
$client
Methods
__call()
Pass other method calls down to the underlying client.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
mixed —__construct()
Create a new PhpRedis connection.
public
__construct(Redis $client) : void
Parameters
- $client : Redis
Return values
void —client()
Get the underlying Redis client.
public
client() : mixed
Return values
mixed —command()
Run a command against the Redis database.
public
command(string $method[, array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed> = []
Return values
mixed —createSubscription()
Subscribe to a set of given channels for messages.
public
abstract createSubscription(array<string|int, mixed>|string $channels, Closure $callback[, string $method = 'subscribe' ]) : void
Parameters
- $channels : array<string|int, mixed>|string
- $callback : Closure
- $method : string = 'subscribe'
Return values
void —disconnect()
Disconnects from the Redis instance.
public
disconnect() : void
Return values
void —eval()
Evaluate a script and return its result.
public
eval(string $script, int $numberOfKeys, dynamic ...$arguments) : mixed
Parameters
- $script : string
- $numberOfKeys : int
- $arguments : dynamic
Return values
mixed —evalsha()
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
public
evalsha(string $script, int $numkeys, mixed ...$arguments) : mixed
Parameters
- $script : string
- $numkeys : int
- $arguments : mixed
Return values
mixed —executeRaw()
Execute a raw command.
public
executeRaw(array<string|int, mixed> $parameters) : mixed
Parameters
- $parameters : array<string|int, mixed>
Return values
mixed —exists()
Determine if the given keys exist.
public
exists(dynamic ...$keys) : int
Parameters
- $keys : dynamic
Return values
int —funnel()
Funnel a callback for a maximum number of simultaneous executions.
public
funnel(string $name) : ConcurrencyLimiterBuilder
Parameters
- $name : string
Return values
ConcurrencyLimiterBuilder —get()
Returns the value of the given key.
public
get(string $key) : string|null
Parameters
- $key : string
Return values
string|null —hmget()
Get the value of the given hash fields.
public
hmget(string $key, dynamic ...$dictionary) : int
Parameters
- $key : string
- $dictionary : dynamic
Return values
int —hmset()
Set the given hash fields to their respective values.
public
hmset(string $key, dynamic ...$dictionary) : int
Parameters
- $key : string
- $dictionary : dynamic
Return values
int —hsetnx()
Set the given hash field if it doesn't exist.
public
hsetnx(string $hash, string $key, string $value) : int
Parameters
- $hash : string
- $key : string
- $value : string
Return values
int —lrem()
Removes the first count occurrences of the value element from the list.
public
lrem(string $key, int $count, $value) : int|false
Parameters
Return values
int|false —mget()
Get the values of all the given keys.
public
mget(array<string|int, mixed> $keys) : array<string|int, mixed>
Parameters
- $keys : array<string|int, mixed>
Return values
array<string|int, mixed> —pipeline()
Execute commands in a pipeline.
public
pipeline([callable $callback = null ]) : Redis|array<string|int, mixed>
Parameters
- $callback : callable = null
Return values
Redis|array<string|int, mixed> —psubscribe()
Subscribe to a set of given channels with wildcards.
public
psubscribe(array<string|int, mixed>|string $channels, Closure $callback) : void
Parameters
- $channels : array<string|int, mixed>|string
- $callback : Closure
Return values
void —set()
Set the string value in argument as value of the key.
public
set(string $key, mixed $value[, string|null $expireResolution = null ][, int|null $expireTTL = null ][, string|null $flag = null ]) : bool
Parameters
- $key : string
- $value : mixed
- $expireResolution : string|null = null
- $expireTTL : int|null = null
- $flag : string|null = null
Return values
bool —setnx()
Set the given key if it doesn't exist.
public
setnx(string $key, string $value) : int
Parameters
- $key : string
- $value : string
Return values
int —spop()
Removes and returns a random element from the set value at key.
public
spop(string $key[, int|null $count = null ]) : mixed|false
Parameters
- $key : string
- $count : int|null = null
Return values
mixed|false —subscribe()
Subscribe to a set of given channels for messages.
public
subscribe(array<string|int, mixed>|string $channels, Closure $callback) : void
Parameters
- $channels : array<string|int, mixed>|string
- $callback : Closure
Return values
void —throttle()
Throttle a callback for a maximum number of executions over a given duration.
public
throttle(string $name) : DurationLimiterBuilder
Parameters
- $name : string
Return values
DurationLimiterBuilder —transaction()
Execute commands in a transaction.
public
transaction([callable $callback = null ]) : Redis|array<string|int, mixed>
Parameters
- $callback : callable = null
Return values
Redis|array<string|int, mixed> —zadd()
Add one or more members to a sorted set or update its score if it already exists.
public
zadd(string $key, dynamic ...$dictionary) : int
Parameters
- $key : string
- $dictionary : dynamic
Return values
int —zinterstore()
Find the intersection between sets and store in a new set.
public
zinterstore(string $output, array<string|int, mixed> $keys[, array<string|int, mixed> $options = [] ]) : int
Parameters
- $output : string
- $keys : array<string|int, mixed>
- $options : array<string|int, mixed> = []
Return values
int —zrangebyscore()
Return elements with score between $min and $max.
public
zrangebyscore(string $key, mixed $min, mixed $max[, array<string|int, mixed> $options = [] ]) : int
Parameters
- $key : string
- $min : mixed
- $max : mixed
- $options : array<string|int, mixed> = []
Return values
int —zrevrangebyscore()
Return elements with score between $min and $max.
public
zrevrangebyscore(string $key, mixed $min, mixed $max[, array<string|int, mixed> $options = [] ]) : int
Parameters
- $key : string
- $min : mixed
- $max : mixed
- $options : array<string|int, mixed> = []
Return values
int —zunionstore()
Find the union between sets and store in a new set.
public
zunionstore(string $output, array<string|int, mixed> $keys[, array<string|int, mixed> $options = [] ]) : int
Parameters
- $output : string
- $keys : array<string|int, mixed>
- $options : array<string|int, mixed> = []
Return values
int —applyPrefix()
Apply prefix to the given key if necessary.
private
applyPrefix(string $key) : string
Parameters
- $key : string