| Total Complexity | 27 |
| Total Lines | 135 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | class CheckRequestCache |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * 缓存对象 |
||
| 28 | * @var Cache |
||
| 29 | */ |
||
| 30 | protected $cache; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * 配置参数 |
||
| 34 | * @var array |
||
| 35 | */ |
||
| 36 | protected $config = [ |
||
| 37 | // 请求缓存规则 true为自动规则 |
||
| 38 | 'request_cache_key' => true, |
||
| 39 | // 请求缓存有效期 |
||
| 40 | 'request_cache_expire' => null, |
||
| 41 | // 全局请求缓存排除规则 |
||
| 42 | 'request_cache_except' => [], |
||
| 43 | // 请求缓存的Tag |
||
| 44 | 'request_cache_tag' => '', |
||
| 45 | ]; |
||
| 46 | |||
| 47 | public function __construct(Cache $cache, Config $config) |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * 设置当前地址的请求缓存 |
||
| 55 | * @access public |
||
| 56 | * @param Request $request |
||
|
1 ignored issue
–
show
|
|||
| 57 | * @param Closure $next |
||
|
1 ignored issue
–
show
|
|||
| 58 | * @param mixed $cache |
||
|
1 ignored issue
–
show
|
|||
| 59 | * @return Response |
||
| 60 | */ |
||
| 61 | public function handle($request, Closure $next, $cache = null) |
||
| 98 | } |
||
| 99 | |||
| 100 | /** |
||
| 101 | * 读取当前地址的请求缓存信息 |
||
| 102 | * @access protected |
||
| 103 | * @param Request $request |
||
|
1 ignored issue
–
show
|
|||
| 104 | * @return mixed |
||
| 105 | */ |
||
| 106 | protected function getRequestCache($request) |
||
| 161 |