From: skodak Date: Sun, 13 Jul 2008 20:27:14 +0000 (+0000) Subject: MDL-15071 new method for installing of table from xmld structure - credit goes to... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0549c245e16d04aeb248c8bb9d73581d72055a89;p=moodle.git MDL-15071 new method for installing of table from xmld structure - credit goes to Andrei Bautu --- diff --git a/lib/ddl/database_manager.php b/lib/ddl/database_manager.php index 823facbf94..e07b84ca8b 100644 --- a/lib/ddl/database_manager.php +++ b/lib/ddl/database_manager.php @@ -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);