Reputation: 1445
I came from PHP/MySQL background, and now I landed new back-end position as Coldfusion 9 developer. Im totally new with Coldfusion, so for learning and testing purposes I have installed CF on my localhost. On my localhost I have set and tested ORM, which worked perfectly, and it did not interfere with other parent folders. Once I uploaded my Application.cfc file to our main server, under site/project89/cfc/orm/
<cfcomponent>
<cfset this.name = "whatevername">
<cfset this.ormenabled = "true">
<cfset this.datasource = "name_db">
</cfcomponent>
It affected the whole parent server folders, including main "site" folder where we have all other coldfusion projects that were build before.
Is there a way to set ORM to affect only its own subdirectories and DO NOT make any changes to its parent folders?
Example, enable ORM for site/project89, and prevent ORM on other site/project**.
Any help or advise will be greatly appreciated, because where I work no one familiar with ORM and I can not afford to crash our server again.
Thank you.
Upvotes: 1
Views: 140
Reputation: 9857
I think the issue you are having relates to the location/struture of your application.
You need to move your Application.cfc
to the root of site/project89
.
From the ColdFusion docs:
When ColdFusion starts processing the request, it does the following:
It searches the page's directory for a file named Application.cfc. If one exists, it creates a new instance of the CFC, processes the initial events, and stops searching. (ColdFusion creates a new instance of the CFC and processes its initialization code for each request.)
If the requested page's directory does not have an Application.cfc file, it checks the directory for an Application.cfm file. If one exists, ColdFusion logically includes the Application.cfm page at the beginning of the requested page and stops searching further. If the requested page's directory does not have an Application.cfc or Application.cfm file, ColdFusion searches up the directory tree and checks each directory first for an Application.cfc file and then, if one is not found, for an Application.cfm page, until it reaches the root directory (such as C:).
When it finds an Application.cfc or Application.cfm file, it processes the page and stops searching.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=appFramework_06.html (ColdFusion 8 but still relevant)
Upvotes: 3
Reputation: 6956
I guess under "affected" you mean that it is looking for model CFCs everywhere. If this is true, you can try to solve it by restricting the path of models:
this.ormsettings.cfclocation = "path.to.models";
Upvotes: 1