TYPO3 API  SVNRelease
FailoverTransport.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This file is part of SwiftMailer.
00005  * (c) 2004-2009 Chris Corbyn
00006  *
00007  * For the full copyright and license information, please view the LICENSE
00008  * file that was distributed with this source code.
00009  */
00010 
00011 //@require 'Swift/Transport/FailoverTransport.php';
00012 //@require 'Swift/DependencyContainer.php';
00013 
00014 /**
00015  * Contains a list of redundant Transports so when one fails, the next is used.
00016  * @package Swift
00017  * @subpackage Transport
00018  * @author Chris Corbyn
00019  */
00020 class Swift_FailoverTransport extends Swift_Transport_FailoverTransport
00021 {
00022 
00023   /**
00024    * Creates a new FailoverTransport with $transports.
00025    * @param array $transports
00026    */
00027   public function __construct($transports = array())
00028   {
00029     call_user_func_array(
00030       array($this, 'Swift_Transport_FailoverTransport::__construct'),
00031       Swift_DependencyContainer::getInstance()
00032         ->createDependenciesFor('transport.failover')
00033       );
00034 
00035     $this->setTransports($transports);
00036   }
00037 
00038   /**
00039    * Create a new FailoverTransport instance.
00040    * @param string $transports
00041    * @return Swift_FailoverTransport
00042    */
00043   public static function newInstance($transports = array())
00044   {
00045     return new self($transports);
00046   }
00047 
00048 }