| 1 | <?php |
||
| 13 | class FileStorage implements StorageInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var Filesystem |
||
| 17 | */ |
||
| 18 | protected $fs; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $cache_dir = ''; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param Filesystem $fs |
||
| 27 | * @param string $cache_dir |
||
| 28 | */ |
||
| 29 | 5 | public function __construct(Filesystem $fs, $cache_dir) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $key |
||
| 37 | * |
||
| 38 | * @return string|null |
||
| 39 | */ |
||
| 40 | 5 | public function get($key) |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $key |
||
| 52 | * @param string $data |
||
| 53 | * @param \DateTime $expires |
||
| 54 | */ |
||
| 55 | 1 | public function set($key, $data, \DateTime $expires) |
|
| 61 | |||
| 62 | /** |
||
| 63 | * @param string $key |
||
| 64 | * |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | 5 | protected function getFilename($key) |
|
| 71 | } |
||
| 72 |