Merge pull request #903 from shreesh-webkul/gli-912

Fix: Smarty index.php in smarty cache and compile directory gets deleted when clearing cache
This commit is contained in:
Rohit Jain
2024-03-15 12:08:35 +05:30
committed by GitHub
2 changed files with 2 additions and 5 deletions

View File

@@ -3023,6 +3023,8 @@ exit;
$smarty = Context::getContext()->smarty;
Tools::clearCache($smarty);
Tools::clearCompile($smarty);
@copy(_PS_CACHE_DIR_.'smarty/index.php', _PS_CACHE_DIR_.'smarty/cache/index.php');
@copy(_PS_CACHE_DIR_.'smarty/index.php', _PS_CACHE_DIR_.'smarty/compile/index.php');
}
public static function clearColorListCache($id_product = false)

View File

@@ -114,11 +114,6 @@ class Smarty_Internal_Method_ClearCompiledTemplate
$unlink = true;
}
}
if (substr($_filepath, -9) == 'index.php') {
$unlink = false;
}
if ($unlink && is_file($_filepath) && @unlink($_filepath)) {
$_count++;
if (function_exists('opcache_invalidate')