summaryrefslogtreecommitdiffstats
path: root/lib/migrate.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-05-10 23:06:53 +0000
committerTom Needham <needham.thomas@gmail.com>2012-05-10 23:06:53 +0000
commit709b0a1ddc5a4ec518a1c53c2a6397cbb29bf45c (patch)
tree1550ce7d5095bcc359fe447ea8e297c70d28b2f4 /lib/migrate.php
parent4094f6f8e09b7bfac4d010e2409b7f9d2c36a991 (diff)
downloadnextcloud-server-709b0a1ddc5a4ec518a1c53c2a6397cbb29bf45c.tar.gz
nextcloud-server-709b0a1ddc5a4ec518a1c53c2a6397cbb29bf45c.zip
Check if app is enabled before exporting its data
Diffstat (limited to 'lib/migrate.php')
-rw-r--r--lib/migrate.php54
1 files changed, 28 insertions, 26 deletions
diff --git a/lib/migrate.php b/lib/migrate.php
index 99926171b77..8fb949d66e1 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -406,36 +406,38 @@ class OC_Migrate{
// Foreach provider
foreach( self::$providers as $provider ){
- $success = true;
- // Does this app use the database?
- if( file_exists( OC::$SERVERROOT.'/apps/'.$provider->getID().'/appinfo/database.xml' ) ){
- // Create some app tables
- $tables = self::createAppTables( $provider->getID() );
- if( is_array( $tables ) ){
- // Save the table names
- foreach($tables as $table){
- $return['apps'][$provider->getID()]['tables'][] = $table;
+ // Check if the app is enabled
+ if( OC_App::isEnabled( $provider->getID() ) ){
+ $success = true;
+ // Does this app use the database?
+ if( file_exists( OC::$SERVERROOT.'/apps/'.$provider->getID().'/appinfo/database.xml' ) ){
+ // Create some app tables
+ $tables = self::createAppTables( $provider->getID() );
+ if( is_array( $tables ) ){
+ // Save the table names
+ foreach($tables as $table){
+ $return['apps'][$provider->getID()]['tables'][] = $table;
+ }
+ } else {
+ // It failed to create the tables
+ $success = false;
}
+ }
+
+ // Run the export function?
+ if( $success ){
+ // Set the provider properties
+ $provider->setData( self::$uid, self::$content );
+ $return['apps'][$provider->getID()]['success'] = $provider->export();
} else {
- // It failed to create the tables
- $success = false;
+ $return['apps'][$provider->getID()]['success'] = false;
+ $return['apps'][$provider->getID()]['message'] = 'failed to create the app tables';
}
+
+ // Now add some app info the the return array
+ $appinfo = OC_App::getAppInfo( $provider->getID() );
+ $return['apps'][$provider->getID()]['version'] = OC_App::getAppVersion($provider->getID());
}
-
- // Run the export function?
- if( $success ){
- // Set the provider properties
- $provider->setData( self::$uid, self::$content );
- $return['apps'][$provider->getID()]['success'] = $provider->export();
- } else {
- $return['apps'][$provider->getID()]['success'] = false;
- $return['apps'][$provider->getID()]['message'] = 'failed to create the app tables';
- }
-
- // Now add some app info the the return array
- $appinfo = OC_App::getAppInfo( $provider->getID() );
- $return['apps'][$provider->getID()]['version'] = OC_App::getAppVersion($provider->getID());
-
}
return $return;