From 5431af0c4bd7b5e50d78c8d519a7988a1efa041c Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Wed, 2 Mar 2011 10:11:58 +0100 Subject: [PATCH] Update examples to the new connection API design. --- examples/SimpleDebuggableConnection.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/SimpleDebuggableConnection.php b/examples/SimpleDebuggableConnection.php index 0420014c..709ce143 100644 --- a/examples/SimpleDebuggableConnection.php +++ b/examples/SimpleDebuggableConnection.php @@ -1,7 +1,11 @@ getArgument(0); $timestamp = round(microtime(true) - $this->_tstart, 4); $debug = $command->getCommandId(); @@ -20,12 +24,12 @@ class SimpleDebuggableConnection extends Predis\Network\TcpConnection { $this->_debugBuffer[] = $debug; } - public function writeCommand(Predis\ICommand $command) { + public function writeCommand(ICommand $command) { parent::writeCommand($command); $this->storeDebug($command, '->'); } - public function readResponse(Predis\ICommand $command) { + public function readResponse(ICommand $command) { $reply = parent::readResponse($command); $this->storeDebug($command, '<-'); return $reply; @@ -36,7 +40,7 @@ class SimpleDebuggableConnection extends Predis\Network\TcpConnection { } } -$parameters = new Predis\ConnectionParameters($single_server); +$parameters = new ConnectionParameters($single_server); $connection = new SimpleDebuggableConnection($parameters); $redis = new Predis\Client($connection);