Skip to content

Commit b5d5d06

Browse files
committedMay 8, 2021
Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit cc2c810.
1 parent 5fb0375 commit b5d5d06

File tree

12 files changed

+29
-1
lines changed

12 files changed

+29
-1
lines changed
 

‎ext/ftp/tests/bug80901.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Bug #80901 (Info leak in ftp extension)
33
--EXTENSIONS--
44
ftp
55
pcntl
6+
--INI--
7+
log_errors_max_len=0
68
--FILE--
79
<?php
810
$bug80901 = true;

‎ext/oci8/tests/error3.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ if ($cv[0] < 11 || ($cv[0] == 11 && $cv[1] < 2) || ($cv[0] == 11 && $cv[1] == 2
1010
die("skip test works only with Oracle 11.2.0.3 or greater version of Oracle client libraries");
1111
}
1212
?>
13+
--INI--
14+
log_errors_max_len=4096
1315
--FILE--
1416
<?php
1517

‎ext/standard/tests/dir/bug80960.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Fix #80960 (opendir() warning wrong info when failed on Windows)
44
<?php
55
if (PHP_OS_FAMILY !== "Windows") die("skip for Windows only");
66
?>
7+
--INI--
8+
log_errors_max_len=0
79
--FILE--
810
<?php
911
opendir("notexist*");

‎ext/standard/tests/file/parse_ini_file_variation3.phpt

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ error_reporting = E_ALL
3333
display_errors = On
3434
display_startup_errors = Off
3535
log_errors = Off
36+
log_errors_max_len = 1024
3637
ignore_repeated_errors = Off
3738
ignore_repeated_source = Off
3839
report_memleaks = On
@@ -68,7 +69,7 @@ foreach($newdirs as $newdir) {
6869
--EXPECTF--
6970
*** Testing parse_ini_file() : variation ***
7071
New include path is : %sparse_ini_file_variation3.dir1%sparse_ini_file_variation3.dir2%sparse_ini_file_variation3.dir3%S
71-
array(9) {
72+
array(10) {
7273
["error_reporting"]=>
7374
string(5) "32767"
7475
["display_errors"]=>
@@ -77,6 +78,8 @@ array(9) {
7778
string(0) ""
7879
["log_errors"]=>
7980
string(0) ""
81+
["log_errors_max_len"]=>
82+
string(4) "1024"
8083
["ignore_repeated_errors"]=>
8184
string(0) ""
8285
["ignore_repeated_source"]=>

‎ext/standard/tests/strings/006.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--TEST--
22
highlight_file() and output buffer
3+
--INI--
4+
log_errors_max_len=4096
35
--FILE--
46
<?php
57

‎ext/standard/tests/strings/007-win32.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
php_strip_whitespace() and output buffer
33
--SKIPIF--
44
<?php if( substr(PHP_OS, 0, 3) != "WIN") die('skip Windows only test');?>
5+
--INI--
6+
log_errors_max_len=4096
57
--FILE--
68
<?php
79
$file = str_repeat("A", PHP_MAXPATHLEN - strlen(__DIR__ . DIRECTORY_SEPARATOR . __FILE__));

‎ext/standard/tests/strings/007.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
php_strip_whitespace() and output buffer
33
--SKIPIF--
44
<?php if( substr(PHP_OS, 0, 3) == "WIN") die('skip Non windows test');?>
5+
--INI--
6+
log_errors_max_len=4096
57
--FILE--
68
<?php
79
$file = str_repeat("A", PHP_MAXPATHLEN - strlen(__DIR__ . DIRECTORY_SEPARATOR . __FILE__));

‎main/main.c

+1
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ PHP_INI_BEGIN()
662662
STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals)
663663
STD_PHP_INI_BOOLEAN("implicit_flush", "0", PHP_INI_ALL, OnUpdateBool, implicit_flush, php_core_globals, core_globals)
664664
STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals)
665+
STD_PHP_INI_ENTRY("log_errors_max_len", "1024", PHP_INI_ALL, OnUpdateLong, log_errors_max_len, php_core_globals, core_globals)
665666
STD_PHP_INI_BOOLEAN("ignore_repeated_errors", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_errors, php_core_globals, core_globals)
666667
STD_PHP_INI_BOOLEAN("ignore_repeated_source", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_source, php_core_globals, core_globals)
667668
STD_PHP_INI_BOOLEAN("report_memleaks", "1", PHP_INI_ALL, OnUpdateBool, report_memleaks, php_core_globals, core_globals)

‎main/php_globals.h

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ struct _php_core_globals {
6868
zend_uchar display_errors;
6969
bool display_startup_errors;
7070
bool log_errors;
71+
zend_long log_errors_max_len;
7172
bool ignore_repeated_errors;
7273
bool ignore_repeated_source;
7374
bool report_memleaks;

‎php.ini-development

+5
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,11 @@ display_startup_errors = On
519519
; https://php.net/log-errors
520520
log_errors = On
521521

522+
; Set maximum length of log_errors. In error_log information about the source is
523+
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
524+
; https://php.net/log-errors-max-len
525+
log_errors_max_len = 1024
526+
522527
; Do not log repeated messages. Repeated errors must occur in same file on same
523528
; line unless ignore_repeated_source is set true.
524529
; https://php.net/ignore-repeated-errors

‎php.ini-production

+5
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@ display_startup_errors = Off
521521
; https://php.net/log-errors
522522
log_errors = On
523523

524+
; Set maximum length of log_errors. In error_log information about the source is
525+
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
526+
; https://php.net/log-errors-max-len
527+
log_errors_max_len = 1024
528+
524529
; Do not log repeated messages. Repeated errors must occur in same file on same
525530
; line unless ignore_repeated_source is set true.
526531
; https://php.net/ignore-repeated-errors

‎run-tests.php

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ function main(): void
296296
'precision=14',
297297
'serialize_precision=-1',
298298
'memory_limit=128M',
299+
'log_errors_max_len=0',
299300
'opcache.fast_shutdown=0',
300301
'opcache.file_update_protection=0',
301302
'opcache.revalidate_freq=0',

0 commit comments

Comments
 (0)