diff options
| author | 2019-08-22 20:04:26 +0200 | |
|---|---|---|
| committer | 2019-08-22 20:04:26 +0200 | |
| commit | 6cedeeeae51f5e5220d7f786fb801951811bb743 (patch) | |
| tree | e9315d2b0c6df48d2a26d6eeeec49dcf94f6929f /lib/Minz/FrontController.php | |
| parent | 48dda9a803d4c461b6e8b1d2484aaa803ee25462 (diff) | |
Minz: New environment variable to control development mode (#2508)
* New environment variable to control development mode
Suggestion of new enviromnent variable, as discussed
https://github.com/FreshRSS/FreshRSS/pull/2492#issuecomment-523613920
* Update Docker/README.md
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
* Update Docker/README.md
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
* Update Docker/README.md
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
* Declare ENV in Dockerfile
Tested
Diffstat (limited to 'lib/Minz/FrontController.php')
| -rw-r--r-- | lib/Minz/FrontController.php | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php index 066278b7c..e09b022fc 100644 --- a/lib/Minz/FrontController.php +++ b/lib/Minz/FrontController.php @@ -115,21 +115,26 @@ class Minz_FrontController { } 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; + $envType = getenv('FRESHRSS_ENV'); + if ($envType == '') { + $conf = Minz_Configuration::get('system'); + $envType = $conf->environment; + } + switch ($envType) { + case 'development': + error_reporting(E_ALL); + ini_set('display_errors', 'On'); + ini_set('log_errors', 'On'); + break; + case 'silent': + error_reporting(0); + break; + case 'production': + default: + error_reporting(E_ALL); + ini_set('display_errors', 'Off'); + ini_set('log_errors', 'On'); + break; } } } |
