PHP Class Jamm\Memory\RedisServer

Inheritance: implements Jamm\Memory\IRedisServer
Afficher le fichier Open project: jamm/memory

Protected Properties

Свойство Type Description
$connection

Méthodes publiques

Méthode Description
Append ( $key, $value )
Auth ( $password )
BITCOUNT ( string $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 ( $key, $timeout )
BRPop ( $key, $timeout )
BRPopLPush ( $source, $destination, $timeout )
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 ( $parameter )
Config_ResetStat ( )
Config_Set ( $parameter, $value )
DBsize ( )
DEBUG_OBJECT ( string $key ) : mixed 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 ( $key )
DecrBy ( $key, $decrement )
Del ( $key )
Discard ( )
ECHO_ ( string $message ) : string 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 ( )
Exists ( $key )
Expire ( $key, $seconds )
Expireat ( $key, $timestamp )
FlushAll ( )
FlushDB ( )
Get ( $key )
GetBit ( $key, $offset )
GetRange ( $key, $start, $end )
GetSet ( $key, $value )
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 ( $key )
IncrBy ( $key, $increment )
Info ( )
Keys ( $pattern )
LASTSAVE ( ) Get the UNIX time stamp of the last successful save to disk Ping the server
LIndex ( $key, $index )
LInsert ( $key, $after = true, $pivot, $value )
LLen ( $key )
LPop ( $key )
LPush ( $key, $value )
LPushX ( $key, $value )
LRange ( $key, $start, $stop )
LRem ( $key, $count, $value )
LSet ( $key, $index, $value )
LTrim ( $key, $start, $stop )
MGet ( $key )
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 )
MSetNX ( array $keys )
Move ( $key, $db )
Multi ( )
OBJECT ( string $subcommand, array $arguments = [] ) : mixed 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 ( $pattern )
PTTL ( string $key ) : integer Get the time to live for a key in milliseconds
PUnsubscribe ( $pattern = null )
Persist ( $key )
Publish ( $channel, $message )
Quit ( )
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 ( $key )
RPopLPush ( $source, $destination )
RPush ( $key, $value )
RPushX ( $key, $value )
Rename ( $key, $newkey )
RenameNX ( $key, $newkey )
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 ) : boolean Synchronously save the dataset to disk and then shut down the server One of modifiers can be turned on:
SLOWLOG ( string $subcommand, string $argument = '' ) : mixed Manages the Redis slow queries log
SPOP ( string $key ) : string Remove and return a random member from a set
SRANDMEMBER ( string $key, integer $count = 1 ) : string Get a random member from a set
SYNC ( ) Internal command used for replication
Select ( $index )
Set ( $key, $value )
SetBit ( $key, $offset, $value )
SetEx ( $key, $seconds, $value )
SetNX ( $key, $value )
SetRange ( $key, $offset, $value )
SlaveOf ( $host, $port )
Sort ( $key, $sort_rule )
StrLen ( $key )
Subscribe ( $channel )
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 ( $key )
Type ( $key )
Unsubscribe ( $channel = '' )
Unwatch ( )
Watch ( $key )
__call ( $name, $args ) * If some command is not wrapped.
__construct ( $host = 'localhost', $port = '6379' )
__destruct ( ) Close connection
bgRewriteAOF ( )
bgSave ( )
connect ( $host, $port )
hDel ( $key, $field )
hExists ( $key, $field )
hGet ( $key, $field )
hGetAll ( $key )
hIncrBy ( $key, $field, $increment )
hKeys ( $key )
hLen ( $key )
hMGet ( $key, array $fields )
hMSet ( $key, $fields )
hSet ( $key, $field, $value )
hSetNX ( $key, $field, $value )
hVals ( $key )
sAdd ( $key, $member )
sCard ( $key )
sDiff ( $key )
sDiffStore ( $destination, $key )
sInter ( $key )
sInterStore ( $destination, $key )
sIsMember ( $key, $member )
sMembers ( $key )
sMove ( $source, $destination, $member )
sRem ( $key, $member )
sUnion ( $key )
sUnionStore ( $destination, $key )
send_command ( ) : array | boolean | integer | null | string Execute send_command and return the result Each entity of the send_command should be passed as argument Example: send_command('set','key','example value'); or: send_command('multi'); send_command('config','ResetStat'); // if command contain 2 words, they should be separated send_command('set','a', serialize($arr)); send_command('set','b', 1); send_command('execute');
zAdd ( $key, $score, $member = NULL )
zCard ( $key )
zCount ( $key, $min, $max )
zIncrBy ( $key, $increment, $member )
zInterStore ( $destination, array $keys, array $weights = null, $aggregate = null )
zRange ( $key, $start, $stop, $withscores = false )
zRangeByScore ( $key, $min, $max, $withscores = false, array $limit = null )
zRank ( $key, $member )
zRem ( $key, $member )
zRemRangeByRank ( $key, $start, $stop )
zRemRangeByScore ( $key, $min, $max )
zRevRange ( $key, $start, $stop, $withscores = false )
zRevRangeByScore ( $key, $max, $min, $withscores = false, array $limit = null )
zRevRank ( $key, $member )
zScore ( $key, $member )
zUnionStore ( $destination, array $keys, array $weights = null, $aggregate = null )

Méthodes protégées

Méthode Description
_read_reply ( )
_send ( $args )
reportError ( $msg )

Method Details

Append() public méthode

public Append ( $key, $value )

Auth() public méthode

public Auth ( $password )

BITCOUNT() public méthode

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

BITOP() public méthode

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

BLPop() public méthode

public BLPop ( $key, $timeout )

BRPop() public méthode

public BRPop ( $key, $timeout )

BRPopLPush() public méthode

public BRPopLPush ( $source, $destination, $timeout )

CLIENT_GETNAME() public méthode

Get the current connection name
public CLIENT_GETNAME ( )

CLIENT_KILL() public méthode

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

CLIENT_LIST() public méthode

Get the list of client connections
public CLIENT_LIST ( )

CLIENT_SETNAME() public méthode

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

Config_Get() public méthode

public Config_Get ( $parameter )

Config_ResetStat() public méthode

public Config_ResetStat ( )

Config_Set() public méthode

public Config_Set ( $parameter, $value )

DBsize() public méthode

public DBsize ( )

DEBUG_OBJECT() public méthode

Get debugging information about a key
public DEBUG_OBJECT ( string $key ) : mixed
$key string
Résultat mixed

DEBUG_SEGFAULT() public méthode

Make the server crash
public DEBUG_SEGFAULT ( )

DUMP() public méthode

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

Decr() public méthode

public Decr ( $key )

DecrBy() public méthode

public DecrBy ( $key, $decrement )

Del() public méthode

public Del ( $key )

Discard() public méthode

public Discard ( )

ECHO_() public méthode

Echo the given string
public ECHO_ ( string $message ) : string
$message string
Résultat string

EVALSHA() public méthode

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

EVAL_() public méthode

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

Exec() public méthode

public Exec ( )

Exists() public méthode

public Exists ( $key )

Expire() public méthode

public Expire ( $key, $seconds )

Expireat() public méthode

public Expireat ( $key, $timestamp )

FlushAll() public méthode

public FlushAll ( )

FlushDB() public méthode

public FlushDB ( )

Get() public méthode

public Get ( $key )

GetBit() public méthode

public GetBit ( $key, $offset )

GetRange() public méthode

public GetRange ( $key, $start, $end )

GetSet() public méthode

public GetSet ( $key, $value )

HINCRBYFLOAT() public méthode

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

INCRBYFLOAT() public méthode

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

Incr() public méthode

public Incr ( $key )

IncrBy() public méthode

public IncrBy ( $key, $increment )

Info() public méthode

public Info ( )

Keys() public méthode

public Keys ( $pattern )

LASTSAVE() public méthode

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

LIndex() public méthode

public LIndex ( $key, $index )

LInsert() public méthode

public LInsert ( $key, $after = true, $pivot, $value )

LLen() public méthode

public LLen ( $key )

LPop() public méthode

public LPop ( $key )

LPush() public méthode

public LPush ( $key, $value )

LPushX() public méthode

public LPushX ( $key, $value )

LRange() public méthode

public LRange ( $key, $start, $stop )

LRem() public méthode

public LRem ( $key, $count, $value )

LSet() public méthode

public LSet ( $key, $index, $value )

LTrim() public méthode

public LTrim ( $key, $start, $stop )

MGet() public méthode

public MGet ( $key )

MIGRATE() public méthode

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

MONITOR() public méthode

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

MSet() public méthode

public MSet ( array $keys )
$keys array

MSetNX() public méthode

public MSetNX ( array $keys )
$keys array

Move() public méthode

public Move ( $key, $db )

Multi() public méthode

public Multi ( )

OBJECT() public méthode

Inspect the internals of Redis objects
public OBJECT ( string $subcommand, array $arguments = [] ) : mixed
$subcommand string
$arguments array
Résultat mixed

PEXPIRE() public méthode

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

PEXPIREAT() public méthode

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

PING() public méthode

Ping the server
public PING ( )

PSETEX() public méthode

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

PSubscribe() public méthode

public PSubscribe ( $pattern )

PTTL() public méthode

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

PUnsubscribe() public méthode

public PUnsubscribe ( $pattern = null )

Persist() public méthode

public Persist ( $key )

Publish() public méthode

public Publish ( $channel, $message )

Quit() public méthode

public Quit ( )

RANDOMKEY() public méthode

Return a random key from the keyspace
public RANDOMKEY ( )

RESTORE() public méthode

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

RPop() public méthode

public RPop ( $key )

RPopLPush() public méthode

public RPopLPush ( $source, $destination )

RPush() public méthode

public RPush ( $key, $value )

RPushX() public méthode

public RPushX ( $key, $value )

Rename() public méthode

public Rename ( $key, $newkey )

RenameNX() public méthode

public RenameNX ( $key, $newkey )

SAVE() public méthode

Synchronously save the dataset to disk
public SAVE ( )

SCRIPT_EXISTS() public méthode

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

SCRIPT_FLUSH() public méthode

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

SCRIPT_KILL() public méthode

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

SCRIPT_LOAD() public méthode

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

SHUTDOWN() public méthode

Synchronously save the dataset to disk and then shut down the server One of modifiers can be turned on:
public SHUTDOWN ( boolean $save = false, boolean $nosave = false ) : boolean
$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.
Résultat boolean

SLOWLOG() public méthode

Manages the Redis slow queries log
public SLOWLOG ( string $subcommand, string $argument = '' ) : mixed
$subcommand string
$argument string
Résultat mixed

SPOP() public méthode

Remove and return a random member from a set
public SPOP ( string $key ) : string
$key string
Résultat string

SRANDMEMBER() public méthode

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

SYNC() public méthode

Internal command used for replication
public SYNC ( )

Select() public méthode

public Select ( $index )

Set() public méthode

public Set ( $key, $value )

SetBit() public méthode

public SetBit ( $key, $offset, $value )

SetEx() public méthode

public SetEx ( $key, $seconds, $value )

SetNX() public méthode

public SetNX ( $key, $value )

SetRange() public méthode

public SetRange ( $key, $offset, $value )

SlaveOf() public méthode

public SlaveOf ( $host, $port )

Sort() public méthode

public Sort ( $key, $sort_rule )

StrLen() public méthode

public StrLen ( $key )

Subscribe() public méthode

public Subscribe ( $channel )

TIME() public méthode

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

TTL() public méthode

public TTL ( $key )

Type() public méthode

public Type ( $key )

Unsubscribe() public méthode

public Unsubscribe ( $channel = '' )

Unwatch() public méthode

public Unwatch ( )

Watch() public méthode

public Watch ( $key )

__call() public méthode

..
public __call ( $name, $args )

__construct() public méthode

public __construct ( $host = 'localhost', $port = '6379' )

__destruct() public méthode

Close connection
public __destruct ( )

_read_reply() protected méthode

protected _read_reply ( )

_send() protected méthode

protected _send ( $args )

bgRewriteAOF() public méthode

public bgRewriteAOF ( )

bgSave() public méthode

public bgSave ( )

connect() public méthode

public connect ( $host, $port )

hDel() public méthode

public hDel ( $key, $field )

hExists() public méthode

public hExists ( $key, $field )

hGet() public méthode

public hGet ( $key, $field )

hGetAll() public méthode

public hGetAll ( $key )

hIncrBy() public méthode

public hIncrBy ( $key, $field, $increment )

hKeys() public méthode

public hKeys ( $key )

hLen() public méthode

public hLen ( $key )

hMGet() public méthode

public hMGet ( $key, array $fields )
$fields array

hMSet() public méthode

public hMSet ( $key, $fields )

hSet() public méthode

public hSet ( $key, $field, $value )

hSetNX() public méthode

public hSetNX ( $key, $field, $value )

hVals() public méthode

public hVals ( $key )

reportError() protected méthode

protected reportError ( $msg )

sAdd() public méthode

public sAdd ( $key, $member )

sCard() public méthode

public sCard ( $key )

sDiff() public méthode

public sDiff ( $key )

sDiffStore() public méthode

public sDiffStore ( $destination, $key )

sInter() public méthode

public sInter ( $key )

sInterStore() public méthode

public sInterStore ( $destination, $key )

sIsMember() public méthode

public sIsMember ( $key, $member )

sMembers() public méthode

public sMembers ( $key )

sMove() public méthode

public sMove ( $source, $destination, $member )

sRem() public méthode

public sRem ( $key, $member )

sUnion() public méthode

public sUnion ( $key )

sUnionStore() public méthode

public sUnionStore ( $destination, $key )

send_command() public méthode

Execute send_command and return the result Each entity of the send_command should be passed as argument Example: send_command('set','key','example value'); or: send_command('multi'); send_command('config','ResetStat'); // if command contain 2 words, they should be separated send_command('set','a', serialize($arr)); send_command('set','b', 1); send_command('execute');
public send_command ( ) : array | boolean | integer | null | string
Résultat array | boolean | integer | null | string

zAdd() public méthode

public zAdd ( $key, $score, $member = NULL )

zCard() public méthode

public zCard ( $key )

zCount() public méthode

public zCount ( $key, $min, $max )

zIncrBy() public méthode

public zIncrBy ( $key, $increment, $member )

zInterStore() public méthode

public zInterStore ( $destination, array $keys, array $weights = null, $aggregate = null )
$keys array
$weights array

zRange() public méthode

public zRange ( $key, $start, $stop, $withscores = false )

zRangeByScore() public méthode

public zRangeByScore ( $key, $min, $max, $withscores = false, array $limit = null )
$limit array

zRank() public méthode

public zRank ( $key, $member )

zRem() public méthode

public zRem ( $key, $member )

zRemRangeByRank() public méthode

public zRemRangeByRank ( $key, $start, $stop )

zRemRangeByScore() public méthode

public zRemRangeByScore ( $key, $min, $max )

zRevRange() public méthode

public zRevRange ( $key, $start, $stop, $withscores = false )

zRevRangeByScore() public méthode

public zRevRangeByScore ( $key, $max, $min, $withscores = false, array $limit = null )
$limit array

zRevRank() public méthode

public zRevRank ( $key, $member )

zScore() public méthode

public zScore ( $key, $member )

zUnionStore() public méthode

public zUnionStore ( $destination, array $keys, array $weights = null, $aggregate = null )
$keys array
$weights array

Property Details

$connection protected_oe property

protected $connection