Преглед на файлове

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