Commit b067ff35 authored by Nigel McNie's avatar Nigel McNie
Browse files

Clear smarty compile/ directories when running an upgrade.

This gives the theme a chance to not suck and fail when theme-related changes are made that wouldn't otherwise be picked up by smarty's mtime check.
(cherry picked from commit 18f3fe7d64d7438495f6c824fdfb5f30ecc79a66)
parent 0391cf41
......@@ -44,6 +44,18 @@ if (!$upgrades) {
die_info(get_string('noupgrades', 'admin'));
}
// Remove all files in the smarty cache
require_once('file.php');
$basedir = get_config('dataroot') . 'smarty/compile/';
$dh = new DirectoryIterator($basedir);
foreach ($dh as $themedir) {
if ($themedir->isDot()) continue;
$themedirname = $basedir . $themedir->getFilename();
rmdirr($themedirname);
clearstatcache();
check_dir_exists($themedirname);
}
$loadingicon = theme_get_url('images/loading.gif');
$successicon = theme_get_url('images/success.gif');
$failureicon = theme_get_url('images/failure.gif');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment