From 425eeea92e00ecbfccfc0b13dbc1cfb41d09069c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 4 Jul 2026 03:19:52 +0900 Subject: fix(php-rpc): wire Runtime::invoke/get_extension_info/extensions Route the platform-repository seams that need real PHP introspection through php-rpc instead of todo!()/hardcoded shims: - Runtime::invoke now handles the two dynamic callables PlatformRepository actually reaches (inet_pton, curl_version) via new php-rpc calls; other callables remain unsupported. - Runtime::get_extension_info uses a new `extension_info` php-rpc call (ReflectionExtension::info() + output buffering) instead of todo!(). - Runtime::get_extensions/get_extension_version now query the real PHP process (get_loaded_extensions, phpversion) instead of the shirabe-php-shim's hardcoded "standard CLI environment" model, so platform requirement checks see the extensions actually installed. Co-Authored-By: Claude Sonnet 5 --- crates/shirabe-php-rpc/php/worker.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/shirabe-php-rpc/php/worker.php') diff --git a/crates/shirabe-php-rpc/php/worker.php b/crates/shirabe-php-rpc/php/worker.php index 58ba973..cb2bf48 100644 --- a/crates/shirabe-php-rpc/php/worker.php +++ b/crates/shirabe-php-rpc/php/worker.php @@ -9,6 +9,19 @@ if ($client === false) { $dispatch = [ 'defined' => static fn($name) => defined($name), 'constant' => static fn($name) => defined($name) ? constant($name) : null, + 'inet_pton' => static fn($arg) => @inet_pton($arg), + 'curl_version' => static fn($arg) => function_exists('curl_version') ? (curl_version()['version'] ?? null) : null, + 'phpversion' => static fn($name) => phpversion($name), + 'get_loaded_extensions' => static fn($arg) => implode(',', get_loaded_extensions()), + 'extension_info' => static function ($name) { + if (!extension_loaded($name)) { + return ''; + } + $re = new ReflectionExtension($name); + ob_start(); + $re->info(); + return (string) ob_get_clean(); + }, ]; $read_exact = static function ($conn, int $len): ?string { $buf = ''; -- cgit v1.3.1