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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| <?php
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 1);
date_default_timezone_set('Europe/Paris');
// mise en place des r�pertoires et chargement des classes
set_include_path('.'
. PATH_SEPARATOR . './library'
. PATH_SEPARATOR . './application/models/'
. PATH_SEPARATOR . get_include_path());
require_once "library/Zend/Loader/Autoloader.php";
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);
// Chargement de la configuration
$config = new Zend_Config_Ini('./application/config.ini', 'general');
$registry = Zend_Registry::getInstance();
$registry->set('config', $config);
// Mise en place de la BDD
$db = Zend_Db::factory($config->db);
Zend_Db_Table::setDefaultAdapter($db);
//$view = new Acti_View_Smarty($this->config);
$view = new Acti_View_Smarty();
// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('./application/controllers');
Zend_Layout::startMvc(array('layoutPath'=>'./application/layouts'));
/*
;exemple de configuration smarty
;smarty.compile
smarty.compile.force = false
smarty.compile.path = ./system/build/smarty
;smarty.cache
smarty.cache.enabled = false
smarty.cache.path = ./system/cache
smarty.cache.lifetime = 3600
*/
$view->setScriptPath('./application/views/scripts');
$viewhelper = new Zend_Controller_Action_Helper_ViewRenderer($view);
$viewhelper->setViewSuffix('tpl');
$viewhelper->setViewScriptPathSpec(':module/:controller/:action.:suffix');
Zend_Controller_Action_HelperBroker::addHelper($viewhelper);
// run!
$frontController->dispatch(); |
Partager