diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-11-07 17:24:41 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-11-07 17:24:41 +0100 |
commit | d8637c62e0b77cc597c9e11e4ea2bcbdd5c74646 (patch) | |
tree | 67b9099196713dd3f7d88209f8390a80b1780cd3 /lib/private/legacy | |
parent | a5fa9604babdab101357016066ed72b4fcab1d21 (diff) | |
download | nextcloud-server-d8637c62e0b77cc597c9e11e4ea2bcbdd5c74646.tar.gz nextcloud-server-d8637c62e0b77cc597c9e11e4ea2bcbdd5c74646.zip |
Reduce the getAppPath and autoloader calls
The getAppPath will always return the same data for the same appId. It
is actually already cached. However we do some cleanup of the appId
(again). Same for the autoloading it is actually already checked.
This just removes the unneeded calls. Which can add up if you have a lot
of incomming shares.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_App.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 941cd25397d..34d5d9ffe7c 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -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); + } } } |