]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add getApps() method to return apps supporting migration
authorTom Needham <needham.thomas@gmail.com>
Tue, 13 Mar 2012 21:28:53 +0000 (21:28 +0000)
committerTom Needham <needham.thomas@gmail.com>
Tue, 13 Mar 2012 21:28:53 +0000 (21:28 +0000)
lib/migrate.php

index a6a6432d0de3e5faff8e7aaf357ee15500b95b7e..863cf261f4e919ae22976c630bf07fde9881078a 100644 (file)
@@ -121,6 +121,21 @@ class OC_Migrate{
                
        }
        
+       /**
+       * @breif returns an array of apps that support migration
+       * @return array
+       */
+       static public function getApps(){
+               $allapps = OC_App::getAllApps();
+               foreach($allapps as $app){
+                       $path = OC::$SERVERROOT . '/apps/' . $app . '/lib/migrate.php';
+                       if( file_exists( $path ) ){
+                               $supportsmigration[] = $app;
+                       }       
+               }
+               reutrn $supportsmigration;      
+       }
+       
        /**
        * @breif imports a new user
        * @param $db string path to migration.db