yiisoft / config

Configuration management
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
31 stars 11 forks source link

Existed configuration group "does not exist" after update to 1.3.1 #151

Closed tomaszkane closed 9 months ago

tomaszkane commented 9 months ago

What steps will reproduce the problem?

Update package from 1.3.0 to 1.3.1 Have private package with custom config group like "yii2-common"

{
  "extra": {
    "config-plugin-options": {
      "source-directory": "config"
    },
    "config-plugin": {
      "yii2-common": [
        "yii2-common.php"
      ]
    }
  }
}

and load this like:

$yiiConfig = new Config(
    paths: new ConfigPaths(__DIR__ . '/../..'),
    environment: YII_ENV,
    modifiers: [
        RecursiveMerge::groups('yii2-common', 'yii2-backend'),
    ],
    mergePlanFile: 'config/.merge-plan.php',
);

$commonConfig = $yiiConfig->get('yii2-common'); // exception, but this group exist in several packages

What is the expected result?

Config works.

What do you get instead?

Uncaught ErrorException: The "yii2-common" configuration group does not exist. in /var/www/champ/vendor/yiisoft/config/src/FilesExtractor.php:169

Additional info

Q A
Version 1.3.1
PHP version 8.0
Operating system KDE Neon
vjik commented 9 months ago

Done by #152