PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/events/onrequestend/debug.cfm

http://cfwheels.googlecode.com/
ColdFusion | 161 lines | 154 code | 7 blank | 0 comment | 3 complexity | 7de927e7c7ba01610b26c6c971a47caf MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  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. <cfoutput>
  21. <style type="text/css">
  22. ##wheels-debug-area
  23. {
  24. clear: both;
  25. margin: 100px 0;
  26. text-align: left;
  27. background: ##ececec;
  28. padding: 10px;
  29. border-top: 3px solid ##999;
  30. border-bottom: 3px solid ##999;
  31. }
  32. ##wheels-debug-area td
  33. {
  34. font: 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
  35. line-height: 1.5em;
  36. color: ##333;
  37. }
  38. ##wheels-debug-area a
  39. {
  40. color: ##333;
  41. text-decoration: underline;
  42. padding: 0 1px;
  43. }
  44. ##wheels-debug-area a:hover
  45. {
  46. color: ##fff;
  47. background: ##333;
  48. text-decoration: none;
  49. }
  50. </style>
  51. <div id="wheels-debug-area">
  52. <table cellspacing="0" cellpadding="0">
  53. <cfif Len(application.wheels.incompatiblePlugins) OR Len(application.wheels.dependantPlugins) OR NOT ArrayIsEmpty(request.wheels.deprecation)>
  54. <tr>
  55. <td valign="top"><strong><span style="color:red;">Warnings:</span></strong></td>
  56. <td>
  57. <span style="color:red;">
  58. <cfif Len(application.wheels.incompatiblePlugins)>
  59. <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>
  60. </cfif>
  61. <cfif Len(application.wheels.dependantPlugins)>
  62. <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>
  63. </cfif>
  64. <cfif NOT ArrayIsEmpty(request.wheels.deprecation)>
  65. <cfloop array="#request.wheels.deprecation#" index="i">#i.message# (line #i.line# in #i.template#)<br /></cfloop>
  66. </cfif>
  67. </span>
  68. </td>
  69. </tr>
  70. </cfif>
  71. <tr>
  72. <td valign="top" style="width:125px;"><strong>Application:</strong></td>
  73. <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>
  74. </tr>
  75. <tr>
  76. <td valign="top"><strong>Framework:</strong></td>
  77. <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>
  78. </tr>
  79. <tr>
  80. <td valign="top"><strong>CFML Engine:</strong></td>
  81. <td>#get("serverName")# #get("serverVersion")#</td>
  82. </tr>
  83. <tr>
  84. <td valign="top"><strong>Default Data Source:</strong></td>
  85. <td>#get("dataSourceName")#</td>
  86. </tr>
  87. <tr>
  88. <td valign="top"><strong>Active Environment:</strong></td>
  89. <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>
  90. </tr>
  91. <tr>
  92. <td valign="top"><strong>URL Rewriting:</strong></td>
  93. <td>#get("URLRewriting")#</td>
  94. </tr>
  95. <tr>
  96. <td valign="top"><strong>URL Obfuscation:</strong></td>
  97. <td><cfif get("obfuscateUrls")>On<cfelse>Off</cfif></td>
  98. </tr>
  99. <tr>
  100. <td valign="top"><strong>Plugins:</strong></td>
  101. <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>
  102. </tr>
  103. <cfif StructKeyExists(request.wheels.params, "route")>
  104. <tr>
  105. <td valign="top"><strong>Route:</strong></td>
  106. <td>#request.wheels.params.route#</td>
  107. </tr>
  108. </cfif>
  109. <tr>
  110. <td valign="top"><strong>Controller:</strong></td>
  111. <td>#request.wheels.params.controller#</td>
  112. </tr>
  113. <tr>
  114. <td valign="top"><strong>Action:</strong></td>
  115. <td>#request.wheels.params.action#</td>
  116. </tr>
  117. <cfif StructKeyExists(request.wheels.params, "key")>
  118. <tr>
  119. <td valign="top"><strong>Key(s):</strong></td>
  120. <td>#request.wheels.params.key#</td>
  121. </tr>
  122. </cfif>
  123. <tr>
  124. <td valign="top"><strong>Additional Params:</strong></td>
  125. <td>
  126. <cfset loc.additionalParamsExists = false>
  127. <cfloop collection="#request.wheels.params#" item="loc.i">
  128. <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">
  129. <cfset loc.additionalParamsExists = true>
  130. <cfif isStruct(request.wheels.params[loc.i])>
  131. #lCase(loc.i)# = #SerializeJSON(request.wheels.params[loc.i])#<br />
  132. <cfelseif IsArray(request.wheels.params[loc.i])>
  133. #lCase(loc.i)# = #SerializeJSON(request.wheels.params[loc.i])#<br />
  134. <cfelseif IsSimpleValue(request.wheels.params[loc.i])>
  135. #lCase(loc.i)# = #request.wheels.params[loc.i]#<br />
  136. </cfif>
  137. </cfif>
  138. </cfloop>
  139. <cfif NOT loc.additionalParamsExists>
  140. None
  141. </cfif>
  142. </td>
  143. </tr>
  144. <tr>
  145. <td valign="top"><strong>Caching Stats:</strong></td>
  146. <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>
  147. </tr>
  148. <tr>
  149. <td valign="top"><strong>Execution Time:</strong></td>
  150. <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>
  151. </tr>
  152. </table>
  153. </div>
  154. </cfoutput>