aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-11-16 20:37:57 +0100
committerJulius Härtl <jus@bitgrid.net>2022-12-07 22:32:05 +0100
commitb2af916872b88d1cb1739904ec66fc4417ac0112 (patch)
treead25198c850680372851c866223eaddbf75b75dd /lib
parent3899de12b77abf7489557729cb4a9e0b8935933a (diff)
downloadnextcloud-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.php11
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