Folks,

I'm not sure if it's ok to post this question here or not, so if it's
out-of-band for this forum just let me know...


I've got an app hosted on a shared server (who doesn't?) and I seem to be
running into a problem. I've worked around it, but I'd like some input for
the future.

I have a directory that we'll call / for now just because it's easiest.
Within / I have a dozen or so templates, a directory called CFC that has all
my CFCs in it, and used to have a folder called includes that contained all
my include files. I say used to because I ran into an odd problem.

A little background... since all my templates are in a root folder and the
CFCs are one directory down, I'm using
createObject("component","cfc.{cfc_name}") to create my instances. The last
argument to createObject is usually something like "cfc.user," and it works
fine because CFMX can find the CFC files by looking in a folder called CFC
relative to the current directory (/) and containing a file name "user.cfc."
THAT all works fine... however:

Several of my include files contained calls to CFC methods. If a page in my
main folder (/) used CFINCLUDE to consume a file from "/include", and the
included file contained a to createObject to instantiate "cfc.user" it would
fail, claiming that such an object didn't exist within the scope of this
application.

I thought that, in terms of relative paths, cfincludes used the location of
the base template to find any objects, but it doesn't seem to.
Interestingly, whenever I call a CFC from another CFC, I have to drop the
"cfc." from "cfc.user" and call the method via the simple object name "user"
or it ALSO claims it can't find it (although I believe Ben Forta made a note
of this behavior in the CF-WACK).

I tried several methods to re-point the CFC references from within these
includes, including an explicit path, including the CFC file into the
include file, using "..cfc.user" (which REALLY didn't work) and a few other
things before I gave up and moved the includes into the main directory. I
know the simplest way to fix this is run it on a box I can control and set
up a custom tag directory (which will happen eventually), but for right now
I'm stuck. It works, but it seems "broken" to me to do it this way.

I finally moved all my includes into / and renamed them all to have "inc_"
for the first four characters in the file name to keep them together in my
file lists. I don't mind, but it adds several many extra entries in my list
view in Dreamweaver... and it's not a convention I LIKE.

Any thoughts, input, or mockery?

Laterz,
J
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to