mirror of
https://github.com/predis/predis.git
synced 2026-09-13 11:57:02 +00:00
No more implicit serialization for an array instance passed as the single argument of a MultiBulkCommand.
This commit is contained in:
+14
-6
@@ -422,11 +422,7 @@ abstract class MultiBulkCommand extends Command {
|
||||
$argsc = count($arguments);
|
||||
|
||||
if ($argsc === 1 && is_array($arguments[0])) {
|
||||
$cmd_args = array();
|
||||
foreach ($arguments[0] as $k => $v) {
|
||||
$cmd_args[] = $k;
|
||||
$cmd_args[] = $v;
|
||||
}
|
||||
$cmd_args = $arguments[0];
|
||||
$argsc = count($cmd_args);
|
||||
}
|
||||
else {
|
||||
@@ -1802,9 +1798,21 @@ class SetPreserve extends \Predis\BulkCommand {
|
||||
class SetMultiple extends \Predis\MultiBulkCommand {
|
||||
public function canBeHashed() { return false; }
|
||||
public function getCommandId() { return 'MSET'; }
|
||||
public function filterArguments(Array $arguments) {
|
||||
if (count($arguments) === 1 && is_array($arguments[0])) {
|
||||
$flattenedKVs = array();
|
||||
$args = &$arguments[0];
|
||||
foreach ($args as $k => $v) {
|
||||
$flattenedKVs[] = $k;
|
||||
$flattenedKVs[] = $v;
|
||||
}
|
||||
return $flattenedKVs;
|
||||
}
|
||||
return $arguments;
|
||||
}
|
||||
}
|
||||
|
||||
class SetMultiplePreserve extends \Predis\MultiBulkCommand {
|
||||
class SetMultiplePreserve extends \Predis\Commands\SetMultiple {
|
||||
public function canBeHashed() { return false; }
|
||||
public function getCommandId() { return 'MSETNX'; }
|
||||
public function parseResponse($data) { return (bool) $data; }
|
||||
|
||||
Reference in New Issue
Block a user