/** * This method initializes the autoloader stack * Therefore it registers every autoloader, which is given in * config/autoload.config.php. */ public static function initAutoload() { // register tha whole autoload stack spl_autoload_register(array('Moonlake_Autoload_Autoload', 'loadClass'), true); // registers the autoloader loader Moonlake_Autoload_Autoload::registerLoader(new Autoloader_Loader()); // load config include_once 'library/moonlake/config/config.php'; $alcfg = new Moonlake_Config_Config('autoload'); foreach ($alcfg->returnAll() as $loader) { try { $autoloader = new $loader(); } catch (Moonlake_Exception_Autoloader $e) { throw new Moonlake_Exception_Autoloader("Could not register a particular autoloader class. Probably there is an mistake related to '{$e->classname}' in the configuration in 'config/autoload.php'. The loader is expected in the file {$e->classpath}.", $e->classname, $e->classpath); } Moonlake_Autoload_Autoload::registerLoader($autoloader); } }