I am using 2 different extensions and was getting frustrated when I had to edit main config file every time I added new extension. so I created separate config files in extension folders and merged as follows and it is working fine.
$config = require_once('main.php'); $config2 = require_once('extension01.php'); $config3 = require_once('extension02.php'); $final = array_merge_recursive($config, $config2, $config3); Yii::createWebApplication($final)->run();
what is disadvantage in doing that? this way authors can ship their config file with default options and user just need to link file in index.php