From 357263a70bf56e351e0d292c6144f998dad7f079 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 30 May 2019 14:20:15 +0200 Subject: 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 --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/private/AppFramework/DependencyInjection') 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; -- cgit v1.2.3