diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-03-03 13:26:01 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-03-03 13:26:01 +0000 |
commit | 188a304625b8ddb597505f69bc34487806b5b18e (patch) | |
tree | 7e72331e51068c7b0ca10a10da08df48333a750c /lib/migrate.php | |
parent | 6906988b4ec795d5d33367cd192b47d061f1c906 (diff) | |
download | nextcloud-server-188a304625b8ddb597505f69bc34487806b5b18e.tar.gz nextcloud-server-188a304625b8ddb597505f69bc34487806b5b18e.zip |
Replace db on import. Update user_migration export function.
Diffstat (limited to 'lib/migrate.php')
-rw-r--r-- | lib/migrate.php | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/lib/migrate.php b/lib/migrate.php index a1b4c5019bc..c5def5b5830 100644 --- a/lib/migrate.php +++ b/lib/migrate.php @@ -41,16 +41,26 @@ class OC_Migrate{ * @return string xml of app data */ public static function export($uid){ + + $doc = new DOMDocument(); + $doc->formatOutput = true; + OC_Log::write('user_migrate','App data export started for user: '.$uid,OC_Log::INFO); - $xml = ''; + foreach(self::$providers as $provider){ + OC_Log::write('user_migrate','Getting app data for app:'.$provider->appid,OC_Log::INFO); - $xml .= '<app>'; - $xml .= self::appInfoXML($provider->appid); - $xml .= $provider->export($uid); - $xml .= '</app>'; + $app = $doc->createElement('app'); + $doc->appendChild($app); + // Append app info + $app = $doc->appendChild( self::appInfoXML( $provider->appid ) ); + + // Add the app data + $app->appendChild($provider->export($uid)); + } - return $xml; + + return $doc->saveXML(); } /** @@ -59,10 +69,12 @@ class OC_Migrate{ * @return string xml app info */ public static function appInfoXML($appid){ - $info = OC_App::getAppInfo($appid); - $xml = '<appinfo>'; - $xml .= 'INFO HERE'; - $xml .= '</appinfo>'; - return $xml; + $doc = new DOMDocument(); + $appinfo = $doc->createElement('appinfo'); + $appinfo = $doc->appendChild($appinfo); + $data = $doc->createTextNode($appid); + $appinfo->appendChild($data); + + return $appinfo; } } |