Taken from: http://www.forta.com/blog/index.cfm/2007/4/24/Scorpio-Per-Application-Settings
ColdFusion users have long wanted a way to define settings per application, rather than server-wide. In truth, this is doable right now, just install multiple instances of ColdFusion an each instance gets its own CF Admin and own settings.
But, if that is not an option, then Scorpio will help, as I explained last night in Seattle. ColdFusion MX7 introduced Application.cfc as an alternative to Application.cfm. Application.cfc does everything that Application.cfm does, and added important new features (like methods that get executed OnSessionStart and OnSessionEnd).
To set application settings using Application.cfc, variables are set in the THIS scope. THIS.name to set the application name, THIS.sessionManagement to enable session state management, and so on.
In Scorpio, Application.cfc and the THIS scope can be used to define per application settings. For example, THIS.mappings is a structure which contains the currently defined ColdFusion mappings.
To set a mapping you just modify that structure like this:
<cfset THIS.mappings["MyStuff"]="c:\inetpub\MyStuff">
<cfset StructInsert(THIS.mappings, "MyStuff", "c:\inetpub\myStuff")>
You can set the path like this:
<cfset THIS.customtagpaths="c:\inetpub\wwwroot\ben\tags">
<cfset THIS.customtagpaths=ListAppend(customtagpaths, "c:\inetpub\wwwroot\ben\tags")>
No comments:
Post a Comment