PageRenderTime 31ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/framework/vendor/swift/lib/classes/Swift.php

http://zoop.googlecode.com/
PHP | 57 lines | 22 code | 9 blank | 26 comment | 2 complexity | 56b5c3d7c34e6e0cebefeed12acfddd9 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  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. * General utility class in Swift Mailer, not to be instantiated.
  11. *
  12. * @package Swift
  13. *
  14. * @author Chris Corbyn
  15. */
  16. abstract class Swift
  17. {
  18. /** Swift Mailer Version number generated during dist release process */
  19. const VERSION = '4.0.6';
  20. /**
  21. * Internal autoloader for spl_autoload_register().
  22. *
  23. * @param string $class
  24. */
  25. public static function autoload($class)
  26. {
  27. //Don't interfere with other autoloaders
  28. if (0 !== strpos($class, 'Swift'))
  29. {
  30. return false;
  31. }
  32. $path = dirname(__FILE__).'/'.str_replace('_', '/', $class).'.php';
  33. if (!file_exists($path))
  34. {
  35. return false;
  36. }
  37. require_once $path;
  38. }
  39. /**
  40. * Configure autoloading using Swift Mailer.
  41. *
  42. * This is designed to play nicely with other autoloaders.
  43. */
  44. public static function registerAutoload()
  45. {
  46. spl_autoload_register(array('Swift', 'autoload'));
  47. }
  48. }