summaryrefslogtreecommitdiffstats
path: root/lib/migrate.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-03-17 15:01:08 +0000
committerTom Needham <needham.thomas@gmail.com>2012-03-17 15:01:08 +0000
commit247b25e7a97fcbe8386c63b1318537e669d40480 (patch)
treed96c4fbbcf0cc9eb8de9f7b97ab800b81121b406 /lib/migrate.php
parent5234e66bab0ebc6fd7eeef8170cf9f61f035124d (diff)
downloadnextcloud-server-247b25e7a97fcbe8386c63b1318537e669d40480.tar.gz
nextcloud-server-247b25e7a97fcbe8386c63b1318537e669d40480.zip
Fix structure of export zip
Diffstat (limited to 'lib/migrate.php')
-rw-r--r--lib/migrate.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/migrate.php b/lib/migrate.php
index f5fb808f173..44d28297d48 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -228,7 +228,7 @@ class OC_Migrate{
if( !file_put_contents( $tmpfile, $json ) ){
return false;
} else {
- self::$zip->addFile( $tmpfile, "export_info.json" );
+ self::$zip->addFile( $tmpfile, "/" . self::$uid . "/export_info.json" );
return true;
}
}
@@ -278,6 +278,8 @@ class OC_Migrate{
self::$uid = $uid;
// Create the zip object
self::$zip = new ZipArchive;
+ // Set export type
+ self::$exporttype = 'user';
// Calculate users data dir
$user = OC_User::getUser();
$userdatadir = OC_Config::getValue( 'datadirectory' ) . '/' . $user . '/';
@@ -306,8 +308,9 @@ class OC_Migrate{
return false;
}
// Export the app info
- $exportinfo = json_encode( self::addExportInfo( self::exportAppData() ) );
- file_put_contents( $userdatadir . '/exportinfo.json', $exportinfo );
+ $appinfo = self::exportAppData();
+ // Save the migration results
+ self::addExportInfo( $appinfo );
// Add the data dir to the zip
self::addDirToZip( $userdatadir );
// Close the zip