Listing 1810
Submitted by kev, 1 December 2008
error_reporting(E_ALL); /** * * @File - index.php * * @Use - Boot strapping Zend Framework * */ define('ZFW_VERSION','1.6.1'); define('ZFW_PREFIX','/usr/share/php/ZendFramework'); define('ZFW_ALT', '/usr/local/lib/php/'); define('APP_PATH', realpath(dirname(__FILE__))); $paths = array( APP_PATH, ZFW_ALT, APP_PATH . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'models', APP_PATH . DIRECTORY_SEPARATOR . 'library', ZFW_PREFIX . DIRECTORY_SEPARATOR . 'ZendFramework-'. ZFW_VERSION . DIRECTORY_SEPARATOR. 'library', get_include_path() ); /*** set the include path from above ***/ set_include_path(implode(PATH_SEPARATOR, $paths)); /*** include the bootstrap ***/ require_once('Zend/Loader.php'); /*** load up zend ***/ Zend_Loader::registerAutoload(); /*** load up the config ***/ $config = new Zend_Config_Ini( APP_PATH .DIRECTORY_SEPARATOR . 'application/config/fes.ini', 'kevinwa' ); $registry->config = $config; // echo $registry->config->database->params->host; // echo $registry->config->database->params->dbname; /*** configure and fire up layouts ***/ $l_config = new Zend_Config_Ini(APP_PATH.'/application/config/layout.ini', 'layout'); $layout = Zend_Layout::startMvc($l_config); /*** load up pear db ***/ $db = DB::connect("pgsql://bruce:snurgs@localhost/my_db"); Zend_Registry::set('db', $db); /*** load up the front controller ***/ $front = Zend_Controller_Front::getInstance(); /*** add the modules path ***/ // $front->addModuleDirectory(APP_PATH . DIRECTORY_SEPARATOR . 'application/modules' . $module); $front->addModuleDirectory(APP_PATH . DIRECTORY_SEPARATOR . 'application/modules'); /* $front->addControllerDirectory(APP_PATH . DIRECTORY_SEPARATOR . 'library/Fes/Controller') ->setRouter(new Zend_Controller_Router_Rewrite()) ->registerPlugin(new Fes_Controller_Plugin_ModelLoader()); */ /*** turn on exceptions ***/ $front->throwExceptions(true); /*** aways use the default controller on error/exception ***/ $front->setParam('useDefaultControllerAlways', true); /*** and dispatch it ***/ $front->dispatch();
