You may use one main config file and to use it in your dev and staging versions, overwriting only changed components (e.g. ‘db’ component) configs, thus you’ll have rules in main config file only.
Example, your dev.php
return CMap::mergeArray(
require(dirname(__FILE__) . '/main.php'), array(
'modules' => array(
'gii' => array(
'class' => 'system.gii.GiiModule',
'password' => 'admin',
),
),
'components' => array(
'cache' => array(
'class' => 'system.caching.CDummyCache',
),
'db' => array(
'class'=>'DbConnection',
'connectionString' => 'mysql:host=127.0.0.1;dbname=LOCALDB’,
'emulatePrepare' => true,
'username' => '',
'password' => '',
'charset' => 'utf8',
'enableProfiling' => true,
'enableParamLogging' => true,
),
'errorHandler' => array(
'errorAction' => null,//'site/error',
),
),
'params' => array(
),
)
);
On more convenient thing is about different console config files, not to duplicate things:
Example, your console_dev.php
$mainConfig = require(dirname(__FILE__) . '/dev.php');
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Console Application',
'import' => $mainConfig['import'],
'modules' => $mainConfig['modules'],
'components'=>array(
'request' => array(
'hostInfo' => 'http://domain',
'baseUrl' => '',
'scriptUrl' => '',
),
'settings' => $mainConfig['components']['settings'],
'db' => $mainConfig['components']['db'],
'format' => $mainConfig['components']['format'],
),
),
);
Hope it’ll help or at least will give you fresh ideas.