]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15071 new method for installing of table from xmld structure - credit goes to...
authorskodak <skodak>
Sun, 13 Jul 2008 20:27:14 +0000 (20:27 +0000)
committerskodak <skodak>
Sun, 13 Jul 2008 20:27:14 +0000 (20:27 +0000)
lib/ddl/database_manager.php

index 823facbf94252ad85950db32aa018a1983a911a9..e07b84ca8b214b8da7387f8995c4660a4580a16e 100644 (file)
@@ -386,9 +386,7 @@ if (!is_object($xmldb_key)) {
     }
 
     /**
-     * This function will load one entire XMLDB file, generating all the needed
-     * SQL statements, specific for each RDBMS ($CFG->dbtype) and, finally, it
-     * will execute all those statements against the DB.
+     * This function will load one entire XMLDB file and call install_from_xmldb_structure.
      *
      * @param $file full path to the XML file to be used
      * @return void
@@ -413,6 +411,18 @@ if (!is_object($xmldb_key)) {
 
         $xmldb_structure = $xmldb_file->getStructure();
 
+        $this->install_from_xmldb_structure($xmldb_file->getStructure());
+    }
+
+    /**
+     * This function will generate all the needed SQL statements, specific for each 
+     * RDBMS type and, finally, it will execute all those statements against the DB.
+     *
+     * @param object $structure xmldb_structure object
+     * @return void
+     */
+    public function install_from_xmldb_structure($xmldb_structure) {
+
         /// Do this function silenty (to avoid output in install/upgrade process)
         $olddbdebug = $this->mdb->get_debug();
         $this->mdb->set_debug(false);