On most of my projects I end up having a dynamic xml for online testing, and an .xml file when I work locally.
What I do is having all the config vars on the top of my code, and comment depending wether I’m working locally or on the server.
as en example
//server
xml_file = “http://mydomain.com/mywebservice.php”
//local
xml_file = “myfile.xml”
What would be really handy for me, instead of commenting each block each time, would be having a conditional:
if(we’re online){
xml_file = “http://mydomain.com/mywebservice.php”
} else {
xml_file = “myfile.xml”
}
… but I don’t know how I can approach that.
Any ideas?
TIA