class ConnectionManager extends ConnectionManager

Redis connection manager.

Traits

Configurable trait.

Properties

protected string $default Name of the default connection. from ConfigurableTrait
protected array $configurations Configurations. from ConfigurableTrait
protected array $connections Connections. from ConnectionManager

Methods

__construct(string $default, array $configurations)

Constructor.

addConfiguration(string $name, array $configuration)

Adds a configuration.

removeConfiguration(string $name)

Removes a configuration.

mixed
connect(string $connection)

Connects to the chosen redis configuration and returns the connection.

connection($connection = null)

No description

close(string|null $connection = null)

Closes the chosen connection.

mixed
executeAndClose(Closure $closure, string|null $connection = null)

Executes the passed closure using the chosen connection before closing it.

mixed
__call(string $name, array $arguments)

Magic shortcut to the default connection.

Details

in ConfigurableTrait at line 35
__construct(string $default, array $configurations)

Constructor.

Parameters

string $default Default connection name
array $configurations Configurations

in ConfigurableTrait at line 48
addConfiguration(string $name, array $configuration)

Adds a configuration.

Parameters

string $name Connection name
array $configuration Configuration

in ConfigurableTrait at line 59
removeConfiguration(string $name)

Removes a configuration.

It will also remove any active connection linked to the configuration.

Parameters

string $name Connection name

at line 28
protected mixed connect(string $connection)

Connects to the chosen redis configuration and returns the connection.

Parameters

string $connection Connection name

Return Value

mixed

at line 20
Redis connection($connection = null)

Parameters

$connection

Return Value

Redis

in ConnectionManager at line 62
close(string|null $connection = null)

Closes the chosen connection.

Parameters

string|null $connection Connection name

in ConnectionManager at line 87
mixed executeAndClose(Closure $closure, string|null $connection = null)

Executes the passed closure using the chosen connection before closing it.

Parameters

Closure $closure Closure to execute
string|null $connection Connection name

Return Value

mixed

in ConnectionManager at line 116
mixed __call(string $name, array $arguments)

Magic shortcut to the default connection.

Parameters

string $name Method name
array $arguments Method arguments

Return Value

mixed