You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
6.2 KiB

11 years ago
12 years ago
12 years ago
  1. <?php namespace Majestic\Redis;
  2. /**
  3. *
  4. *
  5. * @copyright NetMonsters <team@netmonsters.ru>
  6. * @link http://netmonsters.ru
  7. * @package Majestic
  8. * @subpackage Redis
  9. * @since 2011-05-17
  10. */
  11. /**
  12. * Redis stub for https://github.com/nicolasff/phpredis
  13. * @author aterekhov
  14. * @see https://github.com/nicolasff/phpredis
  15. *
  16. * @method bool connect() connect(string $host, int $port = 6379, float $timeout = 0) Connect to redis
  17. * @method bool pconnect() pconnect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id) Connect to redis with reusing connection
  18. * @method bool select() select(int $dbindex) Switches to a given database
  19. * @method void close() Close connection to redis
  20. * @method bool setOption() setOption(mixed $name, mixed $value) Set client option
  21. * @method mixed getOption() getOption(mixed $name) Get client option
  22. * @method string ping() ping() Check the current connection status
  23. * @method string|bool get() get(string $key) Get the value related to the specified key
  24. * @method bool set() set(string $key, mixed $value, int $timeout = null) Set the string value in argument as value of the key
  25. * @method bool setex() setex(string $key, int $ttl, mixed $value) Set the string value in argument as value of the key, with a time to live
  26. * @method bool setnx() setnx(string $key, int $ttl) Set the string value in argument as value of the key if the key doesn't already exist in the database
  27. * @method float delete() delete(mixed $key) Remove specified keys
  28. * @method Redis multi() multi(mixed $mode = 1) Enter and exit transactional mode
  29. * @method bool exec() exec() Enter and exit transactional mode
  30. * @method void watch() watch(mixed $keys) Watches a key for modifications by another client
  31. * @method void unwatch() unwatch(mixed $keys) Watches a key for modifications by another client
  32. * @method void subscribe() subscribe(array $channels, mixed $callback) Subscribe to channels. Warning: this function will probably change in the future
  33. * @method void publish() publish(string $channel, string $message) Publish messages to channels. Warning: this function will probably change in the future
  34. * @method bool exists() exists(string $key) Verify if the specified key exists
  35. * @method int incr() incr(string $key) Increment the number stored at key by one
  36. * @method int incrBy() incrBy(string $key, int $value) Increment the number stored at key by $value
  37. *
  38. * @method bool expire() expire(string $key, int $ttl) Sets an expiration date (a timeout) on an item
  39. *
  40. * @method float zAdd() zAdd(string $key, float $score, string $value) Adds the specified member with a given score to the sorted set stored at key
  41. * @method array zRange() zRange(string $key, float $start, float $end, bool $with_scores = false) Returns a range of elements from the ordered set stored at the specified key, with values in the range [start, end]
  42. * @method float zDelete() zDelete(string $key, string $value) Deletes a specified member from the ordered set.
  43. * @method array zRevRange() zRevRange(string $key, float $start, float $end, bool $with_scores = false) Returns a range of elements from the ordered set stored at the specified key, with values in the range [start, end]
  44. * @method array zRangeByScore() zRangeByScore(string $key, float $start, float $end) Returns the elements of the sorted set stored at the specified key which have scores in the range [start,end]. Adding a parenthesis before start or end excludes it from the range. +inf and -inf are also valid limits. zRevRangeByScore returns the same items in reverse order, when the start and end parameters are swapped.
  45. * @method int zRemRangeByScore() zRemRangeByScore(string $key, float $start, float $end) Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end].
  46. * @method int zRemRangeByRank() zRemRangeByRank(string $key, int $start, int $end) Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end].
  47. * @method float zCard() zCard(string $key) Returns the cardinality of an ordered set
  48. * @method float zScore() zScore(string $key, string $value) Returns the score of a given member in the specified sorted set.
  49. * @method float zUnionStore() zUnionStore(string $destination, array $keys, array $weights = array(), string $aggregate = 'sum') Creates an union of sorted sets given in second argument and store in in first argument
  50. * @method float zInterStore() zInterStore(string $destination, array $keys, array $weights = array(), string $aggregate = 'sum') Creates an intersection of sorted sets given in second argument and store in in first argument
  51. * @method int sAdd() sAdd(string $key, string $value) Adds a value to the set value stored at key. If this value is already in the set, FALSE is returned.
  52. * @method int sCard() sCard(string $key) Returns the cardinality of the set identified by key.
  53. * @method int sSize() sSize(string $key) Returns the cardinality of the set identified by key.
  54. * @method array sMembers() sMembers(string $key) Returns the contents of a set.
  55. * @method array sGetMembers() sGetMembers(string $key) Returns the contents of a set.
  56. * @method bool sContains() sContains(string $key, string $value) Checks if value is a member of the set stored at the key key.
  57. * @method bool sIsMember() sIsMember(string $key, string $value) Checks if value is a member of the set stored at the key key.
  58. * @method bool sRem() sRem(string $key, string $member) Removes the specified member from the set value stored at key.
  59. * @method bool sRemove() sRemove(string $key, string $member) Removes the specified member from the set value stored at key.
  60. * @method array lRange() lRange(string $key, int $start, int $end) Returns the specified elements of the list stored at the specified key in the range [start, end]. start and stop are interpretated as indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate
  61. * @method int rPush() rPush(string $key, string $value) Adds the string value to the tail (right) of the list. Creates the list if the key didn't exist. If the key exists and is not a list, FALSE is returned.
  62. * @method array lTrim() lTrim(string $key, int $start, int $stop) Trims an existing list so that it will contain only a specified range of elements.
  63. * @method array sInter
  64. */
  65. class Redis
  66. {
  67. }