diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-06-23 16:20:31 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-06-23 16:20:31 +0200 |
commit | a8868fa007bbf6ed52cf7044bdd1b891084fbab9 (patch) | |
tree | 780bc5c608310f1d7c64fb2d80f620ff42e0d958 | |
parent | b591c830088cbde14d7cad3c205ddf929f07e33c (diff) | |
download | nextcloud-server-a8868fa007bbf6ed52cf7044bdd1b891084fbab9.tar.gz nextcloud-server-a8868fa007bbf6ed52cf7044bdd1b891084fbab9.zip |
work with non existing apps directory. thanks toAntonio for the hint
-rw-r--r-- | lib/installer.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/installer.php b/lib/installer.php index 4069f2ab7c6..c5ca0883d76 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -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 ); } /** |