1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
// mise en place des répertoires et chargement des classes
set_include_path('../application/library:../application/models/');
include "Zend/Loader.php";
Zend_Loader::registerAutoload();
Zend_Session::start();
$config = new Zend_Config_Ini('../application/configuration/configuration.ini');
$db = Zend_Db::factory($config->bdd);
Zend_Db_Table::setDefaultAdapter($db);
// mise en cache de la structure de la base
// D'abord, configurons le cache
$frontendOptions = array('automatic_serialization' => true);
$backendOptions = array('cache_dir'=> $config->cache_db->dossier);
$cache_db = Zend_Cache::factory('Core','File',$frontendOptions,$backendOptions);
// Puis passons le comme objet de cache par défaut
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache_db);
// gestion de la langue
Zend_Registry::set('lang', $lang);
$translate = new Zend_Translate('ini','../application/traduction/'.Zend_Registry::get('lang').'.ini');
//
$router = new Zend_Controller_Router_Rewrite();
// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setRouter($router);
$frontController->addControllerDirectory('../application/site/controllers','default');
$frontController->addControllerDirectory('../application/administration/controllers','administration');
Zend_Layout::startMvc(array('layoutPath'=>'../application/layouts'));
$frontController->dispatch(); |
Partager