PHP Интерфейс Jamm\Memory\IRedisServer

Показать файл Открыть проект

Открытые методы

Метод Описание
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

Описание методов

Append() публичный Метод

Append a value to a key
public Append ( string $key, string $value ) : integer
$key string
$value string
Результат integer

Auth() публичный Метод

Request for authentication in a password protected Redis server.
public Auth ( string $password ) : boolean
$password string
Результат boolean

BITCOUNT() публичный Метод

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
Результат integer

BITOP() публичный Метод

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
Результат integer

BLPop() публичный Метод

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

BRPop() публичный Метод

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

BRPopLPush() публичный Метод

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
Результат string | boolean

CLIENT_GETNAME() публичный Метод

Get the current connection name
public CLIENT_GETNAME ( )

CLIENT_KILL() публичный Метод

The ip:port should match a line returned by the CLIENT LIST command.
public CLIENT_KILL ( $ip, $port ) : boolean
$ip
$port
Результат boolean

CLIENT_LIST() публичный Метод

Get the list of client connections
public CLIENT_LIST ( )

CLIENT_SETNAME() публичный Метод

Set the current connection name
public CLIENT_SETNAME ( string $connection_name ) : boolean
$connection_name string
Результат boolean

Config_Get() публичный Метод

Get the value of a configuration parameter
public Config_Get ( string $parameter ) : string
$parameter string
Результат string

Config_ResetStat() публичный Метод

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() публичный Метод

Set the value of a configuration parameter
public Config_Set ( $parameter, $value ) : boolean
$parameter
$value
Результат boolean

DBsize() публичный Метод

Return the number of keys in the selected database
public DBsize ( ) : integer
Результат integer

DEBUG_OBJECT() публичный Метод

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

DEBUG_SEGFAULT() публичный Метод

Make the server crash
public DEBUG_SEGFAULT ( )

DUMP() публичный Метод

The returned value can be synthesized back into a Redis key using the RESTORE command.
public DUMP ( string $key ) : string
$key string
Результат string

Decr() публичный Метод

Decrement the integer value of a key by one
public Decr ( string $key ) : integer
$key string
Результат integer

DecrBy() публичный Метод

Decrement the integer value of a key by the given number
public DecrBy ( string $key, integer $decrement ) : integer
$key string
$decrement integer
Результат integer

Del() публичный Метод

.. or: array($key1, $key2, ...)
public Del ( string $key ) : integer
$key string
Результат integer

Discard() публичный Метод

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

ECHO_() публичный Метод

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

EVALSHA() публичный Метод

Execute a Lua script server side
public EVALSHA ( $sha1, array $keys, array $args ) : mixed
$sha1
$keys array
$args array
Результат mixed

EVAL_() публичный Метод

Execute a Lua script server side
public EVAL_ ( string $script, array $keys, array $args ) : mixed
$script string
$keys array
$args array
Результат mixed

Exec() публичный Метод

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() публичный Метод

Determine if a key exists
public Exists ( string $key ) : integer
$key string
Результат integer

Expire() публичный Метод

Set a key's time to live in seconds
public Expire ( string $key, integer $seconds ) : boolean
$key string
$seconds integer
Результат boolean

Expireat() публичный Метод

Set the expiration for a key as a UNIX timestamp
public Expireat ( string $key, integer $timestamp ) : integer
$key string
$timestamp integer
Результат integer

FlushAll() публичный Метод

Remove all keys from all databases
public FlushAll ( )

FlushDB() публичный Метод

Remove all keys from the current database
public FlushDB ( )

Get() публичный Метод

Get the value of a key
public Get ( string $key ) : string
$key string
Результат string

GetBit() публичный Метод

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

GetRange() публичный Метод

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
Результат string

GetSet() публичный Метод

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
Результат string

HINCRBYFLOAT() публичный Метод

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
Результат float the value of field after the increment

INCRBYFLOAT() публичный Метод

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
Результат float the value of key after the increment

Incr() публичный Метод

Increment the integer value of a key by one
public Incr ( string $key ) : integer
$key string
Результат integer

IncrBy() публичный Метод

Increment the integer value of a key by the given number
public IncrBy ( string $key, integer $increment ) : integer
$key string
$increment integer
Результат integer

Info() публичный Метод

Get information and statistics about the server
public Info ( )

Keys() публичный Метод

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.
Результат array

LASTSAVE() публичный Метод

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

LIndex() публичный Метод

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
Результат string | boolean

LInsert() публичный Метод

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
Результат integer

LLen() публичный Метод

Get the length of a list
public LLen ( string $key ) : integer
$key string
Результат integer

LPop() публичный Метод

Remove and get the first element in a list
public LPop ( string $key ) : string | boolean
$key string
Результат string | boolean

LPush() публичный Метод

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
Результат integer

LPushX() публичный Метод

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
Результат integer

LRange() публичный Метод

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
Результат array

LRem() публичный Метод

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
Результат integer

LSet() публичный Метод

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
Результат boolean

LTrim() публичный Метод

Trim a list to the specified range
public LTrim ( string $key, integer $start, integer $stop ) : boolean
$key string
$start integer
$stop integer
Результат boolean

MGet() публичный Метод

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
Результат array

MIGRATE() публичный Метод

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
Результат boolean

MONITOR() публичный Метод

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

MSet() публичный Метод

Set multiple keys to multiple values
public MSet ( array $keys ) : string
$keys array (key => value)
Результат string

MSetNX() публичный Метод

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).
Результат integer

Move() публичный Метод

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
Результат integer

Multi() публичный Метод

Mark the start of a transaction block
public Multi ( )

OBJECT() публичный Метод

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

PEXPIRE() публичный Метод

Set a key's time to live in milliseconds
public PEXPIRE ( string $key, integer $milliseconds ) : integer
$key string
$milliseconds integer
Результат integer 1 if the timeout was set, 0 if key does not exist or the timeout could not be set.

PEXPIREAT() публичный Метод

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
Результат integer 1 if the timeout was set, 0 if key does not exist or the timeout could not be set.

PING() публичный Метод

Ping the server
public PING ( )

PSETEX() публичный Метод

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
Результат boolean

PSubscribe() публичный Метод

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

PTTL() публичный Метод

Get the time to live for a key in milliseconds
public PTTL ( string $key ) : integer
$key string
Результат integer Time to live in milliseconds or -1 when key does not exist or does not have a timeout.

PUnsubscribe() публичный Метод

Stop listening for messages posted to channels matching the given patterns
public PUnsubscribe ( array | string | null $pattern = null ) : integer
$pattern array | string | null
Результат integer

Persist() публичный Метод

Remove the expiration from a key
public Persist ( string $key ) : integer
$key string
Результат integer

Publish() публичный Метод

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
Результат integer

Quit() публичный Метод

Close the connection
public Quit ( )

RANDOMKEY() публичный Метод

Return a random key from the keyspace
public RANDOMKEY ( )

RESTORE() публичный Метод

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
Результат boolean

RPop() публичный Метод

Removes and returns the last element of the list stored at key.
public RPop ( string $key ) : string | boolean
$key string
Результат string | boolean

RPopLPush() публичный Метод

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
Результат string

RPush() публичный Метод

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
Результат integer | boolean

RPushX() публичный Метод

Append a value to a list, only if the list exists
public RPushX ( string $key, string $value ) : integer
$key string
$value string
Результат integer

Rename() публичный Метод

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
Результат boolean

RenameNX() публичный Метод

Rename a key, only if the new key does not exist
public RenameNX ( string $key, string $newkey ) : integer
$key string
$newkey string
Результат integer

SAVE() публичный Метод

Synchronously save the dataset to disk
public SAVE ( )

SCRIPT_EXISTS() публичный Метод

Check existence of scripts in the script cache.
public SCRIPT_EXISTS ( string $script ) : array
$script string
Результат array

SCRIPT_FLUSH() публичный Метод

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

SCRIPT_KILL() публичный Метод

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

SCRIPT_LOAD() публичный Метод

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
Результат string This command returns the SHA1 digest of the script added into the script cache.

SHUTDOWN() публичный Метод

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() публичный Метод

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

SPOP() публичный Метод

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

SRANDMEMBER() публичный Метод

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

SYNC() публичный Метод

Internal command used for replication
public SYNC ( )

Select() публичный Метод

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

Set() публичный Метод

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
Результат string

SetBit() публичный Метод

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.
Результат integer

SetEX() публичный Метод

Set the value and expiration of a key
public SetEX ( string $key, integer $seconds, string $value ) : boolean
$key string
$seconds integer
$value string
Результат boolean

SetNX() публичный Метод

Set the value of a key, only if the key does not exist
public SetNX ( string $key, string $value ) : boolean
$key string
$value string
Результат boolean

SetRange() публичный Метод

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.
Результат integer

SlaveOf() публичный Метод

Make the server a slave of another instance, or promote it as master
public SlaveOf ( string $host, integer $port ) : string
$host string
$port integer
Результат string

Sort() публичный Метод

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.
Результат array

StrLen() публичный Метод

Get the length of the value stored in a key
public StrLen ( string $key ) : integer
$key string
Результат integer

Subscribe() публичный Метод

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() публичный Метод

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
Результат array

TTL() публичный Метод

Get the time to live for a key
public TTL ( string $key ) : integer
$key string
Результат integer

Type() публичный Метод

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.
Результат string

Unsubscribe() публичный Метод

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

Unwatch() публичный Метод

Forget about all watched keys
public Unwatch ( )

Watch() публичный Метод

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

bgRewriteAOF() публичный Метод

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

bgSave() публичный Метод

Asynchronously save the dataset to disk
public bgSave ( )

hDel() публичный Метод

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
Результат integer

hExists() публичный Метод

Determine if a hash field exists
public hExists ( string $key, string $field ) : integer
$key string
$field string
Результат integer

hGet() публичный Метод

Get the value of a hash field
public hGet ( string $key, string $field ) : string | integer
$key string
$field string
Результат string | integer

hGetAll() публичный Метод

Get all the fields and values in a hash
public hGetAll ( string $key ) : array
$key string
Результат array

hIncrBy() публичный Метод

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
Результат integer

hKeys() публичный Метод

Get all the fields in a hash
public hKeys ( string $key ) : array
$key string name of hash
Результат array

hLen() публичный Метод

Get the number of fields in a hash
public hLen ( string $key ) : integer
$key string
Результат integer

hMGet() публичный Метод

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
Результат array

hMSet() публичный Метод

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

hSet() публичный Метод

Set the string value of a hash field
public hSet ( string $key, string $field, string $value ) : integer
$key string hash
$field string
$value string
Результат integer

hSetNX() публичный Метод

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
Результат integer

hVals() публичный Метод

Get all the values in a hash
public hVals ( string $key ) : array
$key string
Результат array

sAdd() публичный Метод

Add a member to a set
public sAdd ( string $key, string | array $member ) : boolean
$key string
$member string | array or multiple arguments
Результат boolean

sCard() публичный Метод

Get the number of members in a set
public sCard ( string $key ) : integer
$key string
Результат integer

sDiff() публичный Метод

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
Результат array

sDiffStore() публичный Метод

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
Результат integer

sInter() публичный Метод

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
Результат array

sInterStore() публичный Метод

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.
Результат integer

sIsMember() публичный Метод

Returns if value is a member of the set.
public sIsMember ( string $key, string $member ) : boolean
$key string
$member string
Результат boolean

sMembers() публичный Метод

Returns all the members of the set.
public sMembers ( string $key ) : array
$key string
Результат array

sMove() публичный Метод

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
Результат integer

sRem() публичный Метод

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
Результат boolean

sUnion() публичный Метод

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
Результат array

sUnionStore() публичный Метод

..]
public sUnionStore ( $destination, string | array $key ) : integer
$destination
$key string | array Returns the number of elements in the resulting set.
Результат integer

zAdd() публичный Метод

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))
Результат integer

zCard() публичный Метод

Get the number of members in a sorted set
public zCard ( string $key ) : integer
$key string
Результат integer

zCount() публичный Метод

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
Результат integer

zIncrBy() публичный Метод

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
Результат number

zInterStore() публичный Метод

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.
Результат integer

zRange() публичный Метод

public zRange ( string $key, integer $start, integer $stop, boolean $withscores = false ) : array
$key string
$start integer
$stop integer
$withscores boolean
Результат array

zRangeByScore() публичный Метод

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
Результат array

zRank() публичный Метод

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
Результат integer | boolean

zRem() публичный Метод

Remove a member from a sorted set
public zRem ( string $key, string | array $member ) : integer
$key string
$member string | array
Результат integer

zRemRangeByRank() публичный Метод

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.
Результат integer

zRemRangeByScore() публичный Метод

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
Результат integer

zRevRange() публичный Метод

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
Результат array

zRevRangeByScore() публичный Метод

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)
Результат array

zRevRank() публичный Метод

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
Результат integer | boolean

zScore() публичный Метод

Get the score associated with the given member in a sorted set
public zScore ( string $key, string $member ) : string
$key string
$member string
Результат string

zUnionStore() публичный Метод

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
Результат integer