Эх сурвалжийг харах

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

Daniele Alessandri 15 жил өмнө
parent
commit
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]);
         }
     }