Quellcode durchsuchen

Rename Predis\CommandPipeline to Predis\PipelineContext.

Daniele Alessandri vor 14 Jahren
Ursprung
Commit
c2a61a3113
4 geänderte Dateien mit 17 neuen und 17 gelöschten Zeilen
  1. 0 0
      examples/PipelineContext.php
  2. 4 4
      lib/Predis/Client.php
  3. 1 1
      lib/Predis/PipelineContext.php
  4. 12 12
      test/ClientFeaturesTest.php

+ 0 - 0
examples/CommandPipeline.php → examples/PipelineContext.php


+ 4 - 4
lib/Predis/Client.php

@@ -181,22 +181,22 @@ class Client {
         if (isset($options)) {
             if (isset($options['safe']) && $options['safe'] == true) {
                 $connection = $this->_connection;
-                $pipeline = new CommandPipeline($this,
+                $pipeline = new PipelineContext($this,
                     Utils::isCluster($connection)
                         ? new Pipeline\SafeClusterExecutor($connection)
                         : new Pipeline\SafeExecutor($connection)
                 );
             }
             else {
-                $pipeline = new CommandPipeline($this);
+                $pipeline = new PipelineContext($this);
             }
         }
         return $this->pipelineExecute(
-            $pipeline ?: new CommandPipeline($this), $pipelineBlock
+            $pipeline ?: new PipelineContext($this), $pipelineBlock
         );
     }
 
-    private function pipelineExecute(CommandPipeline $pipeline, $block) {
+    private function pipelineExecute(PipelineContext $pipeline, $block) {
         return $block !== null ? $pipeline->execute($block) : $pipeline;
     }
 

+ 1 - 1
lib/Predis/CommandPipeline.php → lib/Predis/PipelineContext.php

@@ -5,7 +5,7 @@ namespace Predis;
 use Predis\Commands\ICommand;
 use Predis\Pipeline\IPipelineExecutor;
 
-class CommandPipeline {
+class PipelineContext {
     private $_client, $_pipelineBuffer, $_returnValues, $_running, $_executor;
 
     public function __construct(Client $client, IPipelineExecutor $executor = null) {

+ 12 - 12
test/ClientFeaturesTest.php

@@ -387,21 +387,21 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
     }
 
 
-    /* Client + CommandPipeline */
+    /* Client + PipelineContext */
 
-    function testCommandPipeline_Simple() {
+    function testPipelineContext_Simple() {
         $client = RC::getConnection();
         $client->flushdb();
 
         $pipe = $client->pipeline();
 
-        $this->assertInstanceOf('\Predis\CommandPipeline', $pipe);
-        $this->assertInstanceOf('\Predis\CommandPipeline', $pipe->set('foo', 'bar'));
-        $this->assertInstanceOf('\Predis\CommandPipeline', $pipe->set('hoge', 'piyo'));
-        $this->assertInstanceOf('\Predis\CommandPipeline', $pipe->mset(array(
+        $this->assertInstanceOf('\Predis\PipelineContext', $pipe);
+        $this->assertInstanceOf('\Predis\PipelineContext', $pipe->set('foo', 'bar'));
+        $this->assertInstanceOf('\Predis\PipelineContext', $pipe->set('hoge', 'piyo'));
+        $this->assertInstanceOf('\Predis\PipelineContext', $pipe->mset(array(
             'foofoo' => 'barbar', 'hogehoge' => 'piyopiyo'
         )));
-        $this->assertInstanceOf('\Predis\CommandPipeline', $pipe->mget(array(
+        $this->assertInstanceOf('\Predis\PipelineContext', $pipe->mget(array(
             'foo', 'hoge', 'foofoo', 'hogehoge'
         )));
 
@@ -412,7 +412,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $this->assertEquals('barbar', $replies[3][2]);
     }
 
-    function testCommandPipeline_FluentInterface() {
+    function testPipelineContext_FluentInterface() {
         $client = RC::getConnection();
         $client->flushdb();
 
@@ -421,7 +421,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $this->assertEquals('bar', $replies[2]);
     }
 
-    function testCommandPipeline_CallableAnonymousBlock() {
+    function testPipelineContext_CallableAnonymousBlock() {
         $client = RC::getConnection();
         $client->flushdb();
 
@@ -435,7 +435,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $this->assertEquals('bar', $replies[2]);
     }
 
-    function testCommandPipeline_ClientExceptionInCallableBlock() {
+    function testPipelineContext_ClientExceptionInCallableBlock() {
         $client = RC::getConnection();
         $client->flushdb();
 
@@ -449,7 +449,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $this->assertFalse($client->exists('foo'));
     }
 
-    function testCommandPipeline_ServerExceptionInCallableBlock() {
+    function testPipelineContext_ServerExceptionInCallableBlock() {
         $client = RC::createConnection(array('throw_errors' => false));
         $client->flushdb();
 
@@ -465,7 +465,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $this->assertTrue($client->exists('hoge'));
     }
 
-    function testCommandPipeline_Flush() {
+    function testPipelineContext_Flush() {
         $client = RC::getConnection();
         $client->flushdb();