PHP Interface Jamm\Memory\IRedisServer

Afficher le fichier Open project: jamm/memory

Méthodes publiques

Méthode Description
Append ( string $key, string $value ) : integer Append a value to a key
Auth ( string $password ) : boolean Request for authentication in a password protected Redis server.
BITCOUNT ( $key, integer $start, integer $end ) : integer Count the number of set bits (population counting) in a string.
BITOP ( string $operation, string $destkey, string $key ) : integer Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.
BLPop ( string | array $key, integer $timeout ) Remove and get the first element in a list, or block until one is available Parameters format: key1,key2,key3,.
BRPop ( string | array $key, integer $timeout ) Remove and get the last element in a list, or block until one is available Parameters format: key1,key2,key3,.
BRPopLPush ( $source, $destination, $timeout ) : string | boolean Pop a value from a list, push it to another list and return it; or block until one is available
CLIENT_GETNAME ( ) Get the current connection name
CLIENT_KILL ( $ip, $port ) : boolean The CLIENT KILL command closes a given client connection identified by ip:port.
CLIENT_LIST ( ) Get the list of client connections
CLIENT_SETNAME ( string $connection_name ) : boolean Set the current connection name
Config_Get ( string $parameter ) : string Get the value of a configuration parameter
Config_ResetStat ( ) Resets the statistics reported by Redis using the INFO command.
Config_Set ( $parameter, $value ) : boolean Set the value of a configuration parameter
DBsize ( ) : integer Return the number of keys in the selected database
DEBUG_OBJECT ( string $key ) Get debugging information about a key
DEBUG_SEGFAULT ( ) Make the server crash
DUMP ( string $key ) : string Serialize the value stored at key in a Redis-specific format and return it to the user.
Decr ( string $key ) : integer Decrement the integer value of a key by one
DecrBy ( string $key, integer $decrement ) : integer Decrement the integer value of a key by the given number
Del ( string $key ) : integer Delete a key Parameters: $key1, $key2, .
Discard ( ) Flushes all previously queued commands in a transaction and restores the connection state to normal.
ECHO_ ( string $message ) Echo the given string
EVALSHA ( $sha1, array $keys, array $args ) : mixed Execute a Lua script server side
EVAL_ ( string $script, array $keys, array $args ) : mixed Execute a Lua script server side
Exec ( ) Executes all previously queued commands in a transaction and restores the connection state to normal.
Exists ( string $key ) : integer Determine if a key exists
Expire ( string $key, integer $seconds ) : boolean Set a key's time to live in seconds
Expireat ( string $key, integer $timestamp ) : integer Set the expiration for a key as a UNIX timestamp
FlushAll ( ) Remove all keys from all databases
FlushDB ( ) Remove all keys from the current database
Get ( string $key ) : string Get the value of a key
GetBit ( string $key, integer $offset ) Returns the bit value at offset in the string value stored at key
GetRange ( string $key, integer $start, integer $end ) : string Get a substring of the string stored at a key
GetSet ( string $key, string $value ) : string Atomically sets key to value and returns the old value stored at key.
HINCRBYFLOAT ( string $key, string $field, float $increment ) : float Increment the specified field of an hash stored at key, and representing a floating point number, by the specified increment.
INCRBYFLOAT ( string $key, float $increment ) : float Increment the string representing a floating point number stored at key by the specified increment.
Incr ( string $key ) : integer Increment the integer value of a key by one
IncrBy ( string $key, integer $increment ) : integer Increment the integer value of a key by the given number
Info ( ) Get information and statistics about the server
Keys ( string $pattern ) : array Returns all keys matching pattern.
LASTSAVE ( ) Get the UNIX time stamp of the last successful save to disk Ping the server
LIndex ( string $key, integer $index ) : string | boolean Returns the element at index $index in the list stored at $key.
LInsert ( string $key, boolean $after = true, string $pivot, string $value ) : integer Insert an element before or after another element in a list
LLen ( string $key ) : integer Get the length of a list
LPop ( string $key ) : string | boolean Remove and get the first element in a list
LPush ( string $key, string | array $value ) : integer Inserts value at the head of the list stored at key.
LPushX ( string $key, string $value ) : integer Inserts value at the head of the list stored at key, only if key already exists and holds a list.
LRange ( string $key, integer $start, integer $stop ) : array Returns the specified elements of the list stored at key.
LRem ( string $key, integer $count, string $value ) : integer Removes the first count occurrences of elements equal to value from the list stored at key.
LSet ( $key, $index, $value ) : boolean Sets the list element at index to value.
LTrim ( string $key, integer $start, integer $stop ) : boolean Trim a list to the specified range
MGet ( string $key ) : array Returns the values of all specified keys.
MIGRATE ( string $host, string $port, string $key, integer $destination_db, integer $timeout ) : boolean Atomically transfer a key from a Redis instance to another one.
MONITOR ( ) Listen for all requests received by the server in real time
MSet ( array $keys ) : string Set multiple keys to multiple values
MSetNX ( array $keys ) : integer Set multiple keys to multiple values, only if none of the keys exist
Move ( string $key, integer $db ) : integer Move key from the currently selected database (see SELECT) to the specified destination database.
Multi ( ) Mark the start of a transaction block
OBJECT ( string $subcommand, array $arguments = [] ) Inspect the internals of Redis objects
PEXPIRE ( string $key, integer $milliseconds ) : integer Set a key's time to live in milliseconds
PEXPIREAT ( string $key, integer $milliseconds_timestamp ) : integer Set the expiration for a key as a UNIX timestamp specified in milliseconds
PING ( ) Ping the server
PSETEX ( string $key, integer $milliseconds, string $value ) : boolean Set the value and expiration in milliseconds of a key
PSubscribe ( string $pattern ) Subscribes the client to the given patterns.
PTTL ( string $key ) : integer Get the time to live for a key in milliseconds
PUnsubscribe ( array | string | null $pattern = null ) : integer Stop listening for messages posted to channels matching the given patterns
Persist ( string $key ) : integer Remove the expiration from a key
Publish ( string $channel, string $message ) : integer Post a message to a channel Returns the number of clients that received the message.
Quit ( ) Close the connection
RANDOMKEY ( ) Return a random key from the keyspace
RESTORE ( string $key, integer $ttl, string $serialized_value ) : boolean Create a key using the provided serialized value, previously obtained using DUMP.
RPop ( string $key ) : string | boolean Removes and returns the last element of the list stored at key.
RPopLPush ( string $source, string $destination ) : string Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.
RPush ( string $key, string | array $value ) : integer | boolean Inserts value at the tail of the list stored at key.
RPushX ( string $key, string $value ) : integer Append a value to a list, only if the list exists
Rename ( string $key, string $newkey ) : boolean Renames key to newkey.
RenameNX ( string $key, string $newkey ) : integer Rename a key, only if the new key does not exist
SAVE ( ) Synchronously save the dataset to disk
SCRIPT_EXISTS ( string $script ) : array Check existence of scripts in the script cache.
SCRIPT_FLUSH ( ) Remove all the scripts from the script cache.
SCRIPT_KILL ( ) Kills the currently executing Lua script, assuming no write operation was yet performed by the script.
SCRIPT_LOAD ( string $script ) : string Load a script into the scripts cache, without executing it.
SHUTDOWN ( boolean $save = false, boolean $nosave = false ) Synchronously save the dataset to disk and then shut down the server One of modifiers can be turned on:
SLOWLOG ( string $subcommand, string $argument = '' ) Manages the Redis slow queries log
SPOP ( string $key ) Remove and return a random member from a set
SRANDMEMBER ( string $key, integer $count = 1 ) Get a random member from a set
SYNC ( ) Internal command used for replication
Select ( integer $index ) Select the DB with having the specified zero-based numeric index. New connections always use DB 0.
Set ( string $key, string $value ) : string Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type.
SetBit ( string $key, integer $offset, integer $value ) : integer Sets or clears the bit at offset in the string value stored at key
SetEX ( string $key, integer $seconds, string $value ) : boolean Set the value and expiration of a key
SetNX ( string $key, string $value ) : boolean Set the value of a key, only if the key does not exist
SetRange ( string $key, integer $offset, string $value ) : integer Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
SlaveOf ( string $host, integer $port ) : string Make the server a slave of another instance, or promote it as master
Sort ( string $key, string $sort_rule ) : array Sort the elements in a list, set or sorted set
StrLen ( string $key ) : integer Get the length of the value stored in a key
Subscribe ( $channel ) Subscribes the client to the specified channels.
TIME ( ) : array Returns the current server time as a two items lists: a Unix timestamp and the amount of microseconds already elapsed in the current second
TTL ( string $key ) : integer Get the time to live for a key
Type ( string $key ) : string Returns the string representation of the type of the value stored at key.
Unsubscribe ( string $channel = '' ) Unsubscribes the client from the given channels, or from all of them if none is given.
Unwatch ( ) Forget about all watched keys
Watch ( string $key ) Marks the given keys to be watched for conditional execution of a transaction each argument is a key: watch('key1', 'key2', 'key3', .
bgRewriteAOF ( ) Rewrites the append-only file to reflect the current dataset in memory.
bgSave ( ) Asynchronously save the dataset to disk
hDel ( string $key, array | string $field ) : integer Removes the specified fields from the hash stored at key.
hExists ( string $key, string $field ) : integer Determine if a hash field exists
hGet ( string $key, string $field ) : string | integer Get the value of a hash field
hGetAll ( string $key ) : array Get all the fields and values in a hash
hIncrBy ( string $key, string $field, integer $increment ) : integer Increments the number stored at field in the hash stored at key by increment.
hKeys ( string $key ) : array Get all the fields in a hash
hLen ( string $key ) : integer Get the number of fields in a hash
hMGet ( string $key, array $fields ) : array Returns the values associated with the specified fields in the hash stored at key.
hMSet ( string $key, array $fields ) Set multiple hash fields to multiple values
hSet ( string $key, string $field, string $value ) : integer Set the string value of a hash field
hSetNX ( string $key, string $field, string $value ) : integer Set the value of a hash field, only if the field does not exist
hVals ( string $key ) : array Get all the values in a hash
sAdd ( string $key, string | array $member ) : boolean Add a member to a set
sCard ( string $key ) : integer Get the number of members in a set
sDiff ( string | array $key ) : array Returns the members of the set resulting from the difference between the first set and all the successive sets.
sDiffStore ( string $destination, string | array $key ) : integer This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.
sInter ( string | array $key ) : array Returns the members of the set resulting from the intersection of all the given sets.
sInterStore ( string $destination, string | array $key ) : integer Intersect multiple sets and store the resulting set in a key This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.
sIsMember ( string $key, string $member ) : boolean Returns if value is a member of the set.
sMembers ( string $key ) : array Returns all the members of the set.
sMove ( string $source, string $destination, string $member ) : integer Move member from the set at source to the set at destination.
sRem ( string $key, string $member ) : boolean Remove member from the set. If 'value' is not a member of this set, no operation is performed.
sUnion ( string | array $key ) : array Returns the members of the set resulting from the union of all the given sets.
sUnionStore ( $destination, string | array $key ) : integer Add multiple sets and store the resulting set in a key Parameters: $destination, $key [key .
zAdd ( string $key, integer | array $score, string $member = NULL ) : integer Add a member to a sorted set, or update its score if it already exists
zCard ( string $key ) : integer Get the number of members in a sorted set
zCount ( string $key, string | integer $min, string | integer $max ) : integer Returns the number of elements in the sorted set at key with a score between min and max.
zIncrBy ( string $key, number $increment, string $member ) : number Increment the score of a member in a sorted set
zInterStore ( string $destination, array $keys, array $weights = null, string | null $aggregate = null ) : integer Intersect multiple sorted sets and store the resulting sorted set in a new key
zRange ( string $key, integer $start, integer $stop, boolean $withscores = false ) : array
zRangeByScore ( string $key, string | number $min, string | number $max, boolean $withscores = false, array $limit = null ) : array Return a range of members in a sorted set, by score
zRank ( string $key, string $member ) : integer | boolean Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.
zRem ( string $key, string | array $member ) : integer Remove a member from a sorted set
zRemRangeByRank ( string $key, integer $start, integer $stop ) : integer Removes all elements in the sorted set stored at key with rank between start and stop.
zRemRangeByScore ( string $key, string | number $min, string | number $max ) : integer Remove all members in a sorted set within the given scores
zRevRange ( string $key, integer $start, integer $stop, boolean $withscores = false ) : array Returns the specified range of elements in the sorted set stored at key.
zRevRangeByScore ( string $key, number $max, number $min, boolean $withscores = false, array $limit = null ) : array Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).
zRevRank ( string $key, string $member ) : integer | boolean Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.
zScore ( string $key, string $member ) : string Get the score associated with the given member in a sorted set
zUnionStore ( string $destination, array $keys, array $weights = null, string | null $aggregate = null ) : integer Add multiple sorted sets and store the resulting sorted set in a new key

Method Details

Append() public méthode

Append a value to a key
public Append ( string $key, string $value ) : integer
$key string
$value string
Résultat integer

Auth() public méthode

Request for authentication in a password protected Redis server.
public Auth ( string $password ) : boolean
$password string
Résultat boolean

BITCOUNT() public méthode

By default all the bytes contained in the string are examined. It is possible to specify the counting operation only in an interval passing the additional arguments start and end.
public BITCOUNT ( $key, integer $start, integer $end ) : integer
$key
$start integer
$end integer
Résultat integer

BITOP() public méthode

The BITOP command supports four bitwise operations: AND, OR, XOR and NOT, thus the valid forms to call the command are: BITOP AND destkey srckey1 srckey2 srckey3 ... srckeyN BITOP OR destkey srckey1 srckey2 srckey3 ... srckeyN BITOP XOR destkey srckey1 srckey2 srckey3 ... srckeyN BITOP NOT destkey srckey As you can see NOT is special as it only takes an input key, because it performs inversion of bits so it only makes sense as an unary operator. The result of the operation is always stored at destkey.
public BITOP ( string $operation, string $destkey, string $key ) : integer
$operation string
$destkey string
$key string
Résultat integer

BLPop() public méthode

..,keyN,timeout or array(key1,key2,keyN), timeout
public BLPop ( string | array $key, integer $timeout )
$key string | array
$timeout integer - time of waiting

BRPop() public méthode

..,keyN,timeout or array(key1,key2,keyN), timeout
public BRPop ( string | array $key, integer $timeout )
$key string | array
$timeout integer - time of waiting

BRPopLPush() public méthode

Pop a value from a list, push it to another list and return it; or block until one is available
public BRPopLPush ( $source, $destination, $timeout ) : string | boolean
$source
$destination
$timeout
Résultat string | boolean

CLIENT_GETNAME() public méthode

Get the current connection name
public CLIENT_GETNAME ( )

CLIENT_KILL() public méthode

The ip:port should match a line returned by the CLIENT LIST command.
public CLIENT_KILL ( $ip, $port ) : boolean
$ip
$port
Résultat boolean

CLIENT_LIST() public méthode

Get the list of client connections
public CLIENT_LIST ( )

CLIENT_SETNAME() public méthode

Set the current connection name
public CLIENT_SETNAME ( string $connection_name ) : boolean
$connection_name string
Résultat boolean

Config_Get() public méthode

Get the value of a configuration parameter
public Config_Get ( string $parameter ) : string
$parameter string
Résultat string

Config_ResetStat() public méthode

These are the counters that are reset: Keyspace hits Keyspace misses Number of commands processed Number of connections received Number of expired keys
public Config_ResetStat ( )

Config_Set() public méthode

Set the value of a configuration parameter
public Config_Set ( $parameter, $value ) : boolean
$parameter
$value
Résultat boolean

DBsize() public méthode

Return the number of keys in the selected database
public DBsize ( ) : integer
Résultat integer

DEBUG_OBJECT() public méthode

Get debugging information about a key
public DEBUG_OBJECT ( string $key )
$key string

DEBUG_SEGFAULT() public méthode

Make the server crash
public DEBUG_SEGFAULT ( )

DUMP() public méthode

The returned value can be synthesized back into a Redis key using the RESTORE command.
public DUMP ( string $key ) : string
$key string
Résultat string

Decr() public méthode

Decrement the integer value of a key by one
public Decr ( string $key ) : integer
$key string
Résultat integer

DecrBy() public méthode

Decrement the integer value of a key by the given number
public DecrBy ( string $key, integer $decrement ) : integer
$key string
$decrement integer
Résultat integer

Del() public méthode

.. or: array($key1, $key2, ...)
public Del ( string $key ) : integer
$key string
Résultat integer

Discard() public méthode

If WATCH was used, DISCARD unwatches all keys.
public Discard ( )

ECHO_() public méthode

Echo the given string
public ECHO_ ( string $message )
$message string

EVALSHA() public méthode

Execute a Lua script server side
public EVALSHA ( $sha1, array $keys, array $args ) : mixed
$sha1
$keys array
$args array
Résultat mixed

EVAL_() public méthode

Execute a Lua script server side
public EVAL_ ( string $script, array $keys, array $args ) : mixed
$script string
$keys array
$args array
Résultat mixed

Exec() public méthode

When using WATCH, EXEC will execute commands only if the watched keys were not modified, allowing for a check-and-set mechanism.
public Exec ( )

Exists() public méthode

Determine if a key exists
public Exists ( string $key ) : integer
$key string
Résultat integer

Expire() public méthode

Set a key's time to live in seconds
public Expire ( string $key, integer $seconds ) : boolean
$key string
$seconds integer
Résultat boolean

Expireat() public méthode

Set the expiration for a key as a UNIX timestamp
public Expireat ( string $key, integer $timestamp ) : integer
$key string
$timestamp integer
Résultat integer

FlushAll() public méthode

Remove all keys from all databases
public FlushAll ( )

FlushDB() public méthode

Remove all keys from the current database
public FlushDB ( )

Get() public méthode

Get the value of a key
public Get ( string $key ) : string
$key string
Résultat string

GetBit() public méthode

Returns the bit value at offset in the string value stored at key
public GetBit ( string $key, integer $offset )
$key string
$offset integer

GetRange() public méthode

Get a substring of the string stored at a key
public GetRange ( string $key, integer $start, integer $end ) : string
$key string
$start integer
$end integer
Résultat string

GetSet() public méthode

Returns an error when key exists but does not hold a string value. Usage: From time to time we need to get the value of the counter and reset it to zero atomically. This can be done using GETSET mycounter "0".
public GetSet ( string $key, string $value ) : string
$key string
$value string
Résultat string

HINCRBYFLOAT() public méthode

If the field does not exist, it is set to 0 before performing the operation.
public HINCRBYFLOAT ( string $key, string $field, float $increment ) : float
$key string
$field string
$increment float
Résultat float the value of field after the increment

INCRBYFLOAT() public méthode

If the key does not exist, it is set to 0 before performing the operation.
public INCRBYFLOAT ( string $key, float $increment ) : float
$key string
$increment float
Résultat float the value of key after the increment

Incr() public méthode

Increment the integer value of a key by one
public Incr ( string $key ) : integer
$key string
Résultat integer

IncrBy() public méthode

Increment the integer value of a key by the given number
public IncrBy ( string $key, integer $increment ) : integer
$key string
$increment integer
Résultat integer

Info() public méthode

Get information and statistics about the server
public Info ( )

Keys() public méthode

Returns all keys matching pattern.
public Keys ( string $pattern ) : array
$pattern string Supported glob-style patterns: h?llo matches hello, hallo and hxllo h*llo matches hllo and heeeello h[ae]llo matches hello and hallo, but not hillo Use \ to escape special characters if you want to match them verbatim.
Résultat array

LASTSAVE() public méthode

Get the UNIX time stamp of the last successful save to disk Ping the server
public LASTSAVE ( )

LIndex() public méthode

The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth. When the value at key is not a list, an error is returned.
public LIndex ( string $key, integer $index ) : string | boolean
$key string
$index integer
Résultat string | boolean

LInsert() public méthode

Insert an element before or after another element in a list
public LInsert ( string $key, boolean $after = true, string $pivot, string $value ) : integer
$key string
$after boolean
$pivot string
$value string
Résultat integer

LLen() public méthode

Get the length of a list
public LLen ( string $key ) : integer
$key string
Résultat integer

LPop() public méthode

Remove and get the first element in a list
public LPop ( string $key ) : string | boolean
$key string
Résultat string | boolean

LPush() public méthode

If key does not exist, it is created as empty list before performing the push operation. When key holds a value that is not a list, an error is returned.
public LPush ( string $key, string | array $value ) : integer
$key string
$value string | array
Résultat integer

LPushX() public méthode

In contrary to LPush, no operation will be performed when key does not yet exist.
public LPushX ( string $key, string $value ) : integer
$key string
$value string
Résultat integer

LRange() public méthode

The offsets $start and $stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list. For example, -1 is the last element of the list, -2 the penultimate, and so on.
public LRange ( string $key, integer $start, integer $stop ) : array
$key string
$start integer
$stop integer
Résultat array

LRem() public méthode

The count argument influences the operation in the following ways: count > 0: Remove elements equal to value moving from head to tail. count < 0: Remove elements equal to value moving from tail to head. count = 0: Remove all elements equal to value. For example, LREM list -2 "hello" will remove the last two occurrences of "hello" in the list stored at list.
public LRem ( string $key, integer $count, string $value ) : integer
$key string
$count integer
$value string
Résultat integer

LSet() public méthode

For more information on the index argument, see LINDEX. An error is returned for out of range indexes.
public LSet ( $key, $index, $value ) : boolean
$key
$index
$value
Résultat boolean

LTrim() public méthode

Trim a list to the specified range
public LTrim ( string $key, integer $start, integer $stop ) : boolean
$key string
$start integer
$stop integer
Résultat boolean

MGet() public méthode

For every key that does not hold a string value or does not exist, the special value nil is returned. Parameters: $key, [key ...] or: array($key1, $key2...)
public MGet ( string $key ) : array
$key string
Résultat array

MIGRATE() public méthode

On success the key is deleted from the original instance and is guaranteed to exist in the target instance. The command is atomic and blocks the two instances for the time required to transfer the key, at any given time the key will appear to exist in a given instance or in the other instance, unless a timeout error occurs.
public MIGRATE ( string $host, string $port, string $key, integer $destination_db, integer $timeout ) : boolean
$host string
$port string
$key string
$destination_db integer
$timeout integer
Résultat boolean

MONITOR() public méthode

Listen for all requests received by the server in real time
public MONITOR ( )

MSet() public méthode

Set multiple keys to multiple values
public MSet ( array $keys ) : string
$keys array (key => value)
Résultat string

MSetNX() public méthode

Set multiple keys to multiple values, only if none of the keys exist
public MSetNX ( array $keys ) : integer
$keys array (key => value) Returns: 1 if the all the keys were set. 0 if no key was set (at least one key already existed).
Résultat integer

Move() public méthode

When key already exists in the destination database, or it does not exist in the source database, it does nothing. It is possible to use MOVE as a locking primitive because of this.
public Move ( string $key, integer $db ) : integer
$key string
$db integer
Résultat integer

Multi() public méthode

Mark the start of a transaction block
public Multi ( )

OBJECT() public méthode

Inspect the internals of Redis objects
public OBJECT ( string $subcommand, array $arguments = [] )
$subcommand string
$arguments array

PEXPIRE() public méthode

Set a key's time to live in milliseconds
public PEXPIRE ( string $key, integer $milliseconds ) : integer
$key string
$milliseconds integer
Résultat integer 1 if the timeout was set, 0 if key does not exist or the timeout could not be set.

PEXPIREAT() public méthode

Set the expiration for a key as a UNIX timestamp specified in milliseconds
public PEXPIREAT ( string $key, integer $milliseconds_timestamp ) : integer
$key string
$milliseconds_timestamp integer the Unix time at which the key will expire
Résultat integer 1 if the timeout was set, 0 if key does not exist or the timeout could not be set.

PING() public méthode

Ping the server
public PING ( )

PSETEX() public méthode

Set the value and expiration in milliseconds of a key
public PSETEX ( string $key, integer $milliseconds, string $value ) : boolean
$key string
$milliseconds integer
$value string
Résultat boolean

PSubscribe() public méthode

Subscribes the client to the given patterns.
public PSubscribe ( string $pattern )
$pattern string

PTTL() public méthode

Get the time to live for a key in milliseconds
public PTTL ( string $key ) : integer
$key string
Résultat integer Time to live in milliseconds or -1 when key does not exist or does not have a timeout.

PUnsubscribe() public méthode

Stop listening for messages posted to channels matching the given patterns
public PUnsubscribe ( array | string | null $pattern = null ) : integer
$pattern array | string | null
Résultat integer

Persist() public méthode

Remove the expiration from a key
public Persist ( string $key ) : integer
$key string
Résultat integer

Publish() public méthode

Post a message to a channel Returns the number of clients that received the message.
public Publish ( string $channel, string $message ) : integer
$channel string
$message string
Résultat integer

Quit() public méthode

Close the connection
public Quit ( )

RANDOMKEY() public méthode

Return a random key from the keyspace
public RANDOMKEY ( )

RESTORE() public méthode

Create a key using the provided serialized value, previously obtained using DUMP.
public RESTORE ( string $key, integer $ttl, string $serialized_value ) : boolean
$key string
$ttl integer If ttl is 0 the key is created without any expire, otherwise the specified expire time (in milliseconds) is set.
$serialized_value string
Résultat boolean

RPop() public méthode

Removes and returns the last element of the list stored at key.
public RPop ( string $key ) : string | boolean
$key string
Résultat string | boolean

RPopLPush() public méthode

If source does not exist, the value nil is returned and no operation is performed.
public RPopLPush ( string $source, string $destination ) : string
$source string
$destination string
Résultat string

RPush() public méthode

If key does not exist, it is created as empty list before performing the push operation. When key holds a value that is not a list, an error is returned. Parameters: key value [value ...] or: key, array(value,value,...)
public RPush ( string $key, string | array $value ) : integer | boolean
$key string
$value string | array
Résultat integer | boolean

RPushX() public méthode

Append a value to a list, only if the list exists
public RPushX ( string $key, string $value ) : integer
$key string
$value string
Résultat integer

Rename() public méthode

It returns an error when the source and destination names are the same, or when key does not exist. If newkey already exists it is overwritten.
public Rename ( string $key, string $newkey ) : boolean
$key string
$newkey string
Résultat boolean

RenameNX() public méthode

Rename a key, only if the new key does not exist
public RenameNX ( string $key, string $newkey ) : integer
$key string
$newkey string
Résultat integer

SAVE() public méthode

Synchronously save the dataset to disk
public SAVE ( )

SCRIPT_EXISTS() public méthode

Check existence of scripts in the script cache.
public SCRIPT_EXISTS ( string $script ) : array
$script string
Résultat array

SCRIPT_FLUSH() public méthode

Remove all the scripts from the script cache.
public SCRIPT_FLUSH ( )

SCRIPT_KILL() public méthode

Kills the currently executing Lua script, assuming no write operation was yet performed by the script.
public SCRIPT_KILL ( )

SCRIPT_LOAD() public méthode

After the specified command is loaded into the script cache it will be callable using EVALSHA with the correct SHA1 digest of the script, exactly like after the first successful invocation of EVAL.
public SCRIPT_LOAD ( string $script ) : string
$script string
Résultat string This command returns the SHA1 digest of the script added into the script cache.

SHUTDOWN() public méthode

Synchronously save the dataset to disk and then shut down the server One of modifiers can be turned on:
public SHUTDOWN ( boolean $save = false, boolean $nosave = false )
$save boolean will force a DB saving operation even if no save points are configured.
$nosave boolean will prevent a DB saving operation even if one or more save points are configured.

SLOWLOG() public méthode

Manages the Redis slow queries log
public SLOWLOG ( string $subcommand, string $argument = '' )
$subcommand string
$argument string

SPOP() public méthode

Remove and return a random member from a set
public SPOP ( string $key )
$key string

SRANDMEMBER() public méthode

Get a random member from a set
public SRANDMEMBER ( string $key, integer $count = 1 )
$key string
$count integer

SYNC() public méthode

Internal command used for replication
public SYNC ( )

Select() public méthode

Select the DB with having the specified zero-based numeric index. New connections always use DB 0.
public Select ( integer $index )
$index integer

Set() public méthode

Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type.
public Set ( string $key, string $value ) : string
$key string
$value string
Résultat string

SetBit() public méthode

Sets or clears the bit at offset in the string value stored at key
public SetBit ( string $key, integer $offset, integer $value ) : integer
$key string
$offset integer
$value integer Returns the original bit value stored at offset.
Résultat integer

SetEX() public méthode

Set the value and expiration of a key
public SetEX ( string $key, integer $seconds, string $value ) : boolean
$key string
$seconds integer
$value string
Résultat boolean

SetNX() public méthode

Set the value of a key, only if the key does not exist
public SetNX ( string $key, string $value ) : boolean
$key string
$value string
Résultat boolean

SetRange() public méthode

If the offset is larger than the current length of the string at key, the string is padded with zero-bytes to make offset fit. Non-existing keys are considered as empty strings, so this command will make sure it holds a string large enough to be able to set value at offset. Thanks to SETRANGE and the analogous GETRANGE commands, you can use Redis strings as a linear array with O(1) random access. This is a very fast and efficient storage in many real world use cases.
public SetRange ( string $key, integer $offset, string $value ) : integer
$key string
$offset integer
$value string Returns the length of the string after it was modified by the command.
Résultat integer

SlaveOf() public méthode

Make the server a slave of another instance, or promote it as master
public SlaveOf ( string $host, integer $port ) : string
$host string
$port integer
Résultat string

Sort() public méthode

Sort the elements in a list, set or sorted set
public Sort ( string $key, string $sort_rule ) : array
$key string
$sort_rule string [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination] Returns list of sorted elements.
Résultat array

StrLen() public méthode

Get the length of the value stored in a key
public StrLen ( string $key ) : integer
$key string
Résultat integer

Subscribe() public méthode

Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE and PUNSUBSCRIBE commands.
public Subscribe ( $channel )
$channel Parameters: $channel [channel ...]

TIME() public méthode

Returns the current server time as a two items lists: a Unix timestamp and the amount of microseconds already elapsed in the current second
public TIME ( ) : array
Résultat array

TTL() public méthode

Get the time to live for a key
public TTL ( string $key ) : integer
$key string
Résultat integer

Type() public méthode

The different types that can be returned are: string, list, set, zset and hash.
public Type ( string $key ) : string
$key string Returns type of key, or 'none' when key does not exist.
Résultat string

Unsubscribe() public méthode

Parameters: [channel [channel ...]]
public Unsubscribe ( string $channel = '' )
$channel string

Unwatch() public méthode

Forget about all watched keys
public Unwatch ( )

Watch() public méthode

..)
public Watch ( string $key )
$key string

bgRewriteAOF() public méthode

Rewrites the append-only file to reflect the current dataset in memory.
public bgRewriteAOF ( )

bgSave() public méthode

Asynchronously save the dataset to disk
public bgSave ( )

hDel() public méthode

Non-existing fields are ignored. Non-existing keys are treated as empty hashes and this command returns 0. Parameters: ($key, $field1, $field2...) or: ($key, array($field1,$field2...))
public hDel ( string $key, array | string $field ) : integer
$key string
$field array | string
Résultat integer

hExists() public méthode

Determine if a hash field exists
public hExists ( string $key, string $field ) : integer
$key string
$field string
Résultat integer

hGet() public méthode

Get the value of a hash field
public hGet ( string $key, string $field ) : string | integer
$key string
$field string
Résultat string | integer

hGetAll() public méthode

Get all the fields and values in a hash
public hGetAll ( string $key ) : array
$key string
Résultat array

hIncrBy() public méthode

If key does not exist, a new key holding a hash is created. If field does not exist or holds a string that cannot be interpreted as integer, the value is set to 0 before the operation is performed. Returns the value at field after the increment operation.
public hIncrBy ( string $key, string $field, integer $increment ) : integer
$key string
$field string
$increment integer
Résultat integer

hKeys() public méthode

Get all the fields in a hash
public hKeys ( string $key ) : array
$key string name of hash
Résultat array

hLen() public méthode

Get the number of fields in a hash
public hLen ( string $key ) : integer
$key string
Résultat integer

hMGet() public méthode

For every field that does not exist in the hash, a nil value is returned.
public hMGet ( string $key, array $fields ) : array
$key string
$fields array
Résultat array

hMSet() public méthode

Set multiple hash fields to multiple values
public hMSet ( string $key, array $fields )
$key string
$fields array (field => value)

hSet() public méthode

Set the string value of a hash field
public hSet ( string $key, string $field, string $value ) : integer
$key string hash
$field string
$value string
Résultat integer

hSetNX() public méthode

Set the value of a hash field, only if the field does not exist
public hSetNX ( string $key, string $field, string $value ) : integer
$key string
$field string
$value string
Résultat integer

hVals() public méthode

Get all the values in a hash
public hVals ( string $key ) : array
$key string
Résultat array

sAdd() public méthode

Add a member to a set
public sAdd ( string $key, string | array $member ) : boolean
$key string
$member string | array or multiple arguments
Résultat boolean

sCard() public méthode

Get the number of members in a set
public sCard ( string $key ) : integer
$key string
Résultat integer

sDiff() public méthode

For example: key1 = {a,b,c,d} key2 = {c} key3 = {a,c,e} SDIFF key1 key2 key3 = {b,d} Keys that do not exist are considered to be empty sets. Parameters: key1, key2, key3...
public sDiff ( string | array $key ) : array
$key string | array
Résultat array

sDiffStore() public méthode

If destination already exists, it is overwritten. Returns the number of elements in the resulting set. Parameters: destination, key [key, ...] or: destination, array(key,key, ...)
public sDiffStore ( string $destination, string | array $key ) : integer
$destination string
$key string | array
Résultat integer

sInter() public méthode

For example: key1 = {a,b,c,d} key2 = {c} key3 = {a,c,e} SINTER key1 key2 key3 = {c} Parameters: key [key ...] or: array(key, key, ...)
public sInter ( string | array $key ) : array
$key string | array
Résultat array

sInterStore() public méthode

If destination already exists, it is overwritten. Parameters: $destination,$key [key ...] or: $destination, array($key, $key...)
public sInterStore ( string $destination, string | array $key ) : integer
$destination string
$key string | array Returns the number of elements in the resulting set.
Résultat integer

sIsMember() public méthode

Returns if value is a member of the set.
public sIsMember ( string $key, string $member ) : boolean
$key string
$member string
Résultat boolean

sMembers() public méthode

Returns all the members of the set.
public sMembers ( string $key ) : array
$key string
Résultat array

sMove() public méthode

This operation is atomic. In every given moment the element will appear to be a member of source or destination for other clients. If the source set does not exist or does not contain the specified element, no operation is performed and 0 is returned. Otherwise, the element is removed from the source set and added to the destination set. When the specified element already exists in the destination set, it is only removed from the source set.
public sMove ( string $source, string $destination, string $member ) : integer
$source string
$destination string
$member string
Résultat integer

sRem() public méthode

An error is returned when the value stored at key is not a set.
public sRem ( string $key, string $member ) : boolean
$key string
$member string
Résultat boolean

sUnion() public méthode

For example: key1 = {a,b,c,d} key2 = {c} key3 = {a,c,e} SUNION key1 key2 key3 = {a,b,c,d,e} Parameters: key [key...]
public sUnion ( string | array $key ) : array
$key string | array
Résultat array

sUnionStore() public méthode

..]
public sUnionStore ( $destination, string | array $key ) : integer
$destination
$key string | array Returns the number of elements in the resulting set.
Résultat integer

zAdd() public méthode

Add a member to a sorted set, or update its score if it already exists
public zAdd ( string $key, integer | array $score, string $member = NULL ) : integer
$key string
$score integer | array
$member string Can be used as: zadd(key, score, member) zadd(key, score1, member1, score2, member2) zadd(key, array(score1 => member1, score2 => member2))
Résultat integer

zCard() public méthode

Get the number of members in a sorted set
public zCard ( string $key ) : integer
$key string
Résultat integer

zCount() public méthode

The min and max arguments have the same semantic as described for ZRANGEBYSCORE.
public zCount ( string $key, string | integer $min, string | integer $max ) : integer
$key string
$min string | integer
$max string | integer
Résultat integer

zIncrBy() public méthode

Increment the score of a member in a sorted set
public zIncrBy ( string $key, number $increment, string $member ) : number
$key string
$increment number
$member string
Résultat number

zInterStore() public méthode

Intersect multiple sorted sets and store the resulting sorted set in a new key
public zInterStore ( string $destination, array $keys, array $weights = null, string | null $aggregate = null ) : integer
$destination string
$keys array
$weights array
$aggregate string | null see Aggregate* constants Returns the number of elements in the resulting sorted set at destination.
Résultat integer

zRange() public méthode

public zRange ( string $key, integer $start, integer $stop, boolean $withscores = false ) : array
$key string
$start integer
$stop integer
$withscores boolean
Résultat array

zRangeByScore() public méthode

Return a range of members in a sorted set, by score
public zRangeByScore ( string $key, string | number $min, string | number $max, boolean $withscores = false, array $limit = null ) : array
$key string
$min string | number
$max string | number
$withscores boolean
$limit array
Résultat array

zRank() public méthode

The rank (or index) is 0-based, which means that the member with the lowest score has rank 0. Use ZREVRANK to get the rank of an element with the scores ordered from high to low.
public zRank ( string $key, string $member ) : integer | boolean
$key string
$member string
Résultat integer | boolean

zRem() public méthode

Remove a member from a sorted set
public zRem ( string $key, string | array $member ) : integer
$key string
$member string | array
Résultat integer

zRemRangeByRank() public méthode

Both start and stop are 0-based indexes with 0 being the element with the lowest score. These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score. For example: -1 is the element with the highest score, -2 the element with the second highest score and so forth.
public zRemRangeByRank ( string $key, integer $start, integer $stop ) : integer
$key string
$start integer
$stop integer Returns the number of elements removed.
Résultat integer

zRemRangeByScore() public méthode

Remove all members in a sorted set within the given scores
public zRemRangeByScore ( string $key, string | number $min, string | number $max ) : integer
$key string
$min string | number
$max string | number
Résultat integer

zRevRange() public méthode

The elements are considered to be ordered from the highest to the lowest score. Descending lexicographical order is used for elements with equal score.
public zRevRange ( string $key, integer $start, integer $stop, boolean $withscores = false ) : array
$key string
$start integer
$stop integer
$withscores boolean
Résultat array

zRevRangeByScore() public méthode

In contrary to the default ordering of sorted sets, for this command the elements are considered to be ordered from high to low scores. The elements having the same score are returned in reverse lexicographical order.
public zRevRangeByScore ( string $key, number $max, number $min, boolean $withscores = false, array $limit = null ) : array
$key string
$max number
$min number
$withscores boolean
$limit array (offset, count)
Résultat array

zRevRank() public méthode

The rank (or index) is 0-based, which means that the member with the highest score has rank 0. Use ZRANK to get the rank of an element with the scores ordered from low to high.
public zRevRank ( string $key, string $member ) : integer | boolean
$key string
$member string
Résultat integer | boolean

zScore() public méthode

Get the score associated with the given member in a sorted set
public zScore ( string $key, string $member ) : string
$key string
$member string
Résultat string

zUnionStore() public méthode

Add multiple sorted sets and store the resulting sorted set in a new key
public zUnionStore ( string $destination, array $keys, array $weights = null, string | null $aggregate = null ) : integer
$destination string
$keys array
$weights array
$aggregate string | null see Aggregate* constants
Résultat integer