Permalink
Browse files

copy from branch 4.0

  • Loading branch information...
1 parent 7aee8d9 commit 2e37958116b61d2a8d9b2d916e69c5901a013338 micstriit committed Mar 22, 2013
Showing 3,632 changed files with 462,557 additions and 2,754 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -21,7 +21,7 @@
<head>
<title>Railo #ucFirst(request.adminType)# Administrator</title>
</cfoutput>
- <link rel="stylesheet" href="resources/css/style.css.cfm" type="text/css" />
+ <link rel="stylesheet" href="resources/css/style40.css.cfm" type="text/css" />
<script src="resources/js/jquery-1.7.2.min.js.cfm" type="text/javascript"></script>
<script src="resources/js/jquery.blockUI.js.cfm" type="text/javascript"></script>
<script src="resources/js/admin.js.cfm" type="text/javascript"></script>
@@ -15,6 +15,7 @@
<cffunction name="onBeforeUpdate" returntype="void" output="no">
+ <!--- add the right file delimiter --->
<cfset form.custom_path=replace(
form.custom_path,
SLASH[server.separator.file],
@@ -24,7 +25,15 @@
<cfset form.custom_path=form.custom_path&server.separator.file>
</cfif>
+ <!--- make sure relative path and path with placeholder are working --->
+ <cfif not directoryExists(form.custom_path)>
+ <cfset local._custom_path=expandPath(form.custom_path)>
+ <cfif directoryExists(local._custom_path)>
+ <cfset form.custom_path=local._custom_path>
+ </cfif>
+ </cfif>
+ <!--- if parent exist, create it --->
<cfif not directoryExists(form.custom_path)>
<cfset var parent=mid(form.custom_path,1,len(form.custom_path)-1)>
<cfset parent=getDirectoryFromPath(parent)>
@@ -34,6 +43,7 @@
<cfthrow message="directory [#form.custom_path#] doesn't exist">
</cfif>
</cfif>
+
</cffunction>
<cffunction name="getName" returntype="string" output="no"
@@ -26,15 +26,6 @@
,field("Scope Variables","scopes","Application,CGI,Client,Cookie,Form,Request,Server,Session,URL",true,"Enable Scope reporting","checkbox","Application,CGI,Client,Cookie,Form,Request,Server,Session,URL")
- ,field("Database Activity","database",true,false,"Select this option to show the database activity for the SQL Query events and Stored Procedure events in the debugging output.","checkbox")
-
- ,field("Exceptions","exception",true,false,"Select this option to output all exceptions raised for the request. ","checkbox")
-
- ,field("Tracing","tracing",true,false,"Select this option to show trace event information. Tracing lets a developer track program flow and efficiency through the use of the CFTRACE tag.","checkbox")
-
- ,field("Timer","timer",true,false,"Select this option to show timer event information. Timers let a developer track the execution time of the code between the start and end tags of the CFTIMER tag. ","checkbox")
- ,field("Implicit variable Access","implicitAccess",true,false,"Select this option to show all accesses to scopes, queries and threads that happens implicit (cascaded). ","checkbox")
-
,group("Output Format","Define details to the fomrat of the debug output",3)
,field("Background Color","bgcolor","white",true,"Color in the back, ","text80")
@@ -54,7 +45,7 @@ string function getDescription(){
return "The old style debug template";
}
string function getid(){
- return "railo-classic";
+ return "railo-classic";
}
@@ -77,9 +68,9 @@ private void function throwWhenNotNumeric(struct custom, string name){
throw "value for ["&name&"] must be numeric";
}
-private function isColumnEmpty(string columnName){
- if(!isDefined(columnName)) return true;
- return !len(replace(valueList(""&columnName),',','','all'));
+private function isColumnEmpty(query query, string columnName){
+ if(!QueryColumnExists(query,columnName)) return true;
+ return !len(ArrayToList(QueryColumnData(query,columnName),''));
}
@@ -236,7 +227,7 @@ millisecond:"ms"
<!--- Exceptions --->
-<cfif structKeyExists(custom,"exception") and custom.exception and structKeyExists(debugging,"exceptions") and arrayLen(debugging.exceptions)>
+<cfif structKeyExists(debugging,"exceptions") and arrayLen(debugging.exceptions)>
<cfset exceptions=debugging.exceptions>
<p class="cfdebug"><hr/><b class="cfdebuglge">Caught Exceptions</b></p>
@@ -260,7 +251,7 @@ millisecond:"ms"
<!--- Timers --->
-<cfif structKeyExists(custom,"timer") and custom.timer and timers.recordcount>
+<cfif timers.recordcount>
<p class="cfdebug"><hr/><b class="cfdebuglge">CFTimer Times</b></p>
<table border="1" cellpadding="2" cellspacing="0" class="cfdebug">
<tr>
@@ -279,7 +270,7 @@ millisecond:"ms"
</cfif>
<!--- Access Scope --->
-<cfif structKeyExists(custom,"implicitAccess") and custom.implicitAccess and implicitAccess.recordcount>
+<cfif implicitAccess.recordcount>
<p class="cfdebug"><hr/><b class="cfdebuglge">Implicit variable Access</b></p>
<table border="1" cellpadding="2" cellspacing="0" class="cfdebug">
<tr>
@@ -303,9 +294,9 @@ millisecond:"ms"
</cfif>
<!--- Traces --->
-<cfif structKeyExists(custom,"tracing") and custom.tracing and traces.recordcount>
- <cfset hasAction=!isColumnEmpty('traces.action')>
- <cfset hasCategory=!isColumnEmpty('traces.category')>
+<cfif traces.recordcount>
+ <cfset hasAction=!isColumnEmpty(traces,'action')>
+ <cfset hasCategory=!isColumnEmpty(traces,'category')>
<p class="cfdebug"><hr/><b class="cfdebuglge">Trace Points</b></p>
<table border="1" cellpadding="2" cellspacing="0" class="cfdebug">
<tr>
@@ -340,7 +331,7 @@ millisecond:"ms"
<!--- Queries --->
-<cfif structKeyExists(custom,"database") and custom.database and queries.recordcount>
+<cfif queries.recordcount>
<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_sql">SQL Queries</a></b></p>
<cfloop query="queries">
<code><b>#queries.name#</b> (Datasource=#queries.datasource#, Time=#formatUnit(custom.unit, queries.time)#, Records=#queries.count#) in #queries.src#</code><br />
@@ -23,13 +23,6 @@ component extends="Debug" {
,field("Scope Variables","scopes","Application,CGI,Client,Cookie,Form,Request,Server,Session,URL",true,"Select this option to show the content of the corresponding Scope.","checkbox","Application,CGI,Client,Cookie,Form,Request,Server,Session,URL")
- ,field("Database Activity","database",true,false,"Select this option to show the database activity for the SQL Query events and Stored Procedure events.","checkbox")
-
- ,field("Exceptions","exception",true,false,"Select this option to output all exceptions raised for the request. ","checkbox")
-
- ,field("Tracing","tracing",true,false,"Select this option to show trace event information. Tracing lets a developer track program flow and efficiency through the use of the CFTRACE tag or the TraceObject Function.","checkbox")
-
- ,field("Timer","timer",true,false,"Select this option to show timer event information. Timers let a developer track the execution time of the code between the start and end tags of the CFTIMER tag. ","checkbox")
);
@@ -130,19 +123,19 @@ component extends="Debug" {
print("Pages",array('src','count','load','query','app','total'),pages);
// DATABASE
- if(structKeyExists(custom,"database") && custom.database && debugging.queries.recordcount)
+ if(debugging.queries.recordcount)
print("Queries",array('src','datasource','name','sql','time','count'),debugging.queries);
// TIMER
- if(structKeyExists(custom,"timer") && custom.timer && debugging.timers.recordcount)
+ if(debugging.timers.recordcount)
print("Timers",array('template','label','time'),debugging.timers);
// TRACING
- if(structKeyExists(custom,"tracing") && custom.tracing && debugging.traces.recordcount)
+ if(debugging.traces.recordcount)
print("Trace Points",array('template','type','category','text','line','action','varname','varvalue','time'),debugging.traces);
// EXCEPTION
- if(structKeyExists(custom,"exception") && custom.exception && arrayLen(debugging.exceptions)) {
+ if(arrayLen(debugging.exceptions)) {
var qry=queryNew("type,message,detail,template")
var len=arrayLen(debugging.exceptions);
QueryAddRow(qry,len);
@@ -6,21 +6,6 @@
,field("Minimal Execution Time","minimal","0",true,{_appendix:"microseconds",_bottom:"Execution times for templates, includes, modules, custom tags, and component method calls. Outputs only templates taking longer than the time (in microseconds) defined above."},"text40")
,field("Highlight","highlight","250000",true,{_appendix:"microseconds",_bottom:"Highlight templates taking longer than the following (in microseconds) in red."},"text50")
,group("Custom Debugging Output","Define what is outputted",3)
- ,field("Database Activity","database","Enabled",false,
- "Select this option to show the database activity for the SQL Query events and Stored Procedure events in the debugging output."
- ,"checkbox","Enabled")
- ,field("Exceptions","exception","Enabled",false,
- "Select this option to output all exceptions raised for the request. "
- ,"checkbox","Enabled")
- ,field("Tracing","tracing","Enabled",false,
- "Select this option to show trace event information. Tracing lets a developer track program flow and efficiency through the use of the CFTRACE tag."
- ,"checkbox","Enabled")
- ,field("Timer","timer","Enabled",false,
- "Select this option to show timer event information. Timers let a developer track the execution time of the code between the start and end tags of the CFTIMER tag. "
- ,"checkbox","Enabled")
- ,field("Implicit variable Access","implicitAccess","Enabled",false,
- "Select this option to show all accesses to scopes, queries and threads that happens implicit (cascaded). "
- ,"checkbox","Enabled")
,field("Scope Variables","scopes","Enabled",false,"Enable Scope reporting","checkbox","Enabled")
,field("General Debug Information ","general","Enabled",false,
"Select this option to show general information about this request. General items are Railo Version, Template, Time Stamp, User Locale, User Agent, User IP, and Host Name. ",
@@ -55,11 +40,28 @@
}
private function isColumnEmpty(query qry,string columnName){
- if(!isDefined(columnName)) return true;
+ if(!QueryColumnExists(qry,columnName)) return true;
return !len(arrayToList(queryColumnData(qry,columnName),""));
}
</cfscript>
+ <cffunction name="isOldIE" output="true">
+ <cfif structKeyExists(cgi,'http_user_agent')>
+ <cfset var index=findNocase('MSIE',cgi.http_user_agent)>
+ <cfif index GT 0>
+ <cfset index+=4>
+ <cfset var next=find(';',cgi.http_user_agent,index+1)>
+ <cfif next GT 0>
+ <cfset var sub=trim(mid(cgi.http_user_agent,index,next-index))>
+ <cfif isNumeric(sub) and sub LT 8>
+ <cfreturn true>
+ </cfif>
+ </cfif>
+ </cfif>
+ </cfif>
+ <cfreturn false>
+ </cffunction>
+
<cffunction name="output" returntype="void">
<cfargument name="custom" type="struct" required="yes" />
<cfargument name="debugging" required="true" type="struct" />
@@ -68,11 +70,6 @@
<cfif !structKeyExists(arguments.custom,'minimal')><cfset arguments.custom.minimal="0"></cfif>
<cfif !structKeyExists(arguments.custom,'highlight')><cfset arguments.custom.highlight="250000"></cfif>
<cfif !structKeyExists(arguments.custom,'scopes')><cfset arguments.custom.scopes=false></cfif>
- <cfif !structKeyExists(arguments.custom,'tracing')><cfset arguments.custom.tracing="Enabled"></cfif>
- <cfif !structKeyExists(arguments.custom,'timer')><cfset arguments.custom.timer="Enabled"></cfif>
- <cfif !structKeyExists(arguments.custom,'implicitAccess')><cfset arguments.custom.implicitAccess="Enabled"></cfif>
- <cfif !structKeyExists(arguments.custom,'exception')><cfset arguments.custom.exception="Enabled"></cfif>
- <cfif !structKeyExists(arguments.custom,'database')><cfset arguments.custom.database="Enabled"></cfif>
<cfif !structKeyExists(arguments.custom,'general')><cfset arguments.custom.general="Enabled"></cfif>
<cfset var time=getTickCount() />
@@ -102,8 +99,16 @@
} />
<!--- Plus/minus Image --->
<cfoutput>
- <cfset var plus="#cgi.context_path#/railo-context/admin/resources/img/plus.png.cfm" />
- <cfset var minus="#cgi.context_path#/railo-context/admin/resources/img/minus.png.cfm" />
+
+ <cfif not isOldIE()>
+ <cfset plus='data:image/gif;base64,R0lGODlhCQAJAIABAAAAAP///yH5BAEAAAEALAAAAAAJAAkAAAIRhI+hG7bwoJINIktzjizeUwAAOw=='>
+ <cfset minus='data:image/gif;base64,R0lGODlhCQAJAIABAAAAAP///yH5BAEAAAEALAAAAAAJAAkAAAIQhI+hG8brXgPzTHllfKiDAgA7'>
+ <cfelse>
+ <cfset plus="#cgi.context_path#/railo-context/admin/resources/img/debug_plus.gif.cfm">
+ <cfset minus="#cgi.context_path#/railo-context/admin/resources/img/debug_minus.gif.cfm">
+ </cfif>
+
+
<cfsavecontent variable="local.sImgPlus">
<img src="#plus#">
</cfsavecontent>
@@ -387,7 +392,7 @@
</tr>
</table>
<!--- Exceptions --->
- <cfif isEnabled(arguments.custom,"exception") and structKeyExists(arguments.debugging,"exceptions") and arrayLen(arguments.debugging.exceptions)>
+ <cfif structKeyExists(arguments.debugging,"exceptions") and arrayLen(arguments.debugging.exceptions)>
<cfset display=structKeyExists(cookie,'railo_debug_modern_exp') and cookie.railo_debug_modern_exp />
<cfset exceptions=debugging.exceptions />
<span class="h2">Caught Exceptions</span>
@@ -434,7 +439,7 @@
</table>
</cfif>
<!--- Implicit variable Access --->
- <cfif isEnabled(arguments.custom,"implicitAccess") and implicitAccess.recordcount>
+ <cfif implicitAccess.recordcount>
<cfset display=structKeyExists(cookie,'railo_debug_modern_acc') and cookie.railo_debug_modern_acc />
<cfset hasAction=!isColumnEmpty(traces,'action') />
<cfset hasCategory=!isColumnEmpty(traces,'category') />
@@ -485,7 +490,7 @@
</table>
</cfif>
<!--- Timers --->
- <cfif isEnabled(arguments.custom,"timer") and timers.recordcount>
+ <cfif timers.recordcount>
<cfset display=structKeyExists(cookie,'railo_debug_modern_time') and cookie.railo_debug_modern_time />
<span class="h2">CFTimer Times</span>
<table class="tbl" cellpadding="0" cellspacing="0">
@@ -527,7 +532,7 @@
</table>
</cfif>
<!--- Traces --->
- <cfif isEnabled(arguments.custom,"tracing") and traces.recordcount>
+ <cfif traces.recordcount>
<cfset display=structKeyExists(cookie,'railo_debug_modern_trace') and cookie.railo_debug_modern_trace />
<cfset hasAction=!isColumnEmpty(traces,'action') />
<cfset hasCategory=!isColumnEmpty(traces,'category') />
@@ -603,7 +608,7 @@
</table>
</cfif>
<!--- Queries --->
- <cfif isEnabled(arguments.custom,"database") and queries.recordcount>
+ <cfif queries.recordcount>
<cfset local.total=0 />
<cfset local.records=0 />
<cfloop query="queries"><cfset total+=queries.time />
Oops, something went wrong. Retry.

0 comments on commit 2e37958

Please sign in to comment.