Views: 4277 (Data available since 06.02.2017)
Located in the namespace \Bitrix\Main\Config. Consists of 2 classes: \Bitrix\Main\Config\Configuration and \Bitrix\Main\Config\Option.
$realm = \Bitrix\Main\Config\Configuration::getValue("http_auth_realm");
$realm = "Bitrix Site Manager"
Class is responsible for the global settings of the entire application. (This feature is determined by pure data in the old core.) Class operates a single base of settings stored in the file
/bitrix/.settings.php. The data stored are random. For example, the entire data pool can be stored for named connections.
$cookiePrefix = \Bitrix\Main\Config\Option::get('main', 'cookie_name', 'BITRIX_SM');
$cookieLogin = $request->getCookie($cookiePrefix.'_LOGIN');
$cookieMd5Pass = $request->getCookie($cookiePrefix.'_UIDN');
The option class is virtually the same as the COption class of the old core and works with the parameters of modules and sites stored in the database. It is controlled from the administrative part: settings of specific forms, setup, etc.
Work with files is object-oriented. It is located in the Bitrix\Main\IO namespace and has 3 basic classes:
- Path – work with paths, static.
- Directory – work with folders.
- File – work with files.
Apart from them, there are other classes, including abstract ones, to organize hierarchy.
bitrix/main/lib folder contains a class library intended for the performance of various frequent actions located in Main and not spread across various modules. Among other things, files and API for work are located in the relevant spaces:
- Bitrix\Main\Data - with cache, including controlled cache.
- Bitrix\Main\Text - with text: classes for text conversion and others.
- Bitrix\Main\Type - with data types: date, file, etc.
- Bitrix\Main\Web - with web: work with URL, web queries, etc.