mirror of
https://github.com/predis/predis.git
synced 2026-09-10 18:37:34 +00:00
Rename protocol interfaces.
This commit is contained in:
@@ -5,18 +5,18 @@ namespace Predis\Network;
|
||||
use Predis\ICommand;
|
||||
use Predis\ConnectionParameters;
|
||||
use Predis\CommunicationException;
|
||||
use Predis\Protocols\IRedisProtocol;
|
||||
use Predis\Protocols\IProtocolProcessor;
|
||||
use Predis\Protocols\TextProtocol;
|
||||
|
||||
class ComposableStreamConnection extends StreamConnection implements IConnectionComposable {
|
||||
private $_protocol;
|
||||
|
||||
public function __construct(ConnectionParameters $parameters, IRedisProtocol $protocol = null) {
|
||||
public function __construct(ConnectionParameters $parameters, IProtocolProcessor $protocol = null) {
|
||||
parent::__construct($parameters);
|
||||
$this->_protocol = $protocol ?: new TextProtocol();
|
||||
}
|
||||
|
||||
public function setProtocol(IRedisProtocol $protocol) {
|
||||
public function setProtocol(IProtocolProcessor $protocol) {
|
||||
if ($protocol === null) {
|
||||
throw new \InvalidArgumentException("The protocol instance cannot be a null value");
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace Predis\Network;
|
||||
|
||||
use Predis\Protocols\IRedisProtocol;
|
||||
use Predis\Protocols\IProtocolProcessor;
|
||||
|
||||
interface IConnectionComposable extends IConnectionSingle {
|
||||
public function setProtocol(IRedisProtocol $protocol);
|
||||
public function setProtocol(IProtocolProcessor $protocol);
|
||||
public function getProtocol();
|
||||
public function writeBytes($buffer);
|
||||
public function readBytes($length);
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Predis\Protocols;
|
||||
use Predis\ICommand;
|
||||
use Predis\Network\IConnectionComposable;
|
||||
|
||||
class ComposableTextProtocol implements IRedisProtocolExtended {
|
||||
class ComposableTextProtocol implements IProtocolProcessorExtended {
|
||||
private $_serializer, $_reader;
|
||||
|
||||
public function __construct(Array $options = array()) {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ namespace Predis\Protocols;
|
||||
use Predis\ICommand;
|
||||
use Predis\Network\IConnectionComposable;
|
||||
|
||||
interface IRedisProtocol {
|
||||
interface IProtocolProcessor {
|
||||
public function write(IConnectionComposable $connection, ICommand $command);
|
||||
public function read(IConnectionComposable $connection);
|
||||
public function setOption($option, $value);
|
||||
+1
-1
@@ -4,7 +4,7 @@ namespace Predis\Protocols;
|
||||
|
||||
use Predis\ICommand;
|
||||
|
||||
interface IRedisProtocolExtended extends IRedisProtocol {
|
||||
interface IProtocolProcessorExtended extends IProtocolProcessor {
|
||||
public function setSerializer(ICommandSerializer $serializer);
|
||||
public function getSerializer();
|
||||
public function setReader(IResponseReader $reader);
|
||||
@@ -10,7 +10,7 @@ use Predis\CommunicationException;
|
||||
use Predis\Network\IConnectionComposable;
|
||||
use Predis\Iterators\MultiBulkResponseSimple;
|
||||
|
||||
class TextProtocol implements IRedisProtocol {
|
||||
class TextProtocol implements IProtocolProcessor {
|
||||
const NEWLINE = "\r\n";
|
||||
const OK = 'OK';
|
||||
const ERROR = 'ERR';
|
||||
|
||||
Reference in New Issue
Block a user