From afd78b49a60a7ffcbafe39acfc4ef9edbda49a28 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Fri, 18 Mar 2011 15:45:27 +0100 Subject: [PATCH] Update README and samples. --- README.markdown | 2 +- examples/SimpleDebuggableConnection.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.markdown b/README.markdown index ea513943..415f1557 100644 --- a/README.markdown +++ b/README.markdown @@ -99,7 +99,7 @@ classes. This can be obtained by subclassing the Predis\Network\IConnectionSingl // Let Predis automatically use your own class to handle the default TCP connection - Predis\Client::defineConnection('tcp', 'MyConnectionClass'); + Predis\ConnectionSchemes::define('tcp', 'MyConnectionClass'); You can have a look at the Predis\Network namespace for some actual code that gives a better diff --git a/examples/SimpleDebuggableConnection.php b/examples/SimpleDebuggableConnection.php index 9005d5c7..f6cd2444 100644 --- a/examples/SimpleDebuggableConnection.php +++ b/examples/SimpleDebuggableConnection.php @@ -40,15 +40,18 @@ class SimpleDebuggableConnection extends StreamConnection { } } -$parameters = new ConnectionParameters($single_server); -$connection = new SimpleDebuggableConnection($parameters); +$options = array( + 'connections' => array( + 'tcp' => 'SimpleDebuggableConnection', + ), +); -$redis = new Predis\Client($connection); +$redis = new Predis\Client($single_server, $options); $redis->set('foo', 'bar'); $redis->get('foo'); $redis->info(); -print_r($connection->getDebugBuffer()); +print_r($redis->getConnection()->getDebugBuffer()); /* OUTPUT: Array