Cache.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\facade;
  12. use think\Facade;
  13. /**
  14. * @see \think\Cache
  15. * @mixin \think\Cache
  16. * @method \think\cache\Driver connect(array $options = [], mixed $name = false) static 连接缓存
  17. * @method \think\cache\Driver init(array $options = []) static 初始化缓存
  18. * @method \think\cache\Driver store(string $name = '') static 切换缓存类型
  19. * @method bool has(string $name) static 判断缓存是否存在
  20. * @method mixed get(string $name, mixed $default = false) static 读取缓存
  21. * @method mixed pull(string $name) static 读取缓存并删除
  22. * @method mixed set(string $name, mixed $value, int $expire = null) static 设置缓存
  23. * @method mixed remember(string $name, mixed $value, int $expire = null) static 如果不存在则写入缓存
  24. * @method mixed inc(string $name, int $step = 1) static 自增缓存(针对数值缓存)
  25. * @method mixed dec(string $name, int $step = 1) static 自减缓存(针对数值缓存)
  26. * @method bool rm(string $name) static 删除缓存
  27. * @method bool clear(string $tag = null) static 清除缓存
  28. * @method mixed tag(string $name, mixed $keys = null, bool $overlay = false) static 缓存标签
  29. * @method object handler() static 返回句柄对象,可执行其它高级方法
  30. */
  31. class Cache extends Facade
  32. {
  33. /**
  34. * 获取当前Facade对应类名(或者已经绑定的容器对象标识)
  35. * @access protected
  36. * @return string
  37. */
  38. protected static function getFacadeClass()
  39. {
  40. return 'cache';
  41. }
  42. }