Then don't scatter if-tests around.The reason it was written this way is that the devel database is not actually a complete snapshot of live. Lots of tables and some whole databases aren't there, so pages break horribly in the devel environment. This should of course be solved by replicating the rest of the db. Instead it was handled by adding a configuration option to the db class to over-ride devel mode and connect to the live server anyway. So the developer then had to track, "For this function I want a connection to the live db, for that function I want a connection to devel."
That stops now. Devel is devel, and if it doesn't work in devel then you fucking fix it.
For another you're likely to need at least 3 environments some day. (Development, staging, production.) ... That is very nice if you, for instance, want to give each developer their own machine with a customized installation to play with.Actually we've got four:
- Devel, where each developer has his own vhost and all db connections (starting tomorrow morning) are to the devel db.
- Stage, for testing (assuming we hire some testers [sub-rant deleted here]), which also (as of tomrrow morning) points to devel db.
- Cert, for QA (assuming we hire ... oh, I already went there) which points to live data.
- Live.