availableRequestHandlers = [ $requestHandler, $installerRequestHandler ]; } /** * @param ServerRequestInterface $request * @return ResponseInterface */ protected function handle(ServerRequestInterface $request): ResponseInterface { $this->initializeContext(); foreach ($this->availableRequestHandlers as $handler) { if ($handler->canHandleRequest($request)) { return $handler->handle($request) ->withHeader('X-Frame-Options', 'SAMEORIGIN'); } } throw new \TYPO3\CMS\Core\Exception('No suitable request handler found.', 1518448686); } /** * Initializes the Context used for accessing data and finding out the current state of the application * Will be moved to a DI-like concept once introduced, for now, this is a singleton */ protected function initializeContext() { GeneralUtility::makeInstance(Context::class, [ 'date' => new DateTimeAspect(new \DateTimeImmutable('@' . $GLOBALS['EXEC_TIME'])), 'visibility' => new VisibilityAspect(true, true, true), 'workspace' => new WorkspaceAspect(0), 'backend.user' => new UserAspect(), ]); } }