mirror of
https://github.com/predis/predis.git
synced 2026-08-24 19:39:36 +00:00
Update README and samples.
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user