Russell Heimlich - I disagree, it is useful to keep configuration in version control so when different people work on a project things can be up and running easily. If someone can break into a test server, they can break into a live server. Most config settings aren't unique between a test and live version of a site, except perhaps database and debug settings.

Also, I wouldn't advocate adding a GET param to enable debug mode since is a security risk in live environment. Security through obscurity isn't a great approach.

Paul - the if/switch approach is what we used to use, though I prefer the organisation of splitting this out into multiple files. Makes things a bit more transparent and easier to manage. But there are lots of ways of achieving the same aim :)