49 lines
1.4 KiB
PHP
49 lines
1.4 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('WsEntreprise');
|
|
}
|
|
|
|
//Initialisation global des paramètres de log
|
|
protected function _initLogging()
|
|
{
|
|
require_once 'Zend/Log.php';
|
|
require_once 'Zend/Mail.php';
|
|
/*
|
|
* Suivant l'environnement déterminer les logs disponibles
|
|
* PROD : Fichier (Erreurs, Informations), Mail (Erreurs)
|
|
* REC : Fichier (Erreurs, Informations), Mail (Erreurs)
|
|
* DEV : Fichier (Debug)
|
|
*/
|
|
$fileWriter = new Zend_Log_Writer_Stream('error.log');
|
|
$fileWriter->addFilter(Zend_Log::DEBUG);
|
|
|
|
$mail = new Zend_Mail();
|
|
$mail->setFrom('production@scores-decisions.com')
|
|
->addTo('mricois@scores-decisions.com');
|
|
$mailWriter = new Zend_Log_Writer_Mail($mail);
|
|
$mailWriter->setSubjectPrependText('ERREUR');
|
|
$mailWriter->addFilter(Zend_Log::ERR);
|
|
|
|
$logger = new Zend_Log();
|
|
$logger->addWriter($fileWriter);
|
|
$logger->addWriter($mailWriter);
|
|
|
|
$this->_logger = $logger;
|
|
Zend_Registry::set('log', $logger);
|
|
}
|
|
|
|
}
|
|
|