config files of extension in its own folder

Hi

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

Imho is not standard. I prefer this:




return array (

    ...

    'components' => include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'component.php',

    'modules' => include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'modules.php',

    'params' => include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'params.php',

    'import' => include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'import.php',

    ...

);



this way is clean! And all your config array will be placed in config directory.