PHP Class Snc\RedisBundle\Tests\Profiler\Storage\Mock\RedisMock

Author: Andrej Hudec ([email protected])
Show file Open project: snc/SncRedisBundle Class Usage Examples

Public Methods

Method Description
append ( string $key, string $value ) : integer Append data to an existing item.
close ( ) : boolean Close Redis server connection.
connect ( string $host, integer $port = 6379, float $timeout ) : boolean Add a server to connection pool.
del ( string | array $key ) : integer Remove specified keys.
exists ( string $key ) : boolean Verify if the specified key exists.
expire ( string $key, integer $ttl ) : boolean Sets an expiration time on an item.
flushAll ( ) : boolean Flush all existing items from all databases at the server.
get ( string $key ) : boolean Retrieve item from the server.
select ( $dbnum )
setex ( string $key, integer $ttl, mixed $value ) : boolean Store data at the server with expiration time.

Private Methods

Method Description
getData ( $key )
storeData ( $key, $value )

Method Details

append() public method

Append data to an existing item.
public append ( string $key, string $value ) : integer
$key string
$value string
return integer Size of the value after the append

close() public method

Close Redis server connection.
public close ( ) : boolean
return boolean

connect() public method

Add a server to connection pool.
public connect ( string $host, integer $port = 6379, float $timeout ) : boolean
$host string
$port integer
$timeout float
return boolean

del() public method

Remove specified keys.
public del ( string | array $key ) : integer
$key string | array
return integer

exists() public method

Verify if the specified key exists.
public exists ( string $key ) : boolean
$key string
return boolean

expire() public method

Sets an expiration time on an item.
public expire ( string $key, integer $ttl ) : boolean
$key string
$ttl integer
return boolean

flushAll() public method

Flush all existing items from all databases at the server.
public flushAll ( ) : boolean
return boolean

get() public method

Retrieve item from the server.
public get ( string $key ) : boolean
$key string
return boolean

select() public method

public select ( $dbnum )

setex() public method

Store data at the server with expiration time.
public setex ( string $key, integer $ttl, mixed $value ) : boolean
$key string
$ttl integer
$value mixed
return boolean