You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.4 KiB

3 years ago
  1. <div class="trace trace-as-html" id="trace-box-<?= $index; ?>">
  2. <div class="trace-details">
  3. <div class="trace-head">
  4. <div class="sf-toggle" data-toggle-selector="#trace-html-<?= $index; ?>" data-toggle-initial="<?= $expand ? 'display' : ''; ?>">
  5. <span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg'); ?></span>
  6. <span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg'); ?></span>
  7. <?php
  8. $separator = strrpos($exception['class'], '\\');
  9. $separator = false === $separator ? 0 : $separator + 1;
  10. $namespace = substr($exception['class'], 0, $separator);
  11. $class = substr($exception['class'], $separator);
  12. ?>
  13. <?php if ('' === $class) { ?>
  14. </br>
  15. <?php } else { ?>
  16. <h3 class="trace-class">
  17. <?php if ('' !== $namespace) { ?>
  18. <span class="trace-namespace"><?= $namespace; ?></span>
  19. <?php } ?>
  20. <?= $class; ?>
  21. </h3>
  22. <?php } ?>
  23. <?php if ($exception['message'] && $index > 1) { ?>
  24. <p class="break-long-words trace-message"><?= $this->escape($exception['message']); ?></p>
  25. <?php } ?>
  26. </div>
  27. </div>
  28. <div id="trace-html-<?= $index; ?>" class="sf-toggle-content">
  29. <?php
  30. $isFirstUserCode = true;
  31. foreach ($exception['trace'] as $i => $trace) {
  32. $isVendorTrace = $trace['file'] && (false !== mb_strpos($trace['file'], '/vendor/') || false !== mb_strpos($trace['file'], '/var/cache/'));
  33. $displayCodeSnippet = $isFirstUserCode && !$isVendorTrace;
  34. if ($displayCodeSnippet) {
  35. $isFirstUserCode = false;
  36. } ?>
  37. <div class="trace-line <?= $isVendorTrace ? 'trace-from-vendor' : ''; ?>">
  38. <?= $this->include('views/trace.html.php', [
  39. 'prefix' => $index,
  40. 'i' => $i,
  41. 'trace' => $trace,
  42. 'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''),
  43. ]); ?>
  44. </div>
  45. <?php
  46. } ?>
  47. </div>
  48. </div>
  49. </div>