Working In Team With Yii

Hi there, I would like to know how I can start a project where a selected list of developers could share the code via GIT but having each one of them a credential to the DB.


Dev1 = ‘, dbname=db1, User1, pass123’

Dev2 = ‘, dbname=db1, User2, pass234’

Dev3 = ‘, dbname=db1, User3, pass345’

When a member leaves the team, we could simply remove his access or some rights to the DB.

Thank you for your time :lol:

check out , I use this layout as I have a few sites that rely on the same DB/Models. Works GREAT! It also allows you to set local config files for each dev. The local files are ignored in git so there isn’t an issue there.

Thank you for your reply Zeam!

But that thing looks pretty heavy! :blink:

Is there a simpler solution?

What do people in the open-source community use?

Anyone? :)

You can adapt YiiBoilerplate in separating the config files, basically they separate the base configuration and local configuration that can be used for each developer in your case.

The config files are like this:

main.php (base config):

return CMap::mergeArray(


         ... //any base configs are here


        (file_exists(__DIR__ . '/main-local.php') ? require(__DIR__ . '/main-local.php') : array())


main-local.php (each developer’s config):

return array(



	'connectionString' => 'mysql:host=localhost;dbname=db1',

	'emulatePrepare' => true,

	'username' => '',

	'password' => '',

	'charset' => 'utf8',

        'tablePrefix' => '',




and then do this (quoted from YiiBoilerplate explanation):

Took me a while to understand Yiiboilerplate…

But now it’s getting clearer! :blink: