2 namespace TYPO3\CMS\Core\Build;
48 ->checkForCliDispatch()
51 ->createNecessaryDirectoriesInDocumentRoot()
52 ->includeAndStartCoreBootstrap()
53 ->initializeConfiguration()
54 ->finishCoreBootstrap();
64 @ini_set(
'display_errors', 1);
76 if (!defined(
'TYPO3_MODE')) {
80 array_shift($_SERVER[
'argv']);
81 $flatArguments = implode(
' ', $_SERVER[
'argv']);
82 echo
'Please run the unit tests using the following command:' . chr(10) .
83 sprintf(
'typo3/../bin/phpunit %s', $flatArguments) . chr(10) .
94 protected function defineSitePath()
99 define(
'PATH_thisScript', PATH_site .
'typo3/cli_dispatch.phpsh');
100 $_SERVER[
'SCRIPT_NAME'] = PATH_thisScript;
102 if (!file_exists(PATH_thisScript)) {
103 die(
'Unable to determine path to entry script. Please check your path or set an environment variable \'TYPO3_PATH_WEB\' to your root path.');
116 if (getenv(
'TYPO3_PATH_WEB')) {
117 $webRoot = getenv(
'TYPO3_PATH_WEB');
121 return rtrim(strtr($webRoot,
'\\',
'/'),
'/') .
'/';
129 protected function setTypo3Context()
132 define(
'TYPO3_MODE',
'BE');
134 define(
'TYPO3_cliMode',
true);
135 putenv(
'TYPO3_CONTEXT=Testing');
169 if (is_dir($directory)) {
172 @mkdir($directory, 0777,
true);
174 if (!is_dir($directory)) {
175 throw new \RuntimeException(
'Directory "' . $directory .
'" could not be created', 1423043755);
186 $classLoaderFilepath = __DIR__ .
'/../../../../vendor/autoload.php';
187 if (!file_exists($classLoaderFilepath)) {
188 die(
'ClassLoader can\'t be loaded. Please check your path or set an environment variable \'TYPO3_PATH_WEB\' to your root path.');
190 $classLoader = require $classLoaderFilepath;
193 ->initializeClassLoader($classLoader)
206 $configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager();
207 $GLOBALS[
'TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration();
210 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'trustedHostsPattern'] =
'.*';
224 ->initializeCachingFramework()
225 ->initializePackageManagement(\TYPO3\CMS\Core\Package\UnitTestPackageManager::class)
226 ->ensureClassLoadingInformationExists();
232 if (PHP_SAPI !==
'cli') {
233 die(
'This script supports command line usage only. Please check your command.');