Browse Source

Ensure that iterators returned by multi-bulk replies inside a pipeline are stored in the replies buffer as arrays.

Daniele Alessandri 15 years ago
parent
commit
701e06443c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/Predis.php

+ 5 - 1
lib/Predis.php

@@ -435,7 +435,11 @@ class CommandPipeline {
             $connection->writeCommand($command);
         }
         for ($i = 0; $i < $sizeofPipe; $i++) {
-            $this->_returnValues[] = $connection->readResponse($commands[$i]);
+            $response = $connection->readResponse($commands[$i]);
+            $this->_returnValues[] = ($response instanceof \Iterator
+                ? iterator_to_array($response)
+                : $response
+            );
             unset($commands[$i]);
         }
     }