LaravelRedis

Summary

No public properties found
No constants found
No private methods found
No private properties found
N/A
File
redis.php
Package
Default
Class hierarchy
LaravelRedis

Tags

None found

Properties

$host

$host : string

The address for the Redis host.

Type

string

Tags

None found

$port

$port : integer

The port on which Redis can be accessed on the host.

Type

integer

Tags

None found

$password

$password : string

The database password, if present.

Type

string

Tags

None found

$database

$database : integer

The database number the connection selects on load.

Type

integer

Tags

None found

$connection

$connection : resource

The connection to the Redis database.

Type

resource

Tags

None found

$databases

$databases : array

The active Redis database instances.

Type

array

Tags

None found

Methods

__construct()

__construct(string  $host, string  $port,   $password = null, integer  $database) : void

Create a new Redis connection instance.

Parameters

string $host
string $port
$password
integer $database

Tags

None found

db()

db(string  $name = 'default') : \Laravel\Redis

Get a Redis database connection instance.

The given name should correspond to a Redis database in the configuration file.

// Get the default Redis database instance $redis = Redis::db();

// Get a specified Redis database instance
$reids = Redis::db('redis_2');

Parameters

string $name

Returns

LaravelRedis

static

Tags

None found

run()

run(string  $method, array  $parameters) : mixed

Execute a command against the Redis database.

// Execute the GET command for the "name" key $name = Redis::db()->run('get', array('name'));

// Execute the LRANGE command for the "list" key
$list = Redis::db()->run('lrange', array(0, 5));

Parameters

string $method
array $parameters

Returns

mixed

Tags

None found

__call()

__call(  $method,   $parameters) 

Dynamically make calls to the Redis database.

Parameters

$method
$parameters

Tags

None found

__callStatic()

__callStatic(  $method,   $parameters) 

Dynamically pass static method calls to the Redis instance.

Parameters

$method
$parameters

static

Tags

None found

__destruct()

__destruct() : void

Close the connection to the Redis database.

Tags

None found

parse()

parse(string  $response) : mixed

Parse and return the response from the Redis database.

Parameters

string $response

Returns

mixed

Tags

None found

connect()

connect() : resource

Establish the connection to the Redis database.

Returns

resource

Tags

None found

command()

command(string  $method, array  $parameters) : string

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

string $method
array $parameters

Returns

string

Tags

None found

inline()

inline(string  $response) : string

Parse and handle an inline response from the Redis database.

Parameters

string $response

Returns

string

Tags

None found

bulk()

bulk(string  $head) : string

Parse and handle a bulk response from the Redis database.

Parameters

string $head

Returns

string

Tags

None found

multibulk()

multibulk(string  $head) : array

Parse and handle a multi-bulk reply from the Redis database.

Parameters

string $head

Returns

array

Tags

None found