mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: detailed error report is displayed in production environment
php > ini_set('display_errors', '0'); php > var_dump(ini_get('display_errors')); string(1) "0" php > ini_set('display_errors', 0); php > var_dump(ini_get('display_errors')); string(1) "0" php > ini_set('display_errors', false); php > var_dump(ini_get('display_errors')); string(0) "" php > ini_set('display_errors', null); php > var_dump(ini_get('display_errors')); string(0) "" php > ini_set('display_errors', 'off'); php > var_dump(ini_get('display_errors')); string(3) "off"
This commit is contained in:
parent
407c108fd9
commit
1874e62fd1
@ -7,6 +7,8 @@
|
||||
| In development, we want to show as many errors as possible to help
|
||||
| make sure they don't make it to production. And save us hours of
|
||||
| painful debugging.
|
||||
|
|
||||
| If you set 'display_errors' to '1', CI4's detailed error report will show.
|
||||
*/
|
||||
error_reporting(-1);
|
||||
ini_set('display_errors', '1');
|
||||
|
@ -6,6 +6,8 @@
|
||||
|--------------------------------------------------------------------------
|
||||
| Don't show ANY in production environments. Instead, let the system catch
|
||||
| it and display a generic error message.
|
||||
|
|
||||
| If you set 'display_errors' to '1', CI4's detailed error report will show.
|
||||
*/
|
||||
ini_set('display_errors', '0');
|
||||
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
|
||||
|
@ -129,7 +129,13 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa
|
||||
// Production environments should have a custom exception file.
|
||||
$view = 'production.php';
|
||||
|
||||
if (str_ireplace(['off', 'none', 'no', 'false', 'null'], '', ini_get('display_errors')) !== '') {
|
||||
if (
|
||||
str_ireplace(
|
||||
['off', 'none', 'no', 'false', 'null', '0'],
|
||||
'',
|
||||
ini_get('display_errors')
|
||||
) !== ''
|
||||
) {
|
||||
$view = 'error_exception.php';
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,13 @@ class Exceptions
|
||||
$view = 'production.php';
|
||||
$templatePath = rtrim($templatePath, '\\/ ') . DIRECTORY_SEPARATOR;
|
||||
|
||||
if (str_ireplace(['off', 'none', 'no', 'false', 'null'], '', ini_get('display_errors')) !== '') {
|
||||
if (
|
||||
str_ireplace(
|
||||
['off', 'none', 'no', 'false', 'null', '0'],
|
||||
'',
|
||||
ini_get('display_errors')
|
||||
) !== ''
|
||||
) {
|
||||
$view = 'error_exception.php';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user