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.