I find RAILS environment system very useful, and I have been using my own implementation on Yii:
[list=1][]I have a base configuration for all the environments.[]Then, I merge it with the specific environment configuration.[*]Finally, I merge it with the local configuration.[/list]So this is my base config folder for all my projects:
I would like to see Yii providing an easy way of doing this without the dirty CMap::mergeArray() calls inside the config files. This feature should not be enabled by default because it is less flexible.
I usually define the environment on the index.php / yiic.php
Optionally: For very complex applications I use folder-based configurations with a bootstrap script that merges all the files of the folder in a single array, saving it in the cache.
Another thing I often stumbled upon with configurations is the problem that I have to set values, which rely on a Yii method, eg. Yii::app()->baseUrl, this is often needed for extensions (e.g. CSS or JavaScript includes). If I do not publish them via assetManager.