Skip to content

Commit

Permalink
MDL-36466 cache: disabled caching during installation and upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Nov 25, 2012
1 parent 3680c61 commit 3308259
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions admin/cli/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@
require($CFG->dirroot.'/version.php');
$CFG->target_release = $release;

// Disable the cache API.
cache_factory::disable();

//Database types
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
Expand Down
9 changes: 9 additions & 0 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
}

if (!core_tables_exist()) {
// Disable the Cache API as much as possible for installation.
cache_factory::disable();

$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);

Expand Down Expand Up @@ -193,6 +196,10 @@

if ($version > $CFG->version) { // upgrade
purge_all_caches();

// Disable the Cache API as much as possible for upgrade.
cache_factory::disable();

$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);

Expand Down Expand Up @@ -297,6 +304,8 @@
}

if (moodle_needs_upgrading()) {
// Disable the Cache API as much as possible for upgrade.
cache_factory::disable();
if (!$PAGE->headerprinted) {
// means core upgrade or installation was not already done
if (!$confirmplugins) {
Expand Down
3 changes: 3 additions & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@
$hint_admindir = '';
$hint_database = '';

// Disable the cache API.
cache_factory::disable();

// Are we in help mode?
if (isset($_GET['help'])) {
install_print_help_page($_GET['help']);
Expand Down

0 comments on commit 3308259

Please sign in to comment.