Skip to content

Commit

Permalink
Debug: Proof of concept $editorLink
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Sep 25, 2010
1 parent 303b1cb commit cbd1f65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Nette/Debug/Debug.php
Expand Up @@ -85,6 +85,9 @@ final class Debug
/** @var int interval for sending email is 2 days */
public static $emailSnooze = 172800;

/** @var string URL pattern to open editor in format "editor:%filename:%line" */
public static $editorLink = "";

/** @var bool {@link Debug::enable()} */
private static $enabled = FALSE;

Expand Down
6 changes: 5 additions & 1 deletion Nette/Debug/templates/bluescreen.phtml
Expand Up @@ -401,7 +401,11 @@ if (headers_sent()) {
} ?>
<?php if (is_file($ex->getFile())): ?>
<?php _netteOpenPanel('Source file', $expanded !== NULL) ?>
<p><strong>File:</strong> <?php echo htmlspecialchars($ex->getFile()) ?> &nbsp; <strong>Line:</strong> <?php echo $ex->getLine() ?></p>
<p><strong>File:</strong> <?php if (self::$editorLink) {
echo '<a href="' . htmlspecialchars(strtr(self::$editorLink, array('%filename' => $ex->getFile(), '%line' => $ex->getLine()))) . '">' . htmlspecialchars($ex->getFile()) . '</a>';
} else {
echo htmlspecialchars($ex->getFile());
} ?> &nbsp; <strong>Line:</strong> <?php echo $ex->getLine() ?></p>
<pre><?php _netteDebugPrintCode($ex->getFile(), $ex->getLine()) ?></pre>
<?php _netteClosePanel() ?>
<?php endif?>
Expand Down

0 comments on commit cbd1f65

Please sign in to comment.