first commit
This commit is contained in:
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generated when a command is sent over an SMTP connection.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Events_CommandEvent extends Swift_Events_EventObject
|
||||
{
|
||||
/**
|
||||
* The command sent to the server.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $command;
|
||||
|
||||
/**
|
||||
* An array of codes which a successful response will contain.
|
||||
*
|
||||
* @var int[]
|
||||
*/
|
||||
private $successCodes = [];
|
||||
|
||||
/**
|
||||
* Create a new CommandEvent for $source with $command.
|
||||
*
|
||||
* @param string $command
|
||||
* @param array $successCodes
|
||||
*/
|
||||
public function __construct(Swift_Transport $source, $command, $successCodes = [])
|
||||
{
|
||||
parent::__construct($source);
|
||||
$this->command = $command;
|
||||
$this->successCodes = $successCodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command which was sent to the server.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCommand()
|
||||
{
|
||||
return $this->command;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the numeric response codes which indicate success for this command.
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function getSuccessCodes()
|
||||
{
|
||||
return $this->successCodes;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Listens for Transports to send commands to the server.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_CommandListener extends Swift_Events_EventListener
|
||||
{
|
||||
/**
|
||||
* Invoked immediately following a command being sent.
|
||||
*/
|
||||
public function commandSent(Swift_Events_CommandEvent $evt);
|
||||
}
|
38
include/swiftmailer/lib/classes/Swift/Events/Event.php
Normal file
38
include/swiftmailer/lib/classes/Swift/Events/Event.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The minimum interface for an Event.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_Event
|
||||
{
|
||||
/**
|
||||
* Get the source object of this event.
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getSource();
|
||||
|
||||
/**
|
||||
* Prevent this Event from bubbling any further up the stack.
|
||||
*
|
||||
* @param bool $cancel, optional
|
||||
*/
|
||||
public function cancelBubble($cancel = true);
|
||||
|
||||
/**
|
||||
* Returns true if this Event will not bubble any further up the stack.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function bubbleCancelled();
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for the EventDispatcher which handles the event dispatching layer.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_EventDispatcher
|
||||
{
|
||||
/**
|
||||
* Create a new SendEvent for $source and $message.
|
||||
*
|
||||
* @return Swift_Events_SendEvent
|
||||
*/
|
||||
public function createSendEvent(Swift_Transport $source, Swift_Mime_SimpleMessage $message);
|
||||
|
||||
/**
|
||||
* Create a new CommandEvent for $source and $command.
|
||||
*
|
||||
* @param string $command That will be executed
|
||||
* @param array $successCodes That are needed
|
||||
*
|
||||
* @return Swift_Events_CommandEvent
|
||||
*/
|
||||
public function createCommandEvent(Swift_Transport $source, $command, $successCodes = []);
|
||||
|
||||
/**
|
||||
* Create a new ResponseEvent for $source and $response.
|
||||
*
|
||||
* @param string $response
|
||||
* @param bool $valid If the response is valid
|
||||
*
|
||||
* @return Swift_Events_ResponseEvent
|
||||
*/
|
||||
public function createResponseEvent(Swift_Transport $source, $response, $valid);
|
||||
|
||||
/**
|
||||
* Create a new TransportChangeEvent for $source.
|
||||
*
|
||||
* @return Swift_Events_TransportChangeEvent
|
||||
*/
|
||||
public function createTransportChangeEvent(Swift_Transport $source);
|
||||
|
||||
/**
|
||||
* Create a new TransportExceptionEvent for $source.
|
||||
*
|
||||
* @return Swift_Events_TransportExceptionEvent
|
||||
*/
|
||||
public function createTransportExceptionEvent(Swift_Transport $source, Swift_TransportException $ex);
|
||||
|
||||
/**
|
||||
* Bind an event listener to this dispatcher.
|
||||
*/
|
||||
public function bindEventListener(Swift_Events_EventListener $listener);
|
||||
|
||||
/**
|
||||
* Dispatch the given Event to all suitable listeners.
|
||||
*
|
||||
* @param string $target method
|
||||
*/
|
||||
public function dispatchEvent(Swift_Events_EventObject $evt, $target);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* An identity interface which all EventListeners must extend.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_EventListener
|
||||
{
|
||||
}
|
61
include/swiftmailer/lib/classes/Swift/Events/EventObject.php
Normal file
61
include/swiftmailer/lib/classes/Swift/Events/EventObject.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* A base Event which all Event classes inherit from.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Events_EventObject implements Swift_Events_Event
|
||||
{
|
||||
/** The source of this Event */
|
||||
private $source;
|
||||
|
||||
/** The state of this Event (should it bubble up the stack?) */
|
||||
private $bubbleCancelled = false;
|
||||
|
||||
/**
|
||||
* Create a new EventObject originating at $source.
|
||||
*
|
||||
* @param object $source
|
||||
*/
|
||||
public function __construct($source)
|
||||
{
|
||||
$this->source = $source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the source object of this event.
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getSource()
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent this Event from bubbling any further up the stack.
|
||||
*/
|
||||
public function cancelBubble($cancel = true)
|
||||
{
|
||||
$this->bubbleCancelled = $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this Event will not bubble any further up the stack.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function bubbleCancelled()
|
||||
{
|
||||
return $this->bubbleCancelled;
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generated when a response is received on a SMTP connection.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Events_ResponseEvent extends Swift_Events_EventObject
|
||||
{
|
||||
/**
|
||||
* The overall result.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $valid;
|
||||
|
||||
/**
|
||||
* The response received from the server.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $response;
|
||||
|
||||
/**
|
||||
* Create a new ResponseEvent for $source and $response.
|
||||
*
|
||||
* @param string $response
|
||||
* @param bool $valid
|
||||
*/
|
||||
public function __construct(Swift_Transport $source, $response, $valid = false)
|
||||
{
|
||||
parent::__construct($source);
|
||||
$this->response = $response;
|
||||
$this->valid = $valid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the response which was received from the server.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the success status of this Event.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid()
|
||||
{
|
||||
return $this->valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Listens for responses from a remote SMTP server.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_ResponseListener extends Swift_Events_EventListener
|
||||
{
|
||||
/**
|
||||
* Invoked immediately following a response coming back.
|
||||
*/
|
||||
public function responseReceived(Swift_Events_ResponseEvent $evt);
|
||||
}
|
126
include/swiftmailer/lib/classes/Swift/Events/SendEvent.php
Normal file
126
include/swiftmailer/lib/classes/Swift/Events/SendEvent.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generated when a message is being sent.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Events_SendEvent extends Swift_Events_EventObject
|
||||
{
|
||||
/** Sending has yet to occur */
|
||||
const RESULT_PENDING = 0x0001;
|
||||
|
||||
/** Email is spooled, ready to be sent */
|
||||
const RESULT_SPOOLED = 0x0011;
|
||||
|
||||
/** Sending was successful */
|
||||
const RESULT_SUCCESS = 0x0010;
|
||||
|
||||
/** Sending worked, but there were some failures */
|
||||
const RESULT_TENTATIVE = 0x0100;
|
||||
|
||||
/** Sending failed */
|
||||
const RESULT_FAILED = 0x1000;
|
||||
|
||||
/**
|
||||
* The Message being sent.
|
||||
*
|
||||
* @var Swift_Mime_SimpleMessage
|
||||
*/
|
||||
private $message;
|
||||
|
||||
/**
|
||||
* Any recipients which failed after sending.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private $failedRecipients = [];
|
||||
|
||||
/**
|
||||
* The overall result as a bitmask from the class constants.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $result;
|
||||
|
||||
/**
|
||||
* Create a new SendEvent for $source and $message.
|
||||
*/
|
||||
public function __construct(Swift_Transport $source, Swift_Mime_SimpleMessage $message)
|
||||
{
|
||||
parent::__construct($source);
|
||||
$this->message = $message;
|
||||
$this->result = self::RESULT_PENDING;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Transport used to send the Message.
|
||||
*
|
||||
* @return Swift_Transport
|
||||
*/
|
||||
public function getTransport()
|
||||
{
|
||||
return $this->getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Message being sent.
|
||||
*
|
||||
* @return Swift_Mime_SimpleMessage
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the array of addresses that failed in sending.
|
||||
*
|
||||
* @param array $recipients
|
||||
*/
|
||||
public function setFailedRecipients($recipients)
|
||||
{
|
||||
$this->failedRecipients = $recipients;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an recipient addresses which were not accepted for delivery.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getFailedRecipients()
|
||||
{
|
||||
return $this->failedRecipients;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the result of sending.
|
||||
*
|
||||
* @param int $result
|
||||
*/
|
||||
public function setResult($result)
|
||||
{
|
||||
$this->result = $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the result of this Event.
|
||||
*
|
||||
* The return value is a bitmask from
|
||||
* {@see RESULT_PENDING, RESULT_SUCCESS, RESULT_TENTATIVE, RESULT_FAILED}
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getResult()
|
||||
{
|
||||
return $this->result;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Listens for Messages being sent from within the Transport system.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_SendListener extends Swift_Events_EventListener
|
||||
{
|
||||
/**
|
||||
* Invoked immediately before the Message is sent.
|
||||
*/
|
||||
public function beforeSendPerformed(Swift_Events_SendEvent $evt);
|
||||
|
||||
/**
|
||||
* Invoked immediately after the Message is sent.
|
||||
*/
|
||||
public function sendPerformed(Swift_Events_SendEvent $evt);
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The EventDispatcher which handles the event dispatching layer.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Events_SimpleEventDispatcher implements Swift_Events_EventDispatcher
|
||||
{
|
||||
/** A map of event types to their associated listener types */
|
||||
private $eventMap = [];
|
||||
|
||||
/** Event listeners bound to this dispatcher */
|
||||
private $listeners = [];
|
||||
|
||||
/**
|
||||
* Create a new EventDispatcher.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->eventMap = [
|
||||
'Swift_Events_CommandEvent' => 'Swift_Events_CommandListener',
|
||||
'Swift_Events_ResponseEvent' => 'Swift_Events_ResponseListener',
|
||||
'Swift_Events_SendEvent' => 'Swift_Events_SendListener',
|
||||
'Swift_Events_TransportChangeEvent' => 'Swift_Events_TransportChangeListener',
|
||||
'Swift_Events_TransportExceptionEvent' => 'Swift_Events_TransportExceptionListener',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new SendEvent for $source and $message.
|
||||
*
|
||||
* @return Swift_Events_SendEvent
|
||||
*/
|
||||
public function createSendEvent(Swift_Transport $source, Swift_Mime_SimpleMessage $message)
|
||||
{
|
||||
return new Swift_Events_SendEvent($source, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new CommandEvent for $source and $command.
|
||||
*
|
||||
* @param string $command That will be executed
|
||||
* @param array $successCodes That are needed
|
||||
*
|
||||
* @return Swift_Events_CommandEvent
|
||||
*/
|
||||
public function createCommandEvent(Swift_Transport $source, $command, $successCodes = [])
|
||||
{
|
||||
return new Swift_Events_CommandEvent($source, $command, $successCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new ResponseEvent for $source and $response.
|
||||
*
|
||||
* @param string $response
|
||||
* @param bool $valid If the response is valid
|
||||
*
|
||||
* @return Swift_Events_ResponseEvent
|
||||
*/
|
||||
public function createResponseEvent(Swift_Transport $source, $response, $valid)
|
||||
{
|
||||
return new Swift_Events_ResponseEvent($source, $response, $valid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new TransportChangeEvent for $source.
|
||||
*
|
||||
* @return Swift_Events_TransportChangeEvent
|
||||
*/
|
||||
public function createTransportChangeEvent(Swift_Transport $source)
|
||||
{
|
||||
return new Swift_Events_TransportChangeEvent($source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new TransportExceptionEvent for $source.
|
||||
*
|
||||
* @return Swift_Events_TransportExceptionEvent
|
||||
*/
|
||||
public function createTransportExceptionEvent(Swift_Transport $source, Swift_TransportException $ex)
|
||||
{
|
||||
return new Swift_Events_TransportExceptionEvent($source, $ex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind an event listener to this dispatcher.
|
||||
*/
|
||||
public function bindEventListener(Swift_Events_EventListener $listener)
|
||||
{
|
||||
foreach ($this->listeners as $l) {
|
||||
// Already loaded
|
||||
if ($l === $listener) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
$this->listeners[] = $listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch the given Event to all suitable listeners.
|
||||
*
|
||||
* @param string $target method
|
||||
*/
|
||||
public function dispatchEvent(Swift_Events_EventObject $evt, $target)
|
||||
{
|
||||
$bubbleQueue = $this->prepareBubbleQueue($evt);
|
||||
$this->bubble($bubbleQueue, $evt, $target);
|
||||
}
|
||||
|
||||
/** Queue listeners on a stack ready for $evt to be bubbled up it */
|
||||
private function prepareBubbleQueue(Swift_Events_EventObject $evt)
|
||||
{
|
||||
$bubbleQueue = [];
|
||||
$evtClass = \get_class($evt);
|
||||
foreach ($this->listeners as $listener) {
|
||||
if (\array_key_exists($evtClass, $this->eventMap)
|
||||
&& ($listener instanceof $this->eventMap[$evtClass])) {
|
||||
$bubbleQueue[] = $listener;
|
||||
}
|
||||
}
|
||||
|
||||
return $bubbleQueue;
|
||||
}
|
||||
|
||||
/** Bubble $evt up the stack calling $target() on each listener */
|
||||
private function bubble(array &$bubbleQueue, Swift_Events_EventObject $evt, $target)
|
||||
{
|
||||
if (!$evt->bubbleCancelled() && $listener = array_shift($bubbleQueue)) {
|
||||
$listener->$target($evt);
|
||||
$this->bubble($bubbleQueue, $evt, $target);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generated when the state of a Transport is changed (i.e. stopped/started).
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Events_TransportChangeEvent extends Swift_Events_EventObject
|
||||
{
|
||||
/**
|
||||
* Get the Transport.
|
||||
*
|
||||
* @return Swift_Transport
|
||||
*/
|
||||
public function getTransport()
|
||||
{
|
||||
return $this->getSource();
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Listens for changes within the Transport system.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_TransportChangeListener extends Swift_Events_EventListener
|
||||
{
|
||||
/**
|
||||
* Invoked just before a Transport is started.
|
||||
*/
|
||||
public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt);
|
||||
|
||||
/**
|
||||
* Invoked immediately after the Transport is started.
|
||||
*/
|
||||
public function transportStarted(Swift_Events_TransportChangeEvent $evt);
|
||||
|
||||
/**
|
||||
* Invoked just before a Transport is stopped.
|
||||
*/
|
||||
public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt);
|
||||
|
||||
/**
|
||||
* Invoked immediately after the Transport is stopped.
|
||||
*/
|
||||
public function transportStopped(Swift_Events_TransportChangeEvent $evt);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generated when a TransportException is thrown from the Transport system.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Events_TransportExceptionEvent extends Swift_Events_EventObject
|
||||
{
|
||||
/**
|
||||
* The Exception thrown.
|
||||
*
|
||||
* @var Swift_TransportException
|
||||
*/
|
||||
private $exception;
|
||||
|
||||
/**
|
||||
* Create a new TransportExceptionEvent for $transport.
|
||||
*/
|
||||
public function __construct(Swift_Transport $transport, Swift_TransportException $ex)
|
||||
{
|
||||
parent::__construct($transport);
|
||||
$this->exception = $ex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the TransportException thrown.
|
||||
*
|
||||
* @return Swift_TransportException
|
||||
*/
|
||||
public function getException()
|
||||
{
|
||||
return $this->exception;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of SwiftMailer.
|
||||
* (c) 2004-2009 Chris Corbyn
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Listens for Exceptions thrown from within the Transport system.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
interface Swift_Events_TransportExceptionListener extends Swift_Events_EventListener
|
||||
{
|
||||
/**
|
||||
* Invoked as a TransportException is thrown in the Transport system.
|
||||
*/
|
||||
public function exceptionThrown(Swift_Events_TransportExceptionEvent $evt);
|
||||
}
|
Reference in New Issue
Block a user