|
@@ -837,6 +837,171 @@ abstract class RedisServerCompatibility {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class RedisServer__V1_0 extends RedisServerCompatibility {
|
|
|
+ public function getVersion() { return 1.0; }
|
|
|
+ public function getSupportedCommands() {
|
|
|
+ return array(
|
|
|
+ /* miscellaneous commands */
|
|
|
+ 'ping' => '\Predis\Commands\Ping',
|
|
|
+ 'echo' => '\Predis\Commands\DoEcho',
|
|
|
+ 'auth' => '\Predis\Commands\Auth',
|
|
|
+
|
|
|
+ /* connection handling */
|
|
|
+ 'quit' => '\Predis\Commands\Quit',
|
|
|
+
|
|
|
+ /* commands operating on string values */
|
|
|
+ 'set' => '\Predis\Commands\Set',
|
|
|
+ 'setnx' => '\Predis\Commands\SetPreserve',
|
|
|
+ 'setPreserve' => '\Predis\Commands\SetPreserve',
|
|
|
+ 'get' => '\Predis\Commands\Get',
|
|
|
+ 'mget' => '\Predis\Commands\GetMultiple',
|
|
|
+ 'getMultiple' => '\Predis\Commands\GetMultiple',
|
|
|
+ 'getset' => '\Predis\Commands\GetSet',
|
|
|
+ 'getSet' => '\Predis\Commands\GetSet',
|
|
|
+ 'incr' => '\Predis\Commands\Increment',
|
|
|
+ 'increment' => '\Predis\Commands\Increment',
|
|
|
+ 'incrby' => '\Predis\Commands\IncrementBy',
|
|
|
+ 'incrementBy' => '\Predis\Commands\IncrementBy',
|
|
|
+ 'incr' => '\Predis\Commands\Decrement',
|
|
|
+ 'decrement' => '\Predis\Commands\Decrement',
|
|
|
+ 'decrby' => '\Predis\Commands\DecrementBy',
|
|
|
+ 'decrementBy' => '\Predis\Commands\DecrementBy',
|
|
|
+ 'exists' => '\Predis\Commands\Exists',
|
|
|
+ 'del' => '\Predis\Commands\Delete',
|
|
|
+ 'delete' => '\Predis\Commands\Delete',
|
|
|
+ 'type' => '\Predis\Commands\Type',
|
|
|
+
|
|
|
+ /* commands operating on the key space */
|
|
|
+ 'keys' => '\Predis\Commands\Keys',
|
|
|
+ 'randomkey' => '\Predis\Commands\RandomKey',
|
|
|
+ 'randomKey' => '\Predis\Commands\RandomKey',
|
|
|
+ 'rename' => '\Predis\Commands\Rename',
|
|
|
+ 'renamenx' => '\Predis\Commands\RenamePreserve',
|
|
|
+ 'renamePreserve' => '\Predis\Commands\RenamePreserve',
|
|
|
+ 'expire' => '\Predis\Commands\Expire',
|
|
|
+ 'expireat' => '\Predis\Commands\ExpireAt',
|
|
|
+ 'expireAt' => '\Predis\Commands\ExpireAt',
|
|
|
+ 'dbsize' => '\Predis\Commands\DatabaseSize',
|
|
|
+ 'databaseSize' => '\Predis\Commands\DatabaseSize',
|
|
|
+ 'ttl' => '\Predis\Commands\TimeToLive',
|
|
|
+ 'timeToLive' => '\Predis\Commands\TimeToLive',
|
|
|
+
|
|
|
+ /* commands operating on lists */
|
|
|
+ 'rpush' => '\Predis\Commands\ListPushTail',
|
|
|
+ 'pushTail' => '\Predis\Commands\ListPushTail',
|
|
|
+ 'lpush' => '\Predis\Commands\ListPushHead',
|
|
|
+ 'pushHead' => '\Predis\Commands\ListPushHead',
|
|
|
+ 'llen' => '\Predis\Commands\ListLength',
|
|
|
+ 'listLength' => '\Predis\Commands\ListLength',
|
|
|
+ 'lrange' => '\Predis\Commands\ListRange',
|
|
|
+ 'listRange' => '\Predis\Commands\ListRange',
|
|
|
+ 'ltrim' => '\Predis\Commands\ListTrim',
|
|
|
+ 'listTrim' => '\Predis\Commands\ListTrim',
|
|
|
+ 'lindex' => '\Predis\Commands\ListIndex',
|
|
|
+ 'listIndex' => '\Predis\Commands\ListIndex',
|
|
|
+ 'lset' => '\Predis\Commands\ListSet',
|
|
|
+ 'listSet' => '\Predis\Commands\ListSet',
|
|
|
+ 'lrem' => '\Predis\Commands\ListRemove',
|
|
|
+ 'listRemove' => '\Predis\Commands\ListRemove',
|
|
|
+ 'lpop' => '\Predis\Commands\ListPopFirst',
|
|
|
+ 'popFirst' => '\Predis\Commands\ListPopFirst',
|
|
|
+ 'rpop' => '\Predis\Commands\ListPopLast',
|
|
|
+ 'popLast' => '\Predis\Commands\ListPopLast',
|
|
|
+
|
|
|
+ /* commands operating on sets */
|
|
|
+ 'sadd' => '\Predis\Commands\SetAdd',
|
|
|
+ 'setAdd' => '\Predis\Commands\SetAdd',
|
|
|
+ 'srem' => '\Predis\Commands\SetRemove',
|
|
|
+ 'setRemove' => '\Predis\Commands\SetRemove',
|
|
|
+ 'spop' => '\Predis\Commands\SetPop',
|
|
|
+ 'setPop' => '\Predis\Commands\SetPop',
|
|
|
+ 'smove' => '\Predis\Commands\SetMove',
|
|
|
+ 'setMove' => '\Predis\Commands\SetMove',
|
|
|
+ 'scard' => '\Predis\Commands\SetCardinality',
|
|
|
+ 'setCardinality' => '\Predis\Commands\SetCardinality',
|
|
|
+ 'sismember' => '\Predis\Commands\SetIsMember',
|
|
|
+ 'setIsMember' => '\Predis\Commands\SetIsMember',
|
|
|
+ 'sinter' => '\Predis\Commands\SetIntersection',
|
|
|
+ 'setIntersection' => '\Predis\Commands\SetIntersection',
|
|
|
+ 'sinterstore' => '\Predis\Commands\SetIntersectionStore',
|
|
|
+ 'setIntersectionStore' => '\Predis\Commands\SetIntersectionStore',
|
|
|
+ 'sunion' => '\Predis\Commands\SetUnion',
|
|
|
+ 'setUnion' => '\Predis\Commands\SetUnion',
|
|
|
+ 'sunionstore' => '\Predis\Commands\SetUnionStore',
|
|
|
+ 'setUnionStore' => '\Predis\Commands\SetUnionStore',
|
|
|
+ 'sdiff' => '\Predis\Commands\SetDifference',
|
|
|
+ 'setDifference' => '\Predis\Commands\SetDifference',
|
|
|
+ 'sdiffstore' => '\Predis\Commands\SetDifferenceStore',
|
|
|
+ 'setDifferenceStore' => '\Predis\Commands\SetDifferenceStore',
|
|
|
+ 'smembers' => '\Predis\Commands\SetMembers',
|
|
|
+ 'setMembers' => '\Predis\Commands\SetMembers',
|
|
|
+ 'srandmember' => '\Predis\Commands\SetRandomMember',
|
|
|
+ 'setRandomMember' => '\Predis\Commands\SetRandomMember',
|
|
|
+
|
|
|
+ /* multiple databases handling commands */
|
|
|
+ 'select' => '\Predis\Commands\SelectDatabase',
|
|
|
+ 'selectDatabase' => '\Predis\Commands\SelectDatabase',
|
|
|
+ 'move' => '\Predis\Commands\MoveKey',
|
|
|
+ 'moveKey' => '\Predis\Commands\MoveKey',
|
|
|
+ 'flushdb' => '\Predis\Commands\FlushDatabase',
|
|
|
+ 'flushDatabase' => '\Predis\Commands\FlushDatabase',
|
|
|
+ 'flushall' => '\Predis\Commands\FlushAll',
|
|
|
+ 'flushDatabases' => '\Predis\Commands\FlushAll',
|
|
|
+
|
|
|
+ /* sorting */
|
|
|
+ 'sort' => '\Predis\Commands\Sort',
|
|
|
+
|
|
|
+ /* remote server control commands */
|
|
|
+ 'info' => '\Predis\Commands\Info',
|
|
|
+ 'slaveof' => '\Predis\Commands\SlaveOf',
|
|
|
+ 'slaveOf' => '\Predis\Commands\SlaveOf',
|
|
|
+
|
|
|
+ /* persistence control commands */
|
|
|
+ 'save' => '\Predis\Commands\Save',
|
|
|
+ 'bgsave' => '\Predis\Commands\BackgroundSave',
|
|
|
+ 'backgroundSave' => '\Predis\Commands\BackgroundSave',
|
|
|
+ 'lastsave' => '\Predis\Commands\LastSave',
|
|
|
+ 'lastSave' => '\Predis\Commands\LastSave',
|
|
|
+ 'shutdown' => '\Predis\Commands\Shutdown'
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class RedisServer__V1_2 extends RedisServer__V1_0 {
|
|
|
+ public function getVersion() { return 1.2; }
|
|
|
+ public function getSupportedCommands() {
|
|
|
+ return array_merge(parent::getSupportedCommands(), array(
|
|
|
+ /* commands operating on string values */
|
|
|
+ 'mset' => '\Predis\Commands\SetMultiple',
|
|
|
+ 'setMultiple' => '\Predis\Commands\SetMultiple',
|
|
|
+ 'msetnx' => '\Predis\Commands\SetMultiplePreserve',
|
|
|
+ 'setMultiplePreserve' => '\Predis\Commands\SetMultiplePreserve',
|
|
|
+
|
|
|
+ /* commands operating on lists */
|
|
|
+ 'rpoplpush' => '\Predis\Commands\ListPushTailPopFirst',
|
|
|
+ 'listPopLastPushHead' => '\Predis\Commands\ListPopLastPushHead',
|
|
|
+
|
|
|
+ /* commands operating on sorted sets */
|
|
|
+ 'zadd' => '\Predis\Commands\ZSetAdd',
|
|
|
+ 'zsetAdd' => '\Predis\Commands\ZSetAdd',
|
|
|
+ 'zrem' => '\Predis\Commands\ZSetRemove',
|
|
|
+ 'zsetRemove' => '\Predis\Commands\ZSetRemove',
|
|
|
+ 'zrange' => '\Predis\Commands\ZSetRange',
|
|
|
+ 'zsetRange' => '\Predis\Commands\ZSetRange',
|
|
|
+ 'zrevrange' => '\Predis\Commands\ZSetReverseRange',
|
|
|
+ 'zsetReverseRange' => '\Predis\Commands\ZSetReverseRange',
|
|
|
+ 'zrangebyscore' => '\Predis\Commands\ZSetRangeByScore',
|
|
|
+ 'zsetRangeByScore' => '\Predis\Commands\ZSetRangeByScore',
|
|
|
+ 'zcard' => '\Predis\Commands\ZSetCardinality',
|
|
|
+ 'zsetCardinality' => '\Predis\Commands\ZSetCardinality',
|
|
|
+ 'zscore' => '\Predis\Commands\ZSetScore',
|
|
|
+ 'zsetScore' => '\Predis\Commands\ZSetScore',
|
|
|
+ 'zremrangebyscore' => '\Predis\Commands\ZSetRemoveRangeByScore',
|
|
|
+ 'zsetRemoveRangeByScore' => '\Predis\Commands\ZSetRemoveRangeByScore'
|
|
|
+ ));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
|
namespace Predis\Utilities;
|