Fortunately, ColdFusion 8 has per-application mappings - and CrystalTech have them enabled in the CF Administrator - so I was able to dynamically add mappings for all of my top-level directories inside Application.cfc and I was up and running:
<cfloop index="p" list="list,of,toplevel,directories">
<cfset this.mappings["/" & p] = expandPath("/") & p />
</cfloop>
We're looking forward to taking advantage of several of the new features in CF8 soon (it's been frustrating being on CF8 for localhost development but deploying to CFMX7).
Welcome to CF8. :)
So my question is... would it be possible to prevent your app from using *any* mappings except those explicitly declared in Application.cfc? If possible, that might be easier than trying to remember to go back and update the anti-usurpation list whenever a directory is added to the application.
My real criticism here would be aimed at CrystalTech for allowing mappings with "common" names. Thankfully HostMySite have learned that lesson and no longer allow mappings that could clash (they automatically prefix every mapping with your customer number!).
You do not *need* mappings - you can put everything under your webroot on a shared host - so it's partly bad citizenship as well as ignorant hosting companies.
As for CrystalTech, the choice predates my involvement (and is certainly not a choice I would have made). We will be moving off them at some point (soon, hopefully) as I want CF8 on Linux (right now we're on Windows and I hate that).
In the past (on windows) we have simply got into terminal services to do the CF administration right on the box itself.
Now that we're migrating to linux I was wondering how people handle the remote administration and setup of their CF installs? Are people reaklly opening their CF adminstrator up to the outside world?
One of the best in my opinion is to set up a virtual host in Apache so that CFIDE is only available on a specific named host and bound to an IP that is not accessible externally - and then access it over VPN or via an SSH tunnel.
<cfcomponent> <cfset this.name = "MyApp"> <cfset this.mappings = structNew()> <cfset structinsert(this.mappings,"/applicationpath","C:/MyAppFolder/")> <cffunction name="onApplicationStart"> <cfset application.myobject = createobject("component","applicationpath.myobject").init()> </cffunction> </cfcomponent>
This simply will not work, Coldfusion will report that it cannot find the object specified. It doesn't work if you use OnRequestStart() either - the only way to do this is to do it OUTSIDE of the application.cfc, which isn't desirable or even possible depending on your application. Would be interested in other people's comments on this issue as I've not encountered any other mention of it online so far.
There's only one instance I've seen it fail and that's because it wasn't inside any of the Application.cfc functions (onRequestStart,onSessionStart, etc). It was within the constructor zone, but that's easy enough to get around.


