فهرست منبع

[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');
-        }
     }
 
     /**