@@ -148,6 +148,7 @@ class FrameworkExtension extends Extension
148
148
private $ annotationsConfigEnabled = false ;
149
149
private $ validatorConfigEnabled = false ;
150
150
private $ messengerConfigEnabled = false ;
151
+ private $ mailerConfigEnabled = false ;
151
152
152
153
/**
153
154
* Responds to the app.config configuration parameter.
@@ -343,7 +344,7 @@ public function load(array $configs, ContainerBuilder $container)
343
344
$ this ->registerHttpClientConfiguration ($ config ['http_client ' ], $ container , $ loader );
344
345
}
345
346
346
- if ($ this ->isConfigEnabled ($ container , $ config ['mailer ' ])) {
347
+ if ($ this ->mailerConfigEnabled = $ this -> isConfigEnabled ($ container , $ config ['mailer ' ])) {
347
348
$ this ->registerMailerConfiguration ($ config ['mailer ' ], $ container , $ loader );
348
349
}
349
350
@@ -553,6 +554,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
553
554
$ loader ->load ('messenger_debug.xml ' );
554
555
}
555
556
557
+ if ($ this ->mailerConfigEnabled ) {
558
+ $ loader ->load ('mailer_debug.xml ' );
559
+ }
560
+
556
561
$ container ->setParameter ('profiler_listener.only_exceptions ' , $ config ['only_exceptions ' ]);
557
562
$ container ->setParameter ('profiler_listener.only_master_requests ' , $ config ['only_master_requests ' ]);
558
563
@@ -1965,9 +1970,6 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
1965
1970
}
1966
1971
1967
1972
$ loader ->load ('mailer.xml ' );
1968
- if ($ container ->getParameter ('kernel.debug ' )) {
1969
- $ loader ->load ('mailer_debug.xml ' );
1970
- }
1971
1973
$ loader ->load ('mailer_transports.xml ' );
1972
1974
$ container ->getDefinition ('mailer.default_transport ' )->setArgument (0 , $ config ['dsn ' ]);
1973
1975
0 commit comments