Browse Source

Move Publish/Subscribe related classes to the Predis\PubSub namespace.

Daniele Alessandri 13 years ago
parent
commit
4882e23319

+ 1 - 1
examples/DispatcherLoop.php

@@ -28,7 +28,7 @@ PUBLISH control terminate_dispatcher
 $client = new Predis\Client($single_server + array('read_write_timeout' => 0));
 
 // Create a Predis\DispatcherLoop instance and attach a bunch of callbacks.
-$dispatcher = new Predis\DispatcherLoop($client);
+$dispatcher = new Predis\PubSub\DispatcherLoop($client);
 
 // Demonstrate how to use a callable class as a callback for Predis\DispatcherLoop.
 class EventsListener implements Countable

+ 1 - 0
lib/Predis/Client.php

@@ -16,6 +16,7 @@ use Predis\Network\IConnection;
 use Predis\Network\IConnectionSingle;
 use Predis\Profiles\IServerProfile;
 use Predis\Profiles\ServerProfile;
+use Predis\PubSub\PubSubContext;
 use Predis\Pipeline\PipelineContext;
 use Predis\Transaction\MultiExecContext;
 

+ 4 - 1
lib/Predis/DispatcherLoop.php → lib/Predis/PubSub/DispatcherLoop.php

@@ -9,7 +9,10 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis;
+namespace Predis\PubSub;
+
+use Predis\Client;
+use Predis\ClientException;
 
 /**
  * Method-dispatcher loop built around the client-side abstraction of a Redis

+ 5 - 1
lib/Predis/PubSubContext.php → lib/Predis/PubSub/PubSubContext.php

@@ -9,7 +9,11 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis;
+namespace Predis\PubSub;
+
+use Predis\Client;
+use Predis\Helpers;
+use Predis\ClientException;
 
 /**
  * Client-side abstraction of a Publish / Subscribe context.