TYPO3 CMS  TYPO3_8-7
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  */
18 
23 {
27  protected $bootstrap;
28 
33  protected $entryPointLevel = 1;
34 
40  \TYPO3\CMS\Install\Http\RequestHandler::class
41  ];
42 
48  public function __construct($classLoader)
49  {
50  $this->defineLegacyConstants();
51 
52  $this->bootstrap = Bootstrap::getInstance()
53  ->initializeClassLoader($classLoader)
54  ->setRequestType(TYPO3_REQUESTTYPE_INSTALL)
55  ->baseSetup($this->entryPointLevel);
56 
57  foreach ($this->availableRequestHandlers as $requestHandler) {
58  $this->bootstrap->registerRequestHandlerImplementation($requestHandler);
59  }
60 
61  $this->bootstrap
62  ->startOutputBuffering()
63  ->loadConfigurationAndInitialize(false, \TYPO3\CMS\Core\Package\FailsafePackageManager::class);
64  }
65 
73  public function run(callable $execute = null)
74  {
75  $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
76 
77  if ($execute !== null) {
78  call_user_func($execute);
79  }
80 
81  $this->bootstrap->shutdown();
82  }
83 
87  protected function defineLegacyConstants()
88  {
89  define('TYPO3_MODE', 'BE');
90  }
91 }
run(callable $execute=null)
Definition: Application.php:73