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

Skip to content

Commit 92e3023

Browse files
[HttpKernel] fix registering IDE links
1 parent 6fc7fdb commit 92e3023

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ class FrameworkBundle extends Bundle
6161
{
6262
public function boot()
6363
{
64-
if (!ini_get('xdebug.file_link_format') && !get_cfg_var('xdebug.file_link_format')) {
65-
ini_set('xdebug.file_link_format', $this->container->getParameter('debug.file_link_format'));
66-
}
6764
ErrorHandler::register(null, false)->throwAt($this->container->getParameter('debug.error_handler.throw_at'), true);
6865

6966
if ($this->container->hasParameter('kernel.trusted_proxies')) {

src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<argument type="service" id="logger" on-invalid="null" />
7575
<argument>%kernel.debug%</argument>
7676
<argument>%kernel.charset%</argument>
77+
<argument>%debug.file_link_format%</argument>
7778
</service>
7879

7980
<service id="validate_request_listener" class="Symfony\Component\HttpKernel\EventListener\ValidateRequestListener">

src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ExceptionController
3030
protected $twig;
3131
protected $debug;
3232
protected $profiler;
33+
private $fileLinkFormat;
3334

3435
public function __construct(Profiler $profiler = null, Environment $twig, $debug, FileLinkFormatter $fileLinkFormat = null)
3536
{

src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ class ExceptionListener implements EventSubscriberInterface
3636
protected $logger;
3737
protected $debug;
3838
private $charset;
39+
private $fileLinkFormat;
3940

40-
public function __construct($controller, LoggerInterface $logger = null, $debug = false, $charset = null)
41+
public function __construct($controller, LoggerInterface $logger = null, $debug = false, $charset = null, $fileLinkFormat = null)
4142
{
4243
$this->controller = $controller;
4344
$this->logger = $logger;
4445
$this->debug = $debug;
4546
$this->charset = $charset;
47+
$this->fileLinkFormat = $fileLinkFormat;
4648
}
4749

4850
public function onKernelException(GetResponseForExceptionEvent $event)
@@ -123,7 +125,7 @@ protected function duplicateRequest(\Exception $exception, Request $request)
123125
$attributes = array(
124126
'exception' => $exception = FlattenException::create($exception),
125127
'_controller' => $this->controller ?: function () use ($exception) {
126-
$handler = new ExceptionHandler($this->debug, $this->charset);
128+
$handler = new ExceptionHandler($this->debug, $this->charset, $this->fileLinkFormat);
127129

128130
return new Response($handler->getHtml($exception), $exception->getStatusCode(), $exception->getHeaders());
129131
},

0 commit comments

Comments
 (0)