]> git.mjollnir.org Git - moodle.git/commitdiff
Now XMLDB installation is enabled! Old mysql.php and postgres7.php can
authorstronk7 <stronk7>
Wed, 20 Sep 2006 22:36:21 +0000 (22:36 +0000)
committerstronk7 <stronk7>
Wed, 20 Sep 2006 22:36:21 +0000 (22:36 +0000)
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.

admin/index.php
backup/lib.php
lib/adminlib.php
lib/blocklib.php

index 8a9ade6608270e9c3d16cd6cdfe5ef3dbd868829..d8a52dd20f1949e20fa46cd65aa0940a7e1be33f 100644 (file)
     $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
     }
 
index f5f36627a80dba41a1455cba3f3e8c529093a54f..d28e2c1a6152d74063c534e8724b7b1608a8b968 100644 (file)
         /// 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;
         }
index d571befad72d29a6efcc05c4c82a17c9997b798d..e765dec08a4ea2e2af3e89b3c4aae9ff16dc0767 100644 (file)
@@ -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
index 8dd157c6e7e5ae610a6f269e8e08189ac95cdcf1..480794d6e49342ef6c7bef42ebf6eb0ec708ca9b 100644 (file)
@@ -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