ServerVersion20.php 9.2 KB

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