class RedisManager implements Factory (View source)

Properties

protected Application $app The application instance.
protected string $driver The name of the default driver.
protected array $customCreators The registered custom driver creators.
protected array $config The Redis server configurations.
protected mixed $connections The Redis connections.
protected bool $events Indicates whether event dispatcher is set on connections.

Methods

void
__construct(Application $app, string $driver, array $config)

Create a new Redis manager instance.

connection(string|null $name = null)

Get a Redis connection by name.

resolve(string|null $name = null)

Resolve the given connection by name.

resolveCluster(string $name)

Resolve the given cluster connection by name.

configure(Connection $connection, string $name)

Configure the given connection to prepare it for commands.

connector()

Get the connector instance for the current driver.

array
parseConnectionConfiguration(mixed $config)

Parse the Redis connection configuration.

array
connections()

Return all of the created connections.

void
enableEvents()

Enable the firing of Redis command events.

void
disableEvents()

Disable the firing of Redis command events.

void
setDriver(string $driver)

Set the default driver.

$this
extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

mixed
__call(string $method, array $parameters)

Pass methods onto the default Redis connection.

Details

void __construct(Application $app, string $driver, array $config)

Create a new Redis manager instance.

Parameters

Application $app
string $driver
array $config

Return Value

void

Connection connection(string|null $name = null)

Get a Redis connection by name.

Parameters

string|null $name

Return Value

Connection

Connection resolve(string|null $name = null)

Resolve the given connection by name.

Parameters

string|null $name

Return Value

Connection

Exceptions

InvalidArgumentException

protected Connection resolveCluster(string $name)

Resolve the given cluster connection by name.

Parameters

string $name

Return Value

Connection

protected Connection configure(Connection $connection, string $name)

Configure the given connection to prepare it for commands.

Parameters

Connection $connection
string $name

Return Value

Connection

protected Connector connector()

Get the connector instance for the current driver.

Return Value

Connector

protected array parseConnectionConfiguration(mixed $config)

Parse the Redis connection configuration.

Parameters

mixed $config

Return Value

array

array connections()

Return all of the created connections.

Return Value

array

void enableEvents()

Enable the firing of Redis command events.

Return Value

void

void disableEvents()

Disable the firing of Redis command events.

Return Value

void

void setDriver(string $driver)

Set the default driver.

Parameters

string $driver

Return Value

void

$this extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

Parameters

string $driver
Closure $callback

Return Value

$this

mixed __call(string $method, array $parameters)

Pass methods onto the default Redis connection.

Parameters

string $method
array $parameters

Return Value

mixed