Skip to content

Commit

Permalink
Merge pull request #153 from creative-commoners/pulls/2.2/fix-trace
Browse files Browse the repository at this point in the history
FIX Identify correct class/method for query trace
  • Loading branch information
GuySartorelli committed Feb 8, 2024
2 parents 85fa03e + 1bcc071 commit 9a590fa
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions code/Extension/ProxyDBExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,21 @@ protected static function findSource()
);

$sources = array();
foreach ($traces as $trace) {
foreach ($traces as $i => $trace) {
// We need to be able to look ahead one item in the trace, because the class/function values
// are talking about what is being *called* on this line, not the function this line lives in.
if (!isset($traces[$i+1])) {
break;
}

$file = isset($trace['file']) ? pathinfo($trace['file'], PATHINFO_FILENAME) : null;
$class = isset($trace['class']) ? $trace['class'] : null;
$class = isset($traces[$i+1]['class']) ? $traces[$i+1]['class'] : null;
$line = isset($trace['line']) ? $trace['line'] : null;
$function = isset($trace['function']) ? $trace['function'] : null;
$type = isset($trace['type']) ? $trace['type'] : '::';
$function = isset($traces[$i+1]['function']) ? $traces[$i+1]['function'] : null;
$type = isset($traces[$i+1]['type']) ? $traces[$i+1]['type'] : '::';

/* @var $object SSViewer */
$object = isset($trace['object']) ? $trace['object'] : null;
$object = isset($traces[$i+1]['object']) ? $traces[$i+1]['object'] : null;

if (in_array($class, $internalClasses)) {
continue;
Expand Down

0 comments on commit 9a590fa

Please sign in to comment.