From 8df4eaf7b386d34d8c56c30711ea69fddcc012dd Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Thu, 25 Feb 2010 12:44:13 +0100 Subject: [PATCH] Predis\Client::multiExec is now aware of iterable multi-bulk responses. --- lib/Predis.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Predis.php b/lib/Predis.php index 3f1a3a3b..d7a60255 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -522,7 +522,10 @@ class MultiExecBlock { $block($this); } - $execReply = $this->_redisClient->exec(); + $execReply = (($reply = $this->_redisClient->exec()) instanceof \Iterator + ? iterator_to_array($reply) + : $reply + ); $commands = &$this->_commands; $sizeofReplies = count($execReply); @@ -532,7 +535,10 @@ class MultiExecBlock { } for ($i = 0; $i < $sizeofReplies; $i++) { - $returnValues[] = $commands[$i]->parseResponse($execReply[$i]); + $returnValues[] = $commands[$i]->parseResponse($execReply[$i] instanceof \Iterator + ? iterator_to_array($execReply[$i]) + : $execReply[$i] + ); unset($commands[$i]); } }