ServerVersion22.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?php
  2. namespace Predis\Profiles;
  3. class ServerVersion22 extends ServerProfile
  4. {
  5. public function getVersion()
  6. {
  7. return '2.2';
  8. }
  9. public function getSupportedCommands()
  10. {
  11. return array(
  12. /* ---------------- Redis 1.2 ---------------- */
  13. /* commands operating on the key space */
  14. 'exists' => '\Predis\Commands\KeyExists',
  15. 'del' => '\Predis\Commands\KeyDelete',
  16. 'type' => '\Predis\Commands\KeyType',
  17. 'keys' => '\Predis\Commands\KeyKeys',
  18. 'randomkey' => '\Predis\Commands\KeyRandom',
  19. 'rename' => '\Predis\Commands\KeyRename',
  20. 'renamenx' => '\Predis\Commands\KeyRenamePreserve',
  21. 'expire' => '\Predis\Commands\KeyExpire',
  22. 'expireat' => '\Predis\Commands\KeyExpireAt',
  23. 'ttl' => '\Predis\Commands\KeyTimeToLive',
  24. 'move' => '\Predis\Commands\KeyMove',
  25. 'sort' => '\Predis\Commands\KeySort',
  26. /* commands operating on string values */
  27. 'set' => '\Predis\Commands\StringSet',
  28. 'setnx' => '\Predis\Commands\StringSetPreserve',
  29. 'mset' => '\Predis\Commands\StringSetMultiple',
  30. 'msetnx' => '\Predis\Commands\StringSetMultiplePreserve',
  31. 'get' => '\Predis\Commands\StringGet',
  32. 'mget' => '\Predis\Commands\StringGetMultiple',
  33. 'getset' => '\Predis\Commands\StringGetSet',
  34. 'incr' => '\Predis\Commands\StringIncrement',
  35. 'incrby' => '\Predis\Commands\StringIncrementBy',
  36. 'decr' => '\Predis\Commands\StringDecrement',
  37. 'decrby' => '\Predis\Commands\StringDecrementBy',
  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. /* connection related commands */
  76. 'ping' => '\Predis\Commands\ConnectionPing',
  77. 'auth' => '\Predis\Commands\ConnectionAuth',
  78. 'select' => '\Predis\Commands\ConnectionSelect',
  79. 'echo' => '\Predis\Commands\ConnectionEcho',
  80. 'quit' => '\Predis\Commands\ConnectionQuit',
  81. /* remote server control commands */
  82. 'info' => '\Predis\Commands\ServerInfo',
  83. 'slaveof' => '\Predis\Commands\ServerSlaveOf',
  84. 'monitor' => '\Predis\Commands\ServerMonitor',
  85. 'dbsize' => '\Predis\Commands\ServerDatabaseSize',
  86. 'flushdb' => '\Predis\Commands\ServerFlushDatabase',
  87. 'flushall' => '\Predis\Commands\ServerFlushAll',
  88. 'save' => '\Predis\Commands\ServerSave',
  89. 'bgsave' => '\Predis\Commands\ServerBackgroundSave',
  90. 'lastsave' => '\Predis\Commands\ServerLastSave',
  91. 'shutdown' => '\Predis\Commands\ServerShutdown',
  92. 'bgrewriteaof' => '\Predis\Commands\ServerBackgroundRewriteAOF',
  93. /* ---------------- Redis 2.0 ---------------- */
  94. /* commands operating on string values */
  95. 'setex' => '\Predis\Commands\StringSetExpire',
  96. 'append' => '\Predis\Commands\StringAppend',
  97. 'substr' => '\Predis\Commands\StringSubstr',
  98. /* commands operating on lists */
  99. 'blpop' => '\Predis\Commands\ListPopFirstBlocking',
  100. 'brpop' => '\Predis\Commands\ListPopLastBlocking',
  101. /* commands operating on sorted sets */
  102. 'zunionstore' => '\Predis\Commands\ZSetUnionStore',
  103. 'zinterstore' => '\Predis\Commands\ZSetIntersectionStore',
  104. 'zcount' => '\Predis\Commands\ZSetCount',
  105. 'zrank' => '\Predis\Commands\ZSetRank',
  106. 'zrevrank' => '\Predis\Commands\ZSetReverseRank',
  107. 'zremrangebyrank' => '\Predis\Commands\ZSetRemoveRangeByRank',
  108. /* commands operating on hashes */
  109. 'hset' => '\Predis\Commands\HashSet',
  110. 'hsetnx' => '\Predis\Commands\HashSetPreserve',
  111. 'hmset' => '\Predis\Commands\HashSetMultiple',
  112. 'hincrby' => '\Predis\Commands\HashIncrementBy',
  113. 'hget' => '\Predis\Commands\HashGet',
  114. 'hmget' => '\Predis\Commands\HashGetMultiple',
  115. 'hdel' => '\Predis\Commands\HashDelete',
  116. 'hexists' => '\Predis\Commands\HashExists',
  117. 'hlen' => '\Predis\Commands\HashLength',
  118. 'hkeys' => '\Predis\Commands\HashKeys',
  119. 'hvals' => '\Predis\Commands\HashValues',
  120. 'hgetall' => '\Predis\Commands\HashGetAll',
  121. /* transactions */
  122. 'multi' => '\Predis\Commands\TransactionMulti',
  123. 'exec' => '\Predis\Commands\TransactionExec',
  124. 'discard' => '\Predis\Commands\TransactionDiscard',
  125. /* publish - subscribe */
  126. 'subscribe' => '\Predis\Commands\PubSubSubscribe',
  127. 'unsubscribe' => '\Predis\Commands\PubSubUnsubscribe',
  128. 'psubscribe' => '\Predis\Commands\PubSubSubscribeByPattern',
  129. 'punsubscribe' => '\Predis\Commands\PubSubUnsubscribeByPattern',
  130. 'publish' => '\Predis\Commands\PubSubPublish',
  131. /* remote server control commands */
  132. 'config' => '\Predis\Commands\ServerConfig',
  133. /* ---------------- Redis 2.2 ---------------- */
  134. /* commands operating on the key space */
  135. 'persist' => '\Predis\Commands\KeyPersist',
  136. /* commands operating on string values */
  137. 'strlen' => '\Predis\Commands\StringStrlen',
  138. 'setrange' => '\Predis\Commands\StringSetRange',
  139. 'getrange' => '\Predis\Commands\StringGetRange',
  140. 'setbit' => '\Predis\Commands\StringSetBit',
  141. 'getbit' => '\Predis\Commands\StringGetBit',
  142. /* commands operating on lists */
  143. 'rpushx' => '\Predis\Commands\ListPushTailX',
  144. 'lpushx' => '\Predis\Commands\ListPushHeadX',
  145. 'linsert' => '\Predis\Commands\ListInsert',
  146. 'brpoplpush' => '\Predis\Commands\ListPopLastPushHeadBlocking',
  147. /* commands operating on sorted sets */
  148. 'zrevrangebyscore' => '\Predis\Commands\ZSetReverseRangeByScore',
  149. /* transactions */
  150. 'watch' => '\Predis\Commands\TransactionWatch',
  151. 'unwatch' => '\Predis\Commands\TransactionUnwatch',
  152. /* remote server control commands */
  153. 'object' => '\Predis\Commands\ServerObject',
  154. );
  155. }
  156. }