Update database.xml locations. Fix dbexport.xml.
This commit is contained in:
parent
8188a9f51b
commit
86fed4c226
|
@ -62,8 +62,8 @@ if (isset($_POST['admin_export'])) {
|
||||||
$createstring = "<database>\n\n <name>*dbname*</name>\n <create>true</create>";
|
$createstring = "<database>\n\n <name>*dbname*</name>\n <create>true</create>";
|
||||||
|
|
||||||
$dbexport = str_replace( $dbnamestring, "<database>\n\n <name>*dbname*", $dbexport );
|
$dbexport = str_replace( $dbnamestring, "<database>\n\n <name>*dbname*", $dbexport );
|
||||||
$dbexport = str_replace( $dbtableprefixstring, "<table>\n\n <name>*dbtableprefix*", $dbexport );
|
$dbexport = str_replace( $dbtableprefixstring, "<table>\n\n <name>*dbprefix*", $dbexport );
|
||||||
$dbexport = str_replace( $createstring, "<database>\n\n <name>*dbname*</name>\n <create>false</create", $dbexport );
|
$dbexport = str_replace( $createstring, "<database>\n\n <name>*dbname*</name>\n <create>false</create>", $dbexport );
|
||||||
|
|
||||||
// Write the new db export file
|
// Write the new db export file
|
||||||
file_put_contents( $dbfile, $dbexport );
|
file_put_contents( $dbfile, $dbexport );
|
||||||
|
@ -135,6 +135,7 @@ if (isset($_POST['admin_export'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Import db
|
// TODO: Import db
|
||||||
|
OC_DB::replaceDB( get_temp_dir() . '/' . $importname . '/dbexport.xml' );
|
||||||
} else {
|
} else {
|
||||||
// fill template
|
// fill template
|
||||||
$tmpl = new OC_Template('admin_export', 'settings');
|
$tmpl = new OC_Template('admin_export', 'settings');
|
||||||
|
|
|
@ -493,10 +493,10 @@ class OC_DB {
|
||||||
$apps = OC_App::getAllApps();
|
$apps = OC_App::getAllApps();
|
||||||
|
|
||||||
// Delete the old tables
|
// Delete the old tables
|
||||||
self::removeDBStructure( OC::$DOCUMENTROOT . 'db_structure.xml' );
|
self::removeDBStructure( OC::$SERVERROOT . '/db_structure.xml' );
|
||||||
|
|
||||||
foreach($apps as $app){
|
foreach($apps as $app){
|
||||||
$path = '/apps/'.$app.'/appinfo/database.xml';
|
$path = OC::$SERVERROOT.'/apps/'.$app.'/appinfo/database.xml';
|
||||||
if(file_exists($path)){
|
if(file_exists($path)){
|
||||||
self::removeDBStructure( $path );
|
self::removeDBStructure( $path );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue