exception_stack_trace_nav.php 1.8 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. */
  15. use Cake\Error\Debugger;
  16. ?>
  17. <a href="#" class="toggle-link toggle-vendor-frames">toggle vendor stack frames</a>
  18. <ul class="stack-trace">
  19. <?php foreach ($error->getTrace() as $i => $stack): ?>
  20. <?php $class = (isset($stack['file']) && strpos($stack['file'], APP) === false) ? 'vendor-frame' : 'app-frame'; ?>
  21. <li class="stack-frame <?= $class ?>">
  22. <?php if (isset($stack['function'])): ?>
  23. <a href="#" data-target="stack-frame-<?= $i ?>">
  24. <?php if (isset($stack['class'])): ?>
  25. <span class="stack-function">&rang; <?= h($stack['class'] . $stack['type'] . $stack['function']) ?></span>
  26. <?php else: ?>
  27. <span class="stack-function">&rang; <?= h($stack['function']) ?></span>
  28. <?php endif; ?>
  29. <span class="stack-file">
  30. <?php if (isset($stack['file'], $stack['line'])): ?>
  31. <?= h(Debugger::trimPath($stack['file'])) ?>, line <?= $stack['line'] ?>
  32. <?php else: ?>
  33. [internal function]
  34. <?php endif ?>
  35. </span>
  36. </a>
  37. <?php else: ?>
  38. <a href="#">&rang; [internal function]</a>
  39. <?php endif; ?>
  40. </li>
  41. <?php endforeach; ?>
  42. </ul>