aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-11-16 20:21:33 +0100
committerJulius Härtl <jus@bitgrid.net>2022-12-07 22:32:05 +0100
commit3899de12b77abf7489557729cb4a9e0b8935933a (patch)
treed8136abfb565a560d71feafe75b4c5afa4238364 /lib/private/AppFramework
parentd7ecbe32d205309f7bf2eaed41890d40cdc5e660 (diff)
downloadnextcloud-server-3899de12b77abf7489557729cb4a9e0b8935933a.tar.gz
nextcloud-server-3899de12b77abf7489557729cb4a9e0b8935933a.zip
Skip querying the app container for server namespace
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 5fd363ee963..8fe17d5a85e 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -442,6 +442,12 @@ class DIContainer extends SimpleContainer implements IAppContainer {
if ($name === 'AppName' || $name === 'appName') {
return $this->appName;
}
+
+ $isServerClass = str_starts_with($name, 'OCP\\') || str_starts_with($name, 'OC\\');
+ if ($isServerClass && !$this->has($name)) {
+ return $this->getServer()->query($name, $autoload);
+ }
+
try {
return $this->queryNoFallback($name);
} catch (QueryException $firstException) {