defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance() ->initializeClassLoader($classLoader) ->setRequestType(TYPO3_REQUESTTYPE_BE | (isset($_REQUEST['route']) && strpos($_REQUEST['route'], '/ajax/') === 0 ? TYPO3_REQUESTTYPE_AJAX : 0)) ->baseSetup($this->entryPointLevel); // Redirect to install tool if base configuration is not found if (!$this->bootstrap->checkIfEssentialConfigurationExists()) { $this->bootstrap->redirectToInstallTool($this->entryPointLevel); } foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } $this->bootstrap->configure(); } /** * Set up the application and shut it down afterwards * * @param callable $execute */ public function run(callable $execute = null) { $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals(), 'backend'); if ($execute !== null) { call_user_func($execute); } $this->bootstrap->shutdown(); } /** * Define constants and variables */ protected function defineLegacyConstants() { define('TYPO3_MODE', 'BE'); } }