yiisoft / config

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

Implement config updates #3

Closed samdark closed 3 years ago

samdark commented 3 years ago

In case package was updated and old config is already in the application, we need to:

  1. Add new keys from package config to application config.
  2. Comment-out keys that aren't present.
  3. Probably report on the differences?
yiiliveext commented 3 years ago

Version 1. Copy the additional configs to the subfolder /config/yii-debug/readonly - these will be the original default configs. On composer update, we make a diff between the new default configs and the current configs from readonly folder. And then array_merge($diff, $edited_config) Version 2. Before updating the packages, copy the current default configs somewhere in the runtime folder or save in memory. Then we do as in the first version.