Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67af35f

Browse files
committed
Merge pull request laravel#908 from filp/improve/whoops-open-in-editor
Implement Whoops feature to open referenced files in editor/IDE
2 parents 1d970e6 + 6e5a799 commit 67af35f

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": ">=5.3.7",
1414
"classpreloader/classpreloader": "1.0.*",
1515
"ircmaxell/password-compat": "1.0.*",
16-
"filp/whoops": "1.0.0",
16+
"filp/whoops": "1.0.1",
1717
"monolog/monolog": "1.4.*",
1818
"patchwork/utf8": "1.0.*",
1919
"predis/predis": "0.8.*",

src/Illuminate/Exception/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"require": {
1111
"php": ">=5.3.0",
12-
"filp/whoops": "1.0.0",
12+
"filp/whoops": "1.0.1",
1313
"illuminate/support": "4.0.x",
1414
"symfony/http-foundation": "2.3.x",
1515
"symfony/http-kernel": "2.3.*"

src/Illuminate/Exception/resources/pretty-page.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ header {
109109
color:#999;
110110
word-wrap:break-word;
111111
}
112+
.editor-link {
113+
color: inherit;
114+
}
115+
.editor-link:hover strong {
116+
color: #F0E5DF;
117+
}
118+
119+
.editor-link-callout {
120+
padding: 2px 4px;
121+
background: #872D00;
122+
}
112123

113124
.frame-line {
114125
font-weight: bold;

src/Illuminate/Exception/resources/pretty-template.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@
6767
<?php $line = $frame->getLine(); ?>
6868
<div class="frame-code <?php echo ($i == 0 ) ? 'active' : '' ?>" id="frame-code-<?php echo $i ?>">
6969
<div class="frame-file">
70-
<strong><?php echo $e($frame->getFile() ?: '<#unknown>') ?></strong>
70+
<?php $filePath = $frame->getFile(); ?>
71+
<?php if($filePath && $editorHref = $v->handler->getEditorHref($filePath, (int) $line)): ?>
72+
<a href="<?php echo $editorHref ?>" class="editor-link">
73+
<span class="editor-link-callout">open:</span> <strong><?php echo $e($filePath ?: '<#unknown>') ?></strong>
74+
</a>
75+
<?php else: ?>
76+
<strong><?php echo $e($filePath ?: '<#unknown>') ?></strong>
77+
<?php endif ?>
7178
</div>
7279
<?php
7380
// Do nothing if there's no line to work off

0 commit comments

Comments
 (0)