-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoldfire.cfc
30 lines (24 loc) · 1.19 KB
/
coldfire.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<cfcomponent displayname="ColdFire Base Application CFC">
<cffunction name="onRequestEnd" returntype="void">
<cfif IsDefined("onRequest") and IsDebugMode()>
<cfset copyColdFireVariables() />
</cfif>
</cffunction>
<cffunction name="copyColdFireVariables" returntype="void" output="no" access="private" hint="Copies variables scoped variables defined in the ColdFire variables tab to the request scope so they are available to the coldfire.cfm debugging template.">
<cfset var varArray = [] />
<cfset var requestData = GetHttpRequestData() />
<cfset var i = 0 />
<cfif structKeyExists(requestData.headers,"x-coldfire-variables")>
<cfset varArray = DeserializeJSON(requestData.headers["x-coldfire-variables"]) />
<cfset request.__coldFireVariableValues__ = {} />
</cfif>
<cfloop array="#varArray#" index="varName">
<cfif CompareNoCase(Left(varName,10),"variables.") eq 0
OR (Find(".",varName) eq 0 AND ListFindNoCase("application,cgi,client,cookie,form,request,server,url",varName) eq 0)>
<cfif IsDefined(varName)>
<cfset request.__coldFireVariableValues__[varName] = evaluate(varName) />
</cfif>
</cfif>
</cfloop>
</cffunction>
</cfcomponent>