I think the slash notation problem you are having is due to the beginning
root slash in:
createObject("component","/org/bacfug/test");
Which basically means, go the defined or undefined root of CF, then looks
for the folders specified.
We also host a great deal of our sites on shared hosting, and we always ask
them to set up a mapping for our current site. So we can just call our CFCs
by:
foo = createObject("component","mydomain._cfcs.etc"); // which would point
to \sharedhostingroot\mydomain\_cfcs\etc
If they can't set up a mapping for you, or at least set up a general mapping
for the root folder for all of their shared hosting, then you need to switch
up providers. It sucks that it's an extra step to get your app installed,
but at least it's an easy fix->
Tyler
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Nathan Dintenfass
Sent: Wednesday, September 03, 2003 12:21 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] paths on a virtual host
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]
----------------------------------------------------------
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]