1 | <?php |
||
18 | class CacheResponse |
||
19 | { |
||
20 | /** |
||
21 | * @var Filesystem |
||
22 | */ |
||
23 | protected $fs; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $cache_dir; |
||
29 | |||
30 | /** |
||
31 | * @param Filesystem $fs |
||
32 | * @param string $cache_dir |
||
33 | */ |
||
34 | 6 | public function __construct(Filesystem $fs, $cache_dir) |
|
39 | |||
40 | /** |
||
41 | * @param string $url |
||
42 | * |
||
43 | * @return string|null |
||
44 | */ |
||
45 | 5 | public function get($url) |
|
54 | |||
55 | /** |
||
56 | * @param string $request |
||
57 | * @param string $url |
||
58 | * @param string $response |
||
59 | */ |
||
60 | 2 | public function set($request, $url, $response) |
|
68 | |||
69 | /** |
||
70 | * @param string $url |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | 5 | protected function getFilename($url) |
|
78 | |||
79 | /** |
||
80 | * Get cache request expires. |
||
81 | * |
||
82 | * @link http://wiki.anidb.net/w/HTTP_API_Definition |
||
83 | * |
||
84 | * @param string $request |
||
85 | * |
||
86 | * @return int |
||
87 | */ |
||
88 | 2 | protected function getRequestExpires($request) |
|
110 | } |
||
111 |