PHP Class Predis\Connection\StreamConnection

The connection parameters supported by this class are:. - scheme: it can be either 'redis', 'tcp', 'rediss', 'tls' or 'unix'. - host: hostname or IP address of the server. - port: TCP port of the server. - path: path of a UNIX domain socket when scheme is 'unix'. - timeout: timeout to perform the connection (default is 5 seconds). - read_write_timeout: timeout of read / write operations. - async_connect: performs the connection asynchronously. - tcp_nodelay: enables or disables Nagle's algorithm for coalescing. - persistent: the connection is left intact after a GC collection. - ssl: context options array (see http://php.net/manual/en/context.ssl.php)
Author: Daniele Alessandri ([email protected])
Inheritance: extends AbstractConnection
Afficher le fichier Open project: nrk/predis Class Usage Examples

Méthodes publiques

Méthode Description
__destruct ( ) Disconnects from the server and destroys the underlying resource when the garbage collector kicks in only if the connection has not been marked as persistent.
connect ( )
disconnect ( )
read ( )
writeRequest ( Predis\Command\CommandInterface $command )

Méthodes protégées

Méthode Description
assertParameters ( Predis\Connection\ParametersInterface $parameters )
assertSslSupport ( Predis\Connection\ParametersInterface $parameters ) Checks needed conditions for SSL-encrypted connections.
createResource ( )
createStreamSocket ( Predis\Connection\ParametersInterface $parameters, string $address, integer $flags ) : resource Creates a connected stream socket resource.
tcpStreamInitializer ( Predis\Connection\ParametersInterface $parameters ) : resource Initializes a TCP stream resource.
tlsStreamInitializer ( Predis\Connection\ParametersInterface $parameters ) : resource Initializes a SSL-encrypted TCP stream resource.
unixStreamInitializer ( Predis\Connection\ParametersInterface $parameters ) : resource Initializes a UNIX stream resource.
write ( string $buffer ) Performs a write operation over the stream of the buffer containing a command serialized with the Redis wire protocol.

Method Details

__destruct() public méthode

Disconnects from the server and destroys the underlying resource when the garbage collector kicks in only if the connection has not been marked as persistent.
public __destruct ( )

assertParameters() protected méthode

protected assertParameters ( Predis\Connection\ParametersInterface $parameters )
$parameters Predis\Connection\ParametersInterface

assertSslSupport() protected méthode

Checks needed conditions for SSL-encrypted connections.
protected assertSslSupport ( Predis\Connection\ParametersInterface $parameters )
$parameters Predis\Connection\ParametersInterface Initialization parameters for the connection.

connect() public méthode

public connect ( )

createResource() protected méthode

protected createResource ( )

createStreamSocket() protected méthode

Creates a connected stream socket resource.
protected createStreamSocket ( Predis\Connection\ParametersInterface $parameters, string $address, integer $flags ) : resource
$parameters Predis\Connection\ParametersInterface Connection parameters.
$address string Address for stream_socket_client().
$flags integer Flags for stream_socket_client().
Résultat resource

disconnect() public méthode

public disconnect ( )

read() public méthode

public read ( )

tcpStreamInitializer() protected méthode

Initializes a TCP stream resource.
protected tcpStreamInitializer ( Predis\Connection\ParametersInterface $parameters ) : resource
$parameters Predis\Connection\ParametersInterface Initialization parameters for the connection.
Résultat resource

tlsStreamInitializer() protected méthode

Initializes a SSL-encrypted TCP stream resource.
protected tlsStreamInitializer ( Predis\Connection\ParametersInterface $parameters ) : resource
$parameters Predis\Connection\ParametersInterface Initialization parameters for the connection.
Résultat resource

unixStreamInitializer() protected méthode

Initializes a UNIX stream resource.
protected unixStreamInitializer ( Predis\Connection\ParametersInterface $parameters ) : resource
$parameters Predis\Connection\ParametersInterface Initialization parameters for the connection.
Résultat resource

write() protected méthode

Performs a write operation over the stream of the buffer containing a command serialized with the Redis wire protocol.
protected write ( string $buffer )
$buffer string Representation of a command in the Redis wire protocol.

writeRequest() public méthode

public writeRequest ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface