Skip to content

Commit 545ab9c

Browse files
committed
added file:line and a way to mark lines important
1 parent bf1e38a commit 545ab9c

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

index.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@
3434
<li>click a function name to collapse all calls to the same function</li>
3535
<li>click the parameter list to expand it</li>
3636
<li>click the return list to expand it</li>
37-
<li>use the checkbox to hide all PHP internal functions</li>
37+
<li>click the time to mark the line important</li>
38+
<li>use checkboxes to hide all PHP internal functions or limit to important lines</li>
3839
</ul>
3940

4041
<form class="options">
41-
<input type="checkbox" value="1" checked="checked" id="internal"><label for="internal">Show internal
42-
functions</label>
42+
<input type="checkbox" value="1" checked="checked" id="internal">
43+
<label for="internal">Show internal functions</label>
44+
45+
<input type="checkbox" value="1" id="marked">
46+
<label for="marked">Show important only (slow)</label>
4347
</form>
4448

4549

res/XDebugParser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function getTraceHTML()
9292
echo '<div class="f header">';
9393
echo '<div class="func">Function Call</div>';
9494
echo '<div class="data">';
95+
echo '<span class="file">File:Line</span>';
9596
echo '<span class="timediff">ΔTime</span>';
9697
echo '<span class="memorydiff">ΔMemory</span>';
9798
echo '<span class="time">Time</span>';
@@ -128,6 +129,7 @@ function getTraceHTML()
128129
echo '</div>';
129130

130131
echo '<div class="data">';
132+
echo '<span class="file" title="'.htmlspecialchars($func['file'].':'.$func['line']).'">'.htmlspecialchars(basename($func['file']).':'.$func['line']).'</span>';
131133
echo '<span class="timediff">' . sprintf('%f', $func['time.diff']) . '</span>';
132134
echo '<span class="memorydiff">' . sprintf('%d', $func['memory.diff']) . '</span>';
133135
echo '<span class="time">' . sprintf('%f', $func['time.enter']) . '</span>';

res/script.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
$(function(){
22

3-
3+
/* hide blocks */
44
$('div.d, div.f').click(function (e) {
55
if (e.target !== this) return;
66
$(this).toggleClass('hide');
77
e.preventDefault();
88
e.stopPropagation();
99
});
1010

11+
/* collapse parameters */
1112
$('span.params, span.return').click(function (e) {
1213
if (e.target !== this) return;
1314
$(this).toggleClass('short');
1415
e.preventDefault();
1516
e.stopPropagation();
1617
});
1718

19+
/* hide internal funcs */
1820
$('#internal').change(function(){
1921
$('div.i').toggle();
2022
});
2123

24+
/* hide functions */
2225
$('span.name').click(function(e){
2326
if (e.target !== this) return;
2427

@@ -29,4 +32,20 @@ $(function(){
2932
e.preventDefault();
3033
e.stopPropagation();
3134
});
35+
36+
/* mark important */
37+
$('span.time').click(function(e){
38+
if (e.target !== this) return;
39+
40+
$(this).closest('div.f').toggleClass('mark');
41+
42+
e.preventDefault();
43+
e.stopPropagation();
44+
});
45+
46+
/* hide internal funcs */
47+
$('#marked').change(function(){
48+
$('div.f').toggle();
49+
$('div.f.mark').show();
50+
});
3251
});

res/style.css

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
label {
2+
cursor: pointer;
3+
}
4+
15
div.d {
26
padding-left: 2em;
37
border-left: 1px solid #ccc;
@@ -32,6 +36,10 @@ div.f.hide * {
3236
display: none;
3337
}
3438

39+
div.f.mark {
40+
background-color: #ffeced;
41+
}
42+
3543
div.f div {
3644
padding: 5px 0;
3745

@@ -43,9 +51,9 @@ div.f div.func {
4351

4452
div.f div.data {
4553
flex-grow: 0;
46-
width: 450px;
47-
min-width: 450px;
48-
max-width: 450px;
54+
width: 600px;
55+
min-width: 600px;
56+
max-width: 600px;
4957
}
5058

5159
span {
@@ -57,6 +65,7 @@ span {
5765
span.short {
5866
max-height: 1.1em;
5967
overflow: hidden;
68+
word-break: break-all;
6069
}
6170

6271
span.name {
@@ -74,14 +83,20 @@ span.return {
7483
cursor: pointer;
7584
}
7685

86+
span.file,
7787
span.time,
7888
span.memorydiff,
7989
span.timediff {
90+
overflow: hidden;
8091
width: 150px;
8192
text-align: right;
8293
white-space: nowrap;
8394
}
8495

96+
span.time {
97+
cursor: pointer;
98+
}
99+
85100
div.header {
86101
width: 100%;
87102
font-weight: bold;

0 commit comments

Comments
 (0)