Constants Reference
The ExpressionEngine core defines a variety of constants to ensure consistency in several aspects. Please be aware that some of the constants may not be defined, or have different meaning, in the context of the ExpressionEngine installer.
Path Constants
SELF
- Name of the bootstrap fileFCPATH
- Path to the bootstrap fileSYSDIR
- Name of the system directorySYSPATH
- Path of the system directoryAPPPATH
andBASEPATH
- Path to thesystem/ee/legacy
directoryPATH_ADDONS
- Path to the first-party add-ons directoryPATH_THEMES
- Path to the themes directoryPATH_RTE
- Path to the first party RTE tools directoryPATH_MBR_THEMES
- Path to the member themes directoryPATH_CP_GBL_IMG
- Path to the global image directoryPATH_JAVASCRIPT
- Path to the javascript directoryPATH_JQUERY
- Path to the jQuery directoryPATH_THIRD
- Path to third-party add-ons directoryPATH_THIRD_THEMES
- Path to the third-party themes directory
Version Constants
APP_NAME
- Application NameAPP_VER
- Version numberAPP_BUILD
- Build number
URL Constants
BASE
- Base URL to the control panelAMP
-&
QUERY_MARKER
- Question mark if forcing query strings, blank otherwiseURL_THEMES
- URL to the theme folderURL_THIRD_THEMES
- URL to the third-party theme folder
HTML Constants
NBS
-
BR
-<br />
NL
-\\n
Request Constants
REQ
- One of:'PAGE'
,'CP'
,'ACTION'
AJAX_REQUEST
- (bool
)TRUE
if request came from one of jQuery’s ajax functions
Filesystem Mode Constants
These constants are located in expressionengine/config/constants.php
, and are user configurable to their hosts’ requirements. You should always use these constants for creating and writing to files so that you do not have to worry about which permissions to use. Listed alongside each is their default equivalency.
FILE_READ_MODE
- Equivalent to0644
FILE_WRITE_MODE
- Equivalent to0666
DIR_READ_MODE
- Equivalent to0755
DIR_WRITE_MODE
- Equivalent to0777
FOPEN_READ
- Equivalent torb
FOPEN_READ_WRITE
- Equivalent tor+b
FOPEN_WRITE_CREATE_DESTRUCTIVE
- Equivalent towb
FOPEN_READ_WRITE_CREATE_DESTRUCTIVE
- Equivalent tow+b
FOPEN_WRITE_CREATE
- Equivalent toab
FOPEN_READ_WRITE_CREATE
- Equivalent toa+b
FOPEN_WRITE_CREATE_STRICT
- Equivalent toxb
FOPEN_READ_WRITE_CREATE_STRICT
- Equivalent tox+b
Others
LD
- Left template tag delimiter (usually{
)RD
- Right template tag delimiter (usually}
)DEBUG
- (bool
)TRUE
if$debug
is set to 1CSRF_TOKEN
- CSRF token, blank if csrf protection is disabled.XID_SECURE_HASH
- previous name ofCSRF_TOKEN
MASKED_CP
- (bool
)TRUE
if the CP is masked for this requestEXT
- File extension (.php
)UTF8_ENABLED
- Server has proper UTF-8 supportMB_ENABLED
- Server has multibyte function supportPASSWORD_MAX_LENGTH
- Maximum number of characters for a password.