Redis.php 1.8 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php namespace App\Facades\Servers\Redis;
  2. use Illuminate\Support\Facades\Facade;
  3. /**
  4. * @method static \Illuminate\Redis\Connections\Connection connection(string $name = null)
  5. * @method static \Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder funnel(string $name)
  6. * @method static \Illuminate\Redis\Limiters\DurationLimiterBuilder throttle(string $name)
  7. * @method static bool set(string $key,string $value,['EX'|'PX'],[$expire],['NX'|'XX']) 设置指定key的值
  8. * @method static mixed get(string $key) 获取指定key的值
  9. * @method static bool setex(string $key,int $seconds,string $value) 将值value关联到key,并将key的过期时间设为seconds(以秒为单位)。
  10. * @method static bool pErsist(string $key) 移除给定key的过期时间,使得key永不过期
  11. * @method static bool expire(string $key,int $expire) 为给定key设置生存时间
  12. * @method static bool del(mixed $key,...$otherkey) 删除已存在的键。不存在的 key 会被忽略
  13. * @method static int setBit(string $key,int $offset, int$value) 设置或清除指定偏移量上的位(bit)。返回值是:指定偏移量原来储存的位$value
  14. * @method static int getBit(string $key,int $offset) 获取指定偏移量上的位(bit)。返回值是:字符串值指定偏移量上的位(bit)。当偏移量 OFFSET 比字符串值的长度大,或者 key 不存在时,返回 0 。
  15. * @method static int exists(string $key) 检查给定 key 是否存在,若 key 存在返回 1 ,否则返回 0 。
  16. *
  17. * @see \Illuminate\Redis\RedisManager
  18. * @see \Illuminate\Contracts\Redis\Factory
  19. */
  20. class Redis extends Facade
  21. {
  22. /**
  23. * Get the registered name of the component.
  24. *
  25. * @return string
  26. */
  27. protected static function getFacadeAccessor()
  28. {
  29. return 'redis';
  30. }
  31. }