Skip querying the app container for server namespace

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2022-11-16 20:21:33 +01:00
parent d7ecbe32d2
commit 3899de12b7
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -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) {