flux/application/Bootstrap.php

41 lines
1.0 KiB
PHP

<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initConfig()
{
$config = new Zend_Config($this->getOptions());
Zend_Registry::set('config', $config);
return $config;
}
protected function _initDb()
{
$c = Zend_Registry::get('config');
try {
$db = Zend_Db::factory($c->profil->db->metier);
} catch ( Exception $e ) {
echo "Database !\n";
exit;
}
/**
* Set the default adapter to use with all model
*/
Zend_Db_Table::setDefaultAdapter($db);
}
protected function _initCache()
{
/*if ( APPLICATION_ENV!='development' ) {
//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);
}*/
}
}