Index: branches/unlabeled/unlabeled-1.59.2/core/kernel/utility/debugger.php =================================================================== diff -u -r6013 -r6019 --- branches/unlabeled/unlabeled-1.59.2/core/kernel/utility/debugger.php (.../debugger.php) (revision 6013) +++ branches/unlabeled/unlabeled-1.59.2/core/kernel/utility/debugger.php (.../debugger.php) (revision 6019) @@ -244,7 +244,14 @@ $div_width['left'] = round((($total - $total_before - $runtime) / $total) * $total_width); $ret = 'Name: '.$Data['description'].'
'; + + if (isset($Data['file'])) { + $ret .= '[Runtime: '.$runtime.'s] [File: '.$Data['file'].']
'; + } + else { $ret .= 'Runtime: '.$runtime.'s
'; + } + $ret .= '
'; $ret .= '
'; $ret .= '
'; @@ -639,7 +646,23 @@ $this->ProfilerData[$key]['description'] = $description; } - $this->Data[] = array('profile_key' => $key, 'debug_type' => 'profiler'); + if (substr($key, 0, 4) == 'sql_') { + // append place from what was called + $trace_results = debug_backtrace(); + $trace_count = count($trace_results); + $i = 0; + while ($i < $trace_count) { + $trace_file = basename($trace_results[$i]['file']); + if ($trace_file != 'db_connection.php' && $trace_file != 'adodb.inc.php') { + break; + } + $i++; + } + $this->ProfilerData[$key]['file'] = $trace_file.':'.$trace_results[$i]['line']; + unset($trace_results); + } + + $this->Data[] = Array('profile_key' => $key, 'debug_type' => 'profiler'); } function profileFinish($key, $description = null, $timeStamp = null)