mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-03 19:30:49 +02:00
- update cached_timestamp at the template object after cache file is written to avoid possible side effects
- use internally always SMARTY_CACHING_LIFETIME_* constants
This commit is contained in:
@@ -65,11 +65,13 @@ class Smarty_Internal_CacheResource_File {
|
||||
public function writeCachedContent($template, $content)
|
||||
{
|
||||
if (!$template->resource_object->isEvaluated) {
|
||||
return Smarty_Internal_Write_File::writeFile($template->getCachedFilepath(), $content, $this->smarty);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (Smarty_Internal_Write_File::writeFile($template->getCachedFilepath(), $content, $this->smarty) === true) {
|
||||
$template->cached_timestamp = filemtime($template->getCachedFilepath());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty cache folder
|
||||
|
||||
Reference in New Issue
Block a user