PHP Class Predis\Protocol\Text\ResponseReader

Author: Daniele Alessandri ([email protected])
Inheritance: implements Predis\Protocol\ResponseReaderInterface
Show file Open project: nrk/predis Class Usage Examples

Protected Properties

Property Type Description
$handlers

Public Methods

Method Description
__construct ( )
getHandler ( string $prefix ) : Predis\Protocol\Text\Handler\ResponseHandlerInterface Returns the response handler associated to a certain type of response.
read ( Predis\Connection\CompositeConnectionInterface $connection )
setHandler ( string $prefix, Predis\Protocol\Text\Handler\ResponseHandlerInterface $handler ) Sets the handler for the specified prefix identifying the response type.

Protected Methods

Method Description
getDefaultHandlers ( ) : array Returns the default handlers for the supported type of responses.
onProtocolError ( Predis\Connection\CompositeConnectionInterface $connection, string $message ) Handles protocol errors generated while reading responses from a connection.

Method Details

__construct() public method

public __construct ( )

getDefaultHandlers() protected method

Returns the default handlers for the supported type of responses.
protected getDefaultHandlers ( ) : array
return array

getHandler() public method

Returns the response handler associated to a certain type of response.
public getHandler ( string $prefix ) : Predis\Protocol\Text\Handler\ResponseHandlerInterface
$prefix string Identifier of the type of response.
return Predis\Protocol\Text\Handler\ResponseHandlerInterface

onProtocolError() protected method

Handles protocol errors generated while reading responses from a connection.
protected onProtocolError ( Predis\Connection\CompositeConnectionInterface $connection, string $message )
$connection Predis\Connection\CompositeConnectionInterface Redis connection that generated the error.
$message string Error message.

read() public method

public read ( Predis\Connection\CompositeConnectionInterface $connection )
$connection Predis\Connection\CompositeConnectionInterface

setHandler() public method

Sets the handler for the specified prefix identifying the response type.
public setHandler ( string $prefix, Predis\Protocol\Text\Handler\ResponseHandlerInterface $handler )
$prefix string Identifier of the type of response.
$handler Predis\Protocol\Text\Handler\ResponseHandlerInterface Response handler.

Property Details

$handlers protected property

protected $handlers