production, development, a db for each and settings.php

Events happening in the community are now at Drupal community events on www.drupal.org.
Screenack's picture

I maintain a production and development environment. I commonly sync the files and database data and switch the connection string for the environment. For both production and development, the database is only accessible from the hosted machine. Shouldn't this be possible, i.e.,

Development string (If available load and move on. if dev server not available, use the next string)
Production string

Thanks!

Comments

The way I normally handle

kwinters's picture

The way I normally handle this is to have the code in version control and locally modify the line on either live or development (both in the file, but one commented out).

You could also check some environment variable, since you can put code in settings.php - but I wouldn't have it try to connect to both databases and have one fail, because that will delay every single request.

Ken Winters

triDUG

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: