Skip to content

Commit be3477f

Browse files
authored
ext/intl: Remove icu-io as a dependency (#22891)
This remove the dependency of the ICU IO library in the intl extension.
1 parent 1805822 commit be3477f

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ PHP NEWS
2424
- Intl:
2525
. Fixed grammatical issues in Normalizer invalid form and IntlCalendar time
2626
zone offset error messages. (Weilin Du)
27+
. Removed the dependency on the ICU IO library. (Weilin Du)
2728

2829
- ODBC:
2930
. Fixed bug GH-22668 (Heap buffer over-read when a column value exceeds the

build/php.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,15 +1804,15 @@ dnl
18041804
dnl Common setup macro for ICU.
18051805
dnl
18061806
AC_DEFUN([PHP_SETUP_ICU],[
1807-
PKG_CHECK_MODULES([ICU], [icu-uc >= 57.1 icu-io icu-i18n])
1807+
PKG_CHECK_MODULES([ICU], [icu-uc >= 57.1 icu-i18n])
18081808
18091809
PHP_EVAL_INCLINE([$ICU_CFLAGS])
18101810
PHP_EVAL_LIBLINE([$ICU_LIBS], [$1])
18111811
18121812
ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
18131813
ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
18141814
1815-
AS_IF([$PKG_CONFIG icu-io --atleast-version=60],
1815+
AS_IF([$PKG_CONFIG icu-uc --atleast-version=60],
18161816
[ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"])
18171817
])
18181818

ext/intl/config.w32

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ARG_ENABLE("intl", "Enable internationalization support", "no");
55
if (PHP_INTL != "no") {
66
if (CHECK_LIB("icudt.lib", "intl", PHP_INTL) &&
77
CHECK_LIB("icuin.lib", "intl", PHP_INTL) &&
8-
CHECK_LIB("icuio.lib", "intl", PHP_INTL) &&
98
CHECK_LIB("icuuc.lib", "intl", PHP_INTL) &&
109
CHECK_HEADER("unicode/utf.h", "CFLAGS_INTL")) {
1110
// always build as shared - zend_strtod.c/ICU type conflict

ext/intl/msgformat/msgformat_helpers.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <limits.h>
2222
#include <unicode/msgfmt.h>
2323
#include <unicode/chariter.h>
24-
#include <unicode/ustdio.h>
2524
#include <unicode/timezone.h>
2625
#include <unicode/datefmt.h>
2726
#include <unicode/calendar.h>
@@ -407,9 +406,9 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
407406
continue;
408407
}
409408

410-
UChar temp[16];
411-
const int32_t len = u_sprintf(temp, "%u", (uint32_t)num_index);
412-
key.append(temp, len);
409+
char temp[16];
410+
const int32_t len = slprintf(temp, sizeof(temp), "%u", (uint32_t)num_index);
411+
key.append(UnicodeString(temp, len, US_INV));
413412

414413
storedArgType = (Formattable::Type*)zend_hash_index_find_ptr(types, num_index);
415414
} else { //string; assumed to be in UTF-8

0 commit comments

Comments
 (0)