- optimization clear compiled and cached folder completely on detected version change

This commit is contained in:
uwetews
2016-09-19 14:59:49 +02:00
parent 8835408e0d
commit a9e7e8881e
5 changed files with 46 additions and 12 deletions

View File

@@ -419,11 +419,13 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
*/
public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
{
// on cache resources other than file check version stored in cache code
if ($cache && $tpl->smarty->caching_type !== 'file' && Smarty::SMARTY_VERSION !== $properties[ 'version' ]) {
$tpl->smarty->clearAllCache();
return false;
}
$is_valid = true;
if (Smarty::SMARTY_VERSION != $properties[ 'version' ]) {
// new version must rebuild
$is_valid = false;
} elseif ($is_valid && !empty($properties[ 'file_dependency' ]) &&
if (!empty($properties[ 'file_dependency' ]) &&
((!$cache && $tpl->smarty->compile_check) || $tpl->smarty->compile_check == 1)
) {
// check file dependencies at compiled code