Re: Database includes

From: Date: Wed, 29 Aug 2007 03:06:14 +0000
Subject: Re: Database includes
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-261435@lists.php.net to get a copy of this message
Larry Garfield wrote:
On Tuesday 28 August 2007, brian wrote:
If you have to modify anything other than a single config file in order to move your site/app from one server to another, then you have a design flaw. (I'd say that applies for moving the site to a subdirectory on a server too, but that takes a bit more effort.)
I'm with Larry on this. Include a constants file at the top of your scripts. In that file you can place a switch block that tests for the $_SERVER['HTTP_HOST']. For each case, place something like:
That's bad, too, if you have multiple developers on the project. Just have a separate config file that contains *nothing* but the installation config, and every install has its own copy.
How so? If, by multiple developers, you mean multiple *development domains*, then yes, that'd need tweaking. Otherwise, i fail to see the badness.

« previous php.general (#261435) next »