summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-03-02 22:19:06 +0000
committerTom Needham <needham.thomas@gmail.com>2012-03-02 22:19:06 +0000
commit86fed4c226f2ca20e3924e1b9483aeea4073fc3b (patch)
tree746ab9fe3b1564adff15f8517a88a459b92040c6
parent8188a9f51bdf0845dcbc24ffe654118b695febc6 (diff)
downloadnextcloud-server-86fed4c226f2ca20e3924e1b9483aeea4073fc3b.tar.gz
nextcloud-server-86fed4c226f2ca20e3924e1b9483aeea4073fc3b.zip
Update database.xml locations. Fix dbexport.xml.
-rw-r--r--apps/admin_export/settings.php7
-rw-r--r--lib/db.php4
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/admin_export/settings.php b/apps/admin_export/settings.php
index 5eecd4f3a2f..5ba6f716a2b 100644
--- a/apps/admin_export/settings.php
+++ b/apps/admin_export/settings.php
@@ -62,8 +62,8 @@ if (isset($_POST['admin_export'])) {
$createstring = "<database>\n\n <name>*dbname*</name>\n <create>true</create>";
$dbexport = str_replace( $dbnamestring, "<database>\n\n <name>*dbname*", $dbexport );
- $dbexport = str_replace( $dbtableprefixstring, "<table>\n\n <name>*dbtableprefix*", $dbexport );
- $dbexport = str_replace( $createstring, "<database>\n\n <name>*dbname*</name>\n <create>false</create", $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 );
// Write the new db export file
file_put_contents( $dbfile, $dbexport );
@@ -134,7 +134,8 @@ if (isset($_POST['admin_export'])) {
exit();
}
- // TODO: Import db
+ // TODO: Import db
+ OC_DB::replaceDB( get_temp_dir() . '/' . $importname . '/dbexport.xml' );
} else {
// fill template
$tmpl = new OC_Template('admin_export', 'settings');
diff --git a/lib/db.php b/lib/db.php
index 2348da908ef..07e58590966 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -493,10 +493,10 @@ class OC_DB {
$apps = OC_App::getAllApps();
// Delete the old tables
- self::removeDBStructure( OC::$DOCUMENTROOT . 'db_structure.xml' );
+ self::removeDBStructure( OC::$SERVERROOT . '/db_structure.xml' );
foreach($apps as $app){
- $path = '/apps/'.$app.'/appinfo/database.xml';
+ $path = OC::$SERVERROOT.'/apps/'.$app.'/appinfo/database.xml';
if(file_exists($path)){
self::removeDBStructure( $path );
}