Attention

TYPO3 v9 has reached its end-of-life September 30th, 2021 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.

You can order Extended Long Term Support (ELTS) here: TYPO3 ELTS.

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 information 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

Traditional List

TYPO3_MODE

Defined in:
  • \TYPO3\CMS\Backend\Http\Application::defineLegacyConstants()

  • \TYPO3\CMS\Core\Console\CommandApplication::defineLegacyConstants()

  • \TYPO3\CMS\Frontend\Http\Application::defineLegacyConstants()

  • \TYPO3\CMS\Install\Http\Application::defineLegacyConstants()

Description:

Mode of TYPO3: Set to either "FE" or "BE" depending on frontend or backend execution and context.

Available in Frontend:

Yes value = "FE"

TYPO3_OS

Defined in:

SystemEnvironmentBuilder::defineBaseConstants()

Description:

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)

Available in Frontend:

Yes

PATH_thisScript

Defined in:

SystemEnvironmentBuilder::definePaths()

Description:

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.

Available in Frontend:

Yes

TYPO3_mainDir

Defined in:

SystemEnvironmentBuilder::definePaths()

Description:

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.

Available in Frontend:

Yes

PATH_typo3

Defined in:

SystemEnvironmentBuilder::definePaths()

Description:

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.

Available in Frontend:

No

PATH_site

Defined in:

SystemEnvironmentBuilder::definePaths()

Description:

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

Available in Frontend:

Yes

PATH_typo3conf

Defined in:

SystemEnvironmentBuilder::definePaths()

Description:

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

Available in Frontend:

Yes

TYPO3_version

Defined:

SystemEnvironmentBuilder::defineBaseConstants()

Description:

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.

Available in Frontend:

Yes

TYPO3_branch

Defined in:

SystemEnvironmentBuilder::defineBaseConstants()

Description:

The TYPO3 version Branch, as a "x.y" number. Without the patch level.

Available in Frontend:

Yes

Base Constants

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

String Constants

Constant

Value

Description

NUL

chr(0)

A null

Note

This constant has been marked as deprecated and will be removed with TYPO3 v10. Use "\0" instead.

TAB

chr(9)

A tabulator

Note

This constant has been marked as deprecated and will be removed with TYPO3 v10. Use "\t" instead.

LF

chr(10)

A linefeed

CR

chr(13)

A carriage return

SUB

chr(26)

A sub (substitute) character

Note

This constant has been marked as deprecated and will be removed with TYPO3 v10. Use chr(26) instead.

CRLF

CR + LF

Carriage return + linefeed pair

Operating System Identifier

Constant

Value

Description

TYPO3_OS

self::getTypo3Os())

Either "WIN" or empty string

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.

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