Skip to content

Commit 5a57421

Browse files
committed
acf compat since member functions differ between lucee
1 parent c6b897d commit 5a57421

File tree

9 files changed

+49
-14
lines changed

9 files changed

+49
-14
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
- MODULE_ID=cbdebugger
1111
matrix:
1212
- ENGINE=lucee@5
13+
- ENGINE=adobe@2016
1314
- ENGINE=adobe@2018
1415

1516
branches:

models/DebuggerService.cfc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ component
460460
var callstack = callStackGet();
461461
var targetIndex = callstack
462462
.map( function( item, index, array ){
463-
// Do we have template matches or simple tests?
463+
// Do we have template matches or simple function equality?
464464
if ( !isNull( templateMatch ) ) {
465465
if (
466466
arguments.item.function == targetMethod && findNoCase(
@@ -480,8 +480,9 @@ component
480480
return !isNull( arguments.item );
481481
} );
482482

483+
// Only return if we have matches, else default return struct
483484
if ( targetIndex.len() ) {
484-
var results = callStack[ targetIndex.last() + 1 ];
485+
var results = callStack[ targetIndex[ arrayLen( targetIndex ) ] + 1 ];
485486
results[ "line" ] = results.lineNumber;
486487
return results;
487488
}

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Apache License, Version 2.0.
3636
## System Requirements
3737

3838
- Lucee 5+
39-
- ColdFusion 2018+
39+
- ColdFusion 2016+
4040
- ColdBox 6+
4141

4242
# Instructions

test-harness/[email protected]

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name":"cbdebugger-adobe@2016",
3+
"app":{
4+
"serverHomeDirectory":".engine/adobe2016",
5+
"cfengine":"adobe@2016"
6+
},
7+
"web":{
8+
"http":{
9+
"port":"60299"
10+
},
11+
"rewrites":{
12+
"enable":"true"
13+
},
14+
"aliases":{
15+
"/moduleroot/cbdebugger":"../"
16+
}
17+
},
18+
"openBrowser":"false"
19+
}

views/main/panels/cbormPanel.cfm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@
271271
#args.profiler.cborm.totalQueries#
272272
</td>
273273
</tr>
274-
<cfloop array="#args.profiler.cborm.sessionStats.keyArray().sort( "textnocase" )#" item="thisItem" >
274+
<cfset stats = args.profiler.cborm.sessionStats.keyArray()>
275+
<cfset stats.sort( "textnocase" )>
276+
<cfloop array="#stats#" item="thisItem" >
275277
<tr>
276278
<th width="200" align="right">
277279
#thisItem# :

views/main/panels/coldboxPanel.cfm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!--- Sort keys --->
2+
<cfset coldboxKeys = args.profiler.coldbox.keyArray()>
3+
<cfset coldboxKeys.sort( "textnocase" )>
14
<cfoutput>
25
<!--- Title --->
36
<div class="cbd-titles" onClick="cbdToggle( 'cbd-coldboxData' )">
@@ -13,7 +16,7 @@
1316
id="cbd-coldboxData"
1417
>
1518
<table border="0" align="center" cellpadding="0" cellspacing="1" class="cbd-tables">
16-
<cfloop array="#args.profiler.coldbox.keyArray().sort( "textnocase" )#" item="thisItem" >
19+
<cfloop array="#coldboxKeys#" item="thisItem" >
1720
<tr>
1821
<th width="200" align="right">
1922
#thisItem# :

views/main/panels/collectionPanel.cfm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
<cfset collectionKeys = args.collection.keyArray()>
2+
<cfset collectionKeys.sort( "textnocase" )>
13
<cfoutput>
24
<!--- Public Collection --->
35
<table border="0" cellpadding="0" cellspacing="1" class="cbd-tables" width="100%">
46
<tr>
57
<th colspan="2">#args.collectionType# Collection</th>
68
</tr>
7-
<cfloop array="#args.collection.keyArray().sort( "textnocase" )#" index="thisKey">
9+
<cfloop array="#collectionKeys#" index="thisKey">
810
<!--- Identify Value or null --->
911
<cfif !isNull( args.collection[ thisKey ] )>
1012
<cfset thisValue = args.collection[ thisKey ]>

views/main/panels/exceptionPanel.cfm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
<cfoutput>
21
<cfset exceptionBean = new coldbox.system.web.context.ExceptionBean()>
2+
<cfset exceptionKeys = args.profiler.exception.keyArray()>
3+
<cfset exceptionKeys.sort( "textnocase" )>
4+
<cfoutput>
35
<!--- Title --->
46
<div class="cbd-titles" onClick="cbdToggle( 'cbd-exceptionData' )">
57
&nbsp;
@@ -11,7 +13,7 @@
1113

1214
<div class="cbd-contentView" id="cbd-exceptionData">
1315
<table border="0" align="center" cellpadding="0" cellspacing="1" class="cbd-tables">
14-
<cfloop array="#args.profiler.exception.keyArray().sort( "textnocase" )#" item="thisItem" >
16+
<cfloop array="#exceptionKeys#" item="thisItem" >
1517
<cfif !isSimpleValue( args.profiler.exception[ thisItem ] ) OR len( args.profiler.exception[ thisItem ] )>
1618
<tr>
1719
<th width="100" align="right">

views/main/panels/httpRequestPanel.cfm

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@
8383
</cfif>
8484
</table>
8585

86+
<cfset headerKeys = args.profiler.requestData.headers.keyArray()>
87+
<cfset headerKeys.sort( "textnocase" )>
8688
<h2>Headers</h2>
8789
<table border="0" align="center" cellpadding="0" cellspacing="1" class="cbd-tables">
88-
<cfloop array="#args.profiler.requestData.headers.keyArray().sort( "textnocase" )#" item="thisHeader" >
90+
<cfloop array="#headerKeys#" item="thisHeader" >
8991
<tr>
9092
<th width="175" align="right">
9193
#thisHeader#
@@ -102,18 +104,21 @@
102104
Cookie Value
103105
</th>
104106
</tr>
105-
<cfloop array="#args.profiler.requestData.headers.cookie.listToArray( ";" ).sort( "textNoCase" )#" index="thisHeader">
107+
<!--- Sort Cookies --->
108+
<cfset cookieKeys = args.profiler.requestData.headers.cookie.listToArray( ";" )>
109+
<cfset cookieKeys.sort( "textnocase" )>
110+
<cfloop array="#cookieKeys#" index="thisCookie">
106111
<tr>
107112
<td class="cbd-cellBreak">
108113
<em class="textBlue">
109-
#getToken( thisHeader, 1, "=" )#
114+
#getToken( thisCookie, 1, "=" )#
110115
</em>
111116
</td>
112117
<td class="cbd-cellBreak">
113-
<cfif !isBoolean( getToken( thisHeader, 2, "=" ) ) && isJSON( getToken( thisHeader, 2, "=" ) )>
114-
#getInstance( '@JSONPrettyPrint' ).formatJSON( getToken( thisHeader, 2, "=" ) )#
118+
<cfif !isBoolean( getToken( thisCookie, 2, "=" ) ) && isJSON( getToken( thisCookie, 2, "=" ) )>
119+
#getInstance( '@JSONPrettyPrint' ).formatJSON( getToken( thisCookie, 2, "=" ) )#
115120
<cfelse>
116-
#getToken( thisHeader, 2, "=" )#
121+
#getToken( thisCookie, 2, "=" )#
117122
</cfif>
118123
</td>
119124
</tr>

0 commit comments

Comments
 (0)