mirror of
https://github.com/predis/predis.git
synced 2026-09-01 13:19:39 +00:00
Support the different replies of CONFIG GET|SET|RESETSTAT.
This commit is contained in:
@@ -13,4 +13,4 @@
|
||||
|
||||
* Missing tests for commands:
|
||||
PUBLISH, SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, DEBUG, OBJECT,
|
||||
CLIENT
|
||||
CLIENT, CONFIG GET, CONFIG SET, CONFIG RESETSTAT
|
||||
|
||||
@@ -11,8 +11,12 @@
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Iterators\MultiBulkResponseTuple;
|
||||
|
||||
/**
|
||||
* @link http://redis.io/commands/config
|
||||
* @link http://redis.io/commands/config-set
|
||||
* @link http://redis.io/commands/config-get
|
||||
* @link http://redis.io/commands/config-resetstat
|
||||
* @author Daniele Alessandri <suppakilla@gmail.com>
|
||||
*/
|
||||
class ServerConfig extends Command
|
||||
@@ -40,4 +44,25 @@ class ServerConfig extends Command
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function parseResponse($data)
|
||||
{
|
||||
if ($data instanceof \Iterator) {
|
||||
return new MultiBulkResponseTuple($data);
|
||||
}
|
||||
|
||||
if (is_array($data)) {
|
||||
$result = array();
|
||||
for ($i = 0; $i < count($data); $i++) {
|
||||
$result[$data[$i]] = $data[++$i];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user