From 4aeca4ec9c9a092d896ffebb590bea0111b39f64 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 5 Aug 2019 18:46:42 +0200 Subject: [PATCH] [Mailer] made the message logger permanent --- .../DependencyInjection/FrameworkExtension.php | 10 ++++++---- .../Bundle/FrameworkBundle/Resources/config/mailer.xml | 4 ++++ .../FrameworkBundle/Resources/config/mailer_debug.xml | 4 ---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 35b9c9a1a0..158c329fa3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -148,6 +148,7 @@ class FrameworkExtension extends Extension private $annotationsConfigEnabled = false; private $validatorConfigEnabled = false; private $messengerConfigEnabled = false; + private $mailerConfigEnabled = false; /** * Responds to the app.config configuration parameter. @@ -343,7 +344,7 @@ class FrameworkExtension extends Extension $this->registerHttpClientConfiguration($config['http_client'], $container, $loader); } - if ($this->isConfigEnabled($container, $config['mailer'])) { + if ($this->mailerConfigEnabled = $this->isConfigEnabled($container, $config['mailer'])) { $this->registerMailerConfiguration($config['mailer'], $container, $loader); } @@ -553,6 +554,10 @@ class FrameworkExtension extends Extension $loader->load('messenger_debug.xml'); } + if ($this->mailerConfigEnabled) { + $loader->load('mailer_debug.xml'); + } + $container->setParameter('profiler_listener.only_exceptions', $config['only_exceptions']); $container->setParameter('profiler_listener.only_master_requests', $config['only_master_requests']); @@ -1965,9 +1970,6 @@ class FrameworkExtension extends Extension } $loader->load('mailer.xml'); - if ($container->getParameter('kernel.debug')) { - $loader->load('mailer_debug.xml'); - } $loader->load('mailer_transports.xml'); $container->getDefinition('mailer.default_transport')->setArgument(0, $config['dsn']); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml index fa10ebaae3..af71f7b64e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml @@ -33,5 +33,9 @@ + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml index 7447445949..17e1a6ed54 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml @@ -5,10 +5,6 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - - - -