]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix structure of export zip
authorTom Needham <needham.thomas@gmail.com>
Sat, 17 Mar 2012 15:01:08 +0000 (15:01 +0000)
committerTom Needham <needham.thomas@gmail.com>
Sat, 17 Mar 2012 15:01:08 +0000 (15:01 +0000)
lib/migrate.php

index f5fb808f173582ffa1a542fe62d913e11ea4d8ca..44d28297d48f950cffe2a268645a2487a7217daf 100644 (file)
@@ -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