Added feature #15998: Create a new API to send mails based on SwiftMailer to replace...
[Packages/TYPO3.CMS.git] / typo3 / contrib / swiftmailer / classes / Swift.php
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 * General utility class in Swift Mailer, not to be instantiated.
13 *
14 * @package Swift
15 *
16 * @author Chris Corbyn
17 */
18 abstract class Swift
19 {
20
21 /** Swift Mailer Version number generated during dist release process */
22 const VERSION = '4.0.6';
23
24 /**
25 * Internal autoloader for spl_autoload_register().
26 *
27 * @param string $class
28 */
29 public static function autoload($class)
30 {
31 //Don't interfere with other autoloaders
32 if (0 !== strpos($class, 'Swift'))
33 {
34 return false;
35 }
36
37 $path = dirname(__FILE__).'/'.str_replace('_', '/', $class).'.php';
38
39 if (!file_exists($path))
40 {
41 return false;
42 }
43
44 require_once $path;
45 }
46
47 /**
48 * Configure autoloading using Swift Mailer.
49 *
50 * This is designed to play nicely with other autoloaders.
51 */
52 public static function registerAutoload()
53 {
54 spl_autoload_register(array('Swift', 'autoload'));
55 }
56
57 }