]> source.dussan.org Git - nextcloud-server.git/commitdiff
Take some shortcut when setting up the application class
authorJulius Härtl <jus@bitgrid.net>
Wed, 16 Nov 2022 19:37:57 +0000 (20:37 +0100)
committerJulius Härtl <jus@bitgrid.net>
Wed, 7 Dec 2022 21:32:05 +0000 (22:32 +0100)
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>
lib/private/ServerContainer.php

index 0bc99f6c152a9636cd8e922cf53b35f721762375..4352d0e835026d5293141e9f1bafab83bcfd11d8 100644 (file)
@@ -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