Closed vjik closed 2 years ago
Package yiisoft/config consists of two parts.
yiisoft/config
Part 1
Getting config $config->get('console') and syntax:
$config->get('console')
"common": "common/*.php", "params": [ "params.php", "?params-local.php" ], "web": [ "$common", "web/*.php" ], "console": [ "$common", "console/*.php" ], "events": "events.php", "events-web": [ "$events", "events-web.php" ], ...
Part 2
Collect configs from vendor and generation of merge plan.
Suggestion
Add flag to composer.json for disable work composer plugin.
Create merge plan builder by PHP array:
<?php return [ 'options' => [ 'source-directory' => 'config', ], 'configs' => [ 'params' => [ 'params.php', '?params-local.php', ], 'common' => 'common/*.php', 'console' => [ '$common', 'console/*.php', ], ... ]; ]; ...
This approach will allow you to use two ways to configure the application:
1) Configure yiisoft/config in composer.json and collect configs from vendor.
2) Configure yiisoft/config by PHP array and manually create all configs in application.
Package
yiisoft/config
consists of two parts.Part 1
Getting config
$config->get('console')
and syntax:Part 2
Collect configs from vendor and generation of merge plan.
Suggestion
Add flag to composer.json for disable work composer plugin.
Create merge plan builder by PHP array:
This approach will allow you to use two ways to configure the application:
1) Configure
yiisoft/config
in composer.json and collect configs from vendor.2) Configure
yiisoft/config
by PHP array and manually create all configs in application.