From 82c6f6055665ba9b699e6c75b23d3ccc7367fa3e Mon Sep 17 00:00:00 2001 From: pavel Date: Wed, 15 Mar 2017 21:11:57 +0200 Subject: [PATCH] bugfix: logger configuration doesn't take effect in PHP connector #123 --- connectors/php/application/FmApplication.php | 8 ++++---- connectors/php/application/Logger.php | 2 +- connectors/php/config.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/connectors/php/application/FmApplication.php b/connectors/php/application/FmApplication.php index c1a89510..4256a897 100644 --- a/connectors/php/application/FmApplication.php +++ b/connectors/php/application/FmApplication.php @@ -23,6 +23,10 @@ public function getInstance($custom_config = array()) $base_config = require_once(FM_ROOT_PATH . '/config.php'); $configuration = FmHelper::mergeConfigs($base_config, $custom_config); + if (isset($configuration['logger']) && $configuration['logger']['enabled'] == true ) { + $this->logger->enabled = true; + } + if (isset($configuration['plugin']) && !empty($configuration['plugin'])) { $plugin_name = $configuration['plugin']; $plugin_path = FM_ROOT_PATH . "/plugins/{$plugin_name}/"; @@ -36,10 +40,6 @@ public function getInstance($custom_config = array()) $fm = new LocalFilemanager($configuration); } - if (isset($configuration['logger']) && $configuration['logger']['enabled'] == true ) { - $this->logger->enabled = true; - } - if(!auth()) { $fm->error($fm->lang('AUTHORIZATION_REQUIRED')); } diff --git a/connectors/php/application/Logger.php b/connectors/php/application/Logger.php index 7d9e3e59..c05fe266 100644 --- a/connectors/php/application/Logger.php +++ b/connectors/php/application/Logger.php @@ -12,7 +12,7 @@ class Logger { /** * @var boolean */ - public $enabled = true; + public $enabled = false; public function __construct() diff --git a/connectors/php/config.php b/connectors/php/config.php index aab9e5ac..07e9848e 100644 --- a/connectors/php/config.php +++ b/connectors/php/config.php @@ -31,7 +31,7 @@ * Configure Logger class */ "logger" => [ - "enabled" => true, + "enabled" => false, ], /** * General options section