J-P If you want developers to share code with the live site, then that should work. The database is not the only component here. There are modules and themes too. It is not a good idea to have developers share code that is actively in development with a live site. You want to give them write access to the sites/all/modules and sites/all/themes (and/or whereever else they have code they need to muck around with). This is not a good practice in general. Now, if you are talking testing/staging and live, where no code changes are done, then you have a point. On 8/16/07, J-P Stacey <jp.stacey@torchbox.com> wrote:
Tao Starbow wrote:
This is one of the cooler, not-so-well known drupal features. In settings.php you can define $db_url as an array $db_url['default'] = normal drupal string $db_url['backoffice'] = other mysql connect string
then you use db_set_active( db_key ) to switch between them as needed.
Is this a standard core feature, enabled by default? I feel like saying "why wasn't I told about this before?" :)
One of the big problems we have is that many developers working on a given codebase: this means the codebase is in subversion and people check it out to their own machines, work on it, check changes back in.
Some developers develop on the same machine, because their desktops are WinXX and setting up LAMP stacks takes time. On this machine, whilst they can check out site-specific codebases to e.g. sites/developername-clientname-devel.example.com and hence develop in their own sandboxes, it's difficult to keep the site under revision and yet not have people be forced to share a database by settings.php .
But with the above a high-priority module could switch quickly and cleanly between developers' own sandboxed databases: does that sound right? How would you sneak in before any of the other modules? Would the following at the end of settings.php be sufficient:
db_set_active($_SERVER['HTTP_HOST']); // defaults to 'default'
Or is that too hacky? Can you even call a function from within settings.php (notwithstanding the argument of "would you want to?")
Somewhere among all this is functionality to make Drupal a good deal more "enterprise", for whatever that hackneyed term is worth. Transparently distributed development for large-scale, independent CMS teams on their clients' behalf.
Cheers, J-P -- J-P Stacey +44 (0)1608 811870 http://torchbox.com
-- 2bits.com http://2bits.com Drupal development, customization and consulting.