mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
Predis\Client::multiExec is now aware of iterable multi-bulk responses.
This commit is contained in:
+8
-2
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user