-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Added new ErrorController + Preview and enabling there the error renderer mechanism #33271
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="_preview_error" path="/{code}.{_format}"> | ||
<default key="_controller">error_controller::preview</default> | ||
<default key="_format">html</default> | ||
<requirement key="code">\d+</requirement> | ||
</route> | ||
</routes> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
imports: | ||
- { resource: ./../config/default.yml } | ||
- { resource: ./../config/framework.yml } | ||
|
||
security: | ||
encoders: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
imports: | ||
- { resource: ./../config/default.yml } | ||
- { resource: ./../config/framework.yml } | ||
|
||
security: | ||
encoders: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
* Registers the Twig exception listener if Twig is registered as a templating engine. | ||
* | ||
* @author Fabien Potencier <fabien@symfony.com> | ||
* | ||
* @internal | ||
*/ | ||
class ExceptionListenerPass implements CompilerPassInterface | ||
{ | ||
|
@@ -27,13 +29,18 @@ public function process(ContainerBuilder $container) | |
return; | ||
} | ||
|
||
// register the exception controller only if Twig is enabled and required dependencies do exist | ||
if (!class_exists('Symfony\Component\ErrorRenderer\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed all |
||
// to be removed in 5.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yceruto can you please send a PR on master to cleanup this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #33476 |
||
// register the exception listener only if it's currently used, else use the provided by FrameworkBundle | ||
if (null === $container->getParameter('twig.exception_listener.controller') && $container->hasDefinition('exception_listener')) { | ||
$container->removeDefinition('twig.exception_listener'); | ||
yceruto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} elseif ($container->hasParameter('templating.engines')) { | ||
$engines = $container->getParameter('templating.engines'); | ||
if (!\in_array('twig', $engines)) { | ||
$container->removeDefinition('twig.exception_listener'); | ||
} else { | ||
$container->removeDefinition('exception_listener'); | ||
|
||
if ($container->hasParameter('templating.engines')) { | ||
$engines = $container->getParameter('templating.engines'); | ||
if (!\in_array('twig', $engines, true)) { | ||
$container->removeDefinition('twig.exception_listener'); | ||
} | ||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.