diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-02-15 11:20:22 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-02-15 11:20:22 +0100 |
commit | 04053311eef71536eaec8bc0519e21303b0cec20 (patch) | |
tree | 5b08de3e135dcc45311c69494c0c7a1d1d17a562 /lib/private/legacy/app.php | |
parent | cd2e5b549c882473eef74b759b0e3f6af0acb3a8 (diff) | |
download | nextcloud-server-04053311eef71536eaec8bc0519e21303b0cec20.tar.gz nextcloud-server-04053311eef71536eaec8bc0519e21303b0cec20.zip |
Properly encapsulate require_once for app.php
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r-- | lib/private/legacy/app.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index b19d63f560e..646992c2c10 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -133,6 +133,7 @@ class OC_App { * load a single app * * @param string $app + * @throws Exception */ public static function loadApp($app) { self::$loadedApps[] = $app; @@ -146,7 +147,15 @@ class OC_App { if (is_file($appPath . '/appinfo/app.php')) { \OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app); - self::requireAppFile($app); + try { + self::requireAppFile($app); + } catch (Error $ex) { + \OC::$server->getLogger()->logException($ex); + if (!\OC::$server->getAppManager()->isShipped($app)) { + // Only disable apps which are not shipped + self::disable($app); + } + } if (self::isType($app, array('authentication'))) { // since authentication apps affect the "is app enabled for group" check, // the enabled apps cache needs to be cleared to make sure that the @@ -250,16 +259,8 @@ class OC_App { * @param string $app app name */ private static function requireAppFile($app) { - try { - // encapsulated here to avoid variable scope conflicts - require_once $app . '/appinfo/app.php'; - } catch (Error $ex) { - \OC::$server->getLogger()->logException($ex); - if (!\OC::$server->getAppManager()->isShipped($app)) { - // Only disable apps which are not shipped - self::disable($app); - } - } + // encapsulated here to avoid variable scope conflicts + require_once $app . '/appinfo/app.php'; } /** |