Fix wrong serialization for commands that do not have arguments.

This commit is contained in:
Daniele Alessandri
2011-06-06 12:49:38 +02:00
parent ff7812282e
commit 0de4af07dd
+9 -4
View File
@@ -129,14 +129,19 @@ class WebdisConnection implements IConnectionSingle {
}
public function executeCommand(ICommand $command) {
$commandId = $this->getCommandId($command);
$arguments = implode('/', array_map('urlencode', $command->getArguments()));
$request = new HttpRequest($this->_webdisUrl, HttpRequest::METH_POST);
if ($options = $this->getHttpOptions()) {
$request->setOptions($options);
}
$request->setBody("$commandId/$arguments.raw");
$commandId = $this->getCommandId($command);
if ($arguments = $command->getArguments()) {
$arguments = implode('/', array_map('urlencode', $arguments));
$request->setBody("$commandId/$arguments.raw");
}
else {
$request->setBody("$commandId.raw");
}
$response = $request->send();
phpiredis_reader_feed($this->_reader, $response->getBody());