Constants

Constants normally define paths and database information. These values are global and cannot be changed when they are first defined. This is why constants are used for such vital information.

These constants are defined at various points during the bootstrap sequence.

Note

To make the table below a bit more compact, namespaces were left out. Here are the fully qualified class names referred to below:

  • “SystemEnvironmentBuilder” = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder
  • “Bootstrap” = \TYPO3\CMS\Core\Core\Bootstrap
Constant Defined in Description Avail. in FE
TYPO3_MODE init.php Mode of TYPO3: Set to either “FE” or “BE” depending on frontend or backend execution. So in init.php and thumbs.php this value is “BE”.

Yes

value = “FE”

TYPO3_OS SystemEnvironmentBuilder::getTypo3Os() Operating systen; Windows = “WIN”, other = “” (presumed to be some sort of Unix) Yes
PATH_thisScript SystemEnvironmentBuilder::definePaths() Abs. path to current script. Yes
TYPO3_mainDir SystemEnvironmentBuilder::definePaths() This is the directory of the backend administration for the sites of this TYPO3 installation. Hardcoded to typo3/. Must be a subdirectory to the website. See elsewhere for descriptions on how to change the default admin directory, typo3/, to something else. Yes
PATH_typo3 SystemEnvironmentBuilder::definePaths() Abs. path of the TYPO3 admin dir (PATH_site + TYPO3_mainDir). No
PATH_typo3_mod SystemEnvironmentBuilder::definePaths() Relative path (from the PATH_typo3) to a properly configured module. Based on TYPO3_MOD_PATH. No
PATH_site SystemEnvironmentBuilder::definePaths() Absolute path to directory with the frontend (one directory above PATH_typo3) Yes
PATH_typo3conf SystemEnvironmentBuilder::definePaths() Absolute TYPO3 configuration path (local, not part of source). Yes
TYPO3_db Bootstrap::populateLocalConfiguration() Name of the database, for example “t3_coreinstall”. Is defined after the inclusion of typo3conf/LocalConfiguration.php (same for the other TYPO3_* constants below. Yes
TYPO3_db_username Bootstrap::populateLocalConfiguration() Database username Yes
TYPO3_db_password Bootstrap::populateLocalConfiguration() Database password Yes
TYPO3_db_host Bootstrap::populateLocalConfiguration() Database hostname, e.g. “localhost” Yes
TYPO3_extTableDef_script Bootstrap::populateLocalConfiguration()

Name of a php-include script found in “typo3conf/” that contains PHP code that further modifies the table definitions set by the TYPO3 CMS Core.

Deprecated. Make Extensions instead.

Yes
TYPO3_DLOG Bootstrap::defineLoggingAndExceptionConstants() If true, calls to \TYPO3\CMS\Core\Utility\GeneralUtility::devLog() can be made in both frontend and backend; This is event logging which can help to track debugging in general. Yes
TYPO3_MOD_PATH [prior to init.php] Path to module relative to PATH_typo3 (as defined in the module configuration). Must be defined prior to init.php.
TYPO3_enterInstallScript [prior to init.php]

If defined and set true the Install Tool is activated and the script exits after that. Used in typo3/install/index.php:

Example:

define('TYPO3_enterInstallScript', '1');
No
TYPO3_PROCEED_IF_NO_USER [prior to init.php]

If defined and set true the bootstrapping process will return to the parent script even if no backend user was authenticated!

For example, this constant is set by the index.php script so it can include init.php and still show the login form:

define('TYPO3_PROCEED_IF_NO_USER', 1);
require ('init.php');

Please be very careful with this feature - use it only when you have total control of what you are doing!

No
TYPO3_cliMode [prior to init.php]

Initiates CLI (Command Line Interface) mode. This is used when you want a shell executable PHP script to initialize a TYPO3 backend.

For more details see Initializing TYPO3 backend in a PHP shell script in Inside TYPO3.

No
TYPO3_version SystemEnvironmentBuilder::defineBaseConstants() The TYPO3 version, as a “x.y.z” number. Development versions will be either “x.y.z-dev” for stable versions or “x.y-dev” for the current master. Yes