Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into PHP-5.5

* 'PHP-5.5' of https://git.php.net/repository/php-src:
  Put the new php.ini directives together.
  Move the deprecated functions up to the Deprecated Functionality section so they're more visible.
  Regenerate Zend ini scanner
  Fixed bug #63512 parse_ini_file() with INI_SCANNER_RAW removes quotes from value
This commit is contained in:
Christopher Jones 2012-11-18 14:20:57 -08:00
commit 6da7301b34
6 changed files with 1669 additions and 1639 deletions

View File

@ -56,6 +56,12 @@ PHP X.Y UPGRADE NOTES
- The preg_replace /e modifier is now deprecated. Use
preg_replace_callback instead.
(https://wiki.php.net/rfc/remove_preg_replace_eval_modifier)
- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone()
instead.
- mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() now throw
E_DEPRECATED. Their use was already previously discouraged in the docs,
but that predated the existence of E_DEPRECATED.
========================================
4. Changed Functions
@ -98,14 +104,8 @@ PHP X.Y UPGRADE NOTES
- IntlDateFormatter::setCalendar() and datefmt_set_calendar() now also accept
an IntlCalendar object, in which case its time zone is taken. Passing a
constant is still allowed, and still keeps the time zone.
- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone()
instead.
- IntlDateFormatter::format() and datefmt_format() now also accept an
IntlCalendar object for formatting.
- mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() now throw
E_DEPRECATED. Their use was already previously discouraged in the docs,
but that predated the existence of E_DEPRECATED.
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
zend_logo_guid() have been removed
- set_error_handler(NULL) can now be used to reset the error handler.
@ -231,19 +231,23 @@ PHP X.Y UPGRADE NOTES
- Intl:
- This extension now requires ICU 4.0+.
- Added intl.use_exceptions INI directive, which controls what happens when
global errors are set together with intl.error_level.
========================================
9. New Global Constants
========================================
- mysqli
- mysqli:
- Added MYSQLI_SERVER_PUBLIC_KEY constant to be used with mysqli_options()
========================================
10. Changes to INI File Handling
========================================
- mysqlnd
- Intl:
- Added intl.use_exceptions INI directive, which controls what happens when
global errors are set together with intl.error_level.
- mysqlnd:
- Added mysqlnd.sha256_server_public_key INI PERDIR setting that affects all
APIs which use(are built) for mysqlnd. This allows ext/mysqli to be used
with the new auth protocol, although at coarser level.

File diff suppressed because it is too large Load Diff

View File

@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
SECTION_RAW_CHARS [^\]\n\r]
SINGLE_QUOTED_CHARS [^']
RAW_VALUE_CHARS [^"\n\r;\000]
RAW_VALUE_CHARS [^\n\r;\000]
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
@ -445,33 +445,40 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
return '=';
}
<ST_RAW>["] {
<ST_RAW>{RAW_VALUE_CHARS} { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
char *sc = NULL;
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
switch (*YYCURSOR) {
case '\n':
SCNG(lineno)++;
break;
case '\r':
if (*YYCURSOR != '\n') {
SCNG(lineno)++;
}
goto end_raw_value_chars;
break;
case '"':
yyleng = YYCURSOR - SCNG(yy_text) - 2;
SCNG(yy_text)++;
RETURN_TOKEN(TC_RAW, yytext, yyleng);
case '\\':
if (YYCURSOR < YYLIMIT) {
YYCURSOR++;
case ';':
if (sc == NULL) {
sc = YYCURSOR;
}
/* no break */
default:
YYCURSOR++;
break;
}
}
end_raw_value_chars:
yyleng = YYCURSOR - SCNG(yy_text);
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
/* Eat trailing semicolons */
while (yytext[yyleng - 1] == ';') {
yyleng--;
}
/* Eat leading and trailing double quotes */
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
SCNG(yy_text)++;
yyleng = yyleng - 2;
} else if (sc) {
YYCURSOR = sc;
yyleng = YYCURSOR - SCNG(yy_text);
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}

View File

@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Thu Jun 7 17:55:41 2012 */
/* Generated by re2c 0.13.5 on Fri Nov 16 18:27:25 2012 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {

View File

@ -15,7 +15,7 @@ $ini = parse_ini_string("ini=\r\niniraw", null, INI_SCANNER_RAW);
var_dump($ini['ini']);
--EXPECTF--
string(7) "ini;raw"
string(8) ""ini;raw"
string(4) ""ini"
string(3) "ini"
string(7) "ini"raw"
string(0) ""

View File

@ -0,0 +1,33 @@
--TEST--
Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes from value).
--FILE--
<?php
$array = parse_ini_string('
int = 123
constant = INSTALL_ROOT
quotedString = "string"
a = INSTALL_ROOT "waa"
b = "INSTALL_ROOT"
c = "waa" INSTALL_ROOT
d = INSTALL_ROOT "INSTALL_ROOT"', false, INI_SCANNER_RAW);
var_dump($array);
--EXPECTF--
array(7) {
["int"]=>
string(3) "123"
["constant"]=>
string(12) "INSTALL_ROOT"
["quotedString"]=>
string(6) "string"
["a"]=>
string(18) "INSTALL_ROOT "waa""
["b"]=>
string(12) "INSTALL_ROOT"
["c"]=>
string(18) ""waa" INSTALL_ROOT"
["d"]=>
string(27) "INSTALL_ROOT "INSTALL_ROOT""
}