Explorar o código

Bugfix: the response parser for KEYS raises a E_WARNING when using iterators for multi bulk responses against Redis v2.0.

Daniele Alessandri %!s(int64=15) %!d(string=hai) anos
pai
achega
ce00cb14b9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/Predis.php

+ 1 - 1
lib/Predis.php

@@ -1497,7 +1497,7 @@ class Keys extends \Predis\InlineCommand {
     public function getCommandId() { return 'KEYS'; }
     public function parseResponse($data) { 
         // TODO: is this behaviour correct?
-        if (is_array($data)) {
+        if (is_array($data) || $data instanceof \Iterator) {
             return $data;
         }
         return strlen($data) > 0 ? explode(' ', $data) : array();