Application.cfc and ColdFire

While working on the latest version ColdFire I "discovered" the following: If you use the onRequest method of the Application.cfc the page's variables scope is not available to the debugging template. Not a big deal most of the time as the built in debugging templates don't output anything from the variables scope. This is a problem for ColdFire however because it renders the variable dumping functionality basically useless.

So how do you get around the issue? Well, if you are using the onRequest method you can just include the coldfire.cfm template in your onRequestEnd method.

<cffunction name="onRequestStart" returnType="boolean" output="false">
<cfargument name="thePage" type="string" required="true">
<cfreturn true>
</cffunction>

<cffunction name="onRequest" returnType="void">
<cfargument name="thePage" type="string" required="true">
<cfinclude template="#arguments.thePage#">
</cffunction>

<cffunction name="onRequestEnd" returnType="void" output="false">
<cfargument name="thePage" type="string" required="true">
<cfinclude template="coldfire.cfm">
</cffunction>

I know that using includes in CFC methods is generally frowned upon, but this gives you most of the functionality of ColdFire and it will even obey the "Enable Debugging" setting in the ColdFusion administrator. I say that it gives you most of the functionality because running ColdFire via onRequestEnd doesn't report the Application.cfc's onRequest method execution time. If if you run ColdFire as a debug template, or if you use the classic debug template, the onRequest method's execution time is reported. Everything else seems to work fine. That said this is a temporary work around. I think we may need to investigate a better solution for a future release.

Related Blog Entries

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.