Skip to content

Commit a2504e4

Browse files
committed
readme.MD
1 parent 84a263c commit a2504e4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

readme.MD

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,23 @@ class MyServiceProvider extends ServiceProvider
261261
{
262262
}
263263
}
264+
```
265+
266+
### BitrixSettingsDiAdapter
267+
268+
Адаптер-импортер настроек битриксового сервис-локатора (`.settings.php`) в симфонический контейнер.
269+
270+
- **`importParameters(ContainerInterface $container, array $settings, ?string $section = null)`** - импорт параметров.
271+
`section` - если задано, то параметры лягут в именованную секцию параметров контейнера.
272+
- **`importServices(ContainerInterface $container, array $services)`** - импорт сервисов. [Формат](https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=43&LESSON_ID=14032)
273+
274+
Считываются конфиги в Битриксе как-то так:
275+
276+
```php
277+
use Bitrix\Main\Config\Configuration;
278+
279+
$this->config = Configuration::getInstance()->get('my_config') ?? [];
280+
// Из модуля
281+
$this->parameters = Configuration::getInstance('my.module')->get('parameters') ?? [];
282+
$this->services = Configuration::getInstance('my.module')->get('services') ?? [];
264283
```

0 commit comments

Comments
 (0)