I have some sites on a shared host where the "root" of my account is not on
the same drive as the ColdFusion web root.

The CF root is: C:\CFusionMX\wwwroot\

My root is: E:\web\myDomain

[CF version: 6,1,0,63958]

I've been playing around with ways to use component paths on this server and
noticed that I can use "dot notation" paths without any problems, but can't
use "slash notation" paths.

For instance, this works:

<cfscript>
foo = createObject("component","org.bacfug.test");
</cfscript>

But, this does not:

<cfscript>
        foo = createObject("component","/org/bacfug/test");
        writeOutput(foo.getFoo());
</cfscript>

Even though this translates to the right path:

expandPath("/org/bacfug/test.cfm")

(strangely, that last statement ends up with a different path entirely from
expandPath("/") -- as in, a different drive on the machine! [and no, there's
no mapping in CF])

Where it gets really strange is that the "org.bacfug.test" path ONLY works
if the calling page is in the "root" of my account and the
org/bacfug/test.cfc sits below that.  If I call that same code from a
sub-directory of my root it won't work.  This runs counter to how I've seen
dot-notation work when running code from within the CF root (where
"org.bacfug.test" would work regardless of the location of the calling
page).

If someone from MACR or elsewhere would care to chime in on the underlying
mechanism for resolving these paths and why they seem so incongruous that
would be swell.

As it stands, it seems that using CFCs on a shared host is still a major
challenge.  I find I need to either use relative path "slash notation",
which requires that the CFCs live in a directory under the calling page or
in the same directory as the calling page (because you can use a path like
"../org/bacfug/test" but can use a path like "org/bacfug/test") or use the
TemplateProxyFactory trick to instantiate a CFC based on a fully qualified
file path (which I've resorted to recently).  Have others faced these
challenges on shared hosts and have answers I'm not seeing?

 - Nathan

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to