File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
templates/amp sql profiler Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 77
88final class SqlQuery
99{
10+ public array $ backtrace ;
11+
1012 public function __construct (
1113 public string $ sql ,
1214 public float $ executionMS ,
1315 public array |Data $ params = [],
1416 ) {
17+ $ this ->backtrace = array_slice (debug_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS ), 1 );
1518 }
1619}
Original file line number Diff line number Diff line change 8080 <div >
8181 <strong class =" font-normal text-small" >Parameters</strong >: {{ profiler_dump(query .params , 2 ) }}
8282 </div >
83+
84+ <div class =" text-small font-normal" >
85+ <a href =" #" class =" sf-toggle link-inverse"
86+ data-toggle-selector =" #backtrace-{{ loop .index }}"
87+ data-toggle-alt-content =" Hide query backtrace" >View query backtrace</a >
88+ </div >
89+
90+ <div id =" backtrace-{{ loop .index }}" class =" hidden" >
91+ <table >
92+ <thead >
93+ <tr >
94+ <th scope =" col" >#</th >
95+ <th scope =" col" >File/Call</th >
96+ </tr >
97+ </thead >
98+ <tbody >
99+ {% for trace in query .backtrace %}
100+ <tr >
101+ <td >{{ loop .index }}</td >
102+ <td >
103+ <span class =" text-small" >
104+ {% set line_number = trace .line | default (1 ) %}
105+ {% if trace .file is defined %}
106+ <a href =" {{ trace .file | file_link(line_number ) }}" >
107+ {% endif %}
108+ {{- trace .class is defined ? trace .class ~ trace .type | default (' ::' ) -}}
109+ <span class =" status-warning" >{{ trace .function }}</span >
110+ {%- if trace .file is defined -%}
111+ </a >
112+ {% endif %}
113+ (line {{ line_number }})
114+ </span >
115+ </td >
116+ </tr >
117+ {% endfor %}
118+ </tbody >
119+ </table >
120+ </div >
83121 </td >
84122 </tr >
85123 {% endfor %}
You can’t perform that action at this time.
0 commit comments