mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 11:32:40 +00:00
Fix issues with stack trace output.
Traces without files and without classes caused errors in printing the fancy trace.
This commit is contained in:
parent
545694d84b
commit
123a1a21ba
1 changed files with 7 additions and 5 deletions
|
@ -29,12 +29,14 @@ App::uses('Debugger', 'Utility');
|
||||||
printf(
|
printf(
|
||||||
'<a href="#" onclick="traceToggle(event, \'file-excerpt-%s\')">%s line %s</a>',
|
'<a href="#" onclick="traceToggle(event, \'file-excerpt-%s\')">%s line %s</a>',
|
||||||
$i,
|
$i,
|
||||||
$stack['file'],
|
Debugger::trimPath($stack['file']),
|
||||||
$stack['line']
|
$stack['line']
|
||||||
);
|
);
|
||||||
$excerpt = sprintf('<div id="file-excerpt-%s" class="cake-code-dump" style="display:none;"><pre>', $i);
|
$excerpt = sprintf('<div id="file-excerpt-%s" class="cake-code-dump" style="display:none;"><pre>', $i);
|
||||||
$excerpt .= implode("\n", Debugger::excerpt($stack['file'], $stack['line'] - 1, 2));
|
$excerpt .= implode("\n", Debugger::excerpt($stack['file'], $stack['line'] - 1, 2));
|
||||||
$excerpt .= '</pre></div> ';
|
$excerpt .= '</pre></div> ';
|
||||||
|
else:
|
||||||
|
echo '<a href="#">[internal function]</a>';
|
||||||
endif;
|
endif;
|
||||||
echo ' → ';
|
echo ' → ';
|
||||||
if ($stack['function']):
|
if ($stack['function']):
|
||||||
|
@ -43,13 +45,13 @@ App::uses('Debugger', 'Utility');
|
||||||
$args[] = Debugger::getType($arg);
|
$args[] = Debugger::getType($arg);
|
||||||
$params[] = Debugger::exportVar($arg, 2);
|
$params[] = Debugger::exportVar($arg, 2);
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
$called = isset($stack['class']) ? $stack['class'] . $stack['type'] . $stack['function'] : $stack['function'];
|
||||||
|
|
||||||
printf(
|
printf(
|
||||||
'<a href="#" onclick="traceToggle(event, \'trace-args-%s\')">%s%s%s(%s)</a> ',
|
'<a href="#" onclick="traceToggle(event, \'trace-args-%s\')">%s(%s)</a> ',
|
||||||
$i,
|
$i,
|
||||||
$stack['class'],
|
$called,
|
||||||
$stack['type'],
|
|
||||||
$stack['function'],
|
|
||||||
implode(', ', $args)
|
implode(', ', $args)
|
||||||
);
|
);
|
||||||
$arguments = sprintf('<div id="trace-args-%s" class="cake-code-dump" style="display: none;"><pre>', $i);
|
$arguments = sprintf('<div id="trace-args-%s" class="cake-code-dump" style="display: none;"><pre>', $i);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue