swift_required.php 701 B

123456789101112131415161718192021222324252627282930
  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. * Autoloader and dependency injection initialization for Swift Mailer.
  11. */
  12. if (class_exists('Swift', false)) {
  13. return;
  14. }
  15. // Load Swift utility class
  16. require dirname(__FILE__) . '/classes/Swift.php';
  17. if (!function_exists('_swiftmailer_init')) {
  18. function _swiftmailer_init()
  19. {
  20. require dirname(__FILE__) . '/swift_init.php';
  21. }
  22. }
  23. // Start the autoloader and lazy-load the init script to set up dependency injection
  24. Swift::registerAutoload('_swiftmailer_init');