From ef557cbc22d46d09fb495284d177b54ad5f5888a Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Wed, 16 Oct 2024 18:35:06 +0100 Subject: [PATCH 1/5] chore: ignore deprecation errors in prod --- framework/core/src/Foundation/Site.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/core/src/Foundation/Site.php b/framework/core/src/Foundation/Site.php index 3eca6db0ef..323fe7a208 100644 --- a/framework/core/src/Foundation/Site.php +++ b/framework/core/src/Foundation/Site.php @@ -29,8 +29,12 @@ public static function fromPaths(array $paths): SiteInterface ); } + $config = static::loadConfig($paths->base); + + error_reporting($config->inDebugMode() ? E_ALL : E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); + return ( - new InstalledSite($paths, static::loadConfig($paths->base)) + new InstalledSite($paths, $config) )->extendWith(static::loadExtenders($paths->base)); } From cc23330129237cb0013b86c662221fc3de0cb1ea Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Wed, 16 Oct 2024 20:04:11 +0100 Subject: [PATCH 2/5] chore: check if disabled --- framework/core/src/Foundation/Site.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/core/src/Foundation/Site.php b/framework/core/src/Foundation/Site.php index 323fe7a208..a4c398c80c 100644 --- a/framework/core/src/Foundation/Site.php +++ b/framework/core/src/Foundation/Site.php @@ -31,7 +31,9 @@ public static function fromPaths(array $paths): SiteInterface $config = static::loadConfig($paths->base); - error_reporting($config->inDebugMode() ? E_ALL : E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); + if (function_exists('error_reporting')) { + error_reporting($config->inDebugMode() ? E_ALL : E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); + } return ( new InstalledSite($paths, $config) From 296b58eb5990aa9a83d24e4d18e2ed1f1170818b Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Wed, 16 Oct 2024 20:11:14 +0100 Subject: [PATCH 3/5] chore: set display_errors --- framework/core/src/Foundation/Site.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/core/src/Foundation/Site.php b/framework/core/src/Foundation/Site.php index a4c398c80c..ea862fe8ad 100644 --- a/framework/core/src/Foundation/Site.php +++ b/framework/core/src/Foundation/Site.php @@ -35,6 +35,8 @@ public static function fromPaths(array $paths): SiteInterface error_reporting($config->inDebugMode() ? E_ALL : E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); } + ini_set('display_errors', $config->inDebugMode() ? 1 : 0); + return ( new InstalledSite($paths, $config) )->extendWith(static::loadExtenders($paths->base)); From 41b2b1c3fc1a93b88d82378db64c72ae781cca52 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Thu, 17 Oct 2024 09:59:46 +0100 Subject: [PATCH 4/5] 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) From 5a001fb426258515e59f9eec5e70c2707073f93d Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Mon, 21 Oct 2024 18:16:33 +0100 Subject: [PATCH 5/5] chore: always disable display_errors --- framework/core/src/Foundation/Site.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/framework/core/src/Foundation/Site.php b/framework/core/src/Foundation/Site.php index 2d04780148..365af4e212 100644 --- a/framework/core/src/Foundation/Site.php +++ b/framework/core/src/Foundation/Site.php @@ -31,12 +31,10 @@ public static function fromPaths(array $paths): SiteInterface $config = static::loadConfig($paths->base); - if (! $config->inDebugMode()) { - ini_set('display_errors', 0); + ini_set('display_errors', 0); - if (function_exists('error_reporting')) { - error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); - } + if (! $config->inDebugMode() && function_exists('error_reporting')) { + error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); } return (