|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of SwiftMailer. |
|
|
5 |
* (c) 2004-2009 Chris Corbyn |
|
|
6 |
* |
|
|
7 |
* For the full copyright and license information, please view the LICENSE |
|
|
8 |
* file that was distributed with this source code. |
|
|
9 |
*/ |
|
|
10 |
|
|
|
11 |
|
|
|
12 |
/** |
|
|
13 |
* Contains a list of redundant Transports so when one fails, the next is used. |
|
|
14 |
* @package Swift |
|
|
15 |
* @subpackage Transport |
|
|
16 |
* @author Chris Corbyn |
|
|
17 |
*/ |
|
|
18 |
class Swift_FailoverTransport extends Swift_Transport_FailoverTransport |
|
|
19 |
{ |
|
|
20 |
|
|
|
21 |
/** |
|
|
22 |
* Creates a new FailoverTransport with $transports. |
|
|
23 |
* @param array $transports |
|
|
24 |
*/ |
|
|
25 |
public function __construct($transports = array()) |
|
|
26 |
{ |
|
|
27 |
call_user_func_array( |
|
|
28 |
array($this, 'Swift_Transport_FailoverTransport::__construct'), |
|
|
29 |
Swift_DependencyContainer::getInstance() |
|
|
30 |
->createDependenciesFor('transport.failover') |
|
|
31 |
); |
|
|
32 |
|
|
|
33 |
$this->setTransports($transports); |
|
|
34 |
} |
|
|
35 |
|
|
|
36 |
/** |
|
|
37 |
* Create a new FailoverTransport instance. |
|
|
38 |
* @param string $transports |
|
|
39 |
* @return Swift_FailoverTransport |
|
|
40 |
*/ |
|
|
41 |
public static function newInstance($transports = array()) |
|
|
42 |
{ |
|
|
43 |
return new self($transports); |
|
|
44 |
} |
|
|
45 |
|
|
|
46 |
} |