$agreelicence = optional_param('agreelicence',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
if ($ignoreupgradewarning and !empty($_SESSION['upgraderunning'])) {
$_SESSION['upgraderunning'] = 0;
/// Both old .sql files and new install.xml are supported
/// But we priorize install.xml (XMLDB) if present
$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
} else if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
$status = modify_database("$CFG->libdir/db/$CFG->dbtype.sql"); //Old method
if (file_exists("$CFG->dirroot/lib/db/$CFG->dbtype.php")) {
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
}
/// Both old .sql files and new install.xml are supported
/// but we priorize install.xml (XMLDB) if present
$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
} else if (file_exists($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.sql')) {
$status = modify_database($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.sql'); //Old method
include_once($CFG->dirroot . '/backup/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
$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
$newupgrade = true;
}
include_once($fullplug . '/db/'. $CFG->dbtype . '.php'); // defines old upgrading function
$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
$newupgrade = true;
}
/// Both old .sql files and new install.xml are supported
/// but we priorize install.xml (XMLDB) if present
$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
} else if (file_exists($fullplug .'/db/'. $CFG->dbtype .'.sql')) {
$status = modify_database($fullplug .'/db/'. $CFG->dbtype .'.sql'); //Old method
include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
$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
$newupgrade = true;
}
/// Both old .sql files and new install.xml are supported
/// 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
} else {
$status = modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql'); //Old method
/// Both old .sql files and new install.xml are supported
/// but we priorize install.xml (XMLDB) if present
$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
} else if (file_exists($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.sql')) {
$status = modify_database($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.sql'); //Old method
include_once($CFG->dirroot . '/blocks/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
$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
$newupgrade = true;
}
/// Both old .sql files and new install.xml are supported
/// but we priorize install.xml (XMLDB) if present
$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
} else if (file_exists($fullblock .'/db/'. $CFG->dbtype .'.sql')) {
$status = modify_database($fullblock .'/db/'. $CFG->dbtype .'.sql'); //Old method