From 41b2b1c3fc1a93b88d82378db64c72ae781cca52 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Thu, 17 Oct 2024 09:59:46 +0100 Subject: [PATCH] chore: allow debug mode freedom of configuration --- framework/core/src/Foundation/Site.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/framework/core/src/Foundation/Site.php b/framework/core/src/Foundation/Site.php index ea862fe8ad..2d04780148 100644 --- a/framework/core/src/Foundation/Site.php +++ b/framework/core/src/Foundation/Site.php @@ -31,11 +31,13 @@ public static function fromPaths(array $paths): SiteInterface $config = static::loadConfig($paths->base); - if (function_exists('error_reporting')) { - error_reporting($config->inDebugMode() ? E_ALL : E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); - } + if (! $config->inDebugMode()) { + ini_set('display_errors', 0); - ini_set('display_errors', $config->inDebugMode() ? 1 : 0); + if (function_exists('error_reporting')) { + error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); + } + } return ( new InstalledSite($paths, $config)