Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
664 changes: 344 additions & 320 deletions docs/bootstrap-inventory.md

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions ext/intl/BuiltinClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* Register intl builtin classes (php-src ext/intl/php_intl.c; issues #5774, #6696, #19549, #6151, #19670).
*
* Locale / IntlDateFormatter / IntlDatePatternGenerator / IntlCalendar / IntlTimeZone /
* NumberFormatter / Normalizer / Collator / MessageFormatter / Transliterator / ResourceBundle /
* IntlBreakIterator / IntlCodePointBreakIterator / IntlChar / UConverter / Spoofchecker / IntlException
* all gate on {@see IntlExtensionPolicy} advertisement (no phantom class_exists; #6366, #6171, #6139,
* #6188, #20035, #20740, #20822).
* NumberFormatter / Normalizer / Collator / MessageFormatter / IntlListFormatter /
* Transliterator / ResourceBundle / IntlBreakIterator / IntlCodePointBreakIterator /
* IntlChar / UConverter / Spoofchecker / IntlException all gate on {@see IntlExtensionPolicy}
* advertisement (no phantom class_exists; #6366, #6171, #6139, #6188, #20035, #20740, #20822, #23229).
*/
final class BuiltinClasses
{
Expand Down Expand Up @@ -69,6 +69,9 @@ public static function register(Context $ctx): void
VmNumberFormatter::registerClass($ctx);
VmCollator::registerClass($ctx);
VmMessageFormatter::registerClass($ctx);
if (IntlExtensionPolicy::advertisesIntlListFormatter()) {
VmIntlListFormatter::registerClass($ctx);
}
VmTransliterator::registerClass($ctx);
VmResourceBundle::registerClass($ctx);
VmBreakIterator::registerClass($ctx);
Expand Down Expand Up @@ -259,6 +262,17 @@ public static function registerMessageFormatter(Context $ctx): void
}
}

/** IntlListFormatter — PHP 8.5+ + host intl (#23229). */
public static function registerIntlListFormatter(Context $ctx): void
{
$before = array_keys($ctx->classes);
VmIntlListFormatter::registerClass($ctx);
self::registerIntlException($ctx);
foreach (array_diff(array_keys($ctx->classes), $before) as $lc) {
$ctx->classes[$lc]->isInternal = true;
}
}

public static function registerTransliterator(Context $ctx): void
{
$before = array_keys($ctx->classes);
Expand Down
11 changes: 11 additions & 0 deletions ext/intl/IntlExtensionPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ public static function advertisesMessageFormatter(): bool
return self::advertisesBuiltins();
}

/**
* IntlListFormatter — PHP 8.5+ + loaded ext/intl (php-src ext/intl/listformatter; #23229).
*
* Withheld when host intl is off or language profile < 8.5 (no phantom class_exists).
*/
public static function advertisesIntlListFormatter(): bool
{
return self::advertisesBuiltins()
&& CompilerVersion::advertisesIntlListFormatter();
}

/**
* Transliterator / transliterator_* — require loaded ext/intl (php-src transliterator; #6139, #19670).
*/
Expand Down
2 changes: 2 additions & 0 deletions ext/intl/IntlSerializeDeny.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* - NumberFormatter — ext/intl/formatter/formatter.stub.php (#23092)
* - Collator — ext/intl/collator/collator.stub.php (#23092)
* - MessageFormatter — ext/intl/msgformat/msgformat.stub.php (#23092)
* - IntlListFormatter — ext/intl/listformatter/listformatter.stub.php (#23229)
* - ResourceBundle — ext/intl/resourcebundle/resourcebundle.stub.php (#23092)
* - IntlCalendar / IntlGregorianCalendar (+ subclasses) — ext/intl/calendar/calendar.stub.php (#23092)
* - Transliterator — ext/intl/transliterator/transliterator.stub.php (#23136)
Expand All @@ -28,6 +29,7 @@ final class IntlSerializeDeny
VmNumberFormatter::CLASS_LC,
VmCollator::CLASS_LC,
VmMessageFormatter::CLASS_LC,
VmIntlListFormatter::CLASS_LC,
VmResourceBundle::CLASS_LC,
VmIntlCalendar::CLASS_LC,
VmIntlCalendar::GREGORIAN_CLASS_LC,
Expand Down
3 changes: 3 additions & 0 deletions ext/intl/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public function init(Runtime $runtime): void
if (IntlExtensionPolicy::advertisesMessageFormatter()) {
BuiltinClasses::registerMessageFormatter($runtime->vmContext);
}
if (IntlExtensionPolicy::advertisesIntlListFormatter()) {
BuiltinClasses::registerIntlListFormatter($runtime->vmContext);
}
if (IntlExtensionPolicy::advertisesTransliterator()) {
BuiltinClasses::registerTransliterator($runtime->vmContext);
}
Expand Down
Loading
Loading