Skip to content

Commit 3815a77

Browse files
committed
Close GH-16659: Bump ICU requirement to ICU >= 57.1
This requirements bump should rarely affect anybody in practice. All major distros already ship more recent ICU versions, and even for Solaris 11, ICU 57.1 is available via OpenCSW. Note that ICU 57.1 has been released on 2016-03-23[1]. [1] <https://icu.unicode.org/download/57> Closes GH-16688.
1 parent 0db7e53 commit 3815a77

File tree

120 files changed

+16
-7476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+16
-7476
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ PHP NEWS
1616
. Added Dom\Element::$outerHTML. (nielsdos)
1717
. Added Dom\Element::insertAdjacentHTML(). (nielsdos)
1818

19+
- Intl:
20+
. Bumped ICU requirement to ICU >= 57.1. (cmb)
21+
1922
- Output:
2023
. Fixed calculation of aligned buffer size. (cmb)
2124

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ PHP 8.5 UPGRADE NOTES
2929
. It is no longer possible to use "array" and "callable" as class alias names
3030
in class_alias().
3131

32+
- Intl:
33+
. The extension now requires at least ICU 57.1.
34+
3235
- LDAP:
3336
. ldap_get_option() and ldap_set_option() now throw a ValueError when
3437
passing an invalid option.

build/php.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ dnl
17791779
dnl Common setup macro for ICU.
17801780
dnl
17811781
AC_DEFUN([PHP_SETUP_ICU],[
1782-
PKG_CHECK_MODULES([ICU], [icu-uc >= 50.1 icu-io icu-i18n])
1782+
PKG_CHECK_MODULES([ICU], [icu-uc >= 57.1 icu-io icu-i18n])
17831783
17841784
PHP_EVAL_INCLINE([$ICU_CFLAGS])
17851785
PHP_EVAL_LIBLINE([$ICU_LIBS], [$1])

ext/intl/formatter/formatter.stub.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ class NumberFormatter
2727
public const int PATTERN_RULEBASED = UNKNOWN;
2828
/** @cvalue UNUM_IGNORE */
2929
public const int IGNORE = UNKNOWN;
30-
#if U_ICU_VERSION_MAJOR_NUM >= 53
3130
/** @cvalue UNUM_CURRENCY_ACCOUNTING */
3231
public const int CURRENCY_ACCOUNTING = UNKNOWN;
33-
#endif
3432
/** @cvalue UNUM_DEFAULT */
3533
public const int DEFAULT_STYLE = UNKNOWN;
3634

ext/intl/formatter/formatter_arginfo.h

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/normalizer/normalizer.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@
1717

1818
#include <php.h>
1919
#include <unicode/utypes.h>
20-
#if U_ICU_VERSION_MAJOR_NUM < 56
21-
#include <unicode/unorm.h>
22-
23-
#define NORMALIZER_FORM_D UNORM_NFD
24-
#define NORMALIZER_NFD UNORM_NFD
25-
#define NORMALIZER_FORM_KD UNORM_NFKD
26-
#define NORMALIZER_NFKD UNORM_NFKD
27-
#define NORMALIZER_FORM_C UNORM_NFC
28-
#define NORMALIZER_NFC UNORM_NFC
29-
#define NORMALIZER_FORM_KC UNORM_NFKC
30-
#define NORMALIZER_NFKC UNORM_NFKC
31-
#define NORMALIZER_DEFAULT UNORM_DEFAULT
32-
#else
3320
#include <unicode/unorm2.h>
3421

3522
#define NORMALIZER_FORM_D 0x4
@@ -43,6 +30,5 @@
4330
#define NORMALIZER_FORM_KC_CF 0x30
4431
#define NORMALIZER_NFKC_CF NORMALIZER_FORM_KC_CF
4532
#define NORMALIZER_DEFAULT NORMALIZER_FORM_C
46-
#endif
4733

4834
#endif // NORMALIZER_NORMALIZER_H

ext/intl/normalizer/normalizer.stub.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ class Normalizer
2020
public const int FORM_KC = UNKNOWN;
2121
/** @cvalue NORMALIZER_NFKC */
2222
public const int NFKC = UNKNOWN;
23-
#if U_ICU_VERSION_MAJOR_NUM >= 56
2423
/** @cvalue NORMALIZER_FORM_KC_CF */
2524
public const int FORM_KC_CF = UNKNOWN;
2625
/** @cvalue NORMALIZER_NFKC_CF */
2726
public const int NFKC_CF = UNKNOWN;
28-
#endif
2927

3028
/**
3129
* @tentative-return-type
@@ -39,11 +37,9 @@ public static function normalize(string $string, int $form = Normalizer::FORM_C)
3937
*/
4038
public static function isNormalized(string $string, int $form = Normalizer::FORM_C): bool {}
4139

42-
#if U_ICU_VERSION_MAJOR_NUM >= 56
4340
/**
4441
* @tentative-return-type
4542
* @alias normalizer_get_raw_decomposition
4643
*/
4744
public static function getRawDecomposition(string $string, int $form = Normalizer::FORM_C): ?string {}
48-
#endif
4945
}

ext/intl/normalizer/normalizer_arginfo.h

Lines changed: 1 addition & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/normalizer/normalizer_normalize.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,13 @@
1717
#endif
1818

1919
#include "php_intl.h"
20-
#if U_ICU_VERSION_MAJOR_NUM < 56
21-
#include "unicode/unorm.h"
22-
#else
2320
#include <unicode/unorm2.h>
24-
#endif
2521
#include "normalizer.h"
2622
#include "normalizer_class.h"
2723
#include "intl_convert.h"
2824
#include <unicode/utf8.h>
2925

3026

31-
#if U_ICU_VERSION_MAJOR_NUM >= 56
3227
static const UNormalizer2 *intl_get_normalizer(zend_long form, UErrorCode *err)
3328
{/*{{{*/
3429
switch (form)
@@ -74,7 +69,6 @@ static UBool intl_is_normalized(zend_long form, const UChar *uinput, int32_t uin
7469

7570
return unorm2_isNormalized(norm, uinput, uinput_len, err);
7671
}/*}}}*/
77-
#endif
7872

7973
/* {{{ Normalize a string. */
8074
PHP_FUNCTION( normalizer_normalize )
@@ -116,9 +110,7 @@ PHP_FUNCTION( normalizer_normalize )
116110
break;
117111
case NORMALIZER_FORM_C:
118112
case NORMALIZER_FORM_KC:
119-
#if U_ICU_VERSION_MAJOR_NUM >= 56
120113
case NORMALIZER_FORM_KC_CF:
121-
#endif
122114
break;
123115
default:
124116
zend_argument_value_error(2, "must be a a valid normalization form");
@@ -151,11 +143,7 @@ PHP_FUNCTION( normalizer_normalize )
151143
uret_buf = eumalloc( uret_len + 1 );
152144

153145
/* normalize */
154-
#if U_ICU_VERSION_MAJOR_NUM < 56
155-
size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status);
156-
#else
157146
size_needed = intl_normalize(form, uinput, uinput_len, uret_buf, uret_len, &status);
158-
#endif
159147

160148
/* Bail out if an unexpected error occurred.
161149
* (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough).
@@ -179,11 +167,7 @@ PHP_FUNCTION( normalizer_normalize )
179167
status = U_ZERO_ERROR;
180168

181169
/* try normalize again */
182-
#if U_ICU_VERSION_MAJOR_NUM < 56
183-
size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status);
184-
#else
185170
size_needed = intl_normalize(form, uinput, uinput_len, uret_buf, uret_len, &status);
186-
#endif
187171

188172
/* Bail out if an unexpected error occurred. */
189173
if( U_FAILURE(status) ) {
@@ -243,9 +227,7 @@ PHP_FUNCTION( normalizer_is_normalized )
243227
case NORMALIZER_FORM_KD:
244228
case NORMALIZER_FORM_C:
245229
case NORMALIZER_FORM_KC:
246-
#if U_ICU_VERSION_MAJOR_NUM >= 56
247230
case NORMALIZER_FORM_KC_CF:
248-
#endif
249231
break;
250232
default:
251233
zend_argument_value_error(2, "must be a a valid normalization form");
@@ -275,11 +257,7 @@ PHP_FUNCTION( normalizer_is_normalized )
275257

276258

277259
/* test string */
278-
#if U_ICU_VERSION_MAJOR_NUM < 56
279-
uret = unorm_isNormalizedWithOptions( uinput, uinput_len, form, (int32_t) 0 /* options */, &status);
280-
#else
281260
uret = intl_is_normalized(form, uinput, uinput_len, &status);
282-
#endif
283261

284262
efree( uinput );
285263

@@ -298,7 +276,6 @@ PHP_FUNCTION( normalizer_is_normalized )
298276
/* }}} */
299277

300278
/* {{{ Returns the Decomposition_Mapping property for the given UTF-8 encoded code point. */
301-
#if U_ICU_VERSION_MAJOR_NUM >= 56
302279
PHP_FUNCTION( normalizer_get_raw_decomposition )
303280
{
304281
char* input = NULL;
@@ -344,5 +321,4 @@ PHP_FUNCTION( normalizer_get_raw_decomposition )
344321

345322
RETVAL_NEW_STR(intl_convert_utf16_to_utf8(decomposition, decomposition_length, &status));
346323
}
347-
#endif
348324
/* }}} */

ext/intl/php_intl.stub.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,7 @@ function normalizer_normalize(string $string, int $form = Normalizer::FORM_C): s
537537

538538
function normalizer_is_normalized(string $string, int $form = Normalizer::FORM_C): bool {}
539539

540-
#if U_ICU_VERSION_MAJOR_NUM >= 56
541540
function normalizer_get_raw_decomposition(string $string, int $form = Normalizer::FORM_C): ?string {}
542-
#endif
543541

544542
/* resourceboundle */
545543

@@ -605,11 +603,9 @@ function intltz_get_tz_data_version(): string|false {}
605603

606604
function intltz_get_unknown(): IntlTimeZone {}
607605

608-
#if U_ICU_VERSION_MAJOR_NUM >= 52
609606
function intltz_get_windows_id(string $timezoneId): string|false {}
610607

611608
function intltz_get_id_for_windows_id(string $timezoneId, ?string $region = null): string|false {}
612-
#endif
613609

614610
function intltz_has_same_rules(IntlTimeZone $timezone, IntlTimeZone $other): bool {}
615611

ext/intl/php_intl_arginfo.h

Lines changed: 2 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/tests/breakiter_getLocale_basic.phpt

Lines changed: 0 additions & 19 deletions
This file was deleted.

ext/intl/tests/breakiter_getLocale_basic2.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ IntlBreakIterator::getLocale(): basic test
33
--EXTENSIONS--
44
intl
55
--SKIPIF--
6-
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
76
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
87
--FILE--
98
<?php

0 commit comments

Comments
 (0)