Преглед изворни кода

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

Daniele Alessandri пре 16 година
родитељ
комит
701e06443c
1 измењених фајлова са 5 додато и 1 уклоњено
  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]);
         }
     }