From 164d94c40ab8156db4ec8cc3997ee9e9ed18004a Mon Sep 17 00:00:00 2001 From: Miroslav Sustek Date: Sat, 15 Apr 2017 22:22:54 +0200 Subject: [PATCH 1/6] [TwigBundle] Separate error pages into new ErrorPageBundle --- composer.json | 1 + src/Symfony/Bundle/ErrorPageBundle/.gitignore | 3 + .../Bundle/ErrorPageBundle/CHANGELOG.md | 41 ++++++++++++++ .../Controller/ExceptionController.php | 8 +-- .../Controller/PreviewErrorController.php | 2 +- .../Compiler/ExceptionListenerPass.php | 4 +- .../DependencyInjection/Configuration.php | 42 ++++++++++++++ .../ErrorPageExtension.php | 42 ++++++++++++++ .../ErrorPageBundle/ErrorPageBundle.php | 31 +++++++++++ src/Symfony/Bundle/ErrorPageBundle/LICENSE | 19 +++++++ src/Symfony/Bundle/ErrorPageBundle/README.md | 10 ++++ .../Resources/config/error_page.xml | 25 +++++++++ .../Resources/config/routing/errors.xml | 0 .../Resources/views/Exception/error.atom.twig | 1 + .../Resources/views/Exception/error.css.twig | 0 .../Resources/views/Exception/error.html.twig | 0 .../Resources/views/Exception/error.js.twig | 0 .../Resources/views/Exception/error.json.twig | 0 .../Resources/views/Exception/error.rdf.twig | 1 + .../Resources/views/Exception/error.txt.twig | 0 .../Resources/views/Exception/error.xml.twig | 0 .../views/Exception/exception.atom.twig | 1 + .../views/Exception/exception.css.twig | 3 + .../views/Exception/exception.html.twig | 10 ++-- .../views/Exception/exception.js.twig | 3 + .../views/Exception/exception.json.twig | 0 .../views/Exception/exception.rdf.twig | 1 + .../views/Exception/exception.txt.twig | 2 +- .../views/Exception/exception.xml.twig | 2 +- .../views/Exception/exception_full.html.twig | 4 +- .../Resources/views/Exception/logs.html.twig | 0 .../Resources/views/Exception/trace.html.twig | 4 +- .../Resources/views/Exception/trace.txt.twig | 0 .../views/Exception/traces.html.twig | 6 +- .../Resources/views/Exception/traces.txt.twig | 2 +- .../Resources/views/Exception/traces.xml.twig | 2 +- .../views/Exception/traces_text.html.twig | 6 +- .../Resources/views/images/chevron-right.svg | 0 .../Resources/views/images/favicon.png.base64 | 0 .../Resources/views/images/icon-book.svg | 0 .../views/images/icon-minus-square-o.svg | 0 .../views/images/icon-minus-square.svg | 0 .../views/images/icon-plus-square-o.svg | 0 .../views/images/icon-plus-square.svg | 0 .../Resources/views/images/icon-support.svg | 0 .../Resources/views/images/symfony-ghost.svg | 0 .../Resources/views/images/symfony-logo.svg | 0 .../Resources/views/layout.html.twig | 8 +-- .../Controller/ExceptionControllerTest.php | 10 ++-- .../Controller/PreviewErrorControllerTest.php | 6 +- .../Bundle/ErrorPageBundle/Tests/TestCase.php | 18 ++++++ .../Bundle/ErrorPageBundle/composer.json | 55 +++++++++++++++++++ .../Bundle/ErrorPageBundle/phpunit.xml.dist | 31 +++++++++++ .../DependencyInjection/Configuration.php | 6 -- .../DependencyInjection/TwigExtension.php | 2 - .../TwigBundle/Resources/config/twig.xml | 17 ------ .../Resources/views/Exception/error.atom.twig | 1 - .../Resources/views/Exception/error.rdf.twig | 1 - .../views/Exception/exception.atom.twig | 1 - .../views/Exception/exception.css.twig | 3 - .../views/Exception/exception.js.twig | 3 - .../views/Exception/exception.rdf.twig | 1 - src/Symfony/Bundle/TwigBundle/TwigBundle.php | 2 - 63 files changed, 366 insertions(+), 75 deletions(-) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/.gitignore create mode 100644 src/Symfony/Bundle/ErrorPageBundle/CHANGELOG.md rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Controller/ExceptionController.php (92%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Controller/PreviewErrorController.php (96%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/DependencyInjection/Compiler/ExceptionListenerPass.php (89%) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/Configuration.php create mode 100644 src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/ErrorPageExtension.php create mode 100644 src/Symfony/Bundle/ErrorPageBundle/ErrorPageBundle.php create mode 100644 src/Symfony/Bundle/ErrorPageBundle/LICENSE create mode 100644 src/Symfony/Bundle/ErrorPageBundle/README.md create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Resources/config/error_page.xml rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/config/routing/errors.xml (100%) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.atom.twig rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/error.css.twig (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/error.html.twig (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/error.js.twig (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/error.json.twig (100%) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.rdf.twig rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/error.txt.twig (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/error.xml.twig (100%) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.atom.twig create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.css.twig rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/exception.html.twig (82%) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.js.twig rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/exception.json.twig (100%) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.rdf.twig rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/exception.txt.twig (68%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/exception.xml.twig (72%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/exception_full.html.twig (97%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/logs.html.twig (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/trace.html.twig (87%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/trace.txt.twig (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/traces.html.twig (87%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/traces.txt.twig (70%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/traces.xml.twig (57%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/Exception/traces_text.html.twig (66%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/chevron-right.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/favicon.png.base64 (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/icon-book.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/icon-minus-square-o.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/icon-minus-square.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/icon-plus-square-o.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/icon-plus-square.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/icon-support.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/symfony-ghost.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/images/symfony-logo.svg (100%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Resources/views/layout.html.twig (96%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Tests/Controller/ExceptionControllerTest.php (85%) rename src/Symfony/Bundle/{TwigBundle => ErrorPageBundle}/Tests/Controller/PreviewErrorControllerTest.php (91%) create mode 100644 src/Symfony/Bundle/ErrorPageBundle/Tests/TestCase.php create mode 100644 src/Symfony/Bundle/ErrorPageBundle/composer.json create mode 100644 src/Symfony/Bundle/ErrorPageBundle/phpunit.xml.dist delete mode 100644 src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig delete mode 100644 src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig delete mode 100644 src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig delete mode 100644 src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig delete mode 100644 src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.js.twig delete mode 100644 src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.rdf.twig diff --git a/composer.json b/composer.json index 42be8e2b4ee41..94b5d85cc0393 100644 --- a/composer.json +++ b/composer.json @@ -46,6 +46,7 @@ "symfony/dom-crawler": "self.version", "symfony/dotenv": "self.version", "symfony/event-dispatcher": "self.version", + "symfony/error-page-bundle": "self.version", "symfony/expression-language": "self.version", "symfony/filesystem": "self.version", "symfony/finder": "self.version", diff --git a/src/Symfony/Bundle/ErrorPageBundle/.gitignore b/src/Symfony/Bundle/ErrorPageBundle/.gitignore new file mode 100644 index 0000000000000..c49a5d8df5c65 --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/src/Symfony/Bundle/ErrorPageBundle/CHANGELOG.md b/src/Symfony/Bundle/ErrorPageBundle/CHANGELOG.md new file mode 100644 index 0000000000000..9f666dbc29dd7 --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/CHANGELOG.md @@ -0,0 +1,41 @@ +CHANGELOG +========= + +3.3.0 +----- + + * Deprecated `ContainerAwareRuntimeLoader` + +2.7.0 +----- + + * made it possible to configure the default formats for both the `date` and the `number_format` filter + * added support for the new Asset component (from Twig bridge) + * deprecated the assets extension (use the one from the Twig bridge instead) + +2.6.0 +----- + + * [BC BREAK] changed exception.json.twig to match same structure as error.json.twig making clients independent of runtime environment. + +2.3.0 +----- + + * added option to configure a custom template escaping guesser (via `autoescape_service` and `autoescape_service_method`) + +2.2.0 +----- + + * moved the exception controller to be a service (`twig.controller.exception:showAction` vs `Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController::showAction`) + * added support for multiple loaders via the "twig.loader" tag. + * added automatic registration of namespaced paths for registered bundles + * added support for namespaced paths + +2.1.0 +----- + + * added a new setting ("paths") to configure more paths for the Twig filesystem loader + * added contextual escaping based on the template file name (disabled if you explicitly pass an autoescape option) + * added a command that extracts translation messages from templates + * added the real template name when an error occurs in a Twig template + * added the twig:lint command that will validate a Twig template syntax. diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/ErrorPageBundle/Controller/ExceptionController.php similarity index 92% rename from src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php rename to src/Symfony/Bundle/ErrorPageBundle/Controller/ExceptionController.php index f9e86c4daa21d..aec7f52043c3c 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/ErrorPageBundle/Controller/ExceptionController.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Bundle\TwigBundle\Controller; +namespace Symfony\Bundle\ErrorPageBundle\Controller; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; @@ -105,14 +105,14 @@ protected function findTemplate(Request $request, $format, $code, $showException // For error pages, try to find a template for the specific HTTP status code and format if (!$showException) { - $template = sprintf('@Twig/Exception/%s%s.%s.twig', $name, $code, $format); + $template = sprintf('@ErrorPage/Exception/%s%s.%s.twig', $name, $code, $format); if ($this->templateExists($template)) { return $template; } } // try to find a template for the given format - $template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format); + $template = sprintf('@ErrorPage/Exception/%s.%s.twig', $name, $format); if ($this->templateExists($template)) { return $template; } @@ -120,7 +120,7 @@ protected function findTemplate(Request $request, $format, $code, $showException // default to a generic HTML exception $request->setRequestFormat('html'); - return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name); + return sprintf('@ErrorPage/Exception/%s.html.twig', $showException ? 'exception_full' : $name); } // to be removed when the minimum required version of Twig is >= 3.0 diff --git a/src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php b/src/Symfony/Bundle/ErrorPageBundle/Controller/PreviewErrorController.php similarity index 96% rename from src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php rename to src/Symfony/Bundle/ErrorPageBundle/Controller/PreviewErrorController.php index a907ef0abe5b2..07b4731ca9173 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/PreviewErrorController.php +++ b/src/Symfony/Bundle/ErrorPageBundle/Controller/PreviewErrorController.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Bundle\TwigBundle\Controller; +namespace Symfony\Bundle\ErrorPageBundle\Controller; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\HttpKernelInterface; diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php b/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/Compiler/ExceptionListenerPass.php similarity index 89% rename from src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php rename to src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/Compiler/ExceptionListenerPass.php index b7ebb2a406512..12790dfcc4810 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php +++ b/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/Compiler/ExceptionListenerPass.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler; +namespace Symfony\Bundle\ErrorPageBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; /** - * Registers the Twig exception listener if Twig is registered as a templating engine. + * Registers the exception listener if Twig is registered as a templating engine. * * @author Fabien Potencier */ diff --git a/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/Configuration.php new file mode 100644 index 0000000000000..832b9c802e8da --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/Configuration.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\ErrorPageBundle\DependencyInjection; + +use Symfony\Component\Config\Definition\Builder\TreeBuilder; +use Symfony\Component\Config\Definition\ConfigurationInterface; + +/** + * ErrorPageExtension configuration structure. + * + * @author Jeremy Mikola + */ +class Configuration implements ConfigurationInterface +{ + /** + * Generates the configuration tree builder. + * + * @return TreeBuilder The tree builder + */ + public function getConfigTreeBuilder() + { + $treeBuilder = new TreeBuilder(); + $rootNode = $treeBuilder->root('twig'); + + $rootNode + ->children() + ->scalarNode('exception_controller')->defaultValue('twig.controller.exception:showAction')->end() + ->end() + ; + + return $treeBuilder; + } +} diff --git a/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/ErrorPageExtension.php b/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/ErrorPageExtension.php new file mode 100644 index 0000000000000..e05196a0529bf --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/DependencyInjection/ErrorPageExtension.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\ErrorPageBundle\DependencyInjection; + +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; + +/** + * ErrorPageExtension. + * + * @author Fabien Potencier + * @author Jeremy Mikola + */ +class ErrorPageExtension extends Extension +{ + /** + * @param array $configs + * @param ContainerBuilder $container + */ + public function load(array $configs, ContainerBuilder $container) + { + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('error_page.xml'); + + $configuration = $this->getConfiguration($configs, $container); + + $config = $this->processConfiguration($configuration, $configs); + + $container->setParameter('twig.exception_listener.controller', $config['exception_controller']); + } +} diff --git a/src/Symfony/Bundle/ErrorPageBundle/ErrorPageBundle.php b/src/Symfony/Bundle/ErrorPageBundle/ErrorPageBundle.php new file mode 100644 index 0000000000000..d9545bace245d --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/ErrorPageBundle.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\ErrorPageBundle; + +use Symfony\Component\HttpKernel\Bundle\Bundle; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Bundle\ErrorPageBundle\DependencyInjection\Compiler\ExceptionListenerPass; + +/** + * ErrorPageBundle + * + * @author Fabien Potencier + */ +class ErrorPageBundle extends Bundle +{ + public function build(ContainerBuilder $container) + { + parent::build($container); + + $container->addCompilerPass(new ExceptionListenerPass()); + } +} diff --git a/src/Symfony/Bundle/ErrorPageBundle/LICENSE b/src/Symfony/Bundle/ErrorPageBundle/LICENSE new file mode 100644 index 0000000000000..17d16a13367dd --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2017 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/Symfony/Bundle/ErrorPageBundle/README.md b/src/Symfony/Bundle/ErrorPageBundle/README.md new file mode 100644 index 0000000000000..c07d1f2d612be --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/README.md @@ -0,0 +1,10 @@ +ErrorPageBundle +========== + +Resources +--------- + + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/src/Symfony/Bundle/ErrorPageBundle/Resources/config/error_page.xml b/src/Symfony/Bundle/ErrorPageBundle/Resources/config/error_page.xml new file mode 100644 index 0000000000000..a47bce4ce5d8c --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/config/error_page.xml @@ -0,0 +1,25 @@ + + + + + + + + + %twig.exception_listener.controller% + + + + + + %kernel.debug% + + + + + %twig.exception_listener.controller% + + + diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/routing/errors.xml b/src/Symfony/Bundle/ErrorPageBundle/Resources/config/routing/errors.xml similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/config/routing/errors.xml rename to src/Symfony/Bundle/ErrorPageBundle/Resources/config/routing/errors.xml diff --git a/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.atom.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.atom.twig new file mode 100644 index 0000000000000..f085d92cde76b --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.atom.twig @@ -0,0 +1 @@ +{{ include('@ErrorPage/Exception/error.xml.twig') }} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.css.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.css.twig similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.css.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.css.twig diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.html.twig similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.html.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.html.twig diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.js.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.js.twig similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.js.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.js.twig diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.json.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.json.twig similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.json.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.json.twig diff --git a/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.rdf.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.rdf.twig new file mode 100644 index 0000000000000..f085d92cde76b --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.rdf.twig @@ -0,0 +1 @@ +{{ include('@ErrorPage/Exception/error.xml.twig') }} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.txt.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.txt.twig similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.txt.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.txt.twig diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.xml.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.xml.twig similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.xml.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/error.xml.twig diff --git a/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.atom.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.atom.twig new file mode 100644 index 0000000000000..69a7653b6c08d --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.atom.twig @@ -0,0 +1 @@ +{{ include('@ErrorPage/Exception/exception.xml.twig', { exception: exception }) }} diff --git a/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.css.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.css.twig new file mode 100644 index 0000000000000..03a34b98cf227 --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.css.twig @@ -0,0 +1,3 @@ +/* +{{ include('@ErrorPage/Exception/exception.txt.twig', { exception: exception }) }} +*/ diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.html.twig similarity index 82% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.html.twig index 4b35e4fad77db..6295df871d533 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.html.twig @@ -4,7 +4,7 @@

{% for previousException in exception.allPrevious|reverse %} {{ previousException.class|abbr_class }} - {{ include('@Twig/images/chevron-right.svg') }} + {{ include('@ErrorPage/images/chevron-right.svg') }} {% endfor %} {{ exception.class|abbr_class }}

@@ -20,7 +20,7 @@
- {{ include('@Twig/images/symfony-ghost.svg') }} + {{ include('@ErrorPage/images/symfony-ghost.svg') }}
@@ -48,7 +48,7 @@
{% for i, e in exception_as_array %} - {{ include('@Twig/Exception/traces.html.twig', { exception: e, index: loop.index, expand: i in _exceptions_with_user_code or (_exceptions_with_user_code is empty and loop.first) }, with_context = false) }} + {{ include('@ErrorPage/Exception/traces.html.twig', { exception: e, index: loop.index, expand: i in _exceptions_with_user_code or (_exceptions_with_user_code is empty and loop.first) }, with_context = false) }} {% endfor %}
@@ -61,7 +61,7 @@
{% if logger %} - {{ include('@Twig/Exception/logs.html.twig', { logs: logger.logs }, with_context = false) }} + {{ include('@ErrorPage/Exception/logs.html.twig', { logs: logger.logs }, with_context = false) }} {% else %}

No log messages

@@ -81,7 +81,7 @@
{% for e in exception_as_array %} - {{ include('@Twig/Exception/traces_text.html.twig', { exception: e, index: loop.index, num_exceptions: loop.length }, with_context = false) }} + {{ include('@ErrorPage/Exception/traces_text.html.twig', { exception: e, index: loop.index, num_exceptions: loop.length }, with_context = false) }} {% endfor %}
diff --git a/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.js.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.js.twig new file mode 100644 index 0000000000000..03a34b98cf227 --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.js.twig @@ -0,0 +1,3 @@ +/* +{{ include('@ErrorPage/Exception/exception.txt.twig', { exception: exception }) }} +*/ diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.json.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.json.twig similarity index 100% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.json.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.json.twig diff --git a/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.rdf.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.rdf.twig new file mode 100644 index 0000000000000..69a7653b6c08d --- /dev/null +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.rdf.twig @@ -0,0 +1 @@ +{{ include('@ErrorPage/Exception/exception.xml.twig', { exception: exception }) }} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.txt.twig similarity index 68% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.txt.twig index cb17fb149f9ab..c38a318be3a78 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.txt.twig @@ -2,6 +2,6 @@ [message] {{ exception.message }} {% for i, e in exception.toarray %} [{{ i + 1 }}] {{ e.class }}: {{ e.message }} -{{ include('@Twig/Exception/traces.txt.twig', { exception: e }, with_context = false) }} +{{ include('@ErrorPage/Exception/traces.txt.twig', { exception: e }, with_context = false) }} {% endfor %} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.xml.twig similarity index 72% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.xml.twig index 36c9449b6c505..42aed58c71bba 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception.xml.twig @@ -3,7 +3,7 @@ {% for e in exception.toarray %} -{{ include('@Twig/Exception/traces.xml.twig', { exception: e }, with_context = false) }} +{{ include('@ErrorPage/Exception/traces.xml.twig', { exception: e }, with_context = false) }} {% endfor %} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception_full.html.twig similarity index 97% rename from src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig rename to src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception_full.html.twig index e4f220896ecda..1f8300a787045 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig +++ b/src/Symfony/Bundle/ErrorPageBundle/Resources/views/Exception/exception_full.html.twig @@ -1,4 +1,4 @@ -{% extends '@Twig/layout.html.twig' %} +{% extends '@ErrorPage/layout.html.twig' %} {% block head %}