]> source.dussan.org Git - nextcloud-server.git/commitdiff
work with non existing apps directory. thanks toAntonio for the hint
authorFrank Karlitschek <frank@owncloud.org>
Sat, 23 Jun 2012 14:20:31 +0000 (16:20 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Sat, 23 Jun 2012 14:20:31 +0000 (16:20 +0200)
lib/installer.php

index 4069f2ab7c641ec3c21df2b48189cc8866e9d86a..c5ca0883d76b0e8683e430992ea9a8a5c65f37b8 100644 (file)
@@ -287,22 +287,23 @@ class OC_Installer{
         * This function installs all apps found in the 'apps' directory that should be enabled by default;
         */
        public static function installShippedApps(){
-               $dir = opendir( OC::$APPSROOT."/apps" );
-               while( false !== ( $filename = readdir( $dir ))){
-                       if( substr( $filename, 0, 1 ) != '.' and is_dir(OC::$APPSROOT."/apps/$filename") ){
-                               if( file_exists( OC::$APPSROOT."/apps/$filename/appinfo/app.php" )){
-                                       if(!OC_Installer::isInstalled($filename)){
-                                               $info=OC_App::getAppInfo($filename);
-                                               $enabled = isset($info['default_enable']);
-                                               if( $enabled ){
-                                                       OC_Installer::installShippedApp($filename);
-                                                       OC_Appconfig::setValue($filename,'enabled','yes');
+               if($dir = opendir( OC::$APPSROOT."/apps" )){
+                       while( false !== ( $filename = readdir( $dir ))){
+                               if( substr( $filename, 0, 1 ) != '.' and is_dir(OC::$APPSROOT."/apps/$filename") ){
+                                       if( file_exists( OC::$APPSROOT."/apps/$filename/appinfo/app.php" )){
+                                               if(!OC_Installer::isInstalled($filename)){
+                                                       $info=OC_App::getAppInfo($filename);
+                                                       $enabled = isset($info['default_enable']);
+                                                       if( $enabled ){
+                                                               OC_Installer::installShippedApp($filename);
+                                                               OC_Appconfig::setValue($filename,'enabled','yes');
+                                                       }
                                                }
                                        }
                                }
                        }
+                       closedir( $dir );
                }
-               closedir( $dir );
        }
 
        /**