Browse Source

Removed plugin from SF

arjen 14 năm trước cách đây
mục cha
commit
df02c05271

+ 0 - 47
src/Symfony/Bundle/SwiftmailerBundle/Plugin/ImpersonateSenderPlugin.php

@@ -1,47 +0,0 @@
-<?php
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace Symfony\Bundle\SwiftmailerBundle\Plugin;
-
-/**
- * Replaces the sender of a message.
- *
- * @author Arjen Brouwer <info@arjenbrouwer.nl>
- */
-class ImpersonateSenderPlugin implements \Swift_Events_SendListener {
-
-    private $_sender;
-
-    public function __construct($sender) {
-        $this->_sender = $sender;
-    }
-
-    public function beforeSendPerformed(\Swift_Events_SendEvent $evt) {
-        $message = $evt->getMessage();
-        $headers = $message->getHeaders();
-
-        // save current recipients
-        $headers->addPathHeader('X-Swift-Return-Path', $message->getReturnPath());
-
-        // replace them with the one to send to
-        $message->setReturnPath($this->_sender);
-    }
-
-    public function sendPerformed(\Swift_Events_SendEvent $evt) {
-        $message = $evt->getMessage();
-
-        // restore original headers
-        $headers = $message->getHeaders();
-        
-        if ($headers->has('X-Swift-Return-Path')) {
-            $message->setReturnPath($headers->get('X-Swift-Return-Path')->getAddress());
-            $headers->removeAll('X-Swift-Return-Path');
-        }
-    }
-}

+ 1 - 1
src/Symfony/Bundle/SwiftmailerBundle/Resources/config/swiftmailer.xml

@@ -14,8 +14,8 @@
 
         <parameter key="swiftmailer.plugin.redirecting.class">Swift_Plugins_RedirectingPlugin</parameter>
         <parameter key="swiftmailer.plugin.blackhole.class">Swift_Plugins_BlackholePlugin</parameter>
+        <parameter key="swiftmailer.plugin.impersonate.class">Swift_Plugins_ImpersonatePlugin</parameter>
         <parameter key="swiftmailer.plugin.messagelogger.class">Symfony\Bundle\SwiftmailerBundle\Logger\MessageLogger</parameter>
-        <parameter key="swiftmailer.plugin.impersonate.class">Symfony\Bundle\SwiftmailerBundle\Plugin\ImpersonateSenderPlugin</parameter>
         <parameter key="swiftmailer.data_collector.class">Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector</parameter>
     </parameters>