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\Profiles;
  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\Commands\KeyExists',
  34. 'del' => 'Predis\Commands\KeyDelete',
  35. 'type' => 'Predis\Commands\KeyType',
  36. 'keys' => 'Predis\Commands\KeyKeysV12x',
  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. );
  113. }
  114. }