Skip to content

Commit

Permalink
Create the filecache at runtime, resolves #243, #246
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed May 3, 2022
1 parent 34733dd commit 9269d70
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Services/FileCacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@
use Hyde\Framework\Hyde;

/**
* Helper methods to interact with the filecache.json file.
*
* @deprecated v0.20.0-dev, see https://github.com/hydephp/framework/issues/243
* Helper methods to interact with the filecache.
*/
class FileCacheService
{
public static function getFilecache(): array
{
return json_decode(file_get_contents(Hyde::vendorPath('resources/data/filecache.json')), true);
$filecache = [];

$files = glob(Hyde::vendorPath('resources/views/**/*.blade.php'));

foreach ($files as $file) {
$filecache[str_replace(Hyde::vendorPath(), '', $file)] = [
'unixsum' => static::unixsumFile($file),
];
}

return $filecache;
}

public static function getChecksums(): array
Expand Down

0 comments on commit 9269d70

Please sign in to comment.