Usually I have a configuration file with some global variables for the database connection parameters (for example, host name, db name, user, password).
I also really like being able to simply drag and drop all files from my dev machine to the production server. However, the db development host, etc. May differ from what is on the production server.
Is there an easy way, in PHP, to say something like, "if I'm on a dev machine, use these values ? (I would prefer to avoid hacks based on the host's IP name.) I'm thinking of something like setting something up then in php.ini or httpd.conf, so, for example, $DEV_MACHINE , the dev machine is set to true.
source share