- 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:
Uwe.Tews
2010-01-02 12:15:04 +00:00
parent b5ff9e450f
commit 4519218f04
3 changed files with 18 additions and 12 deletions
@@ -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