Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-38558 add preupgrade script support

This is intended things like undoing of local hacks, it is similar to older pre 2.0 upgrade hack.
  • Loading branch information...
commit 6b4b74904b7a10d97a56bc53a955c7c715e76d24 1 parent 7112729
@skodak skodak authored
Showing with 9 additions and 11 deletions.
  1. +7 −9 lib/upgradelib.php
  2. +2 −2 local/readme.txt
View
16 lib/upgradelib.php
@@ -1518,15 +1518,13 @@ function upgrade_core($version, $verbose) {
print_upgrade_part_start('moodle', false, $verbose);
- // one time special local migration pre 2.0 upgrade script
- if ($CFG->version < 2007101600) {
- $pre20upgradefile = "$CFG->dirroot/local/upgrade_pre20.php";
- if (file_exists($pre20upgradefile)) {
- set_time_limit(0);
- require($pre20upgradefile);
- // reset upgrade timeout to default
- upgrade_set_timeout();
- }
+ // Pre-upgrade scripts for local hack workarounds.
+ $preupgradefile = "$CFG->dirroot/local/preupgrade.php";
+ if (file_exists($preupgradefile)) {
+ set_time_limit(0);
+ require($preupgradefile);
+ // Reset upgrade timeout to default.
+ upgrade_set_timeout();
}
$result = xmldb_main_upgrade($CFG->version);
View
4 local/readme.txt
@@ -39,8 +39,8 @@ are supported. There may be some extra files with special meaning in /local/.
Sample /local/ directory listing:
/local/nicehack/ - first customisation plugin
/local/otherhack/ - other customisation plugin
-/local/upgrade_pre20.php - one time upgrade and migration script which is
- executed before main 2.0 upgrade starts
+/local/preupgrade.php - executed before each core upgrade, use $version and $CFG->version
+ if you need to tweak specific local hacks
/local/defaults.php - custom admin setting defaults

0 comments on commit 6b4b749

Please sign in to comment.
Something went wrong with that request. Please try again.