PHP Класс Jamm\Memory\RedisServer

Наследование: implements Jamm\Memory\IRedisServer
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$connection

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

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

Защищенные методы

Метод Описание
_read_reply ( )
_send ( $args )
reportError ( $msg )

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

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

public Append ( $key, $value )

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

public Auth ( $password )

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 ( string $key, integer $start, integer $end ) : integer
$key string
$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() публичный Метод

public BLPop ( $key, $timeout )

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

public BRPop ( $key, $timeout )

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

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

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

public Config_Get ( $parameter )

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

public Config_ResetStat ( )

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

public Config_Set ( $parameter, $value )

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

public DBsize ( )

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

Get debugging information about a key
public DEBUG_OBJECT ( string $key ) : mixed
$key string
Результат mixed

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

public Decr ( $key )

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

public DecrBy ( $key, $decrement )

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

public Del ( $key )

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

public Discard ( )

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

Echo the given string
public ECHO_ ( string $message ) : string
$message string
Результат 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() публичный Метод

public Exec ( )

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

public Exists ( $key )

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

public Expire ( $key, $seconds )

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

public Expireat ( $key, $timestamp )

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

public FlushAll ( )

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

public FlushDB ( )

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

public Get ( $key )

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

public GetBit ( $key, $offset )

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

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

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

public GetSet ( $key, $value )

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

public Incr ( $key )

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

public IncrBy ( $key, $increment )

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

public Info ( )

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

public Keys ( $pattern )

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

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

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

public LIndex ( $key, $index )

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

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

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

public LLen ( $key )

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

public LPop ( $key )

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

public LPush ( $key, $value )

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

public LPushX ( $key, $value )

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

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

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

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

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

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

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

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

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

public MGet ( $key )

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

public MSet ( array $keys )
$keys array

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

public MSetNX ( array $keys )
$keys array

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

public Move ( $key, $db )

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

public Multi ( )

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

Inspect the internals of Redis objects
public OBJECT ( string $subcommand, array $arguments = [] ) : mixed
$subcommand string
$arguments array
Результат mixed

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

public PSubscribe ( $pattern )

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

public PUnsubscribe ( $pattern = null )

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

public Persist ( $key )

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

public Publish ( $channel, $message )

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

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

public RPop ( $key )

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

public RPopLPush ( $source, $destination )

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

public RPush ( $key, $value )

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

public RPushX ( $key, $value )

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

public Rename ( $key, $newkey )

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

public RenameNX ( $key, $newkey )

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

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

Manages the Redis slow queries log
public SLOWLOG ( string $subcommand, string $argument = '' ) : mixed
$subcommand string
$argument string
Результат mixed

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

Remove and return a random member from a set
public SPOP ( string $key ) : string
$key string
Результат string

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

Get a random member from a set
public SRANDMEMBER ( string $key, integer $count = 1 ) : string
$key string
$count integer
Результат string

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

Internal command used for replication
public SYNC ( )

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

public Select ( $index )

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

public Set ( $key, $value )

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

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

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

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

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

public SetNX ( $key, $value )

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

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

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

public SlaveOf ( $host, $port )

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

public Sort ( $key, $sort_rule )

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

public StrLen ( $key )

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

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

public TTL ( $key )

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

public Type ( $key )

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

public Unsubscribe ( $channel = '' )

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

public Unwatch ( )

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

public Watch ( $key )

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

..
public __call ( $name, $args )

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

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

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

Close connection
public __destruct ( )

_read_reply() защищенный Метод

protected _read_reply ( )

_send() защищенный Метод

protected _send ( $args )

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

public bgRewriteAOF ( )

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

public bgSave ( )

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

public connect ( $host, $port )

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

public hDel ( $key, $field )

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

public hExists ( $key, $field )

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

public hGet ( $key, $field )

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

public hGetAll ( $key )

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

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

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

public hKeys ( $key )

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

public hLen ( $key )

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

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

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

public hMSet ( $key, $fields )

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

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

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

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

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

public hVals ( $key )

reportError() защищенный Метод

protected reportError ( $msg )

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

public sAdd ( $key, $member )

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

public sCard ( $key )

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

public sDiff ( $key )

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

public sDiffStore ( $destination, $key )

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

public sInter ( $key )

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

public sInterStore ( $destination, $key )

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

public sIsMember ( $key, $member )

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

public sMembers ( $key )

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

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

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

public sRem ( $key, $member )

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

public sUnion ( $key )

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

public sUnionStore ( $destination, $key )

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

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

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

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

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

public zCard ( $key )

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

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

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

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

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

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

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

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

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

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

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

public zRank ( $key, $member )

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

public zRem ( $key, $member )

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

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

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

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

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

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

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

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

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

public zRevRank ( $key, $member )

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

public zScore ( $key, $member )

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

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

Описание свойств

$connection защищенное свойство

protected $connection