PHP 인터페이스 Jamm\Memory\IRedisServer

파일 보기 프로젝트 열기: jamm/memory

공개 메소드들

메소드 설명
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