12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
-
-
-
-
- abstract class Swift
- {
-
- static $initialized = false;
- static $initPath;
-
-
- const VERSION = '@SWIFT_VERSION_NUMBER@';
-
-
-
- public static function autoload($class)
- {
-
- if (0 !== strpos($class, 'Swift_'))
- {
- return;
- }
-
- $path = dirname(__FILE__).'/'.str_replace('_', '/', $class).'.php';
-
- if (!file_exists($path))
- {
- return;
- }
-
- if (self::$initPath && !self::$initialized)
- {
- self::$initialized = true;
- require self::$initPath;
- }
-
- require $path;
- }
-
-
-
- public static function registerAutoload($initPath = null)
- {
- self::$initPath = $initPath;
- spl_autoload_register(array('Swift', 'autoload'));
- }
-
- }
|