diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-11-16 20:37:57 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-12-07 22:32:05 +0100 |
commit | b2af916872b88d1cb1739904ec66fc4417ac0112 (patch) | |
tree | ad25198c850680372851c866223eaddbf75b75dd /lib | |
parent | 3899de12b77abf7489557729cb4a9e0b8935933a (diff) | |
download | nextcloud-server-b2af916872b88d1cb1739904ec66fc4417ac0112.tar.gz nextcloud-server-b2af916872b88d1cb1739904ec66fc4417ac0112.zip |
Take some shortcut when setting up the application class
When getting the application class we can ask the app container directly
and skip the server container as it won't find a match and fallback to
the app container anyways
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/ServerContainer.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/ServerContainer.php b/lib/private/ServerContainer.php index 0bc99f6c152..4352d0e8350 100644 --- a/lib/private/ServerContainer.php +++ b/lib/private/ServerContainer.php @@ -139,10 +139,13 @@ class ServerContainer extends SimpleContainer { public function query(string $name, bool $autoload = true) { $name = $this->sanitizeName($name); - try { - return parent::query($name, false); - } catch (QueryException $e) { - // Continue with general autoloading then + if (strpos($name, 'OCA\\') !== 0) { + // Skip server container query for app namespace classes + try { + return parent::query($name, false); + } catch (QueryException $e) { + // Continue with general autoloading then + } } // In case the service starts with OCA\ we try to find the service in |