I have recently taken to converting my websites files into ones that work on any path. I am working on using Virtual Hosts to be able to maintain the same .htaccess
file as on the main production server. My initialize file that includes all my models is written dynamically to find out the exact system file path and update the website accordingly so I can upload the whole website anywhere.
The trouble lies in the config file. Depending on whether I am on dev or on prod, I connect to a differert database. Therefore I have a small check first to see if I am running a local server. I do this by storing my naming conventions for my dev in an array and by looping through the array to see if the HTTP_HOST matches a value.
Example:
$dev_names = array('localhost','.dev');
However, when I mentioned this on Chat the other day, a respected user told me that he never does this. Instead he has 2 config files and includes the right one at the right time? I didn't get though what was wrong with my approach?
Can you point out to me the flaws in my plan to help me understand the experts?
(PS. For a bonus you can give me a quick run down on how a bootstrap works, heard that word being thrown around, not sure if it is written in PHP or whatever.)