ServerVersion12.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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\Profile;
  11. /**
  12. * Server profile for Redis v1.2.x.
  13. *
  14. * @author Daniele Alessandri <suppakilla@gmail.com>
  15. */
  16. class ServerVersion12 extends ServerProfile
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function getVersion()
  22. {
  23. return '1.2';
  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\Command\KeyExists',
  34. 'del' => 'Predis\Command\KeyDelete',
  35. 'type' => 'Predis\Command\KeyType',
  36. 'keys' => 'Predis\Command\KeyKeysV12x',
  37. 'randomkey' => 'Predis\Command\KeyRandom',
  38. 'rename' => 'Predis\Command\KeyRename',
  39. 'renamenx' => 'Predis\Command\KeyRenamePreserve',
  40. 'expire' => 'Predis\Command\KeyExpire',
  41. 'expireat' => 'Predis\Command\KeyExpireAt',
  42. 'ttl' => 'Predis\Command\KeyTimeToLive',
  43. 'move' => 'Predis\Command\KeyMove',
  44. 'sort' => 'Predis\Command\KeySort',
  45. /* commands operating on string values */
  46. 'set' => 'Predis\Command\StringSet',
  47. 'setnx' => 'Predis\Command\StringSetPreserve',
  48. 'mset' => 'Predis\Command\StringSetMultiple',
  49. 'msetnx' => 'Predis\Command\StringSetMultiplePreserve',
  50. 'get' => 'Predis\Command\StringGet',
  51. 'mget' => 'Predis\Command\StringGetMultiple',
  52. 'getset' => 'Predis\Command\StringGetSet',
  53. 'incr' => 'Predis\Command\StringIncrement',
  54. 'incrby' => 'Predis\Command\StringIncrementBy',
  55. 'decr' => 'Predis\Command\StringDecrement',
  56. 'decrby' => 'Predis\Command\StringDecrementBy',
  57. /* commands operating on lists */
  58. 'rpush' => 'Predis\Command\ListPushTail',
  59. 'lpush' => 'Predis\Command\ListPushHead',
  60. 'llen' => 'Predis\Command\ListLength',
  61. 'lrange' => 'Predis\Command\ListRange',
  62. 'ltrim' => 'Predis\Command\ListTrim',
  63. 'lindex' => 'Predis\Command\ListIndex',
  64. 'lset' => 'Predis\Command\ListSet',
  65. 'lrem' => 'Predis\Command\ListRemove',
  66. 'lpop' => 'Predis\Command\ListPopFirst',
  67. 'rpop' => 'Predis\Command\ListPopLast',
  68. 'rpoplpush' => 'Predis\Command\ListPopLastPushHead',
  69. /* commands operating on sets */
  70. 'sadd' => 'Predis\Command\SetAdd',
  71. 'srem' => 'Predis\Command\SetRemove',
  72. 'spop' => 'Predis\Command\SetPop',
  73. 'smove' => 'Predis\Command\SetMove',
  74. 'scard' => 'Predis\Command\SetCardinality',
  75. 'sismember' => 'Predis\Command\SetIsMember',
  76. 'sinter' => 'Predis\Command\SetIntersection',
  77. 'sinterstore' => 'Predis\Command\SetIntersectionStore',
  78. 'sunion' => 'Predis\Command\SetUnion',
  79. 'sunionstore' => 'Predis\Command\SetUnionStore',
  80. 'sdiff' => 'Predis\Command\SetDifference',
  81. 'sdiffstore' => 'Predis\Command\SetDifferenceStore',
  82. 'smembers' => 'Predis\Command\SetMembers',
  83. 'srandmember' => 'Predis\Command\SetRandomMember',
  84. /* commands operating on sorted sets */
  85. 'zadd' => 'Predis\Command\ZSetAdd',
  86. 'zincrby' => 'Predis\Command\ZSetIncrementBy',
  87. 'zrem' => 'Predis\Command\ZSetRemove',
  88. 'zrange' => 'Predis\Command\ZSetRange',
  89. 'zrevrange' => 'Predis\Command\ZSetReverseRange',
  90. 'zrangebyscore' => 'Predis\Command\ZSetRangeByScore',
  91. 'zcard' => 'Predis\Command\ZSetCardinality',
  92. 'zscore' => 'Predis\Command\ZSetScore',
  93. 'zremrangebyscore' => 'Predis\Command\ZSetRemoveRangeByScore',
  94. /* connection related commands */
  95. 'ping' => 'Predis\Command\ConnectionPing',
  96. 'auth' => 'Predis\Command\ConnectionAuth',
  97. 'select' => 'Predis\Command\ConnectionSelect',
  98. 'echo' => 'Predis\Command\ConnectionEcho',
  99. 'quit' => 'Predis\Command\ConnectionQuit',
  100. /* remote server control commands */
  101. 'info' => 'Predis\Command\ServerInfo',
  102. 'slaveof' => 'Predis\Command\ServerSlaveOf',
  103. 'monitor' => 'Predis\Command\ServerMonitor',
  104. 'dbsize' => 'Predis\Command\ServerDatabaseSize',
  105. 'flushdb' => 'Predis\Command\ServerFlushDatabase',
  106. 'flushall' => 'Predis\Command\ServerFlushAll',
  107. 'save' => 'Predis\Command\ServerSave',
  108. 'bgsave' => 'Predis\Command\ServerBackgroundSave',
  109. 'lastsave' => 'Predis\Command\ServerLastSave',
  110. 'shutdown' => 'Predis\Command\ServerShutdown',
  111. 'bgrewriteaof' => 'Predis\Command\ServerBackgroundRewriteAOF',
  112. );
  113. }
  114. }