pushAutoloader(array($this, 'syj_autoload'), array($namespace, 'Syj_')); } parent::_bootstrap($resource); } public function run() { Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer')->initView(APPLICATION_PATH . '/views/', 'Syj_View'); parent::run(); } static public function syj_autoload($class) { foreach (self::$libns as $namespace) { if (strpos ($class, $namespace) === 0) { include_once ($namespace . ".php"); return; } } if (strpos ($class, "Syj_") === 0) { $segments = explode ('_', $class); if (count($segments) < 2) { return; } if (count($segments) == 2) { $filename = APPLICATION_PATH . '/' . end($segments) . '.php'; if (Zend_Loader::isReadable($filename)) { include_once $filename; } return; } if (count($segments) < 3) { return; } $isinterface = false; if (strtolower(end($segments)) == "interface") { $isinterface = true; array_pop($segments); } $dirpath = implode(DIRECTORY_SEPARATOR, array_map('strtolower', array_slice($segments, 1, -1))); if ($isinterface) { $dirpath = "interface" . DIRECTORY_SEPARATOR . $dirpath; } $filename = APPLICATION_PATH . '/' . ($dirpath ? $dirpath . '/' : '') . end($segments) . '.php'; if (Zend_Loader::isReadable($filename)) { include_once $filename; } } } }