- Making sure cache file exist before invalidating; creating it if it ain't
This commit is contained in:
parent
e2915c356a
commit
ed63c1ffe5
|
@ -12,13 +12,13 @@ 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);
|
||||
}
|
||||
else {
|
||||
$this->version = file_get_contents($this->filePath);
|
||||
}
|
||||
$this->version = file_get_contents($this->filePath);
|
||||
}
|
||||
}
|
||||
|
||||
protected function generateVersion() : string
|
||||
|
|
Loading…
Reference in New Issue