that is why the Snake was suggesting using a mapping :-)

On Mon, Mar 14, 2011 at 1:46 AM, Mark A. Kruger <[email protected]>wrote:

>
> In my experience it will always use a CF mapping first (if found) then
> relative path... that would make a good article if I could sort it out...
>
> Mark A. Kruger, MCSE, CFG
> (402) 408-3733 ext 105
> www.cfwebtools.com
> www.coldfusionmuse.com
> www.necfug.com
>
> -----Original Message-----
> From: Russ Michaels [mailto:[email protected]]
> Sent: Sunday, March 13, 2011 7:56 PM
> To: cf-talk
> Subject: Re: CF9 CreateObject() Maps From Current Directory First?
>
>
> Matt,
>
> I believe that officially CF would always search relative to the current
> directory first, which applies to CFC's and custom tags.
> In which case if you instantiate the cfc from within subdir, were you also
> have a com/mycfc.cfc then this one would be found first.
>
> I have generally found that ColdFusion search order is not always reliable
> (at least on a shared server with many sites), it sometimes does as above,
> but sometimes looks in the webroot first, and if you have custom tag paths
> it may look there first as well, so I have always used a mapping to avoid
> this problem.
> So perhaps the original developer used a mapping if this code used to work
> fine before?
>
>
>
> On Sun, Mar 13, 2011 at 9:51 PM, Matt Quackenbush
> <[email protected]>wrote:
>
> >
> > Ever since CFCs were introduced, the path to them has been derived
> > based upon the web root.  So, given the following directory structure...
> >
> > /webroot
> >    /com
> >         - myCFC.cfc
> >    /subdir
> >         /com
> >               - myCFC.cfc
> >
> > ... if I were to do the following...
> >
> > myCFCInstance = createObject("component","com.myCFC");
> >
> > ... no matter what file in the directory structure I did this in, I
> > would always be creating an instance of /webroot/com/myCFC.cfc.  I
> > would **NOT** be creating an instance of /webroot/subdir/com/myCFC.cfc
> > unless I provided that full path.  E.g.
> >
> > myCFCInstance = createObject("component","subdir.com.myCFC");
> >
> > I am attempting to get a project setup locally (not coded by me) that
> > has a directory structure similar to the above.  I am running CF
> > 9.0.1, which is giving me an instance of the subdirectory's CFC,
> > rather than the one right off the web root.  I thought I remembered
> > seeing a thread about this issue quite some time back, but I cannot find
> it anywhere.
> >
> > Has anyone ever experienced this and/or know a solution?  (Other than
> > loading up CF8... lol.)
> >
> > Thanks in advance.
> >
> >
> >
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342979
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to