~lzap/cupooy/trunk

« back to all changes in this revision

Viewing changes to lib/vendor/swift/classes/Swift/FailoverTransport.php

  • Committer: Lukáš Zapletal
  • Date: 2009-11-16 15:18:26 UTC
  • Revision ID: lzap@shark-20091116151826-4287asrnx59j26g0
Mailing

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
//@require 'Swift/Transport/FailoverTransport.php';
 
12
//@require 'Swift/DependencyContainer.php';
 
13
 
 
14
/**
 
15
 * Contains a list of redundant Transports so when one fails, the next is used.
 
16
 * @package Swift
 
17
 * @subpackage Transport
 
18
 * @author Chris Corbyn
 
19
 */
 
20
class Swift_FailoverTransport extends Swift_Transport_FailoverTransport
 
21
{
 
22
  
 
23
  /**
 
24
   * Creates a new FailoverTransport with $transports.
 
25
   * @param array $transports
 
26
   */
 
27
  public function __construct($transports = array())
 
28
  {
 
29
    call_user_func_array(
 
30
      array($this, 'Swift_Transport_FailoverTransport::__construct'),
 
31
      Swift_DependencyContainer::getInstance()
 
32
        ->createDependenciesFor('transport.failover')
 
33
      );
 
34
    
 
35
    $this->setTransports($transports);
 
36
  }
 
37
  
 
38
  /**
 
39
   * Create a new FailoverTransport instance.
 
40
   * @param string $transports
 
41
   * @return Swift_FailoverTransport
 
42
   */
 
43
  public static function newInstance($transports = array())
 
44
  {
 
45
    return new self($transports);
 
46
  }
 
47
  
 
48
}