My application currently has the following:
define('DOCROOT', dirname(__FILE__).DIRECTORY_SEPARATOR); define('WEBROOT', 'http://localhost/samples/');
The first line works fine. I can include the configuration file anywhere, and then use the DOCROOT constant as expected.
The second line also works, but it is hard-coded, which means that when this file is uploaded to my web server, it will be incorrect. There should be http://samples.example.com . Is there a good way to somehow prevent this hard coding? I kind of think that I need to hard code something, and in this case, what and how little can I avoid?
Svish
source share