1 | <?php |
||
17 | class FileCacheClassLoader extends CacheListClassLoader |
||
18 | { |
||
19 | /** @var string Path to the cache file */ |
||
20 | private $cacheFile; |
||
21 | |||
22 | /** @var string[]|null Cache to store at the end of the request */ |
||
23 | private $store; |
||
24 | |||
25 | /** |
||
26 | * Creates new FileCacheClassLoader instance and loads the cache file. |
||
27 | * @param string $cacheFile Path to cache file |
||
28 | */ |
||
29 | 9 | public function __construct($cacheFile) |
|
45 | |||
46 | /** |
||
47 | * Writes the cache file if changes were made. |
||
48 | */ |
||
49 | 9 | public function saveCacheFile() |
|
56 | |||
57 | /** |
||
58 | * Returns the path to the cache file. |
||
59 | * @return string Path to the cache file |
||
60 | */ |
||
61 | 6 | public function getCacheFile() |
|
65 | |||
66 | /** |
||
67 | * Stores the cache to be saved at the end of the request. |
||
68 | * @param string[] $cache Class location cache |
||
69 | */ |
||
70 | 6 | public function storeCache(array $cache) |
|
78 | |||
79 | /** |
||
80 | * Creates the PHP code for the class cache. |
||
81 | * @param string[] $cache Class location cache |
||
82 | * @return string PHP code for the cache file |
||
83 | */ |
||
84 | 6 | private function createCache(array $cache) |
|
97 | } |
||
98 |