index : flyspray | |
Archlinux32 customized Flyspray installation | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
commit | 6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch) | |
tree | 350feb504587d932e02837a1442b059759927646 /setup/exportdb.php |
-rw-r--r-- | setup/exportdb.php | 27 |
diff --git a/setup/exportdb.php b/setup/exportdb.php new file mode 100644 index 0000000..fd714a3 --- /dev/null +++ b/setup/exportdb.php @@ -0,0 +1,27 @@ +<?php + +error_reporting(E_ALL); + +die('Enable me by commenting this out by editing '.basename(__FILE__).' at line '.__LINE__); + +require_once '../vendor/adodb/adodb-php/adodb.inc.php'; +require_once '../vendor/adodb/adodb-php/adodb-xmlschema03.inc.php'; + +$conf = @parse_ini_file('../flyspray.conf.php', true) or die('Cannot open config file.'); + +/* Start by creating a normal ADODB connection. */ +$db = ADONewConnection($conf['database']['dbtype']); +$db->Connect( $conf['database']['dbhost'], $conf['database']['dbuser'], + $conf['database']['dbpass'], $conf['database']['dbname']) or die('Cannot connect to DB.'); +$db->debug= true; + +/* Use the database connection to create a new adoSchema object. */ +$schema = new adoSchema($db); + +$withdata=false; +$stripprefix=true; +$data = $schema->ExtractSchema( $withdata, ' ', $conf['database']['dbprefix'], $stripprefix); + +file_put_contents('flyspray-schema.xml', $data); + +?> |