64 lines
1.8 KiB
PHP
64 lines
1.8 KiB
PHP
<?php
|
|
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|
{
|
|
//Initialisation global des paramètres de vue
|
|
protected function _initViewSettings()
|
|
{
|
|
$this->bootstrap('view');
|
|
$view = $this->getResource('view');
|
|
$view->setEncoding('UTF-8');
|
|
$view->doctype('XHTML1_STRICT');
|
|
$view->headMeta()
|
|
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
|
->appendHttpEquiv('Content-Language', 'fr-FR');
|
|
$view->headTitle()->setSeparator(' - ');
|
|
|
|
$view->headLink()
|
|
->appendStylesheet('/styles/reset.css', 'all')
|
|
->appendStylesheet('/styles/main.css', 'all')
|
|
->appendStylesheet('/jqueryui/jquery-ui.css', 'all');
|
|
|
|
$view->headScript()
|
|
->appendFile('/scripts/jquery.js', 'text/javascript')
|
|
->appendFile('/scripts/jquery-ui.js', 'text/javascript')
|
|
->appendFile('/scripts/enrichissement.js', 'text/javascript');
|
|
|
|
$view->headTitle()->setSeparator(' - ');
|
|
|
|
$view->headTitle('Enrichissement de fichier');
|
|
}
|
|
|
|
protected function _initDb()
|
|
{
|
|
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
|
|
try {
|
|
$db = Zend_Db::factory($dbConfig->db);
|
|
Zend_Db_Table::setDefaultAdapter ($db);
|
|
} catch ( Exception $e ) {
|
|
exit ( $e->getMessage() );
|
|
}
|
|
Zend_Registry::set('db', $db);
|
|
}
|
|
|
|
//Initialisation global des paramètres de log
|
|
protected function _initLogging()
|
|
{
|
|
|
|
}
|
|
|
|
protected function _initCache()
|
|
{
|
|
//MetadataCache pour la base de données
|
|
$frontendOptions = array(
|
|
'lifetime' => 14400,
|
|
'automatic_serialization' => true
|
|
);
|
|
$backendOptions = array();
|
|
$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
|
|
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
|
|
|
//Cache pour les données de la base à stocker
|
|
}
|
|
}
|
|
|