bug #27396 [HttpKernel] fix registering IDE links (nicolas-grekas)
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpKernel] fix registering IDE links
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27194
| License | MIT
| Doc PR | -
Reverts some changes made in #27074 in `FrameworkBundle::boot()` that create the linked issue. Leverages changes done in #26138 instead.
Commits
-------
92e3023195
[HttpKernel] fix registering IDE links
This commit is contained in:
commit
31c7db93a5
|
@ -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')) {
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
@ -123,7 +125,7 @@ class ExceptionListener implements EventSubscriberInterface
|
|||
$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());
|
||||
},
|
||||
|
|
Reference in New Issue