PageRenderTime 90ms CodeModel.GetById 82ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/wheels/events/onrequestend/debug.cfm

http://cfwheels.googlecode.com/
ColdFusion | 161 lines | 154 code | 7 blank | 0 comment | 3 complexity | 7de927e7c7ba01610b26c6c971a47caf MD5 | raw file
  1<cfset loc.baseReloadURL = cgi.script_name>
  2<cfif cgi.path_info IS NOT cgi.script_name>
  3	<cfset loc.baseReloadURL = loc.baseReloadURL & cgi.path_info>
  4</cfif>
  5<cfif Len(cgi.query_string)>
  6	<cfset loc.baseReloadURL = loc.baseReloadURL & "?" & cgi.query_string>
  7</cfif>
  8<cfset loc.baseReloadURL = ReplaceNoCase(loc.baseReloadURL, "/" & application.wheels.rewriteFile, "")>
  9<cfloop list="design,development,testing,maintenance,production,true" index="loc.i">
 10	<cfset loc.baseReloadURL = ReplaceNoCase(ReplaceNoCase(loc.baseReloadURL, "?reload=" & loc.i, ""), "&reload=" & loc.i, "")>
 11</cfloop>
 12<cfif loc.baseReloadURL Contains "?">
 13	<cfset loc.baseReloadURL = loc.baseReloadURL & "&">
 14<cfelse>
 15	<cfset loc.baseReloadURL = loc.baseReloadURL & "?">
 16</cfif>
 17<cfset loc.baseReloadURL = loc.baseReloadURL & "reload=">
 18<cfset loc.hasFrameworkTests = StructKeyExists(this, "mappings") && StructKeyExists(this.mappings, "/wheelsMapping") && DirectoryExists(expandPath("/wheelsMapping/tests"))>
 19<cfset loc.hasAppTests = DirectoryExists(expandPath("#get('webPath')#/tests"))>
 20
 21<cfoutput>
 22
 23<style type="text/css">
 24##wheels-debug-area
 25{
 26	clear: both;
 27	margin: 100px 0;
 28	text-align: left;
 29	background: ##ececec;
 30	padding: 10px;
 31	border-top: 3px solid ##999;
 32	border-bottom: 3px solid ##999;
 33}
 34
 35##wheels-debug-area td
 36{
 37	font: 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
 38	line-height: 1.5em;
 39	color: ##333;
 40}
 41
 42##wheels-debug-area a
 43{
 44	color: ##333;
 45	text-decoration: underline;
 46	padding: 0 1px;
 47}
 48
 49##wheels-debug-area a:hover
 50{
 51	color: ##fff;
 52	background: ##333;
 53	text-decoration: none;
 54}
 55</style>
 56
 57<div id="wheels-debug-area">
 58	<table cellspacing="0" cellpadding="0">
 59		<cfif Len(application.wheels.incompatiblePlugins) OR Len(application.wheels.dependantPlugins) OR NOT ArrayIsEmpty(request.wheels.deprecation)>
 60			<tr>
 61				<td valign="top"><strong><span style="color:red;">Warnings:</span></strong></td>
 62				<td>
 63					<span style="color:red;">
 64						<cfif Len(application.wheels.incompatiblePlugins)>
 65							<cfloop list="#application.wheels.incompatiblePlugins#" index="loc.i">The #loc.i# plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin<br /></cfloop>
 66						</cfif>
 67						<cfif Len(application.wheels.dependantPlugins)>
 68							<cfloop list="#application.wheels.dependantPlugins#" index="loc.i"><cfset needs = ListLast(loc.i, "|")>The #ListFirst(loc.i, "|")# plugin needs the following plugin<cfif ListLen(needs) GT 1>s</cfif> to work properly: #needs#<br /></cfloop>
 69						</cfif>
 70						<cfif NOT ArrayIsEmpty(request.wheels.deprecation)>
 71							<cfloop array="#request.wheels.deprecation#" index="i">#i.message# (line #i.line# in #i.template#)<br /></cfloop>
 72						</cfif>
 73					</span>
 74				</td>
 75			</tr>
 76		</cfif>
 77		<tr>
 78			<td valign="top" style="width:125px;"><strong>Application:</strong></td>
 79			<td>#application.applicationName#<cfif NOT Len(get("reloadPassword")) OR loc.hasAppTests> [<cfif NOT Len(get("reloadPassword"))><a href="#loc.baseReloadURL#true">Reload</a></cfif><cfif NOT Len(get("reloadPassword")) AND loc.hasAppTests>, </cfif><cfif loc.hasAppTests><a href="#get('webPath')##ListLast(request.cgi.script_name, '/')#?controller=wheels&action=wheels&view=tests&type=app&reload=true">Run Tests</a></cfif>]</cfif></td>
 80		</tr>
 81		<tr>
 82			<td valign="top"><strong>Framework:</strong></td>
 83			<td>Wheels #get("version")#<cfif loc.hasFrameworkTests> [<a href="#get('webPath')##ListLast(request.cgi.script_name, '/')#?controller=wheels&action=wheels&view=tests&type=core&reload=true">Run Tests</a>]</cfif></td>
 84		</tr>
 85		<tr>
 86			<td valign="top"><strong>CFML Engine:</strong></td>
 87			<td>#get("serverName")# #get("serverVersion")#</td>
 88		</tr>
 89		<tr>
 90			<td valign="top"><strong>Default Data Source:</strong></td>
 91			<td>#get("dataSourceName")#</td>
 92		</tr>
 93		<tr>
 94			<td valign="top"><strong>Active Environment:</strong></td>
 95			<td>#capitalize(get("environment"))#<cfif NOT Len(get("reloadPassword"))><cfset loc.environments = "design,development,testing,maintenance,production"> [<cfset loc.pos = 0><cfloop list="#loc.environments#" index="loc.i"><cfset loc.pos = loc.pos + 1><cfif get("environment") IS NOT loc.i><a href="#loc.baseReloadURL##loc.i#">#capitalize(loc.i)#</a><cfif ListLen(loc.environments) GT loc.pos>, </cfif></cfif></cfloop>]</cfif></td>
 96		</tr>
 97		<tr>
 98			<td valign="top"><strong>URL Rewriting:</strong></td>
 99			<td>#get("URLRewriting")#</td>
100		</tr>
101		<tr>
102			<td valign="top"><strong>URL Obfuscation:</strong></td>
103			<td><cfif get("obfuscateUrls")>On<cfelse>Off</cfif></td>
104		</tr>
105		<tr>
106			<td valign="top"><strong>Plugins:</strong></td>
107			<td><cfif StructCount(get("plugins")) IS NOT 0><cfset loc.count = 0><cfloop collection="#get('plugins')#" item="loc.i"><cfset loc.count = loc.count + 1><a href="#get('webPath')##ListLast(request.cgi.script_name, '/')#?controller=wheels&action=wheels&view=plugins&name=#LCase(loc.i)#">#loc.i#</a><cfif DirectoryExists(expandPath("#get('webPath')#/plugins/#LCase(loc.i)#/tests"))> [<a href="#get('webPath')##ListLast(request.cgi.script_name, '/')#?controller=wheels&action=wheels&view=tests&type=#LCase(loc.i)#&reload=true">Run Tests</a>]</cfif><cfif StructCount(get("plugins")) GT loc.count><br/></cfif></cfloop><cfelse>None</cfif></td>
108		</tr>
109		<cfif StructKeyExists(request.wheels.params, "route")>
110			<tr>
111				<td valign="top"><strong>Route:</strong></td>
112				<td>#request.wheels.params.route#</td>
113			</tr>
114		</cfif>
115		<tr>
116			<td valign="top"><strong>Controller:</strong></td>
117			<td>#request.wheels.params.controller#</td>
118		</tr>
119		<tr>
120			<td valign="top"><strong>Action:</strong></td>
121			<td>#request.wheels.params.action#</td>
122		</tr>
123		<cfif StructKeyExists(request.wheels.params, "key")>
124			<tr>
125				<td valign="top"><strong>Key(s):</strong></td>
126				<td>#request.wheels.params.key#</td>
127			</tr>
128		</cfif>
129		<tr>
130			<td valign="top"><strong>Additional Params:</strong></td>
131			<td>
132			<cfset loc.additionalParamsExists = false>
133			<cfloop collection="#request.wheels.params#" item="loc.i">
134				<cfif loc.i IS NOT "fieldnames" AND loc.i IS NOT "route" AND loc.i IS NOT "controller" AND loc.i IS NOT "action" AND loc.i IS NOT "key">
135					<cfset loc.additionalParamsExists = true>
136					<cfif isStruct(request.wheels.params[loc.i])>
137						#lCase(loc.i)# = #SerializeJSON(request.wheels.params[loc.i])#<br />
138					<cfelseif IsArray(request.wheels.params[loc.i])>
139						#lCase(loc.i)# = #SerializeJSON(request.wheels.params[loc.i])#<br />
140					<cfelseif IsSimpleValue(request.wheels.params[loc.i])>
141						#lCase(loc.i)# = #request.wheels.params[loc.i]#<br />
142					</cfif>
143				</cfif>
144			</cfloop>
145			<cfif NOT loc.additionalParamsExists>
146				None
147			</cfif>
148			</td>
149		</tr>
150		<tr>
151			<td valign="top"><strong>Caching Stats:</strong></td>
152			<td><cfset loc.keys = StructSort(request.wheels.cacheCounts, "textnocase")><cfloop from="1" to="#arrayLen(loc.keys)#" index="loc.i"><cfset loc.key = loc.keys[loc.i]>#LCase(loc.key)#: #request.wheels.cacheCounts[loc.key]#<cfif loc.i lt ArrayLen(loc.keys)>,</cfif> </cfloop></td>
153		</tr>
154		<tr>
155			<td valign="top"><strong>Execution Time:</strong></td>
156			<td>#request.wheels.execution.total#ms<cfif request.wheels.execution.total GT 0> (<cfset loc.keys = StructSort(request.wheels.execution, "numeric", "desc")><cfset loc.firstDone = false><cfloop from="1" to="#arrayLen(loc.keys)#" index="loc.i"><cfset loc.key = loc.keys[loc.i]><cfif loc.key IS NOT "total" AND request.wheels.execution[loc.key] GT 0><cfif loc.firstDone>, </cfif>#LCase(loc.key)# ~#request.wheels.execution[loc.key]#ms<cfset loc.firstDone = true></cfif></cfloop>)</cfif></td>
157		</tr>
158	</table>
159</div>
160
161</cfoutput>