mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Deprecate auto_detect_line_endings
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
This commit is contained in:
parent
bed7139375
commit
232aa34b9f
4 changed files with 15 additions and 2 deletions
|
@ -392,6 +392,9 @@ PHP 8.1 UPGRADE NOTES
|
||||||
instead (for locale-independent parsing) or IntlDateFormatter::parse() (for
|
instead (for locale-independent parsing) or IntlDateFormatter::parse() (for
|
||||||
locale-dependent parsing).
|
locale-dependent parsing).
|
||||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
|
||||||
|
. The auto_detect_line_endings ini setting has been deprecated. If necessary,
|
||||||
|
handle "\r" line breaks manually instead.
|
||||||
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
|
||||||
. The FILE_BINARY and FILE_TEXT constants are deprecated. They already had
|
. The FILE_BINARY and FILE_TEXT constants are deprecated. They already had
|
||||||
no effect previously.
|
no effect previously.
|
||||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
|
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
|
||||||
|
|
|
@ -153,11 +153,19 @@ static void file_globals_dtor(php_file_globals *file_globals_p)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PHP_INI_MH(OnUpdateAutoDetectLineEndings)
|
||||||
|
{
|
||||||
|
if (zend_ini_parse_bool(new_value)) {
|
||||||
|
zend_error(E_DEPRECATED, "auto_detect_line_endings is deprecated");
|
||||||
|
}
|
||||||
|
return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
|
||||||
|
}
|
||||||
|
|
||||||
PHP_INI_BEGIN()
|
PHP_INI_BEGIN()
|
||||||
STD_PHP_INI_ENTRY("user_agent", NULL, PHP_INI_ALL, OnUpdateString, user_agent, php_file_globals, file_globals)
|
STD_PHP_INI_ENTRY("user_agent", NULL, PHP_INI_ALL, OnUpdateString, user_agent, php_file_globals, file_globals)
|
||||||
STD_PHP_INI_ENTRY("from", NULL, PHP_INI_ALL, OnUpdateString, from_address, php_file_globals, file_globals)
|
STD_PHP_INI_ENTRY("from", NULL, PHP_INI_ALL, OnUpdateString, from_address, php_file_globals, file_globals)
|
||||||
STD_PHP_INI_ENTRY("default_socket_timeout", "60", PHP_INI_ALL, OnUpdateLong, default_socket_timeout, php_file_globals, file_globals)
|
STD_PHP_INI_ENTRY("default_socket_timeout", "60", PHP_INI_ALL, OnUpdateLong, default_socket_timeout, php_file_globals, file_globals)
|
||||||
STD_PHP_INI_BOOLEAN("auto_detect_line_endings", "0", PHP_INI_ALL, OnUpdateBool, auto_detect_line_endings, php_file_globals, file_globals)
|
STD_PHP_INI_BOOLEAN("auto_detect_line_endings", "0", PHP_INI_ALL, OnUpdateAutoDetectLineEndings, auto_detect_line_endings, php_file_globals, file_globals)
|
||||||
PHP_INI_END()
|
PHP_INI_END()
|
||||||
|
|
||||||
PHP_MINIT_FUNCTION(file)
|
PHP_MINIT_FUNCTION(file)
|
||||||
|
|
|
@ -16,6 +16,7 @@ var_dump(fgets(STDIN));
|
||||||
echo "Done\n";
|
echo "Done\n";
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
Deprecated: auto_detect_line_endings is deprecated in Unknown on line 0
|
||||||
string(1) "1"
|
string(1) "1"
|
||||||
string(8) "fooBar1
"
|
string(8) "fooBar1
"
|
||||||
string(8) "fooBar2
"
|
string(8) "fooBar2
"
|
||||||
|
|
|
@ -16,7 +16,8 @@ var_dump(fgets($stdin));
|
||||||
|
|
||||||
echo "Done\n";
|
echo "Done\n";
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
|
Deprecated: auto_detect_line_endings is deprecated in %s on line %d
|
||||||
string(2) "on"
|
string(2) "on"
|
||||||
string(8) "fooBar1
"
|
string(8) "fooBar1
"
|
||||||
string(8) "fooBar2
"
|
string(8) "fooBar2
"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue