Factory
in package
implements
FactoryInterface
Standard connection factory for creating connections to Redis nodes.
Tags
Interfaces, Classes and Traits
- FactoryInterface
- Interface for classes providing a factory of connections to Redis nodes.
Table of Contents
- $schemes : mixed
- $defaults : mixed
- aggregate() : mixed
- Aggregates single connections into an aggregate connection instance.
- create() : NodeConnectionInterface
- Creates a new connection object.
- define() : mixed
- Defines or overrides the connection class identified by a scheme prefix.
- getDefaultParameters() : array<string|int, mixed>
- Returns the default set of parameters applied to new connections.
- setDefaultParameters() : mixed
- Assigns a default set of parameters applied to new connections.
- undefine() : mixed
- Undefines the connection identified by a scheme prefix.
- checkInitializer() : mixed
- Checks if the provided argument represents a valid connection class implementing Predis\Connection\NodeConnectionInterface. Optionally, callable objects are used for lazy initialization of connection objects.
- createParameters() : ParametersInterface
- Creates a connection parameters instance from the supplied argument.
- prepareConnection() : mixed
- Prepares a connection instance after its initialization.
Properties
$schemes
protected
mixed
$schemes
= array('tcp' => 'Predis\Connection\StreamConnection', 'unix' => 'Predis\Connection\StreamConnection', 'tls' => 'Predis\Connection\StreamConnection', 'redis' => 'Predis\Connection\StreamConnection', 'rediss' => 'Predis\Connection\StreamConnection', 'http' => 'Predis\Connection\WebdisConnection')
$defaults
private
mixed
$defaults
= array()
Methods
aggregate()
Aggregates single connections into an aggregate connection instance.
public
aggregate(AggregateConnectionInterface $connection, array<string|int, mixed> $parameters) : mixed
Parameters
- $connection : AggregateConnectionInterface
- $parameters : array<string|int, mixed>
-
List of parameters for each connection.
Return values
mixed —create()
Creates a new connection object.
public
create(mixed $parameters) : NodeConnectionInterface
Parameters
- $parameters : mixed
-
Initialization parameters for the connection.
Return values
NodeConnectionInterface —define()
Defines or overrides the connection class identified by a scheme prefix.
public
define(mixed $scheme, mixed $initializer) : mixed
Parameters
- $scheme : mixed
-
Target connection scheme.
- $initializer : mixed
-
Fully-qualified name of a class or a callable for lazy initialization.
Return values
mixed —getDefaultParameters()
Returns the default set of parameters applied to new connections.
public
getDefaultParameters() : array<string|int, mixed>
Return values
array<string|int, mixed> —setDefaultParameters()
Assigns a default set of parameters applied to new connections.
public
setDefaultParameters(array<string|int, mixed> $parameters) : mixed
The set of parameters passed to create a new connection have precedence over the default values set for the connection factory.
Parameters
- $parameters : array<string|int, mixed>
-
Set of connection parameters.
Return values
mixed —undefine()
Undefines the connection identified by a scheme prefix.
public
undefine(mixed $scheme) : mixed
Parameters
- $scheme : mixed
-
Target connection scheme.
Return values
mixed —checkInitializer()
Checks if the provided argument represents a valid connection class implementing Predis\Connection\NodeConnectionInterface. Optionally, callable objects are used for lazy initialization of connection objects.
protected
checkInitializer(mixed $initializer) : mixed
Parameters
- $initializer : mixed
-
FQN of a connection class or a callable for lazy initialization.
Tags
Return values
mixed —createParameters()
Creates a connection parameters instance from the supplied argument.
protected
createParameters(mixed $parameters) : ParametersInterface
Parameters
- $parameters : mixed
-
Original connection parameters.
Return values
ParametersInterface —prepareConnection()
Prepares a connection instance after its initialization.
protected
prepareConnection(NodeConnectionInterface $connection) : mixed
Parameters
- $connection : NodeConnectionInterface
-
Connection instance.