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

index c0903f93d519b7637ec16d651f21e91e3febd782..b650f3eed0df4227a88861cdd4b1c914e94b449f 100644 (file)
@@ -287,16 +287,17 @@ class OC_Installer{
         */
        public static function installShippedApps(){
                foreach(OC::$APPSROOTS as $app_dir) {
-                       $dir = opendir( $app_dir['path'] );
-                       while( false !== ( $filename = readdir( $dir ))){
-                               if( substr( $filename, 0, 1 ) != '.' and is_dir($app_dir['path']."/$filename") ){
-                                       if( file_exists( $app_dir['path']."/$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( $app_dir['path'] )){
+                               while( false !== ( $filename = readdir( $dir ))){
+                                       if( substr( $filename, 0, 1 ) != '.' and is_dir($app_dir['path']."/$filename") ){
+                                               if( file_exists( $app_dir['path']."/$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');
+                                                               }
                                                        }
                                                }
                                        }