Documentation

AbstractConnection
in package
implements NodeConnectionInterface

Base class with the common logic used by connection classes to communicate with Redis.

Tags
author

Daniele Alessandri suppakilla@gmail.com

Interfaces, Classes and Traits

NodeConnectionInterface
Defines a connection used to communicate with a single Redis node.

Table of Contents

$initCommands  : mixed
$parameters  : mixed
$cachedId  : mixed
$resource  : mixed
__construct()  : mixed
__destruct()  : mixed
Disconnects from the server and destroys the underlying resource when PHP's garbage collector kicks in.
__sleep()  : mixed
{@inheritdoc}
__toString()  : string
Returns a string representation of the connection.
addConnectCommand()  : mixed
Pushes the given command into a queue of commands executed when establishing the actual connection to Redis.
connect()  : mixed
{@inheritdoc}
disconnect()  : mixed
{@inheritdoc}
executeCommand()  : mixed
{@inheritdoc}
getParameters()  : ParametersInterface
Returns the parameters used to initialize the connection.
getResource()  : mixed
Returns the underlying resource used to communicate with Redis.
isConnected()  : mixed
{@inheritdoc}
readResponse()  : mixed
{@inheritdoc}
assertParameters()  : ParametersInterface
Checks some of the parameters used to initialize the connection.
createResource()  : mixed
Creates the underlying resource used to communicate with Redis.
getIdentifier()  : string
Gets an identifier for the connection.
onConnectionError()  : mixed
Helper method to handle connection errors.
onProtocolError()  : mixed
Helper method to handle protocol errors.
createExceptionMessage()  : string
Helper method that returns an exception message augmented with useful details from the connection parameters.

Properties

Methods

__destruct()

Disconnects from the server and destroys the underlying resource when PHP's garbage collector kicks in.

public __destruct() : mixed
Return values
mixed

__toString()

Returns a string representation of the connection.

public __toString() : string
Return values
string

addConnectCommand()

Pushes the given command into a queue of commands executed when establishing the actual connection to Redis.

public addConnectCommand(CommandInterface $command) : mixed
Parameters
$command : CommandInterface

Instance of a Redis command.

Return values
mixed

getResource()

Returns the underlying resource used to communicate with Redis.

public getResource() : mixed
Return values
mixed

isConnected()

{@inheritdoc}

public isConnected() : mixed
Return values
mixed

createResource()

Creates the underlying resource used to communicate with Redis.

protected abstract createResource() : mixed
Return values
mixed

getIdentifier()

Gets an identifier for the connection.

protected getIdentifier() : string
Return values
string

onConnectionError()

Helper method to handle connection errors.

protected onConnectionError(string $message[, int $code = null ]) : mixed
Parameters
$message : string

Error message.

$code : int = null

Error code.

Return values
mixed

onProtocolError()

Helper method to handle protocol errors.

protected onProtocolError(string $message) : mixed
Parameters
$message : string

Error message.

Return values
mixed

createExceptionMessage()

Helper method that returns an exception message augmented with useful details from the connection parameters.

private createExceptionMessage(string $message) : string
Parameters
$message : string

Error message.

Return values
string

Search results