Class yii\redis\Connection
Inheritance | yii\redis\Connection » yii\base\Component » yii\base\BaseObject |
---|---|
Implements | yii\base\Configurable |
Available since version | 2.0 |
Source Code | https://github.com/yiisoft/yii2-redis/blob/master/Connection.php |
The redis connection class is used to establish a connection to a redis server.
By default it assumes there is a redis server running on localhost at port 6379 and uses the database number 0.
It is possible to connect to a redis server using $hostname and $port or using a $unixSocket.
It also supports the AUTH command of redis. When the server needs authentication, you can set the $password property to authenticate with the server after connect.
The execution of redis commands is possible with via executeCommand().
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$behaviors | yii\base\Behavior[] | List of behaviors attached to this component. This property is read-only. | yii\base\Component |
$connectionString | string | Socket connection string. This property is read-only. | yii\redis\Connection |
$connectionTimeout | float | Timeout to use for connection to redis. | yii\redis\Connection |
$contextOptions | array | PHP context options which are used in the Redis connection stream. | yii\redis\Connection |
$dataTimeout | float | Timeout to use for redis socket when reading and writing data. | yii\redis\Connection |
$database | integer | The redis database to use. | yii\redis\Connection |
$driverName | string | Name of the DB driver. This property is read-only. | yii\redis\Connection |
$hostname | string | The hostname or ip address to use for connecting to the redis server. | yii\redis\Connection |
$isActive | boolean | Whether the DB connection is established. This property is read-only. | yii\redis\Connection |
$luaScriptBuilder | yii\redis\LuaScriptBuilder | This property is read-only. | yii\redis\Connection |
$password | string | The password for establishing DB connection. | yii\redis\Connection |
$port | integer | The port to use for connecting to the redis server. | yii\redis\Connection |
$redirectConnectionString | string | If the query gets redirected, use this as the temporary new hostname | yii\redis\Connection |
$redisCommands | array | List of available redis commands. | yii\redis\Connection |
$retries | integer | The number of times a command execution should be retried when a connection failure occurs. | yii\redis\Connection |
$retryInterval | integer | The retry interval in microseconds to wait between retry. | yii\redis\Connection |
$socket | resource|false | This property is read-only. | yii\redis\Connection |
$socketClientFlags | integer | Bitmask field which may be set to any combination of connection flags passed to [stream_socket_client()](https://www. | yii\redis\Connection |
$unixSocket | string | The unix socket path (e.g. `/var/run/redis/redis. | yii\redis\Connection |
$useSSL | boolean | Send sockets over SSL protocol. | yii\redis\Connection |
Public Methods
Protected Methods
Method | Description | Defined By |
---|---|---|
initConnection() | Initializes the DB connection. | yii\redis\Connection |
Events
Event | Type | Description | Defined By |
---|---|---|---|
EVENT_AFTER_OPEN | \yii\redis\Event | An event that is triggered after a DB connection is established | yii\redis\Connection |
Property Details
Socket connection string. This property is read-only.
Timeout to use for connection to redis. If not set the timeout set in php.ini will be used: ini_get("default_socket_timeout")
.
PHP context options which are used in the Redis connection stream.
Timeout to use for redis socket when reading and writing data. If not set the php default value will be used.
The redis database to use. This is an integer value starting from 0. Defaults to 0.
Since version 2.0.6 you can disable the SELECT command sent after connection by setting this property to null
.
Name of the DB driver. This property is read-only.
The hostname or ip address to use for connecting to the redis server. Defaults to 'localhost'. If $unixSocket is specified, hostname and $port will be ignored.
Whether the DB connection is established. This property is read-only.
This property is read-only.
The password for establishing DB connection. Defaults to null meaning no AUTH command is sent. See https://redis.io/commands/auth
The port to use for connecting to the redis server. Default port is 6379. If $unixSocket is specified, $hostname and port will be ignored.
If the query gets redirected, use this as the temporary new hostname
List of available redis commands.
See also https://redis.io/commands.
The number of times a command execution should be retried when a connection failure occurs. This is used in executeCommand() when a yii\redis\SocketException is thrown. Defaults to 0 meaning no retries on failure.
The retry interval in microseconds to wait between retry. This is used in executeCommand() when a yii\redis\SocketException is thrown. Defaults to 0 meaning no wait.
This property is read-only.
Bitmask field which may be set to any combination of connection flags passed to stream_socket_client().
Currently the select of connection flags is limited to STREAM_CLIENT_CONNECT
(default), STREAM_CLIENT_ASYNC_CONNECT
and STREAM_CLIENT_PERSISTENT
.
Warning:
STREAM_CLIENT_PERSISTENT
will make PHP reuse connections to the same server. If you are using multiple connection objects to refer to different redis databases on the same $port, redis commands may get executed on the wrong database.STREAM_CLIENT_PERSISTENT
is only safe to use if you use only one database.You may still use persistent connections in this case when disambiguating ports as described in a comment on the PHP manual e.g. on the connection used for session storage, specify the port as:
'port' => '6379/session'
See also https://www.php.net/manual/en/function.stream-socket-client.php.
The unix socket path (e.g. /var/run/redis/redis.sock
) to use for connecting to the redis server.
This can be used instead of $hostname and $port to connect to the server using a unix socket.
If a unix socket path is specified, $hostname and $port will be ignored.
Send sockets over SSL protocol. Default state is false.
Method Details
Allows issuing all supported commands via magic methods.
$redis->hmset('test_collection', 'key1', 'val1', 'key2', 'val2')
public mixed __call ( $name, $params ) | ||
$name | string | Name of the missing method to execute |
$params | array | Method call arguments |
Closes the connection when this component is being serialized.
public array __sleep ( ) |
Append a value to a key. https://redis.io/commands/append
Append a value to a key. https://redis.io/commands/append
public mixed append ( $key, $value ) | ||
$key | ||
$value | ||
return | mixed |
---|
Authenticate to the server. https://redis.io/commands/auth
Authenticate to the server. https://redis.io/commands/auth
public mixed auth ( $password ) | ||
$password | ||
return | mixed |
---|
Asynchronously rewrite the append-only file. https://redis.io/commands/bgrewriteaof
Asynchronously rewrite the append-only file. https://redis.io/commands/bgrewriteaof
public mixed bgrewriteaof ( ) | ||
return | mixed |
---|
Asynchronously save the dataset to disk. https://redis.io/commands/bgsave
Asynchronously save the dataset to disk. https://redis.io/commands/bgsave
public mixed bgsave ( ) | ||
return | mixed |
---|
Count set bits in a string. https://redis.io/commands/bitcount
Count set bits in a string. https://redis.io/commands/bitcount
public mixed bitcount ( $key, $start, $end ) | ||
$key | ||
$start | ||
$end | ||
return | mixed |
---|
Perform arbitrary bitfield integer operations on strings. https://redis.io/commands/bitfield
Perform arbitrary bitfield integer operations on strings. https://redis.io/commands/bitfield
public mixed bitfield ( $key, ...$operations ) | ||
$key | ||
...$operations | ||
return | mixed |
---|
Perform bitwise operations between strings. https://redis.io/commands/bitop
Perform bitwise operations between strings. https://redis.io/commands/bitop
public mixed bitop ( $operation, $destkey, ...$keys ) | ||
$operation | ||
$destkey | ||
...$keys | ||
return | mixed |
---|
Find first bit set or clear in a string. https://redis.io/commands/bitpos
Find first bit set or clear in a string. https://redis.io/commands/bitpos
public mixed bitpos ( $key, $bit, $start, $end ) | ||
$key | ||
$bit | ||
$start | ||
$end | ||
return | mixed |
---|
Remove and get the first element in a list, or block until one is available. https://redis.io/commands/blpop
Remove and get the first element in a list, or block until one is available. https://redis.io/commands/blpop
public mixed blpop ( ...$keys, $timeout ) | ||
...$keys | ||
$timeout | ||
return | mixed |
---|
Remove and get the last element in a list, or block until one is available. https://redis.io/commands/brpop
Remove and get the last element in a list, or block until one is available. https://redis.io/commands/brpop
public mixed brpop ( ...$keys, $timeout ) | ||
...$keys | ||
$timeout | ||
return | mixed |
---|
Pop a value from a list, push it to another list and return it; or block until one is available. https://redis.io/commands/brpoplpush
Pop a value from a list, push it to another list and return it; or block until one is available. https://redis.io/commands/brpoplpush
public mixed brpoplpush ( $source, $destination, $timeout ) | ||
$source | ||
$destination | ||
$timeout | ||
return | mixed |
---|
Get the current connection name. https://redis.io/commands/client-getname
Get the current connection name. https://redis.io/commands/client-getname
public mixed clientGetname ( ) | ||
return | mixed |
---|
Kill the connection of a client. https://redis.io/commands/client-kill
Kill the connection of a client. https://redis.io/commands/client-kill
public mixed clientKill ( ...$filters ) | ||
...$filters | ||
return | mixed |
---|
Get the list of client connections. https://redis.io/commands/client-list
Get the list of client connections. https://redis.io/commands/client-list
public mixed clientList ( ) | ||
return | mixed |
---|
Stop processing commands from clients for some time. https://redis.io/commands/client-pause
Stop processing commands from clients for some time. https://redis.io/commands/client-pause
public mixed clientPause ( $timeout ) | ||
$timeout | ||
return | mixed |
---|
Instruct the server whether to reply to commands. https://redis.io/commands/client-reply
Instruct the server whether to reply to commands. https://redis.io/commands/client-reply
public mixed clientReply ( $option ) | ||
$option | ||
return | mixed |
---|
Set the current connection name. https://redis.io/commands/client-setname
Set the current connection name. https://redis.io/commands/client-setname
public mixed clientSetname ( $connectionName ) | ||
$connectionName | ||
return | mixed |
---|
Closes the currently active DB connection.
It does nothing if the connection is already closed.
public void close ( ) |
Assign new hash slots to receiving node. https://redis.io/commands/cluster-addslots
Assign new hash slots to receiving node. https://redis.io/commands/cluster-addslots
public mixed clusterAddslots ( ...$slots ) | ||
...$slots | ||
return | mixed |
---|
Return the number of local keys in the specified hash slot. https://redis.io/commands/cluster-countkeysinslot
Return the number of local keys in the specified hash slot. https://redis.io/commands/cluster-countkeysinslot
public mixed clusterCountkeysinslot ( $slot ) | ||
$slot | ||
return | mixed |
---|
Set hash slots as unbound in receiving node. https://redis.io/commands/cluster-delslots
Set hash slots as unbound in receiving node. https://redis.io/commands/cluster-delslots
public mixed clusterDelslots ( ...$slots ) | ||
...$slots | ||
return | mixed |
---|
Forces a slave to perform a manual failover of its master.. https://redis.io/commands/cluster-failover
Forces a slave to perform a manual failover of its master.. https://redis.io/commands/cluster-failover
public mixed clusterFailover ( $option ) | ||
$option | ||
return | mixed |
---|
Remove a node from the nodes table. https://redis.io/commands/cluster-forget
Remove a node from the nodes table. https://redis.io/commands/cluster-forget
public mixed clusterForget ( $nodeId ) | ||
$nodeId | ||
return | mixed |
---|
Return local key names in the specified hash slot. https://redis.io/commands/cluster-getkeysinslot
Return local key names in the specified hash slot. https://redis.io/commands/cluster-getkeysinslot
public mixed clusterGetkeysinslot ( $slot, $count ) | ||
$slot | ||
$count | ||
return | mixed |
---|
Provides info about Redis Cluster node state. https://redis.io/commands/cluster-info
Provides info about Redis Cluster node state. https://redis.io/commands/cluster-info
public mixed clusterInfo ( ) | ||
return | mixed |
---|
Returns the hash slot of the specified key. https://redis.io/commands/cluster-keyslot
Returns the hash slot of the specified key. https://redis.io/commands/cluster-keyslot
public mixed clusterKeyslot ( $key ) | ||
$key | ||
return | mixed |
---|
Force a node cluster to handshake with another node. https://redis.io/commands/cluster-meet
Force a node cluster to handshake with another node. https://redis.io/commands/cluster-meet
public mixed clusterMeet ( $ip, $port ) | ||
$ip | ||
$port | ||
return | mixed |
---|
Get Cluster config for the node. https://redis.io/commands/cluster-nodes
Get Cluster config for the node. https://redis.io/commands/cluster-nodes
public mixed clusterNodes ( ) | ||
return | mixed |
---|
Reconfigure a node as a slave of the specified master node. https://redis.io/commands/cluster-replicate
Reconfigure a node as a slave of the specified master node. https://redis.io/commands/cluster-replicate
public mixed clusterReplicate ( $nodeId ) | ||
$nodeId | ||
return | mixed |
---|
Reset a Redis Cluster node. https://redis.io/commands/cluster-reset
Reset a Redis Cluster node. https://redis.io/commands/cluster-reset
public mixed clusterReset ( $resetType ) | ||
$resetType | ||
return | mixed |
---|
Forces the node to save cluster state on disk. https://redis.io/commands/cluster-saveconfig
Forces the node to save cluster state on disk. https://redis.io/commands/cluster-saveconfig
public mixed clusterSaveconfig ( ) | ||
return | mixed |
---|
Bind a hash slot to a specific node. https://redis.io/commands/cluster-setslot
Bind a hash slot to a specific node. https://redis.io/commands/cluster-setslot
public mixed clusterSetslot ( $slot, $type, $nodeid ) | ||
$slot | ||
$type | ||
$nodeid | ||
return | mixed |
---|
List slave nodes of the specified master node. https://redis.io/commands/cluster-slaves
List slave nodes of the specified master node. https://redis.io/commands/cluster-slaves
public mixed clusterSlaves ( $nodeId ) | ||
$nodeId | ||
return | mixed |
---|
Get array of Cluster slot to node mappings. https://redis.io/commands/cluster-slots
Get array of Cluster slot to node mappings. https://redis.io/commands/cluster-slots
public mixed clusterSlots ( ) | ||
return | mixed |
---|
Get array of Redis command details. https://redis.io/commands/command
Get array of Redis command details. https://redis.io/commands/command
public mixed command ( ) | ||
return | mixed |
---|
Get total number of Redis commands. https://redis.io/commands/command-count
Get total number of Redis commands. https://redis.io/commands/command-count
public mixed commandCount ( ) | ||
return | mixed |
---|
Extract keys given a full Redis command. https://redis.io/commands/command-getkeys
Extract keys given a full Redis command. https://redis.io/commands/command-getkeys
public mixed commandGetkeys ( ) | ||
return | mixed |
---|
Get array of specific Redis command details. https://redis.io/commands/command-info
Get array of specific Redis command details. https://redis.io/commands/command-info
public mixed commandInfo ( ...$commandNames ) | ||
...$commandNames | ||
return | mixed |
---|
Get the value of a configuration parameter. https://redis.io/commands/config-get
Get the value of a configuration parameter. https://redis.io/commands/config-get
public mixed configGet ( $parameter ) | ||
$parameter | ||
return | mixed |
---|
Reset the stats returned by INFO. https://redis.io/commands/config-resetstat
Reset the stats returned by INFO. https://redis.io/commands/config-resetstat
public mixed configResetstat ( ) | ||
return | mixed |
---|
Rewrite the configuration file with the in memory configuration. https://redis.io/commands/config-rewrite
Rewrite the configuration file with the in memory configuration. https://redis.io/commands/config-rewrite
public mixed configRewrite ( ) | ||
return | mixed |
---|
Set a configuration parameter to the given value. https://redis.io/commands/config-set
Set a configuration parameter to the given value. https://redis.io/commands/config-set
public mixed configSet ( $parameter, $value ) | ||
$parameter | ||
$value | ||
return | mixed |
---|
Return the number of keys in the selected database. https://redis.io/commands/dbsize
Return the number of keys in the selected database. https://redis.io/commands/dbsize
public mixed dbsize ( ) | ||
return | mixed |
---|
Get debugging information about a key. https://redis.io/commands/debug-object
Get debugging information about a key. https://redis.io/commands/debug-object
public mixed debugObject ( $key ) | ||
$key | ||
return | mixed |
---|
Make the server crash. https://redis.io/commands/debug-segfault
Make the server crash. https://redis.io/commands/debug-segfault
public mixed debugSegfault ( ) | ||
return | mixed |
---|
Decrement the integer value of a key by one. https://redis.io/commands/decr
Decrement the integer value of a key by one. https://redis.io/commands/decr
public mixed decr ( $key ) | ||
$key | ||
return | mixed |
---|
Decrement the integer value of a key by the given number. https://redis.io/commands/decrby
Decrement the integer value of a key by the given number. https://redis.io/commands/decrby
public mixed decrby ( $key, $decrement ) | ||
$key | ||
$decrement | ||
return | mixed |
---|
Delete a key. https://redis.io/commands/del
Delete a key. https://redis.io/commands/del
public mixed del ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Discard all commands issued after MULTI. https://redis.io/commands/discard
Discard all commands issued after MULTI. https://redis.io/commands/discard
public mixed discard ( ) | ||
return | mixed |
---|
Return a serialized version of the value stored at the specified key.. https://redis.io/commands/dump
Return a serialized version of the value stored at the specified key.. https://redis.io/commands/dump
public mixed dump ( $key ) | ||
$key | ||
return | mixed |
---|
Echo the given string. https://redis.io/commands/echo
Echo the given string. https://redis.io/commands/echo
public mixed echo ( $message ) | ||
$message | ||
return | mixed |
---|
Execute a Lua script server side. https://redis.io/commands/eval
Execute a Lua script server side. https://redis.io/commands/eval
public mixed eval ( $script, $numkeys, ...$keys, ...$args ) | ||
$script | ||
$numkeys | ||
...$keys | ||
...$args | ||
return | mixed |
---|
Execute a Lua script server side. https://redis.io/commands/evalsha
Execute a Lua script server side. https://redis.io/commands/evalsha
public mixed evalsha ( $sha1, $numkeys, ...$keys, ...$args ) | ||
$sha1 | ||
$numkeys | ||
...$keys | ||
...$args | ||
return | mixed |
---|
Execute all commands issued after MULTI. https://redis.io/commands/exec
Execute all commands issued after MULTI. https://redis.io/commands/exec
public mixed exec ( ) | ||
return | mixed |
---|
Executes a redis command.
For a list of available commands and their parameters see https://redis.io/commands.
The params array should contain the params separated by white space, e.g. to execute
SET mykey somevalue NX
call the following:
$redis->executeCommand('SET', ['mykey', 'somevalue', 'NX']);
public array|boolean|null|string executeCommand ( $name, $params = [] ) | ||
$name | string | The name of the command |
$params | array | List of parameters for the command |
return | array|boolean|null|string | Dependent on the executed command this method will return different data types:
See redis protocol description for details on the mentioned reply types. |
---|---|---|
throws | yii\db\Exception | for commands that return error reply. |
Determine if a key exists. https://redis.io/commands/exists
Determine if a key exists. https://redis.io/commands/exists
public mixed exists ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Set a key's time to live in seconds. https://redis.io/commands/expire
Set a key's time to live in seconds. https://redis.io/commands/expire
public mixed expire ( $key, $seconds ) | ||
$key | ||
$seconds | ||
return | mixed |
---|
Set the expiration for a key as a UNIX timestamp. https://redis.io/commands/expireat
Set the expiration for a key as a UNIX timestamp. https://redis.io/commands/expireat
public mixed expireat ( $key, $timestamp ) | ||
$key | ||
$timestamp | ||
return | mixed |
---|
Remove all keys from all databases. https://redis.io/commands/flushall
Remove all keys from all databases. https://redis.io/commands/flushall
public mixed flushall ( $ASYNC ) | ||
$ASYNC | ||
return | mixed |
---|
Remove all keys from the current database. https://redis.io/commands/flushdb
Remove all keys from the current database. https://redis.io/commands/flushdb
public mixed flushdb ( $ASYNC ) | ||
$ASYNC | ||
return | mixed |
---|
Add one or more geospatial items in the geospatial index represented using a sorted set. https://redis.io/commands/geoadd
Add one or more geospatial items in the geospatial index represented using a sorted set. https://redis.io/commands/geoadd
public mixed geoadd ( $key, $longitude, $latitude, $member, ...$more ) | ||
$key | ||
$longitude | ||
$latitude | ||
$member | ||
...$more | ||
return | mixed |
---|
Returns the distance between two members of a geospatial index. https://redis.io/commands/geodist
Returns the distance between two members of a geospatial index. https://redis.io/commands/geodist
public mixed geodist ( $key, $member1, $member2, $unit ) | ||
$key | ||
$member1 | ||
$member2 | ||
$unit | ||
return | mixed |
---|
Returns members of a geospatial index as standard geohash strings. https://redis.io/commands/geohash
Returns members of a geospatial index as standard geohash strings. https://redis.io/commands/geohash
public mixed geohash ( $key, ...$members ) | ||
$key | ||
...$members | ||
return | mixed |
---|
Returns longitude and latitude of members of a geospatial index. https://redis.io/commands/geopos
Returns longitude and latitude of members of a geospatial index. https://redis.io/commands/geopos
public mixed geopos ( $key, ...$members ) | ||
$key | ||
...$members | ||
return | mixed |
---|
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point. https://redis.io/commands/georadius
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point. https://redis.io/commands/georadius
public mixed georadius ( $key, $longitude, $latitude, $radius, $metric, ...$options ) | ||
$key | ||
$longitude | ||
$latitude | ||
$radius | ||
$metric | ||
...$options | ||
return | mixed |
---|
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member. https://redis.io/commands/georadiusbymember
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member. https://redis.io/commands/georadiusbymember
public mixed georadiusbymember ( $key, $member, $radius, $metric, ...$options ) | ||
$key | ||
$member | ||
$radius | ||
$metric | ||
...$options | ||
return | mixed |
---|
Get the value of a key. https://redis.io/commands/get
Get the value of a key. https://redis.io/commands/get
public mixed get ( $key ) | ||
$key | ||
return | mixed |
---|
Return the connection string used to open a socket connection. During a redirect (cluster mode) this will be the target of the redirect.
public string getConnectionString ( ) | ||
return | string | Socket connection string |
---|
Returns the name of the DB driver for the current dsn.
public string getDriverName ( ) | ||
return | string | Name of the DB driver |
---|
Returns a value indicating whether the DB connection is established.
public boolean getIsActive ( ) | ||
return | boolean | Whether the DB connection is established |
---|
public yii\redis\LuaScriptBuilder getLuaScriptBuilder ( ) |
Return the connection resource if a connection to the target has been established before, false
otherwise.
public resource|false getSocket ( ) |
Returns the bit value at offset in the string value stored at key. https://redis.io/commands/getbit
Returns the bit value at offset in the string value stored at key. https://redis.io/commands/getbit
public mixed getbit ( $key, $offset ) | ||
$key | ||
$offset | ||
return | mixed |
---|
Get a substring of the string stored at a key. https://redis.io/commands/getrange
Get a substring of the string stored at a key. https://redis.io/commands/getrange
public mixed getrange ( $key, $start, $end ) | ||
$key | ||
$start | ||
$end | ||
return | mixed |
---|
Set the string value of a key and return its old value. https://redis.io/commands/getset
Set the string value of a key and return its old value. https://redis.io/commands/getset
public mixed getset ( $key, $value ) | ||
$key | ||
$value | ||
return | mixed |
---|
Delete one or more hash fields. https://redis.io/commands/hdel
Delete one or more hash fields. https://redis.io/commands/hdel
public mixed hdel ( $key, ...$fields ) | ||
$key | ||
...$fields | ||
return | mixed |
---|
Determine if a hash field exists. https://redis.io/commands/hexists
Determine if a hash field exists. https://redis.io/commands/hexists
public mixed hexists ( $key, $field ) | ||
$key | ||
$field | ||
return | mixed |
---|
Get the value of a hash field. https://redis.io/commands/hget
Get the value of a hash field. https://redis.io/commands/hget
public mixed hget ( $key, $field ) | ||
$key | ||
$field | ||
return | mixed |
---|
Get all the fields and values in a hash. https://redis.io/commands/hgetall
Get all the fields and values in a hash. https://redis.io/commands/hgetall
public mixed hgetall ( $key ) | ||
$key | ||
return | mixed |
---|
Increment the integer value of a hash field by the given number. https://redis.io/commands/hincrby
Increment the integer value of a hash field by the given number. https://redis.io/commands/hincrby
public mixed hincrby ( $key, $field, $increment ) | ||
$key | ||
$field | ||
$increment | ||
return | mixed |
---|
Increment the float value of a hash field by the given amount. https://redis.io/commands/hincrbyfloat
Increment the float value of a hash field by the given amount. https://redis.io/commands/hincrbyfloat
public mixed hincrbyfloat ( $key, $field, $increment ) | ||
$key | ||
$field | ||
$increment | ||
return | mixed |
---|
Get all the fields in a hash. https://redis.io/commands/hkeys
Get all the fields in a hash. https://redis.io/commands/hkeys
public mixed hkeys ( $key ) | ||
$key | ||
return | mixed |
---|
Get the number of fields in a hash. https://redis.io/commands/hlen
Get the number of fields in a hash. https://redis.io/commands/hlen
public mixed hlen ( $key ) | ||
$key | ||
return | mixed |
---|
Get the values of all the given hash fields. https://redis.io/commands/hmget
Get the values of all the given hash fields. https://redis.io/commands/hmget
public mixed hmget ( $key, ...$fields ) | ||
$key | ||
...$fields | ||
return | mixed |
---|
Set multiple hash fields to multiple values. https://redis.io/commands/hmset
Set multiple hash fields to multiple values. https://redis.io/commands/hmset
public mixed hmset ( $key, $field, $value, ...$more ) | ||
$key | ||
$field | ||
$value | ||
...$more | ||
return | mixed |
---|
Incrementally iterate hash fields and associated values. https://redis.io/commands/hscan
Incrementally iterate hash fields and associated values. https://redis.io/commands/hscan
public mixed hscan ( $key, $cursor, $MATCH, $pattern, $COUNT, $count ) | ||
$key | ||
$cursor | ||
$MATCH | ||
$pattern | ||
$COUNT | ||
$count | ||
return | mixed |
---|
Set the string value of a hash field. https://redis.io/commands/hset
Set the string value of a hash field. https://redis.io/commands/hset
public mixed hset ( $key, $field, $value ) | ||
$key | ||
$field | ||
$value | ||
return | mixed |
---|
Set the value of a hash field, only if the field does not exist. https://redis.io/commands/hsetnx
Set the value of a hash field, only if the field does not exist. https://redis.io/commands/hsetnx
public mixed hsetnx ( $key, $field, $value ) | ||
$key | ||
$field | ||
$value | ||
return | mixed |
---|
Get the length of the value of a hash field. https://redis.io/commands/hstrlen
Get the length of the value of a hash field. https://redis.io/commands/hstrlen
public mixed hstrlen ( $key, $field ) | ||
$key | ||
$field | ||
return | mixed |
---|
Get all the values in a hash. https://redis.io/commands/hvals
Get all the values in a hash. https://redis.io/commands/hvals
public mixed hvals ( $key ) | ||
$key | ||
return | mixed |
---|
Increment the integer value of a key by one. https://redis.io/commands/incr
Increment the integer value of a key by one. https://redis.io/commands/incr
public mixed incr ( $key ) | ||
$key | ||
return | mixed |
---|
Increment the integer value of a key by the given amount. https://redis.io/commands/incrby
Increment the integer value of a key by the given amount. https://redis.io/commands/incrby
public mixed incrby ( $key, $increment ) | ||
$key | ||
$increment | ||
return | mixed |
---|
Increment the float value of a key by the given amount. https://redis.io/commands/incrbyfloat
Increment the float value of a key by the given amount. https://redis.io/commands/incrbyfloat
public mixed incrbyfloat ( $key, $increment ) | ||
$key | ||
$increment | ||
return | mixed |
---|
Get information and statistics about the server. https://redis.io/commands/info
Get information and statistics about the server. https://redis.io/commands/info
public mixed info ( $section ) | ||
$section | ||
return | mixed |
---|
Initializes the DB connection.
This method is invoked right after the DB connection is established. The default implementation triggers an EVENT_AFTER_OPEN event.
protected void initConnection ( ) |
Find all keys matching the given pattern. https://redis.io/commands/keys
Find all keys matching the given pattern. https://redis.io/commands/keys
public mixed keys ( $pattern ) | ||
$pattern | ||
return | mixed |
---|
Get the UNIX time stamp of the last successful save to disk. https://redis.io/commands/lastsave
Get the UNIX time stamp of the last successful save to disk. https://redis.io/commands/lastsave
public mixed lastsave ( ) | ||
return | mixed |
---|
Get an element from a list by its index. https://redis.io/commands/lindex
Get an element from a list by its index. https://redis.io/commands/lindex
public mixed lindex ( $key, $index ) | ||
$key | ||
$index | ||
return | mixed |
---|
Insert an element before or after another element in a list. https://redis.io/commands/linsert
Insert an element before or after another element in a list. https://redis.io/commands/linsert
public mixed linsert ( $key, $where, $pivot, $value ) | ||
$key | ||
$where | ||
$pivot | ||
$value | ||
return | mixed |
---|
Get the length of a list. https://redis.io/commands/llen
Get the length of a list. https://redis.io/commands/llen
public mixed llen ( $key ) | ||
$key | ||
return | mixed |
---|
Remove and get the first element in a list. https://redis.io/commands/lpop
Remove and get the first element in a list. https://redis.io/commands/lpop
public mixed lpop ( $key ) | ||
$key | ||
return | mixed |
---|
Prepend one or multiple values to a list. https://redis.io/commands/lpush
Prepend one or multiple values to a list. https://redis.io/commands/lpush
public mixed lpush ( $key, ...$values ) | ||
$key | ||
...$values | ||
return | mixed |
---|
Prepend a value to a list, only if the list exists. https://redis.io/commands/lpushx
Prepend a value to a list, only if the list exists. https://redis.io/commands/lpushx
public mixed lpushx ( $key, $value ) | ||
$key | ||
$value | ||
return | mixed |
---|
Get a range of elements from a list. https://redis.io/commands/lrange
Get a range of elements from a list. https://redis.io/commands/lrange
public mixed lrange ( $key, $start, $stop ) | ||
$key | ||
$start | ||
$stop | ||
return | mixed |
---|
Remove elements from a list. https://redis.io/commands/lrem
Remove elements from a list. https://redis.io/commands/lrem
public mixed lrem ( $key, $count, $value ) | ||
$key | ||
$count | ||
$value | ||
return | mixed |
---|
Set the value of an element in a list by its index. https://redis.io/commands/lset
Set the value of an element in a list by its index. https://redis.io/commands/lset
public mixed lset ( $key, $index, $value ) | ||
$key | ||
$index | ||
$value | ||
return | mixed |
---|
Trim a list to the specified range. https://redis.io/commands/ltrim
Trim a list to the specified range. https://redis.io/commands/ltrim
public mixed ltrim ( $key, $start, $stop ) | ||
$key | ||
$start | ||
$stop | ||
return | mixed |
---|
Get the values of all the given keys. https://redis.io/commands/mget
Get the values of all the given keys. https://redis.io/commands/mget
public mixed mget ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Atomically transfer a key from a Redis instance to another one.. https://redis.io/commands/migrate
Atomically transfer a key from a Redis instance to another one.. https://redis.io/commands/migrate
public mixed migrate ( $host, $port, $key, $destinationDb, $timeout, ...$options ) | ||
$host | ||
$port | ||
$key | ||
$destinationDb | ||
$timeout | ||
...$options | ||
return | mixed |
---|
Listen for all requests received by the server in real time. https://redis.io/commands/monitor
Listen for all requests received by the server in real time. https://redis.io/commands/monitor
public mixed monitor ( ) | ||
return | mixed |
---|
Move a key to another database. https://redis.io/commands/move
Move a key to another database. https://redis.io/commands/move
public mixed move ( $key, $db ) | ||
$key | ||
$db | ||
return | mixed |
---|
Set multiple keys to multiple values. https://redis.io/commands/mset
Set multiple keys to multiple values. https://redis.io/commands/mset
public mixed mset ( ...$keyValuePairs ) | ||
...$keyValuePairs | ||
return | mixed |
---|
Set multiple keys to multiple values, only if none of the keys exist. https://redis.io/commands/msetnx
Set multiple keys to multiple values, only if none of the keys exist. https://redis.io/commands/msetnx
public mixed msetnx ( ...$keyValuePairs ) | ||
...$keyValuePairs | ||
return | mixed |
---|
Mark the start of a transaction block. https://redis.io/commands/multi
Mark the start of a transaction block. https://redis.io/commands/multi
public mixed multi ( ) | ||
return | mixed |
---|
Inspect the internals of Redis objects. https://redis.io/commands/object
Inspect the internals of Redis objects. https://redis.io/commands/object
public mixed object ( $subcommand, ...$argumentss ) | ||
$subcommand | ||
...$argumentss | ||
return | mixed |
---|
Establishes a DB connection.
It does nothing if a DB connection has already been established.
public void open ( ) | ||
throws | yii\db\Exception | if connection fails |
---|
Remove the expiration from a key. https://redis.io/commands/persist
Remove the expiration from a key. https://redis.io/commands/persist
public mixed persist ( $key ) | ||
$key | ||
return | mixed |
---|
Set a key's time to live in milliseconds. https://redis.io/commands/pexpire
Set a key's time to live in milliseconds. https://redis.io/commands/pexpire
public mixed pexpire ( $key, $milliseconds ) | ||
$key | ||
$milliseconds | ||
return | mixed |
---|
Set the expiration for a key as a UNIX timestamp specified in milliseconds. https://redis.io/commands/pexpireat
Set the expiration for a key as a UNIX timestamp specified in milliseconds. https://redis.io/commands/pexpireat
public mixed pexpireat ( $key, $millisecondsTimestamp ) | ||
$key | ||
$millisecondsTimestamp | ||
return | mixed |
---|
Adds the specified elements to the specified HyperLogLog.. https://redis.io/commands/pfadd
Adds the specified elements to the specified HyperLogLog.. https://redis.io/commands/pfadd
public mixed pfadd ( $key, ...$elements ) | ||
$key | ||
...$elements | ||
return | mixed |
---|
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).. https://redis.io/commands/pfcount
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).. https://redis.io/commands/pfcount
public mixed pfcount ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Merge N different HyperLogLogs into a single one.. https://redis.io/commands/pfmerge
Merge N different HyperLogLogs into a single one.. https://redis.io/commands/pfmerge
public mixed pfmerge ( $destkey, ...$sourcekeys ) | ||
$destkey | ||
...$sourcekeys | ||
return | mixed |
---|
Ping the server. https://redis.io/commands/ping
Ping the server. https://redis.io/commands/ping
public mixed ping ( $message ) | ||
$message | ||
return | mixed |
---|
Set the value and expiration in milliseconds of a key. https://redis.io/commands/psetex
Set the value and expiration in milliseconds of a key. https://redis.io/commands/psetex
public mixed psetex ( $key, $milliseconds, $value ) | ||
$key | ||
$milliseconds | ||
$value | ||
return | mixed |
---|
Listen for messages published to channels matching the given patterns. https://redis.io/commands/psubscribe
Listen for messages published to channels matching the given patterns. https://redis.io/commands/psubscribe
public mixed psubscribe ( ...$patterns ) | ||
...$patterns | ||
return | mixed |
---|
Get the time to live for a key in milliseconds. https://redis.io/commands/pttl
Get the time to live for a key in milliseconds. https://redis.io/commands/pttl
public mixed pttl ( $key ) | ||
$key | ||
return | mixed |
---|
Post a message to a channel. https://redis.io/commands/publish
Post a message to a channel. https://redis.io/commands/publish
public mixed publish ( $channel, $message ) | ||
$channel | ||
$message | ||
return | mixed |
---|
Inspect the state of the Pub/Sub subsystem. https://redis.io/commands/pubsub
Inspect the state of the Pub/Sub subsystem. https://redis.io/commands/pubsub
public mixed pubsub ( $subcommand, ...$arguments ) | ||
$subcommand | ||
...$arguments | ||
return | mixed |
---|
Stop listening for messages posted to channels matching the given patterns. https://redis.io/commands/punsubscribe
Stop listening for messages posted to channels matching the given patterns. https://redis.io/commands/punsubscribe
public mixed punsubscribe ( ...$patterns ) | ||
...$patterns | ||
return | mixed |
---|
Close the connection. https://redis.io/commands/quit
Close the connection. https://redis.io/commands/quit
public mixed quit ( ) | ||
return | mixed |
---|
Return a random key from the keyspace. https://redis.io/commands/randomkey
Return a random key from the keyspace. https://redis.io/commands/randomkey
public mixed randomkey ( ) | ||
return | mixed |
---|
Enables read queries for a connection to a cluster slave node. https://redis.io/commands/readonly
Enables read queries for a connection to a cluster slave node. https://redis.io/commands/readonly
public mixed readonly ( ) | ||
return | mixed |
---|
Disables read queries for a connection to a cluster slave node. https://redis.io/commands/readwrite
Disables read queries for a connection to a cluster slave node. https://redis.io/commands/readwrite
public mixed readwrite ( ) | ||
return | mixed |
---|
Rename a key. https://redis.io/commands/rename
Rename a key. https://redis.io/commands/rename
public mixed rename ( $key, $newkey ) | ||
$key | ||
$newkey | ||
return | mixed |
---|
Rename a key, only if the new key does not exist. https://redis.io/commands/renamenx
Rename a key, only if the new key does not exist. https://redis.io/commands/renamenx
public mixed renamenx ( $key, $newkey ) | ||
$key | ||
$newkey | ||
return | mixed |
---|
Create a key using the provided serialized value, previously obtained using DUMP.. https://redis.io/commands/restore
Create a key using the provided serialized value, previously obtained using DUMP.. https://redis.io/commands/restore
public mixed restore ( $key, $ttl, $serializedValue, $REPLACE ) | ||
$key | ||
$ttl | ||
$serializedValue | ||
$REPLACE | ||
return | mixed |
---|
Return the role of the instance in the context of replication. https://redis.io/commands/role
Return the role of the instance in the context of replication. https://redis.io/commands/role
public mixed role ( ) | ||
return | mixed |
---|
Remove and get the last element in a list. https://redis.io/commands/rpop
Remove and get the last element in a list. https://redis.io/commands/rpop
public mixed rpop ( $key ) | ||
$key | ||
return | mixed |
---|
Remove the last element in a list, prepend it to another list and return it. https://redis.io/commands/rpoplpush
Remove the last element in a list, prepend it to another list and return it. https://redis.io/commands/rpoplpush
public mixed rpoplpush ( $source, $destination ) | ||
$source | ||
$destination | ||
return | mixed |
---|
Append one or multiple values to a list. https://redis.io/commands/rpush
Append one or multiple values to a list. https://redis.io/commands/rpush
public mixed rpush ( $key, ...$values ) | ||
$key | ||
...$values | ||
return | mixed |
---|
Append a value to a list, only if the list exists. https://redis.io/commands/rpushx
Append a value to a list, only if the list exists. https://redis.io/commands/rpushx
public mixed rpushx ( $key, $value ) | ||
$key | ||
$value | ||
return | mixed |
---|
Add one or more members to a set. https://redis.io/commands/sadd
Add one or more members to a set. https://redis.io/commands/sadd
public mixed sadd ( $key, ...$members ) | ||
$key | ||
...$members | ||
return | mixed |
---|
Synchronously save the dataset to disk. https://redis.io/commands/save
Synchronously save the dataset to disk. https://redis.io/commands/save
public mixed save ( ) | ||
return | mixed |
---|
Incrementally iterate the keys space. https://redis.io/commands/scan
Incrementally iterate the keys space. https://redis.io/commands/scan
public mixed scan ( $cursor, $MATCH, $pattern, $COUNT, $count ) | ||
$cursor | ||
$MATCH | ||
$pattern | ||
$COUNT | ||
$count | ||
return | mixed |
---|
Get the number of members in a set. https://redis.io/commands/scard
Get the number of members in a set. https://redis.io/commands/scard
public mixed scard ( $key ) | ||
$key | ||
return | mixed |
---|
Set the debug mode for executed scripts.. https://redis.io/commands/script-debug
Set the debug mode for executed scripts.. https://redis.io/commands/script-debug
public mixed scriptDebug ( $option ) | ||
$option | ||
return | mixed |
---|
Check existence of scripts in the script cache.. https://redis.io/commands/script-exists
Check existence of scripts in the script cache.. https://redis.io/commands/script-exists
public mixed scriptExists ( ...$sha1s ) | ||
...$sha1s | ||
return | mixed |
---|
Remove all the scripts from the script cache.. https://redis.io/commands/script-flush
Remove all the scripts from the script cache.. https://redis.io/commands/script-flush
public mixed scriptFlush ( ) | ||
return | mixed |
---|
Kill the script currently in execution.. https://redis.io/commands/script-kill
Kill the script currently in execution.. https://redis.io/commands/script-kill
public mixed scriptKill ( ) | ||
return | mixed |
---|
Load the specified Lua script into the script cache.. https://redis.io/commands/script-load
Load the specified Lua script into the script cache.. https://redis.io/commands/script-load
public mixed scriptLoad ( $script ) | ||
$script | ||
return | mixed |
---|
Subtract multiple sets. https://redis.io/commands/sdiff
Subtract multiple sets. https://redis.io/commands/sdiff
public mixed sdiff ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Subtract multiple sets and store the resulting set in a key. https://redis.io/commands/sdiffstore
Subtract multiple sets and store the resulting set in a key. https://redis.io/commands/sdiffstore
public mixed sdiffstore ( $destination, ...$keys ) | ||
$destination | ||
...$keys | ||
return | mixed |
---|
Change the selected database for the current connection. https://redis.io/commands/select
Change the selected database for the current connection. https://redis.io/commands/select
public mixed select ( $index ) | ||
$index | ||
return | mixed |
---|
Set the string value of a key. https://redis.io/commands/set
Set the string value of a key. https://redis.io/commands/set
public mixed set ( $key, $value, ...$options ) | ||
$key | ||
$value | ||
...$options | ||
return | mixed |
---|
Sets or clears the bit at offset in the string value stored at key. https://redis.io/commands/setbit
Sets or clears the bit at offset in the string value stored at key. https://redis.io/commands/setbit
public mixed setbit ( $key, $offset, $value ) | ||
$key | ||
$offset | ||
$value | ||
return | mixed |
---|
Set the value and expiration of a key. https://redis.io/commands/setex
Set the value and expiration of a key. https://redis.io/commands/setex
public mixed setex ( $key, $seconds, $value ) | ||
$key | ||
$seconds | ||
$value | ||
return | mixed |
---|
Set the value of a key, only if the key does not exist. https://redis.io/commands/setnx
Set the value of a key, only if the key does not exist. https://redis.io/commands/setnx
public mixed setnx ( $key, $value ) | ||
$key | ||
$value | ||
return | mixed |
---|
Overwrite part of a string at key starting at the specified offset. https://redis.io/commands/setrange
Overwrite part of a string at key starting at the specified offset. https://redis.io/commands/setrange
public mixed setrange ( $key, $offset, $value ) | ||
$key | ||
$offset | ||
$value | ||
return | mixed |
---|
Synchronously save the dataset to disk and then shut down the server. https://redis.io/commands/shutdown
Synchronously save the dataset to disk and then shut down the server. https://redis.io/commands/shutdown
public mixed shutdown ( $saveOption ) | ||
$saveOption | ||
return | mixed |
---|
Intersect multiple sets. https://redis.io/commands/sinter
Intersect multiple sets. https://redis.io/commands/sinter
public mixed sinter ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Intersect multiple sets and store the resulting set in a key. https://redis.io/commands/sinterstore
Intersect multiple sets and store the resulting set in a key. https://redis.io/commands/sinterstore
public mixed sinterstore ( $destination, ...$keys ) | ||
$destination | ||
...$keys | ||
return | mixed |
---|
Determine if a given value is a member of a set. https://redis.io/commands/sismember
Determine if a given value is a member of a set. https://redis.io/commands/sismember
public mixed sismember ( $key, $member ) | ||
$key | ||
$member | ||
return | mixed |
---|
Make the server a slave of another instance, or promote it as master. https://redis.io/commands/slaveof
Make the server a slave of another instance, or promote it as master. https://redis.io/commands/slaveof
public mixed slaveof ( $host, $port ) | ||
$host | ||
$port | ||
return | mixed |
---|
Manages the Redis slow queries log. https://redis.io/commands/slowlog
Manages the Redis slow queries log. https://redis.io/commands/slowlog
public mixed slowlog ( $subcommand, $argument ) | ||
$subcommand | ||
$argument | ||
return | mixed |
---|
Get all the members in a set. https://redis.io/commands/smembers
Get all the members in a set. https://redis.io/commands/smembers
public mixed smembers ( $key ) | ||
$key | ||
return | mixed |
---|
Move a member from one set to another. https://redis.io/commands/smove
Move a member from one set to another. https://redis.io/commands/smove
public mixed smove ( $source, $destination, $member ) | ||
$source | ||
$destination | ||
$member | ||
return | mixed |
---|
Sort the elements in a list, set or sorted set. https://redis.io/commands/sort
Sort the elements in a list, set or sorted set. https://redis.io/commands/sort
public mixed sort ( $key, ...$options ) | ||
$key | ||
...$options | ||
return | mixed |
---|
Remove and return one or multiple random members from a set. https://redis.io/commands/spop
Remove and return one or multiple random members from a set. https://redis.io/commands/spop
public mixed spop ( $key, $count ) | ||
$key | ||
$count | ||
return | mixed |
---|
Get one or multiple random members from a set. https://redis.io/commands/srandmember
Get one or multiple random members from a set. https://redis.io/commands/srandmember
public mixed srandmember ( $key, $count ) | ||
$key | ||
$count | ||
return | mixed |
---|
Remove one or more members from a set. https://redis.io/commands/srem
Remove one or more members from a set. https://redis.io/commands/srem
public mixed srem ( $key, ...$members ) | ||
$key | ||
...$members | ||
return | mixed |
---|
Incrementally iterate Set elements. https://redis.io/commands/sscan
Incrementally iterate Set elements. https://redis.io/commands/sscan
public mixed sscan ( $key, $cursor, $MATCH, $pattern, $COUNT, $count ) | ||
$key | ||
$cursor | ||
$MATCH | ||
$pattern | ||
$COUNT | ||
$count | ||
return | mixed |
---|
Get the length of the value stored in a key. https://redis.io/commands/strlen
Get the length of the value stored in a key. https://redis.io/commands/strlen
public mixed strlen ( $key ) | ||
$key | ||
return | mixed |
---|
Listen for messages published to the given channels. https://redis.io/commands/subscribe
Listen for messages published to the given channels. https://redis.io/commands/subscribe
public mixed subscribe ( ...$channels ) | ||
...$channels | ||
return | mixed |
---|
Add multiple sets. https://redis.io/commands/sunion
Add multiple sets. https://redis.io/commands/sunion
public mixed sunion ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Add multiple sets and store the resulting set in a key. https://redis.io/commands/sunionstore
Add multiple sets and store the resulting set in a key. https://redis.io/commands/sunionstore
public mixed sunionstore ( $destination, ...$keys ) | ||
$destination | ||
...$keys | ||
return | mixed |
---|
Swaps two Redis databases. https://redis.io/commands/swapdb
Swaps two Redis databases. https://redis.io/commands/swapdb
public mixed swapdb ( $index, $index ) | ||
$index | ||
$index | ||
return | mixed |
---|
Internal command used for replication. https://redis.io/commands/sync
Internal command used for replication. https://redis.io/commands/sync
public mixed sync ( ) | ||
return | mixed |
---|
Return the current server time. https://redis.io/commands/time
Return the current server time. https://redis.io/commands/time
public mixed time ( ) | ||
return | mixed |
---|
Alters the last access time of a key(s). Returns the number of existing keys specified.. https://redis.io/commands/touch
Alters the last access time of a key(s). Returns the number of existing keys specified.. https://redis.io/commands/touch
public mixed touch ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Get the time to live for a key. https://redis.io/commands/ttl
Get the time to live for a key. https://redis.io/commands/ttl
public mixed ttl ( $key ) | ||
$key | ||
return | mixed |
---|
Determine the type stored at key. https://redis.io/commands/type
Determine the type stored at key. https://redis.io/commands/type
public mixed type ( $key ) | ||
$key | ||
return | mixed |
---|
Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking.. https://redis.io/commands/unlink
Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking.. https://redis.io/commands/unlink
public mixed unlink ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Stop listening for messages posted to the given channels. https://redis.io/commands/unsubscribe
Stop listening for messages posted to the given channels. https://redis.io/commands/unsubscribe
public mixed unsubscribe ( ...$channels ) | ||
...$channels | ||
return | mixed |
---|
Forget about all watched keys. https://redis.io/commands/unwatch
Forget about all watched keys. https://redis.io/commands/unwatch
public mixed unwatch ( ) | ||
return | mixed |
---|
Wait for the synchronous replication of all the write commands sent in the context of the current connection. https://redis.io/commands/wait
Wait for the synchronous replication of all the write commands sent in the context of the current connection. https://redis.io/commands/wait
public mixed wait ( $numslaves, $timeout ) | ||
$numslaves | ||
$timeout | ||
return | mixed |
---|
Watch the given keys to determine execution of the MULTI/EXEC block. https://redis.io/commands/watch
Watch the given keys to determine execution of the MULTI/EXEC block. https://redis.io/commands/watch
public mixed watch ( ...$keys ) | ||
...$keys | ||
return | mixed |
---|
Removes one or multiple messages from the pending entries list (PEL) of a stream consumer group https://redis.io/commands/xack
Removes one or multiple messages from the pending entries list (PEL) of a stream consumer group https://redis.io/commands/xack
public mixed xack ( $stream, $group, ...$ids ) | ||
$stream | ||
$group | ||
...$ids | ||
return | mixed |
---|
Appends the specified stream entry to the stream at the specified key https://redis.io/commands/xadd
Appends the specified stream entry to the stream at the specified key https://redis.io/commands/xadd
public mixed xadd ( $stream, $id, $field, $value, ...$fieldsValues ) | ||
$stream | ||
$id | ||
$field | ||
$value | ||
...$fieldsValues | ||
return | mixed |
---|
Changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument https://redis.io/commands/xclaim
Changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument https://redis.io/commands/xclaim
public mixed xclaim ( $stream, $group, $consumer, $minIdleTimeMs, $id, ...$options ) | ||
$stream | ||
$group | ||
$consumer | ||
$minIdleTimeMs | ||
$id | ||
...$options | ||
return | mixed |
---|
Removes the specified entries from a stream, and returns the number of entries deleted https://redis.io/commands/xdel
Removes the specified entries from a stream, and returns the number of entries deleted https://redis.io/commands/xdel
public mixed xdel ( $stream, ...$ids ) | ||
$stream | ||
...$ids | ||
return | mixed |
---|
Manages the consumer groups associated with a stream data structure https://redis.io/commands/xgroup
Manages the consumer groups associated with a stream data structure https://redis.io/commands/xgroup
public mixed xgroup ( $subCommand, $stream, $group, ...$options ) | ||
$subCommand | ||
$stream | ||
$group | ||
...$options | ||
return | mixed |
---|
Retrieves different information about the streams and associated consumer groups https://redis.io/commands/xinfo
Retrieves different information about the streams and associated consumer groups https://redis.io/commands/xinfo
public mixed xinfo ( $subCommand, $stream, ...$options ) | ||
$subCommand | ||
$stream | ||
...$options | ||
return | mixed |
---|
Returns the number of entries inside a stream https://redis.io/commands/xlen
Returns the number of entries inside a stream https://redis.io/commands/xlen
public mixed xlen ( $stream ) | ||
$stream | ||
return | mixed |
---|
Fetching data from a stream via a consumer group, and not acknowledging such data, has the effect of creating pending entries https://redis.io/commands/xpending
Fetching data from a stream via a consumer group, and not acknowledging such data, has the effect of creating pending entries https://redis.io/commands/xpending
public mixed xpending ( $stream, $group, ...$options ) | ||
$stream | ||
$group | ||
...$options | ||
return | mixed |
---|
Returns the stream entries matching a given range of IDs https://redis.io/commands/xrange
Returns the stream entries matching a given range of IDs https://redis.io/commands/xrange
public mixed xrange ( $stream, $start, $end, ...$options ) | ||
$stream | ||
$start | ||
$end | ||
...$options | ||
return | mixed |
---|
Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller https://redis.io/commands/xread
Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller https://redis.io/commands/xread
public mixed xread ( ...$options ) | ||
...$options | ||
return | mixed |
---|
Special version of the XREAD command with support for consumer groups https://redis.io/commands/xreadgroup
Special version of the XREAD command with support for consumer groups https://redis.io/commands/xreadgroup
public mixed xreadgroup ( $subCommand, $group, $consumer, ...$options ) | ||
$subCommand | ||
$group | ||
$consumer | ||
...$options | ||
return | mixed |
---|
Exactly like XRANGE, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order https://redis.io/commands/xrevrange
Exactly like XRANGE, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order https://redis.io/commands/xrevrange
public mixed xrevrange ( $stream, $end, $start, ...$options ) | ||
$stream | ||
$end | ||
$start | ||
...$options | ||
return | mixed |
---|
Trims the stream to a given number of items, evicting older items (items with lower IDs) if needed https://redis.io/commands/xtrim
Trims the stream to a given number of items, evicting older items (items with lower IDs) if needed https://redis.io/commands/xtrim
public mixed xtrim ( $stream, $strategy, ...$options ) | ||
$stream | ||
$strategy | ||
...$options | ||
return | mixed |
---|
Add one or more members to a sorted set, or update its score if it already exists. https://redis.io/commands/zadd
Add one or more members to a sorted set, or update its score if it already exists. https://redis.io/commands/zadd
public mixed zadd ( $key, ...$options ) | ||
$key | ||
...$options | ||
return | mixed |
---|
Get the number of members in a sorted set. https://redis.io/commands/zcard
Get the number of members in a sorted set. https://redis.io/commands/zcard
public mixed zcard ( $key ) | ||
$key | ||
return | mixed |
---|
Count the members in a sorted set with scores within the given values. https://redis.io/commands/zcount
Count the members in a sorted set with scores within the given values. https://redis.io/commands/zcount
public mixed zcount ( $key, $min, $max ) | ||
$key | ||
$min | ||
$max | ||
return | mixed |
---|
Increment the score of a member in a sorted set. https://redis.io/commands/zincrby
Increment the score of a member in a sorted set. https://redis.io/commands/zincrby
public mixed zincrby ( $key, $increment, $member ) | ||
$key | ||
$increment | ||
$member | ||
return | mixed |
---|
Intersect multiple sorted sets and store the resulting sorted set in a new key. https://redis.io/commands/zinterstore
Intersect multiple sorted sets and store the resulting sorted set in a new key. https://redis.io/commands/zinterstore
public mixed zinterstore ( $destination, $numkeys, $key, ...$options ) | ||
$destination | ||
$numkeys | ||
$key | ||
...$options | ||
return | mixed |
---|
Count the number of members in a sorted set between a given lexicographical range. https://redis.io/commands/zlexcount
Count the number of members in a sorted set between a given lexicographical range. https://redis.io/commands/zlexcount
public mixed zlexcount ( $key, $min, $max ) | ||
$key | ||
$min | ||
$max | ||
return | mixed |
---|
Return a range of members in a sorted set, by index. https://redis.io/commands/zrange
Return a range of members in a sorted set, by index. https://redis.io/commands/zrange
public mixed zrange ( $key, $start, $stop, $WITHSCORES ) | ||
$key | ||
$start | ||
$stop | ||
$WITHSCORES | ||
return | mixed |
---|
Return a range of members in a sorted set, by lexicographical range. https://redis.io/commands/zrangebylex
Return a range of members in a sorted set, by lexicographical range. https://redis.io/commands/zrangebylex
public mixed zrangebylex ( $key, $min, $max, $LIMIT, $offset, $count ) | ||
$key | ||
$min | ||
$max | ||
$LIMIT | ||
$offset | ||
$count | ||
return | mixed |
---|
Return a range of members in a sorted set, by score. https://redis.io/commands/zrangebyscore
Return a range of members in a sorted set, by score. https://redis.io/commands/zrangebyscore
public mixed zrangebyscore ( $key, $min, $max, ...$options ) | ||
$key | ||
$min | ||
$max | ||
...$options | ||
return | mixed |
---|
Determine the index of a member in a sorted set. https://redis.io/commands/zrank
Determine the index of a member in a sorted set. https://redis.io/commands/zrank
public mixed zrank ( $key, $member ) | ||
$key | ||
$member | ||
return | mixed |
---|
Remove one or more members from a sorted set. https://redis.io/commands/zrem
Remove one or more members from a sorted set. https://redis.io/commands/zrem
public mixed zrem ( $key, ...$members ) | ||
$key | ||
...$members | ||
return | mixed |
---|
Remove all members in a sorted set between the given lexicographical range. https://redis.io/commands/zremrangebylex
Remove all members in a sorted set between the given lexicographical range. https://redis.io/commands/zremrangebylex
public mixed zremrangebylex ( $key, $min, $max ) | ||
$key | ||
$min | ||
$max | ||
return | mixed |
---|
Remove all members in a sorted set within the given indexes. https://redis.io/commands/zremrangebyrank
Remove all members in a sorted set within the given indexes. https://redis.io/commands/zremrangebyrank
public mixed zremrangebyrank ( $key, $start, $stop ) | ||
$key | ||
$start | ||
$stop | ||
return | mixed |
---|
Remove all members in a sorted set within the given scores. https://redis.io/commands/zremrangebyscore
Remove all members in a sorted set within the given scores. https://redis.io/commands/zremrangebyscore
public mixed zremrangebyscore ( $key, $min, $max ) | ||
$key | ||
$min | ||
$max | ||
return | mixed |
---|
Return a range of members in a sorted set, by index, with scores ordered from high to low. https://redis.io/commands/zrevrange
Return a range of members in a sorted set, by index, with scores ordered from high to low. https://redis.io/commands/zrevrange
public mixed zrevrange ( $key, $start, $stop, $WITHSCORES ) | ||
$key | ||
$start | ||
$stop | ||
$WITHSCORES | ||
return | mixed |
---|
Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.. https://redis.io/commands/zrevrangebylex
Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.. https://redis.io/commands/zrevrangebylex
public mixed zrevrangebylex ( $key, $max, $min, $LIMIT, $offset, $count ) | ||
$key | ||
$max | ||
$min | ||
$LIMIT | ||
$offset | ||
$count | ||
return | mixed |
---|
Return a range of members in a sorted set, by score, with scores ordered from high to low. https://redis.io/commands/zrevrangebyscore
Return a range of members in a sorted set, by score, with scores ordered from high to low. https://redis.io/commands/zrevrangebyscore
public mixed zrevrangebyscore ( $key, $max, $min, $WITHSCORES, $LIMIT, $offset, $count ) | ||
$key | ||
$max | ||
$min | ||
$WITHSCORES | ||
$LIMIT | ||
$offset | ||
$count | ||
return | mixed |
---|
Determine the index of a member in a sorted set, with scores ordered from high to low. https://redis.io/commands/zrevrank
Determine the index of a member in a sorted set, with scores ordered from high to low. https://redis.io/commands/zrevrank
public mixed zrevrank ( $key, $member ) | ||
$key | ||
$member | ||
return | mixed |
---|
Incrementally iterate sorted sets elements and associated scores. https://redis.io/commands/zscan
Incrementally iterate sorted sets elements and associated scores. https://redis.io/commands/zscan
public mixed zscan ( $key, $cursor, $MATCH, $pattern, $COUNT, $count ) | ||
$key | ||
$cursor | ||
$MATCH | ||
$pattern | ||
$COUNT | ||
$count | ||
return | mixed |
---|
Get the score associated with the given member in a sorted set. https://redis.io/commands/zscore
Get the score associated with the given member in a sorted set. https://redis.io/commands/zscore
public mixed zscore ( $key, $member ) | ||
$key | ||
$member | ||
return | mixed |
---|
Add multiple sorted sets and store the resulting sorted set in a new key. https://redis.io/commands/zunionstore
Add multiple sorted sets and store the resulting sorted set in a new key. https://redis.io/commands/zunionstore
public mixed zunionstore ( $destination, $numkeys, $key, ...$options ) | ||
$destination | ||
$numkeys | ||
$key | ||
...$options | ||
return | mixed |
---|