August 2, 2013, 7:14pm
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 = ‘mysql:host.com, dbname=db1, User1, pass123’
Dev2 = ‘mysql:host.com, dbname=db1, User2, pass234’
Dev3 = ‘mysql:host.com, 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
August 3, 2013, 2:42am
https://github.com/clevertech/YiiBoilerplate , 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.
August 3, 2013, 8:48pm
Thank you for your reply Zeam!
But that thing looks pretty heavy!
Is there a simpler solution?
What do people in the open-source community use?
August 5, 2013, 4:00am
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):
... //any base configs are here
(file_exists(__DIR__ . '/main-local.php') ? require(__DIR__ . '/main-local.php') : array())
main-local.php (each developer’s config):
'connectionString' => 'mysql:host=localhost;dbname=db1',
'emulatePrepare' => true,
'username' => '',
'password' => '',
'charset' => 'utf8',
'tablePrefix' => '',
and then do this (quoted from YiiBoilerplate explanation):
The base configuration should be put under version control, like regular source code, so that it can be shared by every developer. The local configuration should not be put under version control and should only exist in each developer’s working directory.
August 7, 2013, 9:34pm
Took me a while to understand Yiiboilerplate…
But now it’s getting clearer!