ServerVersion20.php 9.2 KB

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