Skip to content

Commit 9269d70

Browse files
committed
Create the filecache at runtime, resolves #243, #246
1 parent 34733dd commit 9269d70

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Services/FileCacheService.php

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@
55
use Hyde\Framework\Hyde;
66

77
/**
8-
* Helper methods to interact with the filecache.json file.
9-
*
10-
* @deprecated v0.20.0-dev, see https://github.com/hydephp/framework/issues/243
8+
* Helper methods to interact with the filecache.
119
*/
1210
class FileCacheService
1311
{
1412
public static function getFilecache(): array
1513
{
16-
return json_decode(file_get_contents(Hyde::vendorPath('resources/data/filecache.json')), true);
14+
$filecache = [];
15+
16+
$files = glob(Hyde::vendorPath('resources/views/**/*.blade.php'));
17+
18+
foreach ($files as $file) {
19+
$filecache[str_replace(Hyde::vendorPath(), '', $file)] = [
20+
'unixsum' => static::unixsumFile($file),
21+
];
22+
}
23+
24+
return $filecache;
1725
}
1826

1927
public static function getChecksums(): array

0 commit comments

Comments
 (0)