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

This commit is contained in:
Daniele Alessandri
2010-03-10 23:45:04 +01:00
parent daf6dbd7c2
commit ce00cb14b9
+1 -1
View File
@@ -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();