isFile() ) { /** * Nel file che includo deve essere solo presente la modifica * dell'include path */ include_once($file->getPathname()); } } } catch (Exception $e) { /** * Per qualsiasi errore blocco tutto. * Non posso presumere che il sistema faccia tutto quello * che deve correttamente se * gli include path non sono corretti */ die($e->getMessage()); } /** * Questa è l'unica cosa che ho bisogno di includere manualmente * * Tutte le altre verranno incluse automaticamente a necessità */ require_once('Zend/Loader.php'); Zend_Loader::registerAutoload(); Zend_Session::start(); /** * Le configurazioni che carico sono in readOnly */ $iniConfigs = new Zend_Config_Ini(DIR_INI.'zender.ini', null, false); /** * Inserisco queste configurazioni all'interno del registro */ Zender_Registry::set('configs.ini', $iniConfigs); $systemDbConfig = $iniConfigs->main->db->system; $connectionConfig = array( 'host' => $systemDbConfig->host, 'username' => $systemDbConfig->username, 'password' => $systemDbConfig->password, 'dbname' => $systemDbConfig->dbname ); if ( trim($systemDbConfig->dsnprefix) != '' ) { $connectionConfig['dsnprefix'] = $systemDbConfig->dsnprefix; } // create db connection $systemDbConnection = Zend_Db::factory($iniConfigs->main->db->system->driver, $connectionConfig ); // create configs table $configTable = new Zender_Config_Db_Table(array('db' => $systemDbConnection)); // load configs $dbConfigs = new Zender_Config_Db($configTable, false); Zender_Registry::set('connections.dbs.system', $systemDbConnection); Zender_Registry::set('configs.db', $dbConfigs); // when init finish, clean up all he temp variable unset($systemDbConnection); unset($configTable); unset($systemDbConfig); unset($dbConfigs); unset($connectionConfig); unset($iniConfigs); // and then dispatch request $front = Zend_Controller_Front::getInstance(); $front->setControllerDirectory(DIR_APPLICATIONS.'default/controllers', 'default'); //========= Loop: fetch modules list and it to front controller ==========// // fetch all active modules: i need a Zender_Module // this will be something like this: /** $modulesDb = new Zender_Modules_Tables('connections.db.system'); foreach ( $modulesDb->getActiveModules() as $module ) { //$module will be a Zender_Module, child of Zend_Db_Table_Row, so i will can modify something and commit difference $front->addControllerDirectory(DIR_APPLICATION.'$module->path, $module->name); } */ //========= :loop =============/ // First i need to fetch info about what kind of router i will use // i can catch it from ini or db, it isn't so important now // Now i prefer ini because can be difficult to modify db configs if Zender don't work well /** Something like this can be good $routerType = Zender_Registry::get('configs.ini')->main->router->type $router = new {$routerType}(); $front->setRouter($router) */ //========= Loop: fetch all active route (sorted by weight as order is very important =========// // fetch all active route in System Db sorted by weight // and then add them to Router //========= :loop ============/ //Zend_Debug::dump($GLOBALS); // Build time in echo just for testing $time = substr(microtime(true) - $time, 0, 5); echo "Build time: {$time} sec";