Staging Servers
20/07/09 11:22
Anyone come up with a good way to write code that automatically configures itself for both development & production servers, and also plays well with a CVS system (such as Subversion)?
I’ve come up with two approaches, but not really happy with either one. These include...
- A config file which is gets modified, based on the server the code is running on.
- Writing code that detects the current environment and then selects a config file based on that.
Both have their issues. #1 will totally break on Subversion, since the file needs to be modified once it is checked out. Then you have to be extra careful not to try to check that one back in again.
echo “I am your PHP Code”;Tags: PHP, HTML CODING