FailoverTransport.php 1.1KB

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