PhpRedisConnection
Extends
Implements
Uses
Properties
$connector callable
The connection creation callback.
$config array
The connection configuration array.
Methods
__construct ( $client , callable $connector , array $config ) : void
Create a new PhpRedis connection.
Parameters
- $client Redis
- $connector callable|null
- $config array
get ( $key ) : string|null
Returns the value of the given key.
Parameters
- $key string
mget ( array $keys ) : array
Get the values of all the given keys.
Parameters
- $keys array
set ( $key , $value , $expireResolution , $expireTTL , $flag ) : bool
Set the string value in the argument as the value of the key.
Parameters
- $key string
- $value mixed
- $expireResolution string|null
- $expireTTL int|null
- $flag string|null
setnx ( $key , $value ) : int
Set the given key if it doesn't exist.
Parameters
- $key string
- $value string
hmget ( $key , $dictionary ) : array
Get the value of the given hash fields.
Parameters
- $key string
- $dictionary mixed
hmset ( $key , $dictionary ) : int
Set the given hash fields to their respective values.
Parameters
- $key string
- $dictionary mixed
hsetnx ( $hash , $key , $value ) : int
Set the given hash field if it doesn't exist.
Parameters
- $hash string
- $key string
- $value string
lrem ( $key , $count , $value ) : int|false
Removes the first count occurrences of the value element from the list.
Parameters
- $key string
- $count int
- $value mixed
blpop ( $arguments ) : array|null
Removes and returns the first element of the list stored at key.
Parameters
- $arguments mixed
brpop ( $arguments ) : array|null
Removes and returns the last element of the list stored at key.
Parameters
- $arguments mixed
spop ( $key , $count ) : mixed|false
Removes and returns a random element from the set value at key.
Parameters
- $key string
- $count int|null
zadd ( $key , $dictionary ) : int
Add one or more members to a sorted set or update its score if it already exists.
Parameters
- $key string
- $dictionary mixed
zrangebyscore ( $key , $min , $max , $options ) : array
Return elements with score between $min and $max.
Parameters
- $key string
- $min mixed
- $max mixed
- $options array
zrevrangebyscore ( $key , $min , $max , $options ) : array
Return elements with score between $min and $max.
Parameters
- $key string
- $min mixed
- $max mixed
- $options array
zinterstore ( $output , $keys , $options ) : int
Find the intersection between sets and store in a new set.
Parameters
- $output string
- $keys array
- $options array
zunionstore ( $output , $keys , $options ) : int
Find the union between sets and store in a new set.
Parameters
- $output string
- $keys array
- $options array
scan ( $cursor , $options ) : mixed
Scans all keys based on options.
Parameters
- $cursor mixed
- $options array
zscan ( $key , $cursor , $options ) : mixed
Scans the given set for all values based on options.
Parameters
- $key string
- $cursor mixed
- $options array
hscan ( $key , $cursor , $options ) : mixed
Scans the given hash for all values based on options.
Parameters
- $key string
- $cursor mixed
- $options array
sscan ( $key , $cursor , $options ) : mixed
Scans the given set for all values based on options.
Parameters
- $key string
- $cursor mixed
- $options array
pipeline ( callable $callback ) : Redis|array
Execute commands in a pipeline.
Parameters
- $callback callable|null
transaction ( callable $callback ) : Redis|array
Execute commands in a transaction.
Parameters
- $callback callable|null
evalsha ( $script , $numkeys , $arguments ) : mixed
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
Parameters
- $script string
- $numkeys int
- $arguments mixed
eval ( $script , $numberOfKeys , $arguments ) : mixed
Evaluate a script and return its result.
Parameters
- $script string
- $numberOfKeys int
- $arguments dynamic
subscribe ( $channels , Closure $callback ) : void
Subscribe to a set of given channels for messages.
Parameters
- $channels array|string
- $callback Closure
psubscribe ( $channels , Closure $callback ) : void
Subscribe to a set of given channels with wildcards.
Parameters
- $channels array|string
- $callback Closure
createSubscription ( $channels , Closure $callback , $method ) : void
Subscribe to a set of given channels for messages.
Parameters
- $channels array|string
- $callback Closure
- $method string
flushdb ( ) : mixed
Flush the selected Redis database.
executeRaw ( array $parameters ) : mixed
Execute a raw command.
Parameters
- $parameters array
command ( $method , array $parameters ) : mixed
Run a command against the Redis database.
Parameters
- $method string
- $parameters array
disconnect ( ) : void
Disconnects from the Redis instance.
applyPrefix ( $key ) : string
Apply a prefix to the given key if necessary.
Parameters
- $key string
__call ( $method , $parameters ) : mixed
Pass other method calls down to the underlying client.
Parameters
- $method string
- $parameters array