- Making sure cache file exist before invalidating; creating it if it ain't

This commit is contained in:
Dave M. 2024-02-01 14:53:47 +00:00
parent e2915c356a
commit ed63c1ffe5
1 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ class CacheInvalidator
protected string $filePath,
protected bool $updateVersion = false,
) {
if ($this->updateVersion) {
if ($this->updateVersion || ! file_exists($this->filePath)) {
$this->version = $this->generateVersion();
file_put_contents($this->filePath, $this->version);
}