Merge pull request #23976 from nextcloud/enh/reduce_getAppPath_and_autoload_reg

Reduce the getAppPath and autoloader calls
This commit is contained in:
Morris Jobke 2020-11-09 11:10:33 +01:00 committed by GitHub
commit f02bab1425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -118,9 +118,12 @@ class OC_App {
// Add each apps' folder as allowed class path
foreach ($apps as $app) {
$path = self::getAppPath($app);
if ($path !== false) {
self::registerAutoloading($app, $path);
// If the app is already loaded then autoloading it makes no sense
if (!isset(self::$loadedApps[$app])) {
$path = self::getAppPath($app);
if ($path !== false) {
self::registerAutoloading($app, $path);
}
}
}