traces.html.php 2.1 KB

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