From: stronk7 Date: Wed, 20 Sep 2006 22:36:21 +0000 (+0000) Subject: Now XMLDB installation is enabled! Old mysql.php and postgres7.php can X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=db8bd7a66f94fb1a5a3a18004fc504e16d2b3719;p=moodle.git 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. --- diff --git a/admin/index.php b/admin/index.php index 8a9ade6608..d8a52dd20f 100644 --- a/admin/index.php +++ b/admin/index.php @@ -30,12 +30,6 @@ $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; @@ -140,7 +134,7 @@ /// 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 @@ -198,7 +192,7 @@ 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 } diff --git a/backup/lib.php b/backup/lib.php index f5f36627a8..d28e2c1a61 100644 --- a/backup/lib.php +++ b/backup/lib.php @@ -336,7 +336,7 @@ /// 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 @@ -367,7 +367,7 @@ 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; } diff --git a/lib/adminlib.php b/lib/adminlib.php index d571befad7..e765dec08a 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -46,7 +46,7 @@ function upgrade_plugins($type, $dir, $return) { 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; } @@ -100,7 +100,7 @@ function upgrade_plugins($type, $dir, $return) { /// 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 @@ -215,7 +215,7 @@ function upgrade_activity_modules($return) { 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; } @@ -328,7 +328,7 @@ function upgrade_activity_modules($return) { /// 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 diff --git a/lib/blocklib.php b/lib/blocklib.php index 8dd157c6e7..480794d6e4 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -923,7 +923,7 @@ function upgrade_blocks_db($continueto) { /// 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 @@ -951,7 +951,7 @@ function upgrade_blocks_db($continueto) { 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; } @@ -1209,7 +1209,7 @@ function upgrade_blocks_plugins($continueto) { /// 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