Selaa lähdekoodia

Predis\Commands\Keys has been adjusted to handle the change in its reply type in a backwards-compatible way (the KEYS command will return a multibulk reply starting from Redis 2.0).

Daniele Alessandri 15 vuotta sitten
vanhempi
commit
e114f86d64
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      lib/Predis.php

+ 3 - 0
lib/Predis.php

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