Skip to content

Commit e97b95b

Browse files
committed
Fix rector error and cleanup up filename displays for Debug toolbar database tab.
1 parent e33f146 commit e97b95b

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

system/Debug/Toolbar/Collectors/Database.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,17 @@ public function display(): array
137137
// Find the first line that doesn't include `system` in the backtrace
138138
$line = [];
139139

140-
foreach ($query['trace'] as $traceLine) {
141-
if (strpos($traceLine['file'], 'system/') !== false) {
140+
foreach ($query['trace'] as &$traceLine) {
141+
// Clean up the file paths
142+
$traceLine['file'] = str_ireplace(APPPATH, 'APPPATH/', $traceLine['file']);
143+
$traceLine['file'] = str_ireplace(SYSTEMPATH, 'SYSTEMPATH/', $traceLine['file']);
144+
$traceLine['file'] = str_ireplace(VENDORPATH, 'VENDORPATH/', $traceLine['file']);
145+
$traceLine['file'] = str_ireplace(ROOTPATH, 'ROOTPATH/', $traceLine['file']);
146+
147+
if (strpos($traceLine['file'], 'APPPATH') === false) {
142148
continue;
143149
}
144-
$line = $traceLine;
145-
break;
150+
$line = empty($line) ? $traceLine : $line;
146151
}
147152

148153
return [
@@ -153,7 +158,7 @@ public function display(): array
153158
'trace' => $query['trace'],
154159
'trace-file' => str_replace(ROOTPATH, '/', $line['file'] ?? ''),
155160
'trace-line' => $line['line'] ?? '',
156-
'qid' => md5((string) $query['query'] . microtime()),
161+
'qid' => md5($query['query'] . microtime()),
157162
];
158163
}, static::$queries);
159164

system/Debug/Toolbar/Views/toolbar.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@
498498
#toolbarContainer.dark #debug-bar .muted {
499499
color: #DFDFDF; }
500500
#toolbarContainer.dark #debug-bar .muted td {
501-
color: #434343; }
501+
color: #797979; }
502502
#toolbarContainer.dark #debug-bar .muted:hover td {
503503
color: #DFDFDF; }
504504
#toolbarContainer.dark #debug-bar #toolbar-position,
@@ -589,9 +589,9 @@
589589
-moz-box-shadow: 0 1px 4px #DFDFDF;
590590
-webkit-box-shadow: 0 1px 4px #DFDFDF; }
591591
#toolbarContainer.light #debug-bar .muted {
592-
color: #434343; }
592+
color: #797979; }
593593
#toolbarContainer.light #debug-bar .muted td {
594-
color: #DFDFDF; }
594+
color: #797979; }
595595
#toolbarContainer.light #debug-bar .muted:hover td {
596596
color: #434343; }
597597
#toolbarContainer.light #debug-bar #toolbar-position,

0 commit comments

Comments
 (0)