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.

The column "Avail. in FE" is an indicator that tells you if the constant, variable or class mentioned is also available to scripts running under the frontend of the "cms" extension.

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

Table 1: Traditional List

Constant Defined in Description Avail. in FE
TYPO3_MODE \TYPO3\CMS\Backend\Http\Application::defineLegacyConstants() \TYPO3\CMS\Core\Console\CommandApplication::defineLegacyConstants() \TYPO3\CMS\Frontend\Http\Application::defineLegacyConstants() \TYPO3\CMS\Install\Http\Application::defineLegacyConstants() Mode of TYPO3: Set to either "FE" or "BE" depending on frontend or backend execution and context.

Yes

value = "FE"

TYPO3_OS SystemEnvironmentBuilder::defineBaseConstants()

Note

this constant has been marked as deprecated and will be removed with TYPO3 v10. Use \TYPO3\CMS\Core\Core\Environment::getPublicPath() to retrieve the information. Use Environment::isWindows() and Environment::isUnix() instead.

Operating system; Windows = "WIN", other = "" (presumed to be some sort of Unix)

Yes
PATH_thisScript SystemEnvironmentBuilder::definePaths()

Note

this constant has been marked as deprecated and will be removed with TYPO3 v10. Use \TYPO3\CMS\Core\Core\Environment::getCurrentScript() to retrieve the information.

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()

Note

this constant has been marked as deprecated and will be removed with TYPO3 v10. Use \TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3' to retrieve the information.

Abs. path of the TYPO3 admin dir.

No
PATH_site SystemEnvironmentBuilder::definePaths()

Note

this constant has been marked as deprecated and will be removed with TYPO3 v10. Use \TYPO3\CMS\Core\Core\Environment::getPublicPath() to retrieve the information.

Absolute path to directory with the frontend (one directory above \TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3/)

Yes
PATH_typo3conf SystemEnvironmentBuilder::definePaths()

Note

this constant has been marked as deprecated and will be removed with TYPO3 v10. Use \TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3conf' to retrieve the information.

Absolute TYPO3 configuration path (local, not part of source).

Yes
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
TYPO3_branch SystemEnvironmentBuilder::defineBaseConstants() The TYPO3 version Branch, as a "x.y" number. Without the patch level. Yes

Table 2: Base Constants

Check \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::defineBaseConstants() for updates.

String constants

Operating system identifier

Service error constants

Constant Value Description
T3_ERR_SV_GENERAL -1 General error - something went wrong
T3_ERR_SV_NOT_AVAIL -2 During execution it showed that the service is not available and should be ignored. The service itself should call $this->setNonAvailable()
T3_ERR_SV_WRONG_SUBTYPE -3 Passed subtype is not possible with this service
T3_ERR_SV_NO_INPUT -4 Passed subtype is not possible with this service
T3_ERR_SV_FILE_NOT_FOUND -20 File not found which the service should process
T3_ERR_SV_FILE_READ -21 File not readable
T3_ERR_SV_FILE_WRITE -22 File not writable
T3_ERR_SV_PROG_NOT_FOUND -40 Passed subtype is not possible with this service
T3_ERR_SV_PROG_FAILED -41 Passed subtype is not possible with this service

Filetypes

Different types of files constants are defined in TYPO3\CMS\Core\Resource\AbstractFile. These constants are available for different groups of files as documented in https://www.iana.org/assignments/media-types/media-types.xhtml

These file types are assigned to all FAL resources. They can, for example, be used in Fluid to decide how to render different types of files.

Constant Value Description
FILETYPE_UNKNOWN 0 Unknown
FILETYPE_TEXT 1 Any kind of text
FILETYPE_IMAGE 2 Any kind of image
FILETYPE_AUDIO 3 Any kind of audio
FILETYPE_VIDEO 4 Any kind of video
FILETYPE_APPLICATION 5 Any kind of application

HTTP status codes

The different status codes available are defined in TYPO3\CMS\Core\Utility\HttpUtility. These constants are defined as documented in https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml