‪TYPO3CMS  9.5
Application.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
27 
33 {
38  protected ‪$availableRequestHandlers = [];
39 
46  public function ‪__construct(
48  ‪RequestHandlerInterface $installerRequestHandler
49  ) {
50  $this->availableRequestHandlers = [
52  $installerRequestHandler
53  ];
54  }
55 
60  protected function ‪handle(ServerRequestInterface $request): ResponseInterface
61  {
62  $this->‪initializeContext();
63  foreach ($this->availableRequestHandlers as $handler) {
64  if ($handler->canHandleRequest($request)) {
65  return $handler->handle($request)
66  ->withHeader('X-Frame-Options', 'SAMEORIGIN');
67  }
68  }
69  throw new \TYPO3\CMS\Core\Exception('No suitable request handler found.', 1518448686);
70  }
71 
76  protected function ‪initializeContext()
77  {
78  GeneralUtility::makeInstance(Context::class, [
79  'date' => new ‪DateTimeAspect(new \DateTimeImmutable('@' . ‪$GLOBALS['EXEC_TIME'])),
80  'visibility' => new ‪VisibilityAspect(true, true, true),
81  'workspace' => new ‪WorkspaceAspect(0),
82  'backend.user' => new ‪UserAspect(),
83  ]);
84  }
85 }
‪TYPO3\CMS\Core\Context\VisibilityAspect
Definition: VisibilityAspect.php:29
‪TYPO3\CMS\Core\Context\WorkspaceAspect
Definition: WorkspaceAspect.php:29
‪TYPO3\CMS\Core\Http\AbstractApplication\$requestHandler
‪string $requestHandler
Definition: AbstractApplication.php:35
‪TYPO3\CMS\Install\Http\Application
Definition: Application.php:33
‪TYPO3\CMS\Install\Http\Application\$availableRequestHandlers
‪array $availableRequestHandlers
Definition: Application.php:37
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:49
‪TYPO3\CMS\Install\Http
Definition: Application.php:2
‪TYPO3\CMS\Core\Http\AbstractApplication
Definition: AbstractApplication.php:28
‪TYPO3\CMS\Core\Http\RequestHandlerInterface
Definition: RequestHandlerInterface.php:28
‪TYPO3\CMS\Install\Http\Application\handle
‪ResponseInterface handle(ServerRequestInterface $request)
Definition: Application.php:59
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Install\Http\Application\initializeContext
‪initializeContext()
Definition: Application.php:75
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Install\Http\Application\__construct
‪__construct(RequestHandlerInterface $requestHandler, RequestHandlerInterface $installerRequestHandler)
Definition: Application.php:45
‪TYPO3\CMS\Core\Context\DateTimeAspect
Definition: DateTimeAspect.php:33
‪TYPO3\CMS\Core\Context\UserAspect
Definition: UserAspect.php:36