mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 01:32:25 +01:00
Delete invalid cached resources when fetching with FilesCache::fetch()
This commit is contained in:
parent
f695701540
commit
e60e30619d
@ -40,9 +40,12 @@ class FilesCache extends AbstractCache
|
||||
*/
|
||||
public function fetch($key)
|
||||
{
|
||||
if ($this->has($key) && $this->isValid($key)) {
|
||||
$data = FileSystem::read($this->getFile($key));
|
||||
return unserialize($data);
|
||||
if ($this->has($key)) {
|
||||
if ($this->isValid($key)) {
|
||||
$data = FileSystem::read($this->getFile($key));
|
||||
return unserialize($data);
|
||||
}
|
||||
FileSystem::delete($this->getFile($key));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user