$value) { if ($key == 0) { $classname .= $value . '_'; } else { $classname .= $value . '/'; } } $classname = rtrim($classname, '/_'); } $classname = preg_replace('/^NewsletterPro_Swift\//', 'Swift/', $classname); // $path = dirname(__FILE__).'/'.str_replace('_', '/', $class).'.php'; $path = dirname(__FILE__).'/'.$classname.'.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); } } } /** * Configure autoloading using NewsletterPro_Swift Mailer. * * This is designed to play nicely with other autoloaders. * * @param mixed $callable A valid PHP callable that will be called when autoloading the first NewsletterPro_Swift class */ public static function registerAutoload($callable = null) { if (null !== $callable) { self::$inits[] = $callable; } spl_autoload_register(array('NewsletterPro_Swift', 'autoload')); } }