### Agent Operations: Start and Install (PHP) Source: https://docs.1c-bitrix.ru/api/reports/deprecated Methods for managing agents, including starting an agent and performing installation steps. `installNextStep()` is part of the installation process. ```PHP Agent::start() Agent::install() Agent::installNextStep() ``` -------------------------------- ### Start Docker Containers Source: https://docs.1c-bitrix.ru/pages/get-started/install-env This command starts the Docker containers defined in the docker-compose.yml file, launching the Bitrix environment. Ensure Docker and Docker Compose are installed and the env-docker repository has been cloned. ```shell cd ./env-docker docker compose up -d ``` -------------------------------- ### Clean Installation - Remove Index File Source: https://docs.1c-bitrix.ru/pages/get-started/install-solution To perform a clean installation without a solution, close the installation wizard and remove the 'index.php' file from the website's root directory. This action is specific to the 1C-Bitrix: Site Management installer. ```shell rm index.php ``` -------------------------------- ### Configure 1C-Bitrix with .settings.php (PHP) Source: https://docs.1c-bitrix.ru/pages/get-started/install-distr This PHP code snippet demonstrates how to configure 1C-Bitrix using the .settings.php file for a quick installation. It covers settings for character encoding, caching, cookies, error handling, and database connections. ```PHP array ( 'value' => true, // кодировка сайта, true для UTF-8 'readonly' => true, ), // настройки кеширования 'cache_flags' => array ( 'value' => array ( 'config_options' => 3600, // время кэширования настроек сайта в секундах 'site_domain' => 3600, // время кэширования настроек домена ), 'readonly' => false, ), // Параметры cookies 'cookies' => array ( 'value' => array ( 'secure' => false, // использовать защищенное соединение HTTPS 'http_only' => true, // разрешать доступ только через HTTP ), 'readonly' => false, ), // настройки обработки ошибок 'exception_handling' => array 'value' => array ( 'debug' => false, // режим отладки 'handled_errors_types' => 4437, // типы обрабатываемых ошибок 'exception_errors_types' => 4437, // типы исключений 'ignore_silence' => false, // игнорировать @-оператор 'assertion_throws_exception' => true, // преобразовывать assert в исключения 'assertion_error_type' => 256, // тип ошибки для assert 'log' => array ( // настройки логирования 'settings' => array ( 'file' => '/var/log/php/exceptions.log', // путь к лог-файлу 'log_size' => 1000000, // максимальный размер лога ), ), ), 'readonly' => false, ), // Настройки подключения к базе данных 'connections' => array ( 'value' => array ( 'default' => array ( 'className' => '\\Bitrix\\Main\\DB\\MysqliConnection', // драйвер БД 'host' => 'localhost', // адрес сервера БД 'database' => 'sitemanager0', // имя БД 'login' => 'root', // пользователь БД 'password' => '', // пароль пользователя 'options' => 2, // дополнительные опции ), ), 'readonly' => true, ) ); ``` -------------------------------- ### Install ImBot Support24 Session Command Source: https://docs.1c-bitrix.ru/api/reports/deprecated Installs a session command for the Support24 bot in the ImBot module. This is part of the setup or update process for the bot's functionality. ```PHP \Bitrix\Imbot\Update\Agent::installSupport24SessionCommand() ``` -------------------------------- ### PHP Namespace Example - Bitrix Source: https://docs.1c-bitrix.ru/api/namespaces/bitrix-perfmon Demonstrates the usage of namespaces in PHP within the Bitrix framework. This example typically involves defining and using namespaces for organizing code and avoiding naming conflicts. It requires the Bitrix environment to be set up. ```php ``` -------------------------------- ### Download and Prepare bitrixsetup.php Script (bitrix user) Source: https://docs.1c-bitrix.ru/pages/get-started/install-distr This snippet demonstrates downloading the `bitrixsetup.php` script using `wget` when logged in as the `bitrix` user. This is a simpler process as ownership does not need to be changed. Navigate to the web root directory before executing. ```shell cd /home/bitrix/www/ # переходим в корневую папку сайта wget https://www.1c-bitrix.ru/download/scripts/bitrixsetup.php # скачиваем скрипт ``` -------------------------------- ### Download 1C-Bitrix Distribution Archive Source: https://docs.1c-bitrix.ru/pages/get-started/install-distr This command downloads the 1C-Bitrix distribution archive (`business_encode.tar.gz`) to the specified web root directory using `wget`. After downloading, the archive needs to be extracted. ```shell cd /home/bitrix/www/ # переходим в папку сайта wget https://www.1c-bitrix.ru/download/business_encode.tar.gz # скачиваем дистрибутив по ссылке ``` -------------------------------- ### Bitrix CRM Automation Demo Wizard Install/Uninstall Source: https://docs.1c-bitrix.ru/api/reports/deprecated Provides methods for installing and uninstalling a simple CRM setup within the Bitrix CRM automation demo wizard. ```PHP Wizard::installSimpleCRM() ``` ```PHP Wizard::unInstallSimpleCRM() ``` -------------------------------- ### Download and Prepare bitrixsetup.php Script (root user) Source: https://docs.1c-bitrix.ru/pages/get-started/install-distr This snippet shows how to download the `bitrixsetup.php` script using `wget` and change its ownership to the `bitrix` user. This is necessary for the web server to access the script. Ensure you are in the correct web root directory. ```shell cd /home/bitrix/www/ # переходим в корневую папку сайта wget https://www.1c-bitrix.ru/download/scripts/bitrixsetup.php # скачиваем скрипт chown bitrix:bitrix bitrixsetup.php # меняем владельца файла на пользователя bitrix ``` -------------------------------- ### Session Command Installation - agent.php Source: https://docs.1c-bitrix.ru/api/reports/deprecated Installs a support session command for agents. This function is relevant for background tasks or agent-specific functionalities that require session management. ```php Agent::installSupport24SessionCommand(); ``` -------------------------------- ### SQL Namespace Example - Bitrix Source: https://docs.1c-bitrix.ru/api/namespaces/bitrix-perfmon Illustrates the concept of namespaces or schema usage in SQL within the context of Bitrix. This example might show how to reference tables or functions within a specific database schema. It assumes a SQL database connected to Bitrix. ```sql -- Example of referencing a table within a specific schema SELECT * FROM `b_user`; -- If Bitrix uses specific schemas, it might look like this: -- SELECT * FROM `bitrix_schema`.`users`; ``` -------------------------------- ### Download bitrixsetup.php Script Source: https://docs.1c-bitrix.ru/pages/get-started/install-env This snippet downloads the bitrixsetup.php script into the website's 'www' directory within the PHP container. It requires access to the Docker container's shell and the 'wget' utility. The script is used for the initial setup of Bitrix. ```shell # войдите в sh-консоль контейнера php под пользователем bitrix docker compose exec —user=bitrix php sh # перейдите в папку сайта cd /opt/www/ # скачайте скрипт для установки продукта wget https://www.1c-bitrix.ru/download/scripts/bitrixsetup.php ``` -------------------------------- ### Clone env-docker Repository Source: https://docs.1c-bitrix.ru/pages/get-started/install-env This snippet clones the official env-docker repository from GitHub to set up a containerized environment for Bitrix. It requires Git to be installed on the local machine. ```shell cd my-project # перейдите в папку проекта git clone https://github.com/bitrix-tools/env-docker.git # склонируйте репозиторий ``` -------------------------------- ### Wizard CRM Installation and Uninstallation Source: https://docs.1c-bitrix.ru/api/reports/deprecated The Wizard class contains methods for installing and uninstalling simple CRM functionalities. These methods are part of the setup and teardown process for CRM features. ```php getByCode($code); if (!$entity) { return $this->renderComponent('demo:error', params: [ 'message' => Loc::getMessage('POST_NOT_FOUND'), ]); } return $this->renderView('posts/view', [ 'entity' => $entity, ]); } } ``` -------------------------------- ### Define BX_PULL_SKIP_INIT Constant in PHP Source: https://docs.1c-bitrix.ru/api/namespaces/bitrix-bizproc This snippet defines the public constant BX_PULL_SKIP_INIT as true. This constant is likely used to control the initialization process of a pull mechanism, potentially for skipping certain setup steps in the disk module. It is defined within the publicpullconfigurator.php file. ```php public const BX_PULL_SKIP_INIT = true; ``` -------------------------------- ### Query Builder Compatibility and Options (PHP) Source: https://docs.1c-bitrix.ru/api/reports/deprecated References `Compatible` and `QueryBuilderOptions` classes within the `SecurityQueryBuilder` namespace. `Compatible` likely deals with query building compatibility, while `QueryBuilderOptions` provides methods for getting limits and checking union distinct usage. ```php namespace Bitrix\Crm\Security\QueryBuilder\Compatible; class Compatible { // ... methods and properties ... } namespace Bitrix\Crm\Security\QueryBuilder\QueryBuilderOptions; class QueryBuilderOptions { public function getLimitByIds(array $ids) { // ... returns limits by IDs ... } public function needUseDistinctUnion(): bool { // ... returns true if distinct union is needed ... return false; } } ``` -------------------------------- ### Show Stepper for Landing Updates Source: https://docs.1c-bitrix.ru/api/reports/deprecated Displays a stepper interface for managing updates within the Landing module. This provides a guided, step-by-step update process for users. ```PHP \Bitrix\Landing\Update\Stepper::show() ``` -------------------------------- ### Get Plan Details in 1C-Bitrix AI Module Source: https://docs.1c-bitrix.ru/api/reports/deprecated Fetches general plan information from the 1C-Bitrix AI Limiter component. This method is used to retrieve available plan configurations. ```php deleteAll();` for comprehensive cache clearing. ```php Helper::setEnabled(); Helper::cleanAll(); ``` -------------------------------- ### Управление группами пользователей 1С-Битрикс (PHP) Source: https://docs.1c-bitrix.ru/index Примеры кода для работы с группами пользователей в 1С-Битрикс, включая получение списка групп, добавление и удаление пользователей из групп. Используются статические методы класса CUser. ```php // Получить список групп пользователя $groups = CUser::GetUserGroup(234); // Добавить пользователя в группы CUser::AppendUserGroup(234, [ // идентификатор группы 3, // срок участия пользователя в группе [ 'GROUP_ID' => 3, 'DATE_ACTIVE_FROM' => '01.01.2025', 'DATE_ACTIVE_TO' => '01.12.2025', ], ]); // Удалить пользователя из группы CUser::RemoveUserGroup(234, [ // идентификаторы групп 3, 4, ]); ``` -------------------------------- ### Access Control: Get Available Operations (PHP) Source: https://docs.1c-bitrix.ru/api/reports/deprecated Retrieves a list of available operations for access control. This functionality has been available since tasks version 20.6.0. ```PHP Access::getAvailableOperations() ``` -------------------------------- ### Контроллер прав доступа 1С-Битрикс (PHP) Source: https://docs.1c-bitrix.ru/index Пример реализации контроллера прав доступа на основе ABAC в 1С-Битрикс. Включает создание класса контроллера и внедрение логики проверки прав в методы контроллера. ```php use Bitrix\Main\Access\AccessibleItem; use Bitrix\Main\Access\BaseAccessController; use Bitrix\Main\Access\User\AccessibleUser; final class PostAccessController extends BaseAccessController { protected function loadItem(int $itemId = null): ?AccessibleItem { return $itemId ? MyPost::loadById($itemId) : null; } protected function loadUser(int $userId): AccessibleUser { return MyUser::loadById($userId); } } use Bitrix\Main\Engine\CurrentUser; final class MyController { public function getAction(int $id, CurrentUser $user, PostAccessController $access) { if ($access->can($user->getId(), 'view', $id)) { // есть доступ } } public function listAction(PostAccessController $access) { $query = MyPost::query(); $filter = $access->getEntityFilter( 'view', $query->getEntity()->getObjectClassName() ); if ($filter) { $query->addFilter($filter); } $rows = $query->fetchCollection(); } } ``` -------------------------------- ### URL and REST API Related Utilities (PHP) Source: https://docs.1c-bitrix.ru/api/reports/deprecated This section documents methods and constants related to URL manipulation and REST API interactions. It includes methods for getting service URLs, placement URLs, and checks for private IP addresses, with notes on deprecation or intended usage. ```php UrlPreview::isIpAddressPrivate() Will be removed. ``` ```php Transport::SERVICE_URL use Transport()->getServiceUrl() ``` ```php Url::getApplicationPlacementUrl() use \Bitrix\Rest\Url\DevOps->getPlacementUrl() ``` -------------------------------- ### HTML Structure for Bitrix API Documentation Source: https://docs.1c-bitrix.ru/api/namespaces/bitrix-biconnector This is the basic HTML structure for the Bitrix API documentation page. It includes meta tags, links to stylesheets (including PrismJS for code highlighting), and script includes for search functionality and templates. ```html Bitrix API

Bitrix API