Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encapsulate require_once to avoid name space bleedind #11634

Merged
merged 1 commit into from
Oct 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/private/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function loadApp($app, $checkUpgrade = true) {
if ($checkUpgrade and self::shouldUpgrade($app)) {
throw new \OC\NeedsUpdateException();
}
require_once $app . '/appinfo/app.php';
self::requireAppFile($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
Expand All @@ -103,6 +103,16 @@ public static function loadApp($app, $checkUpgrade = true) {
}
}

/**
* Load app.php from the given app
*
* @param string $app app name
*/
private static function requireAppFile($app) {
// encapsulated here to avoid variable scope conflicts
require_once $app . '/appinfo/app.php';
}

/**
* check if an app is of a specific type
*
Expand Down