Archive for January 27th, 2008

Creating a Server.cfc

Sunday, January 27th, 2008

This is technique I have been using for a while to handle environmental (development, test, production etc) configuration settings. It mimics the Application.cfc added in ColdFusion 7, creating a Server.cfc shown below.

[The requested file http://www.bealearts.co.uk/wordpress/wp-content/uploads/2008/01/server.cfc could not be found]

The Server.cfc is copied to the approot/webroot of the server and the variables.environment property set the the server type e.g. "Development". Then in each Application deployed to the server, the following code is added to the begining of the onApplicationStart method in Application.cfc.

[The requested file http://www.bealearts.co.uk/wordpress/wp-content/uploads/2008/01/run-server-cfc.cfm could not be found]

Environmental configuration changes within each application can then be made by referencing the server.environment and server.name properties of the server scope.


Copyright © 2005, David Beale

  • Valid XHTML 1.0!
  • Valid CSS
  • Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0