Merge pull request #23978 from nextcloud/enh/query_servercontainer_first

First query the server container
This commit is contained in:
Morris Jobke 2020-11-09 10:58:26 +01:00 committed by GitHub
commit 2f70a25076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -133,6 +133,12 @@ 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
}
// In case the service starts with OCA\ we try to find the service in
// the apps container first.
if (($appContainer = $this->getAppContainerForService($name)) !== null) {