ServerVersion22.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?php
  2. namespace Predis\Profiles;
  3. class ServerVersion22 extends ServerProfile {
  4. public function getVersion()
  5. {
  6. return '2.2';
  7. }
  8. public function getSupportedCommands()
  9. {
  10. return array(
  11. /* ---------------- Redis 1.2 ---------------- */
  12. /* commands operating on the key space */
  13. 'exists' => '\Predis\Commands\KeyExists',
  14. 'del' => '\Predis\Commands\KeyDelete',
  15. 'type' => '\Predis\Commands\KeyType',
  16. 'keys' => '\Predis\Commands\KeyKeys',
  17. 'randomkey' => '\Predis\Commands\KeyRandom',
  18. 'rename' => '\Predis\Commands\KeyRename',
  19. 'renamenx' => '\Predis\Commands\KeyRenamePreserve',
  20. 'expire' => '\Predis\Commands\KeyExpire',
  21. 'expireat' => '\Predis\Commands\KeyExpireAt',
  22. 'ttl' => '\Predis\Commands\KeyTimeToLive',
  23. 'move' => '\Predis\Commands\KeyMove',
  24. 'sort' => '\Predis\Commands\KeySort',
  25. /* commands operating on string values */
  26. 'set' => '\Predis\Commands\StringSet',
  27. 'setnx' => '\Predis\Commands\StringSetPreserve',
  28. 'mset' => '\Predis\Commands\StringSetMultiple',
  29. 'msetnx' => '\Predis\Commands\StringSetMultiplePreserve',
  30. 'get' => '\Predis\Commands\StringGet',
  31. 'mget' => '\Predis\Commands\StringGetMultiple',
  32. 'getset' => '\Predis\Commands\StringGetSet',
  33. 'incr' => '\Predis\Commands\StringIncrement',
  34. 'incrby' => '\Predis\Commands\StringIncrementBy',
  35. 'decr' => '\Predis\Commands\StringDecrement',
  36. 'decrby' => '\Predis\Commands\StringDecrementBy',
  37. /* commands operating on lists */
  38. 'rpush' => '\Predis\Commands\ListPushTail',
  39. 'lpush' => '\Predis\Commands\ListPushHead',
  40. 'llen' => '\Predis\Commands\ListLength',
  41. 'lrange' => '\Predis\Commands\ListRange',
  42. 'ltrim' => '\Predis\Commands\ListTrim',
  43. 'lindex' => '\Predis\Commands\ListIndex',
  44. 'lset' => '\Predis\Commands\ListSet',
  45. 'lrem' => '\Predis\Commands\ListRemove',
  46. 'lpop' => '\Predis\Commands\ListPopFirst',
  47. 'rpop' => '\Predis\Commands\ListPopLast',
  48. 'rpoplpush' => '\Predis\Commands\ListPopLastPushHead',
  49. /* commands operating on sets */
  50. 'sadd' => '\Predis\Commands\SetAdd',
  51. 'srem' => '\Predis\Commands\SetRemove',
  52. 'spop' => '\Predis\Commands\SetPop',
  53. 'smove' => '\Predis\Commands\SetMove',
  54. 'scard' => '\Predis\Commands\SetCardinality',
  55. 'sismember' => '\Predis\Commands\SetIsMember',
  56. 'sinter' => '\Predis\Commands\SetIntersection',
  57. 'sinterstore' => '\Predis\Commands\SetIntersectionStore',
  58. 'sunion' => '\Predis\Commands\SetUnion',
  59. 'sunionstore' => '\Predis\Commands\SetUnionStore',
  60. 'sdiff' => '\Predis\Commands\SetDifference',
  61. 'sdiffstore' => '\Predis\Commands\SetDifferenceStore',
  62. 'smembers' => '\Predis\Commands\SetMembers',
  63. 'srandmember' => '\Predis\Commands\SetRandomMember',
  64. /* commands operating on sorted sets */
  65. 'zadd' => '\Predis\Commands\ZSetAdd',
  66. 'zincrby' => '\Predis\Commands\ZSetIncrementBy',
  67. 'zrem' => '\Predis\Commands\ZSetRemove',
  68. 'zrange' => '\Predis\Commands\ZSetRange',
  69. 'zrevrange' => '\Predis\Commands\ZSetReverseRange',
  70. 'zrangebyscore' => '\Predis\Commands\ZSetRangeByScore',
  71. 'zcard' => '\Predis\Commands\ZSetCardinality',
  72. 'zscore' => '\Predis\Commands\ZSetScore',
  73. 'zremrangebyscore' => '\Predis\Commands\ZSetRemoveRangeByScore',
  74. /* connection related commands */
  75. 'ping' => '\Predis\Commands\ConnectionPing',
  76. 'auth' => '\Predis\Commands\ConnectionAuth',
  77. 'select' => '\Predis\Commands\ConnectionSelect',
  78. 'echo' => '\Predis\Commands\ConnectionEcho',
  79. 'quit' => '\Predis\Commands\ConnectionQuit',
  80. /* remote server control commands */
  81. 'info' => '\Predis\Commands\ServerInfo',
  82. 'slaveof' => '\Predis\Commands\ServerSlaveOf',
  83. 'monitor' => '\Predis\Commands\ServerMonitor',
  84. 'dbsize' => '\Predis\Commands\ServerDatabaseSize',
  85. 'flushdb' => '\Predis\Commands\ServerFlushDatabase',
  86. 'flushall' => '\Predis\Commands\ServerFlushAll',
  87. 'save' => '\Predis\Commands\ServerSave',
  88. 'bgsave' => '\Predis\Commands\ServerBackgroundSave',
  89. 'lastsave' => '\Predis\Commands\ServerLastSave',
  90. 'shutdown' => '\Predis\Commands\ServerShutdown',
  91. 'bgrewriteaof' => '\Predis\Commands\ServerBackgroundRewriteAOF',
  92. /* ---------------- Redis 2.0 ---------------- */
  93. /* commands operating on string values */
  94. 'setex' => '\Predis\Commands\StringSetExpire',
  95. 'append' => '\Predis\Commands\StringAppend',
  96. 'substr' => '\Predis\Commands\StringSubstr',
  97. /* commands operating on lists */
  98. 'blpop' => '\Predis\Commands\ListPopFirstBlocking',
  99. 'brpop' => '\Predis\Commands\ListPopLastBlocking',
  100. /* commands operating on sorted sets */
  101. 'zunionstore' => '\Predis\Commands\ZSetUnionStore',
  102. 'zinterstore' => '\Predis\Commands\ZSetIntersectionStore',
  103. 'zcount' => '\Predis\Commands\ZSetCount',
  104. 'zrank' => '\Predis\Commands\ZSetRank',
  105. 'zrevrank' => '\Predis\Commands\ZSetReverseRank',
  106. 'zremrangebyrank' => '\Predis\Commands\ZSetRemoveRangeByRank',
  107. /* commands operating on hashes */
  108. 'hset' => '\Predis\Commands\HashSet',
  109. 'hsetnx' => '\Predis\Commands\HashSetPreserve',
  110. 'hmset' => '\Predis\Commands\HashSetMultiple',
  111. 'hincrby' => '\Predis\Commands\HashIncrementBy',
  112. 'hget' => '\Predis\Commands\HashGet',
  113. 'hmget' => '\Predis\Commands\HashGetMultiple',
  114. 'hdel' => '\Predis\Commands\HashDelete',
  115. 'hexists' => '\Predis\Commands\HashExists',
  116. 'hlen' => '\Predis\Commands\HashLength',
  117. 'hkeys' => '\Predis\Commands\HashKeys',
  118. 'hvals' => '\Predis\Commands\HashValues',
  119. 'hgetall' => '\Predis\Commands\HashGetAll',
  120. /* transactions */
  121. 'multi' => '\Predis\Commands\TransactionMulti',
  122. 'exec' => '\Predis\Commands\TransactionExec',
  123. 'discard' => '\Predis\Commands\TransactionDiscard',
  124. /* publish - subscribe */
  125. 'subscribe' => '\Predis\Commands\PubSubSubscribe',
  126. 'unsubscribe' => '\Predis\Commands\PubSubUnsubscribe',
  127. 'psubscribe' => '\Predis\Commands\PubSubSubscribeByPattern',
  128. 'punsubscribe' => '\Predis\Commands\PubSubUnsubscribeByPattern',
  129. 'publish' => '\Predis\Commands\PubSubPublish',
  130. /* remote server control commands */
  131. 'config' => '\Predis\Commands\ServerConfig',
  132. /* ---------------- Redis 2.2 ---------------- */
  133. /* commands operating on the key space */
  134. 'persist' => '\Predis\Commands\KeyPersist',
  135. /* commands operating on string values */
  136. 'strlen' => '\Predis\Commands\StringStrlen',
  137. 'setrange' => '\Predis\Commands\StringSetRange',
  138. 'getrange' => '\Predis\Commands\StringGetRange',
  139. 'setbit' => '\Predis\Commands\StringSetBit',
  140. 'getbit' => '\Predis\Commands\StringGetBit',
  141. /* commands operating on lists */
  142. 'rpushx' => '\Predis\Commands\ListPushTailX',
  143. 'lpushx' => '\Predis\Commands\ListPushHeadX',
  144. 'linsert' => '\Predis\Commands\ListInsert',
  145. 'brpoplpush' => '\Predis\Commands\ListPopLastPushHeadBlocking',
  146. /* commands operating on sorted sets */
  147. 'zrevrangebyscore' => '\Predis\Commands\ZSetReverseRangeByScore',
  148. /* transactions */
  149. 'watch' => '\Predis\Commands\TransactionWatch',
  150. 'unwatch' => '\Predis\Commands\TransactionUnwatch',
  151. /* remote server control commands */
  152. 'object' => '\Predis\Commands\ServerObject',
  153. );
  154. }
  155. }