diff options
| author | 2015-01-15 14:17:00 +0100 | |
|---|---|---|
| committer | 2015-01-15 14:17:00 +0100 | |
| commit | eaf6c2c33e3c058bd6890c9fb30308b13727b19d (patch) | |
| tree | 6a797374b348e5a42ddd5b8dc26079525f9194eb /lib/Minz/FrontController.php | |
| parent | caa274c75b6a7471f09f9c21057749c686e155fb (diff) | |
| parent | 4c143426712f75fa04999f4e8b3c0b6900bf062d (diff) | |
Merge branch 'dev' into beta
Diffstat (limited to 'lib/Minz/FrontController.php')
| -rw-r--r-- | lib/Minz/FrontController.php | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php index e95c56bf3..f9eff3db6 100644 --- a/lib/Minz/FrontController.php +++ b/lib/Minz/FrontController.php @@ -30,14 +30,13 @@ class Minz_FrontController { * Initialise le dispatcher, met à jour la Request */ public function __construct () { - if (LOG_PATH === false) { - $this->killApp ('Path not found: LOG_PATH'); - } - try { - Minz_Configuration::init (); + Minz_Configuration::register('system', + DATA_PATH . '/config.php', + DATA_PATH . '/config.default.php'); + $this->setReporting(); - Minz_Request::init (); + Minz_Request::init(); $url = $this->buildUrl(); $url['params'] = array_merge ( @@ -114,4 +113,23 @@ class Minz_FrontController { } exit ('### Application problem ###<br />'."\n".$txt); } + + private function setReporting() { + $conf = Minz_Configuration::get('system'); + switch($conf->environment) { + case 'production': + error_reporting(E_ALL); + ini_set('display_errors','Off'); + ini_set('log_errors', 'On'); + break; + case 'development': + error_reporting(E_ALL); + ini_set('display_errors','On'); + ini_set('log_errors', 'On'); + break; + case 'silent': + error_reporting(0); + break; + } + } } |
