class Database implements Database (View source)

Properties

protected array $clients The host address of the database.

Methods

void
__construct(array $servers = array())

Create a new Redis connection instance.

array
createAggregateClient(array $servers)

Create a new aggregate client supporting sharding.

array
createSingleClients(array $servers)

Create an array of single connection clients.

array
getClientOptions(array $servers)

Get any client options from the configuration array.

ClientInterface
connection(string $name = 'default')

Get a specific Redis connection instance.

mixed
command(string $method, array $parameters = array())

Run a command against the Redis database.

void
subscribe(array|string $channels, Closure $callback, string $connection = null)

Subscribe to a set of given channels for messages.

mixed
__call(string $method, array $parameters)

Dynamically make a Redis command.

Details

void __construct(array $servers = array())

Create a new Redis connection instance.

Parameters

array $servers

Return Value

void

protected array createAggregateClient(array $servers)

Create a new aggregate client supporting sharding.

Parameters

array $servers

Return Value

array

protected array createSingleClients(array $servers)

Create an array of single connection clients.

Parameters

array $servers

Return Value

array

protected array getClientOptions(array $servers)

Get any client options from the configuration array.

Parameters

array $servers

Return Value

array

ClientInterface connection(string $name = 'default')

Get a specific Redis connection instance.

Parameters

string $name

Return Value

ClientInterface

mixed command(string $method, array $parameters = array())

Run a command against the Redis database.

Parameters

string $method
array $parameters

Return Value

mixed

void subscribe(array|string $channels, Closure $callback, string $connection = null)

Subscribe to a set of given channels for messages.

Parameters

array|string $channels
Closure $callback
string $connection

Return Value

void

mixed __call(string $method, array $parameters)

Dynamically make a Redis command.

Parameters

string $method
array $parameters

Return Value

mixed