<!--- ensure no one can usurp our webroot-relative paths --->
<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).<cfloop index="p" list="list,of,toplevel,directories">
<cfset this.mappings["/" & p] = expandPath("/") & p />
</cfloop>

12 responses so far ↓
1 Todd Rafferty // Oct 24, 2007 at 4:24 AM
Welcome to CF8. :)
2 Ben // Oct 24, 2007 at 6:01 AM
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.
3 Sean Corfield // Oct 24, 2007 at 6:18 AM
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.
4 Todd Rafferty // Oct 24, 2007 at 6:48 AM
5 Todd Rafferty // Oct 24, 2007 at 6:49 AM
6 Sean Corfield // Oct 24, 2007 at 7:16 AM
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).
7 Anthony Webb // Mar 29, 2008 at 10:49 PM
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?
8 Sean Corfield // Mar 30, 2008 at 1:12 AM
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.
9 Andy Bellenie // Apr 18, 2008 at 3:25 AM
<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.
10 Sean Corfield // Apr 18, 2008 at 7:58 AM
11 Todd Rafferty // Apr 18, 2008 at 8:47 AM
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.
12 Andy // Apr 21, 2008 at 3:21 AM
Leave a Comment