Skip to content

Commit 62ebc88

Browse files
committed
Jet Profiler
------------ * Brand new profiler UI Jet library (core) ------------ * New class Debug_Profiler_Run_BacktraceItem (extends Debug_ErrorHandler_Error_BacktraceItem) * Debug_Profiler_Run_BacktraceItem represents all profiler backtraces (and not only simple array) * Debug_Profiler->getRootDir(): string added * Debug_Profiler->getBlock( string $id ) : ?Debug_Profiler_Run_Block added * Jet_MVC: profiler block names simplified Jet Debug ErrorHandler > Display ------------ * The error handler has the same font as the profiler
1 parent 13f3aad commit 62ebc88

File tree

17 files changed

+1055
-313
lines changed

17 files changed

+1055
-313
lines changed

_profiler/Controller.php

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,9 @@ public function readRun( string $run_id ) : Debug_Profiler_Run|null
102102

103103
public function statusBarDisplayer( Debug_Profiler_Run $run ) : void
104104
{
105-
106105
if($this->save_error) {
107106
if( !Debug::getOutputIsJSON() ) {
108-
require __DIR__ . '/views/status_style.phtml';
109-
require __DIR__ . '/views/status_bar_error.phtml';
107+
require __DIR__ . '/views/status-bar/error.phtml';
110108
}
111109

112110
return;
@@ -118,8 +116,7 @@ public function statusBarDisplayer( Debug_Profiler_Run $run ) : void
118116
echo '<!-- profiler: ' . $URL . ' -->';
119117
} else {
120118
if( !Debug::getOutputIsJSON() ) {
121-
require __DIR__ . '/views/status_style.phtml';
122-
require __DIR__ . '/views/status_bar.phtml';
119+
require __DIR__ . '/views/status-bar.phtml';
123120
}
124121
}
125122
}
@@ -136,6 +133,43 @@ protected function catchShowRun() : void
136133
if( !$run ) {
137134
return;
138135
}
136+
137+
138+
if(
139+
($bt_type=$_GET['show_bt']??'') &&
140+
($bt_id=$_GET['id']??null)!==null
141+
) {
142+
$bt = null;
143+
switch($bt_type) {
144+
case 'run_block_bt_start':
145+
$bt = $run->getBlock($bt_id)?->getBacktraceStart();
146+
break;
147+
case 'run_block_bt_end':
148+
$bt = $run->getBlock($bt_id)?->getBacktraceEnd();
149+
break;
150+
case 'run_block_message_bt':
151+
[$block_id, $message_i] = explode(':', $bt_id);
152+
153+
$bt = $run->getBlock( $block_id )?->getMessages()[(int)$message_i]?->getBacktrace();
154+
155+
break;
156+
case 'run_block_sql_query_bt':
157+
[$block_id, $q_i] = explode(':', $bt_id);
158+
159+
$bt = $run->getBlock( $block_id )?->getSQLQueries()[(int)$q_i]?->getBacktrace();
160+
break;
161+
case 'run_sql_query_bt':
162+
$bt = $run->getSqlQueries()[(int)$bt_id]?->getBacktrace();
163+
break;
164+
}
165+
166+
if($bt) {
167+
require __DIR__ . '/views/result/bt.phtml';
168+
}
169+
170+
die();
171+
}
172+
139173

140174
if( isset( $_GET['callgraph'] ) ) {
141175
$this->showCallGraph( $run );

0 commit comments

Comments
 (0)