[*] BO : Add clear smarty cache button

This commit is contained in:
gRoussac
2013-08-13 15:11:00 +02:00
parent b1b636a911
commit e8685b1430
4 changed files with 23 additions and 13 deletions
+12
View File
@@ -704,6 +704,18 @@ class ToolsCore
}
return false;
}
/**
* Clear smarty cache folders
*/
public static function clearSmartyCache()
{
foreach (array(_PS_CACHE_DIR_.'smarty/cache', _PS_CACHE_DIR_.'smarty/compile') as $dir)
if (file_exists($dir))
foreach (scandir($dir) as $file)
if ($file[0] != '.' && $file != 'index.php')
self::deleteDirectory($dir.DIRECTORY_SEPARATOR.$file);
}
/**
* Display an error according to an error code