MDL-36466 cache: disabled caching during installation and upgrade

This commit is contained in:
Sam Hemelryk 2012-11-13 15:32:57 +13:00
parent 3680c61a3c
commit 3308259062
3 changed files with 15 additions and 0 deletions

View file

@ -169,6 +169,9 @@ require_once($CFG->dirroot.'/cache/lib.php');
require($CFG->dirroot.'/version.php'); require($CFG->dirroot.'/version.php');
$CFG->target_release = $release; $CFG->target_release = $release;
// Disable the cache API.
cache_factory::disable();
//Database types //Database types
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'), $databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'), 'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),

View file

@ -105,6 +105,9 @@ if (!$version or !$release) {
} }
if (!core_tables_exist()) { if (!core_tables_exist()) {
// Disable the Cache API as much as possible for installation.
cache_factory::disable();
$PAGE->set_pagelayout('maintenance'); $PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false); $PAGE->set_popup_notification_allowed(false);
@ -193,6 +196,10 @@ if (empty($CFG->version)) {
if ($version > $CFG->version) { // upgrade if ($version > $CFG->version) { // upgrade
purge_all_caches(); purge_all_caches();
// Disable the Cache API as much as possible for upgrade.
cache_factory::disable();
$PAGE->set_pagelayout('maintenance'); $PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false); $PAGE->set_popup_notification_allowed(false);
@ -297,6 +304,8 @@ if ($branch <> $CFG->branch) { // Update the branch
} }
if (moodle_needs_upgrading()) { if (moodle_needs_upgrading()) {
// Disable the Cache API as much as possible for upgrade.
cache_factory::disable();
if (!$PAGE->headerprinted) { if (!$PAGE->headerprinted) {
// means core upgrade or installation was not already done // means core upgrade or installation was not already done
if (!$confirmplugins) { if (!$confirmplugins) {

View file

@ -220,6 +220,9 @@ $hint_dataroot = '';
$hint_admindir = ''; $hint_admindir = '';
$hint_database = ''; $hint_database = '';
// Disable the cache API.
cache_factory::disable();
// Are we in help mode? // Are we in help mode?
if (isset($_GET['help'])) { if (isset($_GET['help'])) {
install_print_help_page($_GET['help']); install_print_help_page($_GET['help']);