setFallbackAutoloader(true); //$loader->registerNamespace('App_'); // load configuration $config = new Zend_Config_Ini('../application/config.ini', 'general'); $registry = Zend_Registry::getInstance(); $registry->set('config', $config); if ($_SERVER["DOCUMENT_ROOT"]) { $Root = $_SERVER["DOCUMENT_ROOT"]; $Root = rtrim($Root,"/\\"); $registry->set('upload', $Root.'/../data/uploads/'); } // setup application authentication $auth = Zend_Auth::getInstance(); $auth->setStorage(new Zend_Auth_Storage_Session('westdc')); // setup database $db = Zend_Db::factory($config->db); Zend_Db_Table::setDefaultAdapter($db); $registry->set('db',$db); // setup controller $frontController = Zend_Controller_Front::getInstance(); $frontController->throwExceptions(false); //$frontController->setControllerDirectory('../application/controllers'); $frontController->setControllerDirectory(array( 'default' => '../application/default/controllers', 'admin' => '../application/admin/controllers')); $frontController->registerPlugin(new CustomControllerAclManager($auth)); Zend_Layout::startMvc(array('layoutPath'=>'../application/layouts')); $router = new Zend_Controller_Router_Rewrite(); $router->addConfig($config, 'routes'); $frontController->getRouter()->addRoutes($router->getRoutes()); $plugin = new Zend_Controller_Plugin_ErrorHandler(); $plugin->setErrorHandlerModule('default') ->setErrorHandlerController('error') ->setErrorHandlerAction('error'); $frontController->registerPlugin($plugin); $frontController->dispatch();