Bitrix Site Manager

Special constants

Constant Type Description
SITE_ID A
P
I
The ID of the current site.
SITE_DIR A The field Site Folder of the current site settings. Usually used to implement multiple sites using the method 1.
SITE_SERVER_NAME A The field Server URL of the current site settings.
SITE_CHARSET A The field Encoding of the current site settings.
FORMAT_DATE A For the public section, this constant contains the date format from the current site settings. For the administrative section - the current language date format.
FORMAT_DATETIME A For the public section, this constant contains the time format from the current site settings. For the administrative section - the current language time format.
LANGUAGE_ID A For the public section, this constant stores the value of the field Language of the current site settings.
For the administrative section, this constant stores the current language ID.
SITE_TEMPLATE_ID A The ID of the current site template.
START_EXEC_TIME A Contains the time a page started to execute, in the format of the function getmicrotime.
B_PROLOG_INCLUDED A If a prologue service section is included, this constant is set to true. This constant is mainly used in included files for security purposes: to ensure the prologue is included and all the required permissions are checked.
SM_VERSION A The Kernel module current version.
SM_VERSION_DATE A Date the current version of the Kernel module has been released.
ADMIN_SECTION A
P
If the administrative section prologue is to be included, this constant is set to true.
AUTH_404 P This constant is to be initialised prior to the prologue in the 404 error handler files ("page not found"). File handlers can be specified in the web server settings.

This constant, when initialised, allows to change the page to which a form is submitted from standard components: Authorization, Registration, Password Retrieval, Password Change. By default, the submit page is the current page. If the constant is initialised, the submit page is /SITE_DIR/auth.php.

This constant needs to be initialised as data cannot be POST'ed to invalid pages, while the above stated components use the POST method to transfer form data. That's why these components will not work unless the current page physically exist on the server.

Example: define("AUTH_404", "Y");
HELP_FILE P This constant is primarily used in administrative scripts for storing the context help file name, if the name is different than the current script file name. Context help can be invoked using the button on the control toolbar.

Example: define("HELP_FILE", "my_admin_script.php");
NEED_AUTH P If this constant is set to true before the prologue is included, a user authorization status is to be checked. If a current user is not authorised, an authorization form is displayed.

Example: define("NEED_AUTH", true);
ERROR_EMAIL P
I
Stores an e-mail address (or a list of comma-separated addresses) to be used by the function SendError to send error messages.

Example: define("ERROR_EMAIL", "admin@site.ru, support@site.ru");
LOG_FILENAME P
I
C
Stores the absolute path to a log file which is used by the function AddMessage2Log to journal errors and messages.

Example: define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]. "/log.txt");
STATISTIC_ONLY P
I
C
This constant is mainly used in the Web Analytics edition. If it is not initialised, the following HTTP header is sent when dispatching pages of the public section:

Content-Type: text/html; charset=SITE_CHARSET

Example: define("STATISTIC_ONLY", true);
NO_KEEP_STATISTIC P
I
C
If initialised, this constant suppresses collecting the site statistics.

Example: define("NO_KEEP_STATISTIC", true);
NOT_CHECK_PERMISSIONS P
I
C
If set to true before the prologue is included, the first level permission checks are disabled.

Example: define("NOT_CHECK_PERMISSIONS", true);
ONLY_EMAIL P
I

C
If you want the e-mail messages to be sent to only one e-mail address (or a group of e-mail addresses) regardless of the mail templates settings, set this constant to an e-mail address or a list of comma-separated addresses.

Example: define("ONLY_EMAIL", "admin@site.ru, support@site.ru");
BX_CRONTAB P
I

C
If set to true, the agent execution function will run only those agents whose number of runs is not critical (that is, agents whose parameter period is set to "N" when adding it). This constant is mainly applied to agents executed using cron.

Example: define("NO_KEEP_STATISTIC", true);
BX_FILE_PERMISSIONS P
I

C
Unix permissions for the newly created files.

Example: define("BX_FILE_PERMISSIONS", 0755);
BX_DIR_PERMISSIONS P
I

C
Unix permissions for the newly created directories.

Example: define("BX_DIR_PERMISSIONS", 0755);
SM_SAFE_MODE P
I

C
Setting this constant to true disables all modules except Kernel and Site Explorer.

Example: define("SM_SAFE_MODE", true);
DIRECTORY_INDEX P
I

C
This constant is used by the function GetDirIndex to determine the folder index file.

Example: define("DIRECTORY_INDEX",
"index.php index.html index.htm index.phtml default.html index.php3");
MYSQL_TABLE_TYPE C This constant contains the default type name of tables created in MySQL. Can be "MyISAM" or "InnoDB".

Example: define("MYSQL_TABLE_TYPE", "InnoDB");
DBPersistent C If set to true, a persistent connection to the database is to be established.

Example: define("DBPersistent", true);
BX_VALID_FILENAME_SYMBOLS P
A
C
Defines a set of symbols which are allowed in names of uploaded files. Set is specified in the form of regular expression. If the option "save_original_file_name" is set and a file name contains invalid symbols, the system behaviour depends on the convert_original_file_name option value: either the file name is transformed, or an error is displayed upon upload attempt.

The default value is: \x20-\x21\x2B-\x2E\x30-\x39\x41-\x5A\x5F\x61-\x7A\x7B\x7C\x7E.

Legend of constant types