소스 검색

[Swiftmailer] changed disable_strategy behavior

The blackhole plugin that was used previously stop the propagation
of events, which means that the behavior can be slightly different
depending on the order of plugin registrations.

Instead, we now use the null transport to avoid this issue.
Fabien Potencier 14 년 전
부모
커밋
52697ed3df
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php

+ 4 - 4
src/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php

@@ -60,6 +60,10 @@ class SwiftmailerExtension extends Extension
             $transport = $config['transport'];
         }
 
+        if (isset($config['disable_delivery']) && $config['disable_delivery']) {
+            $transport = 'null';
+        }
+
         if ('smtp' === $transport) {
             $loader->load('smtp.xml');
         }
@@ -117,10 +121,6 @@ class SwiftmailerExtension extends Extension
         } else {
             $container->setParameter('swiftmailer.single_address', null);
         }
-
-        if (isset($config['disable_delivery']) && $config['disable_delivery']) {
-            $container->getDefinition('swiftmailer.plugin.blackhole')->addTag('swiftmailer.plugin');
-        }
     }
 
     /**