‪TYPO3CMS  10.4
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 {
38  protected ‪$context;
39 
40  public function ‪__construct(
41  RequestHandlerInterface ‪$requestHandler,
43  ) {
44  $this->requestHandler = ‪$requestHandler;
45  $this->context = ‪$context;
46  }
47 
48  protected function ‪handle(ServerRequestInterface $request): ResponseInterface
49  {
50  $this->‪initializeContext();
51  $request = $request->withAttribute('applicationType', ‪SystemEnvironmentBuilder::REQUESTTYPE_INSTALL);
52  return parent::handle($request)
53  ->withHeader('X-Frame-Options', 'SAMEORIGIN');
54  }
55 
59  protected function ‪initializeContext(): void
60  {
61  $this->context->setAspect('date', new ‪DateTimeAspect(new \DateTimeImmutable('@' . ‪$GLOBALS['EXEC_TIME'])));
62  $this->context->setAspect('visibility', new ‪VisibilityAspect(true, true, true));
63  $this->context->setAspect('workspace', new ‪WorkspaceAspect(0));
64  $this->context->setAspect('backend.user', new ‪UserAspect());
65  }
66 }
‪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:42
‪TYPO3\CMS\Install\Http\Application\__construct
‪__construct(RequestHandlerInterface $requestHandler, Context $context)
Definition: Application.php:39
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Install\Http\Application\$context
‪Context $context
Definition: Application.php:37
‪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:47
‪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:5
‪TYPO3\CMS\Install\Http\Application\initializeContext
‪initializeContext()
Definition: Application.php:58
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder\REQUESTTYPE_INSTALL
‪const REQUESTTYPE_INSTALL
Definition: SystemEnvironmentBuilder.php:52
‪TYPO3\CMS\Core\Context\DateTimeAspect
Definition: DateTimeAspect.php:35
‪TYPO3\CMS\Core\Context\UserAspect
Definition: UserAspect.php:38