exception_stack_trace_nav.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.0.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. * @var array $trace
  15. */
  16. use Cake\Error\Debugger;
  17. ?>
  18. <a href="#" class="toggle-link toggle-vendor-frames">Toggle Vendor Stack Frames</a>
  19. <ul class="stack-trace">
  20. <?php foreach ($trace as $i => $stack): ?>
  21. <?php
  22. $class = isset($stack['file']) && strpos($stack['file'], APP) === false ? 'vendor-frame' : 'app-frame';
  23. $class .= $i == 0 ? ' active' : '';
  24. ?>
  25. <li class="stack-frame <?= $class ?>">
  26. <a href="#" data-target="stack-frame-<?= $i ?>">
  27. <?php if (isset($stack['class'])): ?>
  28. <span class="stack-function"><?= h($stack['class'] . $stack['type'] . $stack['function']) ?></span>
  29. <?php elseif (isset($stack['function'])): ?>
  30. <span class="stack-function"><?= h($stack['function']) ?></span>
  31. <?php endif; ?>
  32. <span class="stack-file">
  33. <?php if (isset($stack['file'], $stack['line'])): ?>
  34. <?= h(Debugger::trimPath($stack['file'])) ?>:<?= $stack['line'] ?>
  35. <?php else: ?>
  36. [internal function]
  37. <?php endif ?>
  38. </span>
  39. </a>
  40. </li>
  41. <?php endforeach; ?>
  42. </ul>