From 91e7102d02cfcda0bf1b82ae1b3fb30900495360 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 6 Aug 2026 20:38:19 +0900 Subject: fix(platform-repository): report the icu and imagick libraries PlatformRepository probes ResourceBundle, IntlChar and Imagick to derive lib-icu-cldr, lib-icu-unicode and lib-imagick-imagemagick. Those probes ran against the shim's hard-coded class_exists allowlist, which never names them, so the packages were silently missing: on a machine with intl, `show --platform` listed fewer libraries than upstream Composer does. The runtime seam now asks the real PHP: hasClass over RPC, and construct / invoke through the worker for the three classes PlatformRepository reaches. A live PHP object has no PhpMixed counterpart, so the seam answers with the entries the caller reads off it. The seam's own callers read those entries instead of returning null and the empty string. Two addLibrary calls also had replaces and provides swapped, dropping `lib-libxslt replaces lib-xsl` and `lib-zip-libzip replaces lib-zip`. `show --platform` now matches upstream Composer byte for byte, and all 59 provideLibraryTestCases datasets pass. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-php-shim/src/var.rs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'crates/shirabe-php-shim/src') diff --git a/crates/shirabe-php-shim/src/var.rs b/crates/shirabe-php-shim/src/var.rs index 4b0ed2f5..dfbd2f03 100644 --- a/crates/shirabe-php-shim/src/var.rs +++ b/crates/shirabe-php-shim/src/var.rs @@ -249,12 +249,6 @@ pub fn get_debug_type_obj(_value: &T) -> String { std::any::type_name::().to_string() } -pub fn instantiate_class(_class: &str, _args: Vec) -> PhpMixed { - // TODO(php-runtime): instantiating a class by name needs a runtime class registry (reflection), - // which the shim does not provide. - todo!() -} - pub fn php_to_string(value: &PhpMixed) -> String { match value { PhpMixed::Null => String::new(), -- cgit v1.3.1