Commit 07f2b0f5 by Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1724724: clear caches on site upgrade"

parents 9ec81780 2c8ec618
......@@ -45,6 +45,9 @@ if (empty($upgrades['settings']['toupgradecount'])) {
// Check for issues which would pose problems during upgrade
ensure_upgrade_sanity();
// Clear all caches
clear_all_caches();
// Actually perform the upgrade
log_info(get_string('cliupgradingmahara', 'admin'));
foreach ($upgrades as $name => $data) {
......
......@@ -63,9 +63,6 @@ if ($install) {
}
if (!empty($upgrade)) {
// clear out menu cache to allow upgraded site to remake cached menus
clear_menu_cache();
if (!empty($upgrade->errormsg)) {
$data['newversion'] = $upgrade->torelease . ' (' . $upgrade->to . ')' ;
$data['install'] = false;
......
......@@ -98,19 +98,8 @@ $successicon = 'icon icon-check text-success left';
$failureicon = 'icon icon-exclamation-triangle left';
$warningicon = 'icon icon-exclamation-triangle left';
// Remove all files in the dwoo cache
require_once('file.php');
$basedir = get_config('dataroot') . 'dwoo/compile/';
$dh = new DirectoryIterator($basedir);
foreach ($dh as $themedir) {
if ($themedir->isDot()) continue;
$themedirname = $basedir . $themedir->getFilename();
rmdirr($themedirname);
clearstatcache();
check_dir_exists($themedirname);
}
// Clear all caches.
clear_all_caches();
$loadingstring = json_encode(get_string('upgradeloading', 'admin'));
$installsuccessstring = json_encode(get_string('installsuccess', 'admin'));
......
......@@ -5130,6 +5130,8 @@ function clear_all_caches($clearsessiondirs = false) {
}
}
clearstatcache();
handle_event('clearcaches', array());
$result = true;
......
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