mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Now XMLDB installation is enabled! Old mysql.php and postgres7.php can
continue being used as previously until we finish all the required DDL functions. Also, this implies that *.sql files aren't needed anymore. Now all we have to do is to maintain the install.xml files from the editor.
This commit is contained in:
parent
8e6a09bd2b
commit
db8bd7a66f
4 changed files with 11 additions and 17 deletions
|
@ -30,12 +30,6 @@
|
||||||
$agreelicence = optional_param('agreelicence',0, PARAM_BOOL);
|
$agreelicence = optional_param('agreelicence',0, PARAM_BOOL);
|
||||||
$ignoreupgradewarning = optional_param('ignoreupgradewarning', 0, PARAM_BOOL);
|
$ignoreupgradewarning = optional_param('ignoreupgradewarning', 0, PARAM_BOOL);
|
||||||
|
|
||||||
/// Interim solution to keep the XMLDB installation disabled
|
|
||||||
/// can be enabled by hand in the config.php, of course
|
|
||||||
if (!isset($CFG->xmldb_enabled)) {
|
|
||||||
$CFG->xmldb_enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// check upgrade status first
|
/// check upgrade status first
|
||||||
if ($ignoreupgradewarning and !empty($_SESSION['upgraderunning'])) {
|
if ($ignoreupgradewarning and !empty($_SESSION['upgraderunning'])) {
|
||||||
$_SESSION['upgraderunning'] = 0;
|
$_SESSION['upgraderunning'] = 0;
|
||||||
|
@ -140,7 +134,7 @@
|
||||||
/// Both old .sql files and new install.xml are supported
|
/// Both old .sql files and new install.xml are supported
|
||||||
/// But we priorize install.xml (XMLDB) if present
|
/// But we priorize install.xml (XMLDB) if present
|
||||||
$status = false;
|
$status = false;
|
||||||
if (file_exists("$CFG->libdir/db/install.xml") && $CFG->xmldb_enabled) {
|
if (file_exists("$CFG->libdir/db/install.xml")) {
|
||||||
$status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
|
$status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
|
||||||
} else if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
|
} else if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
|
||||||
$status = modify_database("$CFG->libdir/db/$CFG->dbtype.sql"); //Old method
|
$status = modify_database("$CFG->libdir/db/$CFG->dbtype.sql"); //Old method
|
||||||
|
@ -198,7 +192,7 @@
|
||||||
if (file_exists("$CFG->dirroot/lib/db/$CFG->dbtype.php")) {
|
if (file_exists("$CFG->dirroot/lib/db/$CFG->dbtype.php")) {
|
||||||
include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines old upgrades
|
include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines old upgrades
|
||||||
}
|
}
|
||||||
if (file_exists("$CFG->dirroot/lib/db/upgrade.php") && $CFG->xmldb_enabled) {
|
if (file_exists("$CFG->dirroot/lib/db/upgrade.php")) {
|
||||||
include_once("$CFG->dirroot/lib/db/upgrade.php"); # defines new upgrades
|
include_once("$CFG->dirroot/lib/db/upgrade.php"); # defines new upgrades
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,7 @@
|
||||||
/// Both old .sql files and new install.xml are supported
|
/// Both old .sql files and new install.xml are supported
|
||||||
/// but we priorize install.xml (XMLDB) if present
|
/// but we priorize install.xml (XMLDB) if present
|
||||||
$status = false;
|
$status = false;
|
||||||
if (file_exists($CFG->dirroot . '/backup/db/install.xml') && $CFG->xmldb_enabled) {
|
if (file_exists($CFG->dirroot . '/backup/db/install.xml')) {
|
||||||
$status = install_from_xmldb_file($CFG->dirroot . '/backup/db/install.xml'); //New method
|
$status = install_from_xmldb_file($CFG->dirroot . '/backup/db/install.xml'); //New method
|
||||||
} else if (file_exists($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.sql')) {
|
} else if (file_exists($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.sql')) {
|
||||||
$status = modify_database($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.sql'); //Old method
|
$status = modify_database($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.sql'); //Old method
|
||||||
|
@ -367,7 +367,7 @@
|
||||||
include_once($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
|
include_once($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
|
||||||
$oldupgrade = true;
|
$oldupgrade = true;
|
||||||
}
|
}
|
||||||
if (is_readable($CFG->dirroot . '/backup/db/upgrade.php') && $CFG->xmldb_enabled) {
|
if (is_readable($CFG->dirroot . '/backup/db/upgrade.php')) {
|
||||||
include_once($CFG->dirroot . '/backup/db/upgrade.php'); // defines new upgrading function
|
include_once($CFG->dirroot . '/backup/db/upgrade.php'); // defines new upgrading function
|
||||||
$newupgrade = true;
|
$newupgrade = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ function upgrade_plugins($type, $dir, $return) {
|
||||||
include_once($fullplug . '/db/'. $CFG->dbtype . '.php'); // defines old upgrading function
|
include_once($fullplug . '/db/'. $CFG->dbtype . '.php'); // defines old upgrading function
|
||||||
$oldupgrade = true;
|
$oldupgrade = true;
|
||||||
}
|
}
|
||||||
if (is_readable($fullplug . '/db/upgrade.php') && $CFG->xmldb_enabled) {
|
if (is_readable($fullplug . '/db/upgrade.php')) {
|
||||||
include_once($fullplug . '/db/upgrade.php'); // defines new upgrading function
|
include_once($fullplug . '/db/upgrade.php'); // defines new upgrading function
|
||||||
$newupgrade = true;
|
$newupgrade = true;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ function upgrade_plugins($type, $dir, $return) {
|
||||||
/// Both old .sql files and new install.xml are supported
|
/// Both old .sql files and new install.xml are supported
|
||||||
/// but we priorize install.xml (XMLDB) if present
|
/// but we priorize install.xml (XMLDB) if present
|
||||||
$status = false;
|
$status = false;
|
||||||
if (file_exists($fullplug . '/db/install.xml') && $CFG->xmldb_enabled) {
|
if (file_exists($fullplug . '/db/install.xml')) {
|
||||||
$status = install_from_xmldb_file($fullplug . '/db/install.xml'); //New method
|
$status = install_from_xmldb_file($fullplug . '/db/install.xml'); //New method
|
||||||
} else if (file_exists($fullplug .'/db/'. $CFG->dbtype .'.sql')) {
|
} else if (file_exists($fullplug .'/db/'. $CFG->dbtype .'.sql')) {
|
||||||
$status = modify_database($fullplug .'/db/'. $CFG->dbtype .'.sql'); //Old method
|
$status = modify_database($fullplug .'/db/'. $CFG->dbtype .'.sql'); //Old method
|
||||||
|
@ -215,7 +215,7 @@ function upgrade_activity_modules($return) {
|
||||||
include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
|
include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
|
||||||
$oldupgrade = true;
|
$oldupgrade = true;
|
||||||
}
|
}
|
||||||
if ( is_readable($fullmod . '/db/upgrade.php') && $CFG->xmldb_enabled) {
|
if ( is_readable($fullmod . '/db/upgrade.php')) {
|
||||||
include_once($fullmod . '/db/upgrade.php'); // defines new upgrading function
|
include_once($fullmod . '/db/upgrade.php'); // defines new upgrading function
|
||||||
$newupgrade = true;
|
$newupgrade = true;
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ function upgrade_activity_modules($return) {
|
||||||
|
|
||||||
/// Both old .sql files and new install.xml are supported
|
/// Both old .sql files and new install.xml are supported
|
||||||
/// but we priorize install.xml (XMLDB) if present
|
/// but we priorize install.xml (XMLDB) if present
|
||||||
if (file_exists($fullmod . '/db/install.xml') && $CFG->xmldb_enabled) {
|
if (file_exists($fullmod . '/db/install.xml')) {
|
||||||
$status = install_from_xmldb_file($fullmod . '/db/install.xml'); //New method
|
$status = install_from_xmldb_file($fullmod . '/db/install.xml'); //New method
|
||||||
} else {
|
} else {
|
||||||
$status = modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql'); //Old method
|
$status = modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql'); //Old method
|
||||||
|
|
|
@ -923,7 +923,7 @@ function upgrade_blocks_db($continueto) {
|
||||||
/// Both old .sql files and new install.xml are supported
|
/// Both old .sql files and new install.xml are supported
|
||||||
/// but we priorize install.xml (XMLDB) if present
|
/// but we priorize install.xml (XMLDB) if present
|
||||||
$status = false;
|
$status = false;
|
||||||
if (file_exists($CFG->dirroot . '/blocks/db/install.xml') && $CFG->xmldb_enabled) {
|
if (file_exists($CFG->dirroot . '/blocks/db/install.xml')) {
|
||||||
$status = install_from_xmldb_file($CFG->dirroot . '/blocks/db/install.xml'); //New method
|
$status = install_from_xmldb_file($CFG->dirroot . '/blocks/db/install.xml'); //New method
|
||||||
} else if (file_exists($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.sql')) {
|
} else if (file_exists($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.sql')) {
|
||||||
$status = modify_database($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.sql'); //Old method
|
$status = modify_database($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.sql'); //Old method
|
||||||
|
@ -951,7 +951,7 @@ function upgrade_blocks_db($continueto) {
|
||||||
include_once($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
|
include_once($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
|
||||||
$oldupgrade = true;
|
$oldupgrade = true;
|
||||||
}
|
}
|
||||||
if (is_readable($CFG->dirroot . '/blocks/db/upgrade.php') && $CFG->xmldb_enabled) {
|
if (is_readable($CFG->dirroot . '/blocks/db/upgrade.php')) {
|
||||||
include_once($CFG->dirroot . '/blocks/db/upgrade.php'); // defines new upgrading function
|
include_once($CFG->dirroot . '/blocks/db/upgrade.php'); // defines new upgrading function
|
||||||
$newupgrade = true;
|
$newupgrade = true;
|
||||||
}
|
}
|
||||||
|
@ -1209,7 +1209,7 @@ function upgrade_blocks_plugins($continueto) {
|
||||||
/// Both old .sql files and new install.xml are supported
|
/// Both old .sql files and new install.xml are supported
|
||||||
/// but we priorize install.xml (XMLDB) if present
|
/// but we priorize install.xml (XMLDB) if present
|
||||||
$status = false;
|
$status = false;
|
||||||
if (file_exists($fullblock . '/db/install.xml') && $CFG->xmldb_enabled) {
|
if (file_exists($fullblock . '/db/install.xml')) {
|
||||||
$status = install_from_xmldb_file($fullblock . '/db/install.xml'); //New method
|
$status = install_from_xmldb_file($fullblock . '/db/install.xml'); //New method
|
||||||
} else if (file_exists($fullblock .'/db/'. $CFG->dbtype .'.sql')) {
|
} else if (file_exists($fullblock .'/db/'. $CFG->dbtype .'.sql')) {
|
||||||
$status = modify_database($fullblock .'/db/'. $CFG->dbtype .'.sql'); //Old method
|
$status = modify_database($fullblock .'/db/'. $CFG->dbtype .'.sql'); //Old method
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue