From ae365645730b95d5b01b0df7382b91668d5fa24e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 7 Aug 2026 20:51:59 +0900 Subject: refactor(platform-repository): fetch the PHP runtime in one RPC call The RuntimeInterface seam asked the worker one question at a time: a round trip per loaded extension, per ReflectionExtension::info() output and per constant, so a single `show --platform` cost 70 to 100 of them. A `platform` dispatch entry now answers all of it as one PHP array, which shirabe-php-rpc decodes into a OnceLock-cached PlatformInfo, the way the diagnose command already works. Composer\Platform\Runtime therefore has no Rust counterpart any more. Its work belongs to the running interpreter, and invoke()/construct() could only be ported as a whitelist that panicked on anything unlisted; it is ported as PHP into the worker instead, and PlatformRepository reads the answers off PlatformInfo. Accessors panic on a name the payload does not carry, so the worker and its consumers cannot drift apart unnoticed. The tests describe the runtime as payload data where they used to mock the seam, with the datasets unchanged. The one loss is the call-count assertion of test_inet_pton_regression: the payload reports the result of `@inet_pton('::')` rather than answering a call. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/platform.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/platform.rs') diff --git a/crates/shirabe/src/platform.rs b/crates/shirabe/src/platform.rs index 6abbb769..11b00e3f 100644 --- a/crates/shirabe/src/platform.rs +++ b/crates/shirabe/src/platform.rs @@ -1,7 +1,9 @@ +//! `Composer\Platform\Runtime` has no Rust counterpart. Its work belongs to the running PHP +//! interpreter, so it is ported as PHP into the RPC worker (`ShirabePlatformRuntime` in +//! `shirabe-php-rpc`), and its callers read the answers off `shirabe_php_rpc::PlatformInfo`. + pub mod hhvm_detector; -pub mod runtime; pub mod version; pub use hhvm_detector::*; -pub use runtime::*; pub use version::*; -- cgit v1.3.1