Skip to content

Commit 1422e9a

Browse files
committed
feature #12045 [Debug] add some file link format handling (nicolas-grekas)
This PR was merged into the 2.6-dev branch. Discussion ---------- [Debug] add some file link format handling | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- c6923af [Debug] add some file link format handling
2 parents d6aa2e7 + 44bcd8e commit 1422e9a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

EventListener/DebugHandlersListener.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ class DebugHandlersListener implements EventSubscriberInterface
3434
* @param LoggerInterface|null $logger A PSR-3 logger
3535
* @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
3636
* @param bool $debug Enables/disables debug mode
37+
* @param string $fileLinkFormat The format for links to source files
3738
*/
38-
public function __construct($exceptionHandler, LoggerInterface $logger = null, $levels = null, $debug = true)
39+
public function __construct($exceptionHandler, LoggerInterface $logger = null, $levels = null, $debug = true, $fileLinkFormat = null)
3940
{
4041
$this->exceptionHandler = $exceptionHandler;
4142
$this->logger = $logger;
4243
$this->levels = $levels;
4344
$this->debug = $debug;
45+
$this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
4446
}
4547

4648
public function configure()
@@ -76,6 +78,7 @@ public function configure()
7678
}
7779
if ($handler instanceof ExceptionHandler) {
7880
$handler->setHandler($this->exceptionHandler);
81+
$handler->setFileLinkFormat($this->fileLinkFormat);
7982
}
8083
$this->exceptionHandler = null;
8184
}

0 commit comments

Comments
 (0)