ServerVersion22.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php
  2. namespace Predis\Profiles;
  3. class ServerVersion22 extends ServerProfile {
  4. public function getVersion() { return '2.2'; }
  5. public function getSupportedCommands() {
  6. return array(
  7. /* ---------------- Redis 1.2 ---------------- */
  8. /* miscellaneous commands */
  9. 'ping' => '\Predis\Commands\Ping',
  10. 'echo' => '\Predis\Commands\DoEcho',
  11. 'auth' => '\Predis\Commands\Auth',
  12. /* connection handling */
  13. 'quit' => '\Predis\Commands\Quit',
  14. /* commands operating on string values */
  15. 'set' => '\Predis\Commands\Set',
  16. 'setnx' => '\Predis\Commands\SetPreserve',
  17. 'mset' => '\Predis\Commands\SetMultiple',
  18. 'msetnx' => '\Predis\Commands\SetMultiplePreserve',
  19. 'get' => '\Predis\Commands\Get',
  20. 'mget' => '\Predis\Commands\GetMultiple',
  21. 'getset' => '\Predis\Commands\GetSet',
  22. 'incr' => '\Predis\Commands\Increment',
  23. 'incrby' => '\Predis\Commands\IncrementBy',
  24. 'decr' => '\Predis\Commands\Decrement',
  25. 'decrby' => '\Predis\Commands\DecrementBy',
  26. 'exists' => '\Predis\Commands\Exists',
  27. 'del' => '\Predis\Commands\Delete',
  28. 'type' => '\Predis\Commands\Type',
  29. /* commands operating on the key space */
  30. 'keys' => '\Predis\Commands\Keys',
  31. 'randomkey' => '\Predis\Commands\RandomKey',
  32. 'rename' => '\Predis\Commands\Rename',
  33. 'renamenx' => '\Predis\Commands\RenamePreserve',
  34. 'expire' => '\Predis\Commands\Expire',
  35. 'expireat' => '\Predis\Commands\ExpireAt',
  36. 'dbsize' => '\Predis\Commands\DatabaseSize',
  37. 'ttl' => '\Predis\Commands\TimeToLive',
  38. /* commands operating on lists */
  39. 'rpush' => '\Predis\Commands\ListPushTail',
  40. 'lpush' => '\Predis\Commands\ListPushHead',
  41. 'llen' => '\Predis\Commands\ListLength',
  42. 'lrange' => '\Predis\Commands\ListRange',
  43. 'ltrim' => '\Predis\Commands\ListTrim',
  44. 'lindex' => '\Predis\Commands\ListIndex',
  45. 'lset' => '\Predis\Commands\ListSet',
  46. 'lrem' => '\Predis\Commands\ListRemove',
  47. 'lpop' => '\Predis\Commands\ListPopFirst',
  48. 'rpop' => '\Predis\Commands\ListPopLast',
  49. 'rpoplpush' => '\Predis\Commands\ListPopLastPushHead',
  50. /* commands operating on sets */
  51. 'sadd' => '\Predis\Commands\SetAdd',
  52. 'srem' => '\Predis\Commands\SetRemove',
  53. 'spop' => '\Predis\Commands\SetPop',
  54. 'smove' => '\Predis\Commands\SetMove',
  55. 'scard' => '\Predis\Commands\SetCardinality',
  56. 'sismember' => '\Predis\Commands\SetIsMember',
  57. 'sinter' => '\Predis\Commands\SetIntersection',
  58. 'sinterstore' => '\Predis\Commands\SetIntersectionStore',
  59. 'sunion' => '\Predis\Commands\SetUnion',
  60. 'sunionstore' => '\Predis\Commands\SetUnionStore',
  61. 'sdiff' => '\Predis\Commands\SetDifference',
  62. 'sdiffstore' => '\Predis\Commands\SetDifferenceStore',
  63. 'smembers' => '\Predis\Commands\SetMembers',
  64. 'srandmember' => '\Predis\Commands\SetRandomMember',
  65. /* commands operating on sorted sets */
  66. 'zadd' => '\Predis\Commands\ZSetAdd',
  67. 'zincrby' => '\Predis\Commands\ZSetIncrementBy',
  68. 'zrem' => '\Predis\Commands\ZSetRemove',
  69. 'zrange' => '\Predis\Commands\ZSetRange',
  70. 'zrevrange' => '\Predis\Commands\ZSetReverseRange',
  71. 'zrangebyscore' => '\Predis\Commands\ZSetRangeByScore',
  72. 'zcard' => '\Predis\Commands\ZSetCardinality',
  73. 'zscore' => '\Predis\Commands\ZSetScore',
  74. 'zremrangebyscore' => '\Predis\Commands\ZSetRemoveRangeByScore',
  75. /* multiple databases handling commands */
  76. 'select' => '\Predis\Commands\SelectDatabase',
  77. 'move' => '\Predis\Commands\MoveKey',
  78. 'flushdb' => '\Predis\Commands\FlushDatabase',
  79. 'flushall' => '\Predis\Commands\FlushAll',
  80. /* sorting */
  81. 'sort' => '\Predis\Commands\Sort',
  82. /* remote server control commands */
  83. 'info' => '\Predis\Commands\Info',
  84. 'slaveof' => '\Predis\Commands\SlaveOf',
  85. 'monitor' => '\Predis\Commands\Monitor',
  86. /* persistence control commands */
  87. 'save' => '\Predis\Commands\Save',
  88. 'bgsave' => '\Predis\Commands\BackgroundSave',
  89. 'lastsave' => '\Predis\Commands\LastSave',
  90. 'shutdown' => '\Predis\Commands\Shutdown',
  91. 'bgrewriteaof' => '\Predis\Commands\BackgroundRewriteAppendOnlyFile',
  92. /* ---------------- Redis 2.0 ---------------- */
  93. /* transactions */
  94. 'multi' => '\Predis\Commands\Multi',
  95. 'exec' => '\Predis\Commands\Exec',
  96. 'discard' => '\Predis\Commands\Discard',
  97. /* commands operating on string values */
  98. 'setex' => '\Predis\Commands\SetExpire',
  99. 'append' => '\Predis\Commands\Append',
  100. 'substr' => '\Predis\Commands\Substr',
  101. /* commands operating on lists */
  102. 'blpop' => '\Predis\Commands\ListPopFirstBlocking',
  103. 'brpop' => '\Predis\Commands\ListPopLastBlocking',
  104. /* commands operating on sorted sets */
  105. 'zunionstore' => '\Predis\Commands\ZSetUnionStore',
  106. 'zinterstore' => '\Predis\Commands\ZSetIntersectionStore',
  107. 'zcount' => '\Predis\Commands\ZSetCount',
  108. 'zrank' => '\Predis\Commands\ZSetRank',
  109. 'zrevrank' => '\Predis\Commands\ZSetReverseRank',
  110. 'zremrangebyrank' => '\Predis\Commands\ZSetRemoveRangeByRank',
  111. /* commands operating on hashes */
  112. 'hset' => '\Predis\Commands\HashSet',
  113. 'hsetnx' => '\Predis\Commands\HashSetPreserve',
  114. 'hmset' => '\Predis\Commands\HashSetMultiple',
  115. 'hincrby' => '\Predis\Commands\HashIncrementBy',
  116. 'hget' => '\Predis\Commands\HashGet',
  117. 'hmget' => '\Predis\Commands\HashGetMultiple',
  118. 'hdel' => '\Predis\Commands\HashDelete',
  119. 'hexists' => '\Predis\Commands\HashExists',
  120. 'hlen' => '\Predis\Commands\HashLength',
  121. 'hkeys' => '\Predis\Commands\HashKeys',
  122. 'hvals' => '\Predis\Commands\HashValues',
  123. 'hgetall' => '\Predis\Commands\HashGetAll',
  124. /* publish - subscribe */
  125. 'subscribe' => '\Predis\Commands\Subscribe',
  126. 'unsubscribe' => '\Predis\Commands\Unsubscribe',
  127. 'psubscribe' => '\Predis\Commands\SubscribeByPattern',
  128. 'punsubscribe' => '\Predis\Commands\UnsubscribeByPattern',
  129. 'publish' => '\Predis\Commands\Publish',
  130. /* remote server control commands */
  131. 'config' => '\Predis\Commands\Config',
  132. /* ---------------- Redis 2.2 ---------------- */
  133. /* transactions */
  134. 'watch' => '\Predis\Commands\Watch',
  135. 'unwatch' => '\Predis\Commands\Unwatch',
  136. /* commands operating on string values */
  137. 'strlen' => '\Predis\Commands\Strlen',
  138. 'setrange' => '\Predis\Commands\SetRange',
  139. 'getrange' => '\Predis\Commands\GetRange',
  140. 'setbit' => '\Predis\Commands\SetBit',
  141. 'getbit' => '\Predis\Commands\GetBit',
  142. /* commands operating on the key space */
  143. 'persist' => '\Predis\Commands\Persist',
  144. /* commands operating on lists */
  145. 'rpushx' => '\Predis\Commands\ListPushTailX',
  146. 'lpushx' => '\Predis\Commands\ListPushHeadX',
  147. 'linsert' => '\Predis\Commands\ListInsert',
  148. 'brpoplpush' => '\Predis\Commands\ListPopLastPushHeadBlocking',
  149. /* commands operating on sorted sets */
  150. 'zrevrangebyscore' => '\Predis\Commands\ZSetReverseRangeByScore',
  151. /* remote server control commands */
  152. 'object' => '\Predis\Commands\DebugObject',
  153. );
  154. }
  155. }