示例#1
0
 /**
  * Internal autoloader for spl_autoload_register().
  *
  * @param string $class
  */
 public static function autoload($class)
 {
     //Don't interfere with other autoloaders
     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;
 }
示例#2
0
 /**
  * Internal autoloader for spl_autoload_register().
  *
  * @param string $class
  */
 public static function autoload($class)
 {
     // Don't interfere with other autoloaders
     if (0 !== strpos($class, 'Swift_')) {
         return;
     }
     $path = __DIR__ . '/' . str_replace('_', '/', $class) . '.php';
     if (!file_exists($path)) {
         return;
     }
     require $path;
     if (self::$inits && !self::$initialized) {
         self::$initialized = true;
         foreach (self::$inits as $init) {
             call_user_func($init);
         }
     }
 }