/** * Registers the Twig autoloader. */ public function registerTwigAutoloader() { if (!class_exists('\\Twig_Autoloader', false)) { require_once craft()->path->getLibPath() . 'Twig/Autoloader.php'; Craft::registerAutoloader(array(new \Twig_Autoloader(), 'autoload')); } }
/** * Registers the SimplePie autoloader. * * @access private */ private function _registerSimplePieAutoloader() { if (!class_exists('\\SimplePie_Autoloader', false)) { require_once craft()->path->getLibPath() . 'SimplePie/autoloader.php'; Craft::registerAutoloader(array(new \SimplePie_Autoloader(), 'autoload')); // Did it work? if (!class_exists('SimplePie')) { throw new Exception(Craft::t('The SimplePie autoloader was not registered properly.')); } } }