If a slight loss of performance is acceptable, this might be an useful solution for accessing e.g basePath and params from inside the config array
main.php
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
$preConfig = array(
'basePath'=>dirname(__FILE__).DS.'..',
'params'=>array(
'nameSuffix'=>'(demo)', // example
...
...
),
);
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
//return CMap::mergeArray(
return array_merge_recursive( // should be able to merge partial arrays together
$preConfig,
array(
// append string from params array
'name'=>'My Web Application '. $preConfig['params']['nameSuffix'],
...
'import'=>array(
...
),
'modules'=>array(
...
),
'components'=>array(
...
),
...
),
);
/Tommy
(My apologies if this has been suggested before)