‪TYPO3CMS  ‪main
Application.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
20 use Psr\Http\Server\RequestHandlerInterface;
28 
34 {
35  public function ‪__construct(
36  RequestHandlerInterface ‪$requestHandler,
37  protected readonly ‪Context $context
38  ) {
39  $this->requestHandler = ‪$requestHandler;
40  }
41 
42  public function ‪handle(ServerRequestInterface $request): ResponseInterface
43  {
44  $this->‪initializeContext();
45  $request = $request->withAttribute('applicationType', ‪SystemEnvironmentBuilder::REQUESTTYPE_INSTALL);
46  return parent::handle($request)
47  ->withHeader('X-Frame-Options', 'SAMEORIGIN');
48  }
49 
53  protected function ‪initializeContext(): void
54  {
55  $this->context->setAspect('date', new ‪DateTimeAspect((new \DateTimeImmutable())->setTimestamp(‪$GLOBALS['EXEC_TIME'])));
56  $this->context->setAspect('visibility', new ‪VisibilityAspect(true, true, true));
57  $this->context->setAspect('workspace', new ‪WorkspaceAspect(0));
58  $this->context->setAspect('backend.user', new ‪UserAspect());
59  }
60 }
‪TYPO3\CMS\Core\Context\VisibilityAspect
Definition: VisibilityAspect.php:31
‪TYPO3\CMS\Core\Context\WorkspaceAspect
Definition: WorkspaceAspect.php:31
‪TYPO3\CMS\Install\Http\Application
Definition: Application.php:34
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder
Definition: SystemEnvironmentBuilder.php:41
‪TYPO3\CMS\Install\Http\Application\__construct
‪__construct(RequestHandlerInterface $requestHandler, protected readonly Context $context)
Definition: Application.php:35
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:54
‪TYPO3\CMS\Install\Http
Definition: Application.php:16
‪TYPO3\CMS\Core\Http\AbstractApplication
Definition: AbstractApplication.php:29
‪TYPO3\CMS\Install\Http\Application\handle
‪handle(ServerRequestInterface $request)
Definition: Application.php:42
‪TYPO3\CMS\Core\Http\AbstractApplication\$requestHandler
‪RequestHandlerInterface null $requestHandler
Definition: AbstractApplication.php:36
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Install\Http\Application\initializeContext
‪initializeContext()
Definition: Application.php:53
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder\REQUESTTYPE_INSTALL
‪const REQUESTTYPE_INSTALL
Definition: SystemEnvironmentBuilder.php:51
‪TYPO3\CMS\Core\Context\DateTimeAspect
Definition: DateTimeAspect.php:35
‪TYPO3\CMS\Core\Context\UserAspect
Definition: UserAspect.php:37