mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +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(
|
||||
'<a href="#" onclick="traceToggle(event, \'file-excerpt-%s\')">%s line %s</a>',
|
||||
$i,
|
||||
$stack['file'],
|
||||
Debugger::trimPath($stack['file']),
|
||||
$stack['line']
|
||||
);
|
||||
$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 .= '</pre></div> ';
|
||||
else:
|
||||
echo '<a href="#">[internal function]</a>';
|
||||
endif;
|
||||
echo ' → ';
|
||||
if ($stack['function']):
|
||||
|
@ -44,12 +46,12 @@ App::uses('Debugger', 'Utility');
|
|||
$params[] = Debugger::exportVar($arg, 2);
|
||||
endforeach;
|
||||
|
||||
$called = isset($stack['class']) ? $stack['class'] . $stack['type'] . $stack['function'] : $stack['function'];
|
||||
|
||||
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,
|
||||
$stack['class'],
|
||||
$stack['type'],
|
||||
$stack['function'],
|
||||
$called,
|
||||
implode(', ', $args)
|
||||
);
|
||||
$arguments = sprintf('<div id="trace-args-%s" class="cake-code-dump" style="display: none;"><pre>', $i);
|
||||
|
|
Loading…
Reference in a new issue