Skip to content

[HttpKernel] fix registering IDE links #27396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ class FrameworkBundle extends Bundle
{
public function boot()
{
if (!ini_get('xdebug.file_link_format') && !get_cfg_var('xdebug.file_link_format')) {
ini_set('xdebug.file_link_format', $this->container->getParameter('debug.file_link_format'));
}
ErrorHandler::register(null, false)->throwAt($this->container->getParameter('debug.error_handler.throw_at'), true);

if ($this->container->hasParameter('kernel.trusted_proxies')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<argument type="service" id="logger" on-invalid="null" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
<argument>%debug.file_link_format%</argument>
</service>

<service id="validate_request_listener" class="Symfony\Component\HttpKernel\EventListener\ValidateRequestListener">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ExceptionController
protected $twig;
protected $debug;
protected $profiler;
private $fileLinkFormat;

public function __construct(Profiler $profiler = null, Environment $twig, $debug, FileLinkFormatter $fileLinkFormat = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ class ExceptionListener implements EventSubscriberInterface
protected $logger;
protected $debug;
private $charset;
private $fileLinkFormat;

public function __construct($controller, LoggerInterface $logger = null, $debug = false, $charset = null)
public function __construct($controller, LoggerInterface $logger = null, $debug = false, $charset = null, $fileLinkFormat = null)
{
$this->controller = $controller;
$this->logger = $logger;
$this->debug = $debug;
$this->charset = $charset;
$this->fileLinkFormat = $fileLinkFormat;
}

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

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