-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4378 from GrahamCampbell/4.2-whoops
[4.2] Updated Whoops
- Loading branch information
Showing
6 changed files
with
54 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
src/Illuminate/Exception/resources/views/frame_code.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php /* Display a code block for all frames in the stack. | ||
* @todo: This should PROBABLY be done on-demand, lest | ||
* we get 200 frames to process. */ ?> | ||
<div class="frame-code-container <?php echo (!$has_frames ? 'empty' : '') ?>"> | ||
<?php foreach($frames as $i => $frame): ?> | ||
<?php $line = $frame->getLine(); ?> | ||
<div class="frame-code <?php echo ($i == 0 ) ? 'active' : '' ?>" id="frame-code-<?php echo $i ?>"> | ||
<div class="frame-file"> | ||
<?php $filePath = $frame->getFile(); ?> | ||
<?php if($filePath && $editorHref = $handler->getEditorHref($filePath, (int) $line)): ?> | ||
<a href="<?php echo $editorHref ?>" class="editor-link"> | ||
<span class="editor-link-callout">open:</span> <strong><?php echo $tpl->escape($filePath ?: '<#unknown>') ?></strong> | ||
</a> | ||
<?php else: ?> | ||
<strong><?php echo $tpl->escape($filePath ?: '<#unknown>') ?></strong> | ||
<?php endif ?> | ||
</div> | ||
<?php | ||
// Do nothing if there's no line to work off | ||
if($line !== null): | ||
|
||
// the $line is 1-indexed, we nab -1 where needed to account for this | ||
$range = $frame->getFileLines($line - 8, 10); | ||
|
||
// getFileLines can return null if there is no source code | ||
if ($range): | ||
$range = array_map(function($line){ return empty($line) ? ' ' : $line;}, $range); | ||
$start = key($range) + 1; | ||
$code = join("\n", $range); | ||
?> | ||
<pre class="code-block prettyprint linenums:<?php echo $start ?>"><?php echo $tpl->escape($code) ?></pre> | ||
<?php endif ?> | ||
<?php endif ?> | ||
|
||
<?php | ||
// Append comments for this frame | ||
$comments = $frame->getComments(); | ||
?> | ||
<div class="frame-comments <?php echo empty($comments) ? 'empty' : '' ?>"> | ||
<?php foreach($comments as $commentNo => $comment): ?> | ||
<?php extract($comment) ?> | ||
<div class="frame-comment" id="comment-<?php echo $i . '-' . $commentNo ?>"> | ||
<span class="frame-comment-context"><?php echo $tpl->escape($context) ?></span> | ||
<?php echo $tpl->escapeButPreserveUris($comment) ?> | ||
</div> | ||
<?php endforeach ?> | ||
</div> | ||
|
||
</div> | ||
<?php endforeach ?> | ||
</div> |