enrichissement/application/Bootstrap.php

64 lines
1.8 KiB
PHP
Raw Permalink Normal View History

2012-01-13 14:35:11 +01:00
<?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(' - ');
2012-01-15 18:43:37 +01:00
$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')
2012-01-19 16:25:47 +01:00
->appendFile('/scripts/jquery-ui.js', 'text/javascript')
->appendFile('/scripts/enrichissement.js', 'text/javascript');
2012-01-15 18:43:37 +01:00
$view->headTitle()->setSeparator(' - ');
2012-01-13 14:35:11 +01:00
$view->headTitle('Enrichissement de fichier');
}
2012-01-15 18:43:37 +01:00
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);
}
2012-01-13 14:35:11 +01:00
//Initialisation global des paramètres de log
protected function _initLogging()
{
}
2012-04-06 11:08:13 +02:00
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
}
2012-01-13 14:35:11 +01:00
}