XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift.php
Go to the documentation of this file.
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 
18 abstract class Swift
19 {
20 
22  const VERSION = '4.0.6';
23 
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 
52  public static function registerAutoload()
53  {
54  spl_autoload_register(array('Swift', 'autoload'));
55  }
56 
57 }