TYPO3 CMS  TYPO3_7-6
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 
32  protected $entryPointPath = 'typo3/sysext/install/Start/';
33 
39  \TYPO3\CMS\Install\Http\RequestHandler::class
40  ];
41 
47  public function __construct($classLoader)
48  {
49  $this->defineLegacyConstants();
50 
51  $this->bootstrap = Bootstrap::getInstance()
52  ->initializeClassLoader($classLoader)
53  ->baseSetup($this->entryPointPath);
54 
55  foreach ($this->availableRequestHandlers as $requestHandler) {
56  $this->bootstrap->registerRequestHandlerImplementation($requestHandler);
57  }
58 
59  $this->bootstrap
60  ->startOutputBuffering()
61  ->loadConfigurationAndInitialize(false, \TYPO3\CMS\Core\Package\FailsafePackageManager::class);
62  }
63 
72  public function run(callable $execute = null)
73  {
74  $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
75 
76  if ($execute !== null) {
77  call_user_func($execute);
78  }
79 
80  $this->bootstrap->shutdown();
81  }
82 
86  protected function defineLegacyConstants()
87  {
88  define('TYPO3_MODE', 'BE');
89  define('TYPO3_enterInstallScript', '1');
90  }
91 }
run(callable $execute=null)
Definition: Application.php:72