Created
September 23, 2021 15:13
-
-
Save DavidBruchmann/37a6ef5ce12386e991042e61349bce60 to your computer and use it in GitHub Desktop.
TYPO3 emergency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the TYPO3 CMS project. | |
* | |
* It is free software; you can redistribute it and/or modify it under | |
* the terms of the GNU General Public License, either version 2 | |
* of the License, or any later version. | |
* | |
* For the full copyright and license information, please read the | |
* LICENSE.txt file that was distributed with this source code. | |
* | |
* The TYPO3 project - inspiring people to share! | |
*/ | |
// Exit early if php requirement is not satisfied. | |
if (PHP_VERSION_ID < 70400 || PHP_VERSION_ID >= 90000) { | |
die('This version of TYPO3 CMS requires PHP >= 7.4 and < 9.0'); | |
} | |
$debug = 1; //false; | |
// Set up the application for the frontend | |
call_user_func(function () { | |
$classLoader = require dirname(__DIR__).'/protected/vendor/autoload.php'; | |
chdir(getenv('TYPO3_PATH_ROOT')); | |
\TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); | |
if ($debug) { | |
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump([$classLoader, getenv('TYPO3_PATH_ROOT'), \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::class]); | |
} | |
try { | |
\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run(); | |
} | |
catch(\Exception $e) { | |
if ($debug) { | |
echo $e->getMessage(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reasons for using this file:
$GLOBALS['TYPO3_CONF_VARS']