ServerVersion12.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 ServerVersion12 extends ServerProfile
  12. {
  13. public function getVersion()
  14. {
  15. return '1.2';
  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\KeyKeysV12x',
  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. );
  102. }
  103. }