From d7f566c29b25d7a78f67b62e7c3048a1befa2f66 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 15 Nov 2023 10:30:23 +0900 Subject: [PATCH 1/4] config: change error_reporting to -1 in production In production in many cases -1 is also appropriate. --- app/Config/Boot/production.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php index 73c7c60afbc7..ae19b2315468 100644 --- a/app/Config/Boot/production.php +++ b/app/Config/Boot/production.php @@ -9,8 +9,8 @@ | | If you set 'display_errors' to '1', CI4's detailed error report will show. */ +error_reporting(-1); ini_set('display_errors', '0'); -error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); /* |-------------------------------------------------------------------------- From 536b1297fe91885cb6679944b410f226fe16a2d3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 15 Nov 2023 10:40:03 +0900 Subject: [PATCH 2/4] docs: add changelog and upgrade --- user_guide_src/source/changelogs/v4.5.0.rst | 3 +++ user_guide_src/source/installation/upgrade_450.rst | 2 ++ 2 files changed, 5 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 31c8b3bd114a..eb9dbefbc58a 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -313,6 +313,9 @@ Changes - **Config:** - ``Config\Feature::$multipleFilters`` has been removed, because now :ref:`multiple-filters` are always enabled. + - The default error level in the production environment + (**app/Config/Boot/production.php**) has been changed to use the same error + level in the development environment. - **RouteCollection:** The HTTP method keys in the protected property ``$routes`` has been fixed from lowercase to uppercase. diff --git a/user_guide_src/source/installation/upgrade_450.rst b/user_guide_src/source/installation/upgrade_450.rst index c81ad21ab1d7..eedf513e9583 100644 --- a/user_guide_src/source/installation/upgrade_450.rst +++ b/user_guide_src/source/installation/upgrade_450.rst @@ -255,6 +255,8 @@ The ``'toolbar'`` in the ``$global['after']`` was removed. Others ^^^^^^ +- app/Config/Boot/production.php + - The default error level to ``error_reporting()`` has been changed to ``-1``. - app/Config/Database.php - The default value of ``charset`` in ``$default`` has been change to ``utf8mb4``. - The default value of ``DBCollat`` in ``$default`` has been change to ``utf8mb4_general_ci``. From 02d525ba7e5cdada206de895097a7f152e4e2369 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 15 Nov 2023 15:49:30 +0900 Subject: [PATCH 3/4] docs: add previous error_reporting() as comment --- app/Config/Boot/production.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php index ae19b2315468..aa3091bdc6e0 100644 --- a/app/Config/Boot/production.php +++ b/app/Config/Boot/production.php @@ -10,6 +10,8 @@ | If you set 'display_errors' to '1', CI4's detailed error report will show. */ error_reporting(-1); +// If you want to suppress some types of errors. +// error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); ini_set('display_errors', '0'); /* From 017a5c453fc36723107c2348e7fc1afeb2458e60 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 26 Nov 2023 07:11:40 +0900 Subject: [PATCH 4/4] config: change to "E_ALL & ~E_DEPRECATED" --- app/Config/Boot/production.php | 4 ++-- user_guide_src/source/changelogs/v4.5.0.rst | 4 ++-- user_guide_src/source/installation/upgrade_450.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php index aa3091bdc6e0..1822cf583f82 100644 --- a/app/Config/Boot/production.php +++ b/app/Config/Boot/production.php @@ -9,8 +9,8 @@ | | If you set 'display_errors' to '1', CI4's detailed error report will show. */ -error_reporting(-1); -// If you want to suppress some types of errors. +error_reporting(E_ALL & ~E_DEPRECATED); +// If you want to suppress more types of errors. // error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); ini_set('display_errors', '0'); diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index eb9dbefbc58a..b25bb473b5a3 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -314,8 +314,8 @@ Changes - ``Config\Feature::$multipleFilters`` has been removed, because now :ref:`multiple-filters` are always enabled. - The default error level in the production environment - (**app/Config/Boot/production.php**) has been changed to use the same error - level in the development environment. + (**app/Config/Boot/production.php**) has been changed to ``E_ALL & ~E_DEPRECATED`` + to match the default **php.ini** for production. - **RouteCollection:** The HTTP method keys in the protected property ``$routes`` has been fixed from lowercase to uppercase. diff --git a/user_guide_src/source/installation/upgrade_450.rst b/user_guide_src/source/installation/upgrade_450.rst index eedf513e9583..6b0f88a93ea4 100644 --- a/user_guide_src/source/installation/upgrade_450.rst +++ b/user_guide_src/source/installation/upgrade_450.rst @@ -256,7 +256,7 @@ Others ^^^^^^ - app/Config/Boot/production.php - - The default error level to ``error_reporting()`` has been changed to ``-1``. + - The default error level to ``error_reporting()`` has been changed to ``E_ALL & ~E_DEPRECATED``. - app/Config/Database.php - The default value of ``charset`` in ``$default`` has been change to ``utf8mb4``. - The default value of ``DBCollat`` in ``$default`` has been change to ``utf8mb4_general_ci``.