]> source.dussan.org Git - nextcloud-server.git/commitdiff
move installation of shipped apps to setup
authorKamil Domanski <kdomanski@kdemail.net>
Sat, 18 Jun 2011 22:55:19 +0000 (00:55 +0200)
committerKamil Domanski <kdomanski@kdemail.net>
Sat, 18 Jun 2011 22:55:19 +0000 (00:55 +0200)
lib/app.php
lib/setup.php

index e373331850d6015b26968e16a8649e07d0cf6c64..4e67da3c414ee5bc9307ab4682c284a46bf06f72 100644 (file)
@@ -57,28 +57,10 @@ class OC_APP{
                }
 
                // The rest comes here
-               $dir = opendir( "$SERVERROOT/apps" );
-               while( false !== ( $filename = readdir( $dir ))){
-                       if( substr( $filename, 0, 1 ) != '.' and is_dir("$SERVERROOT/apps/$filename") ){
-                               if( file_exists( "$SERVERROOT/apps/$filename/appinfo/app.php" )){
-                                       if(OC_APPCONFIG::getValue($filename,'installed_version',0)==0){ //check if the plugin is fully installed
-                                               //install the database
-                                               if(is_file("$SERVERROOT/apps/$filename/appinfo/database.xml")){
-                                                       OC_DB::createDbFromStructure("$SERVERROOT/apps/$filename/appinfo/database.xml");
-                                               }
-                                               
-                                               //run appinfo/install.php
-                                               if(is_file("$SERVERROOT/apps/$filename/appinfo/install.php")){
-                                                       include("$SERVERROOT/apps/$filename/appinfo/install.php");
-                                               }
-                                               $info=self::getAppInfo("$SERVERROOT/apps/$filename/appinfo/info.xml");
-                                               OC_APPCONFIG::setValue($filename,'installed_version',$info['version']);
-                                       }
-                                       require( "apps/$filename/appinfo/app.php" );
-                               }
-                       }
+               $apps = OC_APPCONFIG::getApps();
+               foreach( $apps as $app ){
+                       require( "apps/$app/appinfo/app.php" );
                }
-               closedir( $dir );
 
                self::$init = true;
 
index c2757021f20433f7348d37b7734ae239f2a93a47..e9cb3da686c390e88d015c6969e38ea894e05260 100644 (file)
@@ -31,6 +31,7 @@ else {
 
 class OC_SETUP {
        public static function install($options) {
+               global $SERVERROOT;
                $error = array();
                $dbtype = $options['dbtype'];
                
@@ -133,6 +134,21 @@ class OC_SETUP {
                                OC_GROUP::createGroup('admin');
                                OC_GROUP::addToGroup($username, 'admin');
 
+                               foreach( array( "files_imageviewer", "files_publiclink" ) as $app ){
+
+                                       if(is_file("$SERVERROOT/apps/$app/appinfo/database.xml")){
+                                               OC_DB::createDbFromStructure("$SERVERROOT/apps/$app/appinfo/database.xml");
+                                       }
+
+                                       //run appinfo/install.php
+                                       if(is_file("$SERVERROOT/apps/$app/appinfo/install.php")){
+                                               include("$SERVERROOT/apps/$app/appinfo/install.php");
+                                       }
+
+                                       $info=OC_APP::getAppInfo("$SERVERROOT/apps/$app/appinfo/info.xml");
+                                       OC_APPCONFIG::setValue($app,'installed_version',$info['version']);
+                               }
+
                                //create htaccess files for apache hosts
                                self::createHtaccess(); //TODO detect if apache is used