‪TYPO3CMS  ‪main
Application.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 namespace ‪TYPO3\CMS\Core\Http;
19 
20 use Psr\Http\Message\ResponseInterface;
21 use Psr\Http\Message\ServerRequestInterface;
22 use Psr\Http\Server\RequestHandlerInterface;
23 use TYPO3\CMS\Core\Configuration\ConfigurationManager;
25 
30 {
31  public function ‪__construct(
32  RequestHandlerInterface ‪$requestHandler,
33  protected readonly ConfigurationManager $configurationManager,
34  ) {
35  $this->requestHandler = ‪$requestHandler;
36  }
37 
38  public function ‪handle(ServerRequestInterface $request): ResponseInterface
39  {
40  if (!‪Bootstrap::checkIfEssentialConfigurationExists($this->configurationManager)) {
41  return $this->‪installToolRedirect($request);
42  }
43 
44  return parent::handle($request);
45  }
46 
47  protected function ‪installToolRedirect(ServerRequestInterface $request): ResponseInterface
48  {
49  // /typo3/install.php is currently physically and statically installed to typo3/install.php
50  // so we must not use BackendEntryPointResolver which is targeted towards virtual backend paths.
51  // @todo: Move /typo3/install.php to /install.php?
52  return new ‪RedirectResponse($this->‪getNormalizedParams($request)->getSitePath() . 'typo3/install.php', 302);
53  }
54 
55  protected function ‪getNormalizedParams(ServerRequestInterface $request): ‪NormalizedParams
56  {
58  }
59 }
‪TYPO3\CMS\Core\Http\Application\handle
‪handle(ServerRequestInterface $request)
Definition: Application.php:38
‪TYPO3\CMS\Core\Http\Application\installToolRedirect
‪installToolRedirect(ServerRequestInterface $request)
Definition: Application.php:47
‪TYPO3\CMS\Core\Http\AbstractApplication
Definition: AbstractApplication.php:29
‪TYPO3\CMS\Core\Http\Application\__construct
‪__construct(RequestHandlerInterface $requestHandler, protected readonly ConfigurationManager $configurationManager,)
Definition: Application.php:31
‪TYPO3\CMS\Core\Http\Application
Definition: Application.php:30
‪TYPO3\CMS\Core\Http\Application\getNormalizedParams
‪getNormalizedParams(ServerRequestInterface $request)
Definition: Application.php:55
‪TYPO3\CMS\Core\Http\RedirectResponse
Definition: RedirectResponse.php:30
‪TYPO3\CMS\Core\Http\AbstractApplication\$requestHandler
‪RequestHandlerInterface null $requestHandler
Definition: AbstractApplication.php:36
‪TYPO3\CMS\Core\Core\Bootstrap
Definition: Bootstrap.php:62
‪TYPO3\CMS\Core\Core\Bootstrap\checkIfEssentialConfigurationExists
‪static bool checkIfEssentialConfigurationExists(ConfigurationManager $configurationManager)
Definition: Bootstrap.php:214
‪TYPO3\CMS\Core\Http\NormalizedParams\createFromRequest
‪static static createFromRequest(ServerRequestInterface $request, array $systemConfiguration=null)
Definition: NormalizedParams.php:840
‪TYPO3\CMS\Core\Http\NormalizedParams
Definition: NormalizedParams.php:38
‪TYPO3\CMS\Core\Http
Definition: AbstractApplication.php:18