Same site at multiple places: where to hold DB config?


I’m pretty new to Yii development, but I love it.

There’s just one thing I’m missing, or at least I’d like to know what’s the best way to deal with.

Usually I develop on my laptop, push modifications to Git, and then I pull this repo to a testing site and then to the production one.

The problems come with DB config, because obviously I can have three different connection parameters, and these properties are held in the middle of a file.

In my custom built projects I used to create a config-db.php file containing the MySQL user/pass, and then ignored it in svn/git.

Now I guess I can make the same in Yii, by taking out the db config array and include this additional file inside main.php… But I was wondering if there is a more elegant way to do it.


I think this wiki page will help you:

awesome! thanks!