aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Log.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-05 16:54:16 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-05 16:54:16 +0100
commit51a71ec4b9d62528054be8faee1576a8fd6d37f6 (patch)
treef92299dd5314aef43e9e69e8fde317b9b7790213 /lib/Minz/Log.php
parent7584364a4c2b407e97909e94ba274da62620abea (diff)
New configuration system (not working yet)
- Use only Minz_Configuration - register() method to load a new configuration file - get() to get a configuration - new exceptions related to configuration - fix a list configuration calls to have FRSS working Current problems to resolve: - How to handle configuration param verifications (i.e. check auth_type is a value from none, http_auth, persona or form) - We must use $conf = Minz_Configuration::get('system'); $general_conf = $conf->general; to access global system configuration which is quite annoying. How to change that? See https://github.com/FreshRSS/FreshRSS/issues/730
Diffstat (limited to 'lib/Minz/Log.php')
-rw-r--r--lib/Minz/Log.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php
index d19edc1dc..2063efe7e 100644
--- a/lib/Minz/Log.php
+++ b/lib/Minz/Log.php
@@ -31,10 +31,15 @@ class Minz_Log {
* @param $file_name fichier de log
*/
public static function record ($information, $level, $file_name = null) {
- $env = Minz_Configuration::environment ();
+ try {
+ $conf = Minz_Configuration::get('system');
+ $env = $conf->general['environment'];
+ } catch (Minz_ConfigurationException $e) {
+ $env = 'production';
+ }
- if (! ($env === Minz_Configuration::SILENT
- || ($env === Minz_Configuration::PRODUCTION
+ if (! ($env === 'silent'
+ || ($env === 'production'
&& ($level >= Minz_Log::NOTICE)))) {
if ($file_name === null) {
$file_name = join_path(USERS_PATH, Minz_Session::param('currentUser', '_'), 'log.txt');