|
|
|
|
@ -10,19 +10,21 @@ class OC_DB_MDB2SchemaWriter {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $file
|
|
|
|
|
* @param \Doctrine\DBAL\Schema\AbstractSchemaManager $sm
|
|
|
|
|
* @param \OC\DB\Connection $conn
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
static public function saveSchemaToFile($file, $conn) {
|
|
|
|
|
static public function saveSchemaToFile($file, \OC\DB\Connection $conn) {
|
|
|
|
|
$config = \OC::$server->getConfig();
|
|
|
|
|
|
|
|
|
|
$xml = new SimpleXMLElement('<database/>');
|
|
|
|
|
$xml->addChild('name', OC_Config::getValue( "dbname", "owncloud" ));
|
|
|
|
|
$xml->addChild('name', $config->getSystemValue('dbname', 'owncloud'));
|
|
|
|
|
$xml->addChild('create', 'true');
|
|
|
|
|
$xml->addChild('overwrite', 'false');
|
|
|
|
|
$xml->addChild('charset', 'utf8');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$conn->getConfiguration()->
|
|
|
|
|
setFilterSchemaAssetsExpression('/^'.\OCP\Config::getSystemValue('dbtableprefix'.'/'));
|
|
|
|
|
|
|
|
|
|
setFilterSchemaAssetsExpression('/^' . $config->getSystemValue('dbtableprefix') . '/');
|
|
|
|
|
|
|
|
|
|
foreach ($conn->getSchemaManager()->listTables() as $table) {
|
|
|
|
|
self::saveTable($table, $xml->addChild('table'));
|
|
|
|
|
}
|
|
|
|
|
|