defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance() ->initializeClassLoader($classLoader) ->baseSetup($this->entryPointPath); // can be done here after the base setup is done $this->defineAdditionalEntryPointRelatedConstants(); // Redirect to install tool if base configuration is not found if (!$this->bootstrap->checkIfEssentialConfigurationExists()) { $this->bootstrap->redirectToInstallTool($this->entryPointPath); } foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } $this->bootstrap->configure(); } /** * Set up the application and shut it down afterwards * * @param callable $execute * @return void */ public function run(callable $execute = NULL) { $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals()); if ($execute !== NULL) { if ($execute instanceof \Closure) { $execute->bindTo($this); } call_user_func($execute); } $this->bootstrap->shutdown(); } /** * Define constants and variables */ protected function defineLegacyConstants() { define('TYPO3_MODE', 'BE'); } /** * Define values that are based on the current script */ protected function defineAdditionalEntryPointRelatedConstants() { $currentScript = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('SCRIPT_NAME'); // activate "AJAX" handler when called via ajax.php if (substr($currentScript, -15) === '/typo3/ajax.php') { $GLOBALS['TYPO3_AJAX'] = TRUE; } // allow backend login to work if (substr($currentScript, -16) === '/typo3/index.php') { define('TYPO3_PROCEED_IF_NO_USER', 1); } } }