Update database.xml locations. Fix dbexport.xml.

This commit is contained in:
Tom Needham 2012-03-02 22:19:06 +00:00
parent 8188a9f51b
commit 86fed4c226
2 changed files with 6 additions and 5 deletions

View File

@ -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 );
@ -134,7 +134,8 @@ if (isset($_POST['admin_export'])) {
exit(); exit();
} }
// 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');

View File

@ -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 );
} }