Accessing settings/request vars - where and when

15 views
Skip to first unread message

Nathan Dintenfass

unread,
Mar 10, 2011, 2:58:46 PM3/10/11
to framew...@googlegroups.com
I was trying to make a link on an admin page that would reset my FW1 app
and ran into two issues:

1) When the FW/1 request variables are created -- I know this has come
up before, but I was first trying to say something like this in the
pseudo-constructor of my Application.cfc:

if(request.action EQ 'admin.resetapp')
variables.framework.reloadApplicationOnEveryRequest = true;

Then I tried:

if(getFullyQualifiedAction() EQ 'admin........

Of course, neither work because FW/1 hasn't yet set up the request
variables at that point.

Is this still something on the table for version 2??


2) When generating the link to reset the app I found myself wishing I
could access variables.framework.reload and variables.framework.password
in my controller, but near as I can tell there's no clean way to do that.

Am I crazy to want to do these things?

Eapen

unread,
Mar 10, 2011, 3:19:47 PM3/10/11
to framew...@googlegroups.com
> 1) When the FW/1 request variables are created -- I know this has come up
> before, but I was first trying to say something like this in the
> pseudo-constructor of my Application.cfc:

I second this idea.

I currently use two methods.
1. Do a cfhttp call to the application passing in the "reload=true"
2. I have this code block in my Application.cfc in the setupRequest()
method (but this would log you out of the admin)

<cfif IsDefined("url.restartapp") AND URL.restartapp EQ "true">
<cfset StructClear(SESSION) />
<cfset StructClear(Application) />
<cfset Application.ApplicationName = "appname">
<cflocation addtoken="no" url="index.cfm">
</cfif>

Sean Corfield

unread,
Mar 11, 2011, 10:48:31 AM3/11/11
to framew...@googlegroups.com
On Thu, Mar 10, 2011 at 12:58 PM, Nathan Dintenfass
<nat...@dintenfass.com> wrote:
> Of course, neither work because FW/1 hasn't yet set up the request variables
> at that point.
>
> Is this still something on the table for version 2??

Nothing has run inside FW/1 by the time your pseudo-constructor runs
in Application.cfc so that simply is not possible.

> 2) When generating the link to reset the app I found myself wishing I could
> access variables.framework.reload and variables.framework.password in my
> controller, but near as I can tell there's no clean way to do that.

Sure there is! getConfig() (or is it getConfiguration()? I'm on my
netbook and don't have the code open right now).

> Am I crazy to want to do these things?

Open a ticket for the first one. It may simply not be possible but
I'll look at it.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Reply all
Reply to author
Forward
0 new messages