When I test this I can reference the variables in the included file as long
as the included file's variables don't specify the variables scope (which I
assume forces them to be local to the included template). So just do:

Config.cfm
----------
<cfset constants.sessionTimeout = createTimeSpan(0,0,1,0)>
<cfset constants.applicationTimeout = createTimeSpan(0,0,2,0)>

And reference them as variables.constants.sessionTimeout in the
Application.cfc.


On 7/26/07, Michael Dawson <[EMAIL PROTECTED]> wrote:
>
> I can use relative references, however, there appears to be a bug in CF8
> that won't allow you include a file in the Application.cfc's "constructor"
> area.  Well, that's not entirely correct.  You can include a file, however,
> you can't refer to any variables within that included file.  That makes it
> pretty useless.
>
> What I want to do is very basic:
>
> I want an Application.cfc that is exactly the same for development,
> testing and production.  I want that Application.cfc to get its settings
> from a Config file that is unique to each site (development, testing and
> production).
>
> Here is a requirement:
>
> I want to dynamically set the sessionTimeout and applicationTimeout
> variables in the THIS scope.  I want to pull these values from a config file
> located anywhere on the server (under the web root or outside of it).
>
> Theoretically, it should work like this:
>
> Config.cfm
> ----------
> <cfset variables.constants.sessionTimeout = createTimeSpan(0,0,1,0)>
> <cfset variables.constants.applicationTimeout = createTimeSpan(0,0,2,0)>
>
>
> Application.cfc
> ---------------
> <cfcomponent>
>
>     <cfinclude template="../Config/Config.cfm">
>
>     <cfset this.sessionTimeout = variables.constants.sessionTimeout>
>     <cfset this.applicationTimeout =
> variables.constants.applicationTimeout>
>
> </cfcomponent>
>
>
> When running this simple code, the CFINCLUDE tag does not throw an error,
> however, you can't refer to the variables set within the included file.
>
> I would just like a solution to this simple problem.
>
> Thanks
> M!ke
>
> >> I have structured my web site (CF8) so that my config
> >
> >Use a relative reference to get to the parent directory or to siblings,
> etc.
> >Obviously, something will have to be hard-coded - the relative location
> of
> >the config file, or perhaps the name of the config file if you wanted to
> >mimic the behavior of CF when it's looking for Application.cfc/cfm.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284695
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to