You could use the SERVER_NAME CGI variable to detect which server the code runs on.
<CFIF cgi.SERVER_NAME is "mydevbox">
<!--- Do something on the dev machine --->
<CFELSE>
<!--- Do something on the production box --->
</CFIF>
If the environments are different out of necessity, then, no, it's not a horrible idea. Configs will differ because of naming conventions, file locations, etc., so you need a way to handle them.
Or you could just have a different config file for each server, this is what I do.
I have all my global vars stored in a WDDX file, and I have a different file for each environment, the contensts of that WDDX file is then extracted into REQUEST scope. The WDDX file is of course in a non web accessible folder.
<!---------- in my application.cfm I have this ------------->
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.