1 | <?php |
||
17 | final class Memory implements MemoryInterface |
||
18 | { |
||
19 | // data file extension |
||
20 | private const EXTENSION = 'php'; |
||
21 | |||
22 | /** @var string */ |
||
23 | private $directory; |
||
24 | |||
25 | /** @var FilesInterface */ |
||
26 | private $files = null; |
||
27 | |||
28 | /** |
||
29 | * @param string $directory |
||
30 | * @param FilesInterface $files |
||
31 | */ |
||
32 | public function __construct(string $directory, FilesInterface $files) |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | * |
||
41 | * @param string $filename Cache filename. |
||
42 | */ |
||
43 | public function loadData(string $section, string &$filename = null) |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function saveData(string $section, $data) |
||
70 | |||
71 | /** |
||
72 | * Get extension to use for runtime data or configuration cache. |
||
73 | * |
||
74 | * @param string $name Runtime data file name (without extension). |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | private function getFilename(string $name): string |
||
88 | } |