Question

Currently, in the application.cfc, I extend the Fusebox 5.5 Framework. Then in the OnRequestStart method below, I set the fusebox mode depending on a certain condition.

The problem is that sometimes, the fusebox xml files do not reparse no matter what changes I make. If I force a reparse using the url variables fusebox.parse=true&fusebox.loadclean=true&fusebox.password=xxx then the files parse again.

It is almost like Fusebox remains in production mode even though when I dump the FUSEBOX_PARAMETERS.mode it says "development-full-load"

What could be causing this? Is the way that the fusebox mode is being manipulated correct in the code below or should that kind of setting be done somewhere else (besides the fusebox.xml obviously)??

Any help would be great. Thanks

 <cffunction name="onRequestStart">
    <cfset variables.server_type = "Development" />

    <cfswitch expression="#variables.server_type#">
        <cfcase value="development">
            <cfset FUSEBOX_PARAMETERS.mode = "development-circuit-load" />
            <cfset FUSEBOX_PARAMETERS.debug = true />
            <cfset request.component_reload = true />
        </cfcase>
        <cfdefaultcase>
            <cfset FUSEBOX_PARAMETERS.mode = "production" />
            <cfset FUSEBOX_PARAMETERS.debug = false />
            <cfset request.component_reload = false />
        </cfdefaultcase>
    </cfswitch>
    <cfif (StructKeyExists(attributes, "fusebox.loadapp") AND attributes.fusebox.password EQ application.fusebox.password) OR FUSEBOX_PARAMETERS.mode NEQ application.fusebox.mode>
        <cfset this.onApplicationStart() />
    </cfif> 

    <cfset superReturn = super.onRequestStart(arguments.1) />
</cffunction>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top