diff --git a/system/src/Grav/Common/Debugger.php b/system/src/Grav/Common/Debugger.php index ee32ead766..3ffbd50b0b 100644 --- a/system/src/Grav/Common/Debugger.php +++ b/system/src/Grav/Common/Debugger.php @@ -28,7 +28,6 @@ public function init() /** @var Config $config */ $config = $grav['config']; - $mode = $config->get('system.debugger.mode'); TracyDebugger::$logDirectory = $config->get('system.debugger.log.enabled') ? LOG_DIR : null; TracyDebugger::$maxDepth = $config->get('system.debugger.max_depth'); @@ -38,19 +37,20 @@ public function init() TracyDebugger::$strictMode = true; } + $mode = $config->get('system.debugger.mode'); + if (function_exists('ini_set')) { - ini_set('display_errors', true); + ini_set('display_errors', !($mode === 'production')); } - if ($mode == strtolower('detect')) { + if ($mode === 'detect') { TracyDebugger::$productionMode = self::DETECT; - } elseif ($mode == strtolower('production')) { + } elseif ($mode === 'production') { TracyDebugger::$productionMode = self::PRODUCTION; } else { TracyDebugger::$productionMode = self::DEVELOPMENT; } - } }