diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-05-30 14:20:15 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-06-04 15:13:32 +0200 |
commit | 357263a70bf56e351e0d292c6144f998dad7f079 (patch) | |
tree | 5bdf1458172cbefad7ccd90c173040d8965c6b6b /lib/private/AppFramework/DependencyInjection/DIContainer.php | |
parent | 05058b0135813c4bfc355486e04e2324e2244078 (diff) | |
download | nextcloud-server-357263a70bf56e351e0d292c6144f998dad7f079.tar.gz nextcloud-server-357263a70bf56e351e0d292c6144f998dad7f079.zip |
Do not try to autoload built in types
This avoids calls to the autoloader (or chain of autoloaders) to see if
for example 'principalPrefix' class can be found. While we already know
it is a string.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework/DependencyInjection/DIContainer.php')
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index a6a9b205747..6d337bb9327 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -374,17 +374,12 @@ class DIContainer extends SimpleContainer implements IAppContainer { }); } - /** - * @param string $name - * @return mixed - * @throws QueryException if the query could not be resolved - */ - public function query($name) { + public function query(string $name, bool $autoload = true) { try { return $this->queryNoFallback($name); } catch (QueryException $firstException) { try { - return $this->getServer()->query($name); + return $this->getServer()->query($name, $autoload); } catch (QueryException $secondException) { if ($firstException->getCode() === 1) { throw $secondException; |