From c4666a0b60e7643bee55cf8106767ac5c852f260 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke <bfr@qbus.de> Date: Mon, 19 Feb 2018 14:05:36 +0100 Subject: [PATCH] [TASK] Remove unused Bootstrap dependency from frontend request handler Due to moving BE user authentication to a middleware, the Bootstrap instance is no longer needed in the frontend request handler. As the backend request handler is free of a Bootstrap dependency as well, we can also remove the Bootstrap injection in Http\AbstractApplication. The installer and legacy request handlers are unaffected: * The installer application instantiates the request handler on its own. * Legacy request handlers are dispatched by the legacy request handler middleware which keeps passing in a Bootstrap instance Releases: master Resolves: #83961 Related: #83959 Change-Id: I85552b4b1734cdf75d96395ae7610ab19f0bf29c Reviewed-on: https://review.typo3.org/55795 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> --- .../core/Classes/Http/AbstractApplication.php | 3 +-- .../frontend/Classes/Http/RequestHandler.php | 17 ----------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/typo3/sysext/core/Classes/Http/AbstractApplication.php b/typo3/sysext/core/Classes/Http/AbstractApplication.php index d51514feb81c..d0f99c2451b7 100644 --- a/typo3/sysext/core/Classes/Http/AbstractApplication.php +++ b/typo3/sysext/core/Classes/Http/AbstractApplication.php @@ -19,7 +19,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Core\Core\ApplicationInterface; -use TYPO3\CMS\Core\Core\Bootstrap; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -86,7 +85,7 @@ class AbstractApplication implements ApplicationInterface */ protected function handle(ServerRequestInterface $request): ResponseInterface { - $requestHandler = GeneralUtility::makeInstance($this->requestHandler, Bootstrap::getInstance()); + $requestHandler = GeneralUtility::makeInstance($this->requestHandler); $dispatcher = $this->createMiddlewareDispatcher($requestHandler); return $dispatcher->handle($request); diff --git a/typo3/sysext/frontend/Classes/Http/RequestHandler.php b/typo3/sysext/frontend/Classes/Http/RequestHandler.php index 0a64033eed19..d2e6567695e9 100644 --- a/typo3/sysext/frontend/Classes/Http/RequestHandler.php +++ b/typo3/sysext/frontend/Classes/Http/RequestHandler.php @@ -19,7 +19,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface as PsrRequestHandlerInterface; use TYPO3\CMS\Backend\FrontendBackendUserAuthentication; -use TYPO3\CMS\Core\Core\Bootstrap; use TYPO3\CMS\Core\FrontendEditing\FrontendEditingController; use TYPO3\CMS\Core\Http\NullResponse; use TYPO3\CMS\Core\Http\RequestHandlerInterface; @@ -40,28 +39,12 @@ use TYPO3\CMS\Frontend\Page\PageGenerator; */ class RequestHandler implements RequestHandlerInterface, PsrRequestHandlerInterface { - /** - * Instance of the current TYPO3 bootstrap - * @var Bootstrap - */ - protected $bootstrap; - /** * Instance of the timetracker * @var TimeTracker */ protected $timeTracker; - /** - * Constructor handing over the bootstrap and the original request - * - * @param Bootstrap $bootstrap - */ - public function __construct(Bootstrap $bootstrap) - { - $this->bootstrap = $bootstrap; - } - /** * Handles a frontend request * -- GitLab