mirror of
https://github.com/predis/predis.git
synced 2026-08-30 20:21:31 +00:00
Do not use new classes for variadic RPUSH, LPUSH, SADD, SREM and HDEL in the 2.4 profile.
This commit is contained in:
@@ -2,11 +2,17 @@
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class HashDelete extends Command {
|
||||
public function getId() {
|
||||
return 'HDEL';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
|
||||
public function parseResponse($data) {
|
||||
return (bool) $data;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class HashDeleteV24x extends Command {
|
||||
public function getId() {
|
||||
return 'HDEL';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
|
||||
public function parseResponse($data) {
|
||||
return (bool) $data;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
class ListPushHead extends Command {
|
||||
class ListPushHead extends ListPushTail {
|
||||
public function getId() {
|
||||
return 'LPUSH';
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
class ListPushHeadV24x extends ListPushTailV24x {
|
||||
public function getId() {
|
||||
return 'LPUSH';
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,14 @@
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class ListPushTail extends Command {
|
||||
public function getId() {
|
||||
return 'RPUSH';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class ListPushTailV24x extends Command {
|
||||
public function getId() {
|
||||
return 'RPUSH';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,17 @@
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class SetAdd extends Command {
|
||||
public function getId() {
|
||||
return 'SADD';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
|
||||
public function parseResponse($data) {
|
||||
return (bool) $data;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class SetAddV24x extends Command {
|
||||
public function getId() {
|
||||
return 'SADD';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
|
||||
public function parseResponse($data) {
|
||||
return (bool) $data;
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,17 @@
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class SetRemove extends Command {
|
||||
public function getId() {
|
||||
return 'SREM';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
|
||||
public function parseResponse($data) {
|
||||
return (bool) $data;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Predis\Commands;
|
||||
|
||||
use Predis\Helpers;
|
||||
|
||||
class SetRemoveV24x extends Command {
|
||||
public function getId() {
|
||||
return 'SREM';
|
||||
}
|
||||
|
||||
protected function filterArguments(Array $arguments) {
|
||||
return Helpers::filterVariadicValues($arguments);
|
||||
}
|
||||
|
||||
public function parseResponse($data) {
|
||||
return (bool) $data;
|
||||
}
|
||||
}
|
||||
@@ -6,17 +6,6 @@ class ServerVersionNext extends ServerVersion22 {
|
||||
public function getVersion() { return '2.4'; }
|
||||
public function getSupportedCommands() {
|
||||
return array_merge(parent::getSupportedCommands(), array(
|
||||
/* commands operating on lists */
|
||||
'rpush' => '\Predis\Commands\ListPushTailV24x',
|
||||
'lpush' => '\Predis\Commands\ListPushHeadV24x',
|
||||
|
||||
/* commands operating on sets */
|
||||
'sadd' => '\Predis\Commands\SetAddV24x',
|
||||
'srem' => '\Predis\Commands\SetRemoveV24x',
|
||||
|
||||
/* commands operating on hashes */
|
||||
'hdel' => '\Predis\Commands\HashDeleteV24x',
|
||||
|
||||
/* remote server control commands */
|
||||
'info' => '\Predis\Commands\ServerInfoV24x',
|
||||
'client' => '\Predis\Commands\ServerClient',
|
||||
|
||||
Reference in New Issue
Block a user