Now all the XMLDBxxx->geSQL functions return an array of statements to be

executed (easily to handle them in the installation/upgrade process
individually. Also, it's possible to specify one statement end.
This commit is contained in:
stronk7
2006-08-17 19:20:45 +00:00
parent de16da7293
commit 9dcc6300a7
7 changed files with 77 additions and 38 deletions
+4 -7
View File
@@ -697,19 +697,16 @@ class XMLDBStructure extends XMLDBObject {
* This function will return the SQL code needed to create the table for the specified DB and
* prefix. Just one simple wrapper over generators.
*/
function getCreateStructureSQL ($dbtype, $prefix) {
function getCreateStructureSQL ($dbtype, $prefix, $statement_end=true) {
$sqltext = '';
$results = array();
$classname = 'XMLDB' . $dbtype;
$generator = new $classname();
$generator->setPrefix($prefix);
if ($tables = $this->getTables()) {
foreach ($tables as $table) {
$sqltext .= $generator->getCreateTableSQL($table) . "\n\n";
$results = array_merge($results, $table->getCreateTableSQL($dbtype, $prefix, $statement_end));
}
}
return $sqltext;
return $results;
}
}