Methods summary
public
|
#
__construct( string $host, string $port, integer $password = null, mixed $database = 0 )
Create a new Redis connection instance.
Create a new Redis connection instance.
Parameters
- $host
string $host
- $port
string $port
- $password
integer $database
- $database
|
public static
Laravel\Redis
|
#
db( string $name = 'default' )
Get a Redis database connection instance.
Get a Redis database connection instance.
The given name should correspond to a Redis database in the configuration
file.
$redis = Redis::db();
$reids = Redis::db('redis_2');
Parameters
Returns
|
public
mixed
|
#
run( string $method, array $parameters )
Execute a command against the Redis database.
Execute a command against the Redis database.
$name = Redis::db()->run('get', array('name'));
$list = Redis::db()->run('lrange', array(0, 5));
Parameters
- $method
string $method
- $parameters
array $parameters
Returns
mixed
|
protected
mixed
|
#
parse( string $response )
Parse and return the response from the Redis database.
Parse and return the response from the Redis database.
Parameters
- $response
string $response
Returns
mixed
|
protected
resource
|
#
connect( )
Establish the connection to the Redis database.
Establish the connection to the Redis database.
Returns
resource
|
protected
string
|
#
command( string $method, array $parameters )
Build the Redis command based from a given method and parameters.
Build the Redis command based from a given method and parameters.
Redis protocol states that a command should conform to the following
format:
*<number of arguments> CR LF $<number of bytes of argument 1> CR LF
<argument data> CR LF ... $<number of bytes of argument N> CR LF
<argument data> CR LF
More information regarding the Redis protocol: http://redis.io/topics/protocol
Parameters
- $method
string $method
- $parameters
array $parameters
Returns
string
|
protected
string
|
#
inline( string $response )
Parse and handle an inline response from the Redis database.
Parse and handle an inline response from the Redis database.
Parameters
- $response
string $response
Returns
string
|
protected
string
|
#
bulk( string $head )
Parse and handle a bulk response from the Redis database.
Parse and handle a bulk response from the Redis database.
Parameters
Returns
string
|
protected
array
|
#
multibulk( string $head )
Parse and handle a multi-bulk reply from the Redis database.
Parse and handle a multi-bulk reply from the Redis database.
Parameters
Returns
array
|
public
|
#
__call( mixed $method, mixed $parameters )
Dynamically make calls to the Redis database.
Dynamically make calls to the Redis database.
|
public static
|
#
__callStatic( mixed $method, mixed $parameters )
Dynamically pass static method calls to the Redis instance.
Dynamically pass static method calls to the Redis instance.
|
public
|
#
__destruct( )
Close the connection to the Redis database.
Close the connection to the Redis database.
|