From ce00cb14b91b031c0db4fb3de0621f891a8ff3ca Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Wed, 10 Mar 2010 23:45:04 +0100 Subject: [PATCH] Bugfix: the response parser for KEYS raises a E_WARNING when using iterators for multi bulk responses against Redis v2.0. --- lib/Predis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Predis.php b/lib/Predis.php index 6e65375b..90a3d0d8 100644 --- a/lib/Predis.php +++ b/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();