From 087865ef50283350a3cc74a5363ba44fa7dbe5c5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 20 Jul 2026 08:13:12 +0900 Subject: feat(php-rpc): implement phpinfo() capture over RPC DiagnoseCommand::check_platform needed phpinfo() output but shirabe-php-shim's ob_start()/phpinfo()/ob_get_clean() are unmodeled todo!()s. Add a phpinfo dispatch entry to the PHP worker (capturing output the same way extension_info already does) and a get_phpinfo() wrapper, then switch check_platform to call it directly. This unblocks the phpinfo-related panic in diagnose; the ignored tests now hit a separate RefCell double-borrow bug in check_http, so their ignore reasons are updated to point at that instead. --- .../shirabe/tests/command/diagnose_command_test.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/shirabe/tests/command') diff --git a/crates/shirabe/tests/command/diagnose_command_test.rs b/crates/shirabe/tests/command/diagnose_command_test.rs index 95c713ff..521cea84 100644 --- a/crates/shirabe/tests/command/diagnose_command_test.rs +++ b/crates/shirabe/tests/command/diagnose_command_test.rs @@ -7,11 +7,11 @@ use shirabe_php_shim::PhpMixed; #[test] #[serial] -#[ignore = "DiagnoseCommand::check_platform captures phpinfo() via ob_start()/ob_get_clean(), \ - which are todo!() in shirabe-php-shim (PHP output buffering and runtime introspection \ - are unmodeled), so the command panics before producing output; beyond that, diagnose \ - checks live http/https connectivity to packagist and the github.com rate limit, so the \ - test also requires real network access (as the PHP original does)"] +#[ignore = "DiagnoseCommand::check_http passes &config.borrow() into a call chain that reaches \ + CurlDownloader::download, which then does self.config.borrow_mut() on the same \ + Config RefCell, panicking with 'RefCell already borrowed'; beyond that, diagnose checks \ + live http/https connectivity to packagist and the github.com rate limit, so the test \ + also requires real network access (as the PHP original does)"] fn test_cmd_fail() { let tear_down = init_temp_composer( Some(&serde_json::json!({ "name": "foo/bar", "description": "test pkg" })), @@ -51,11 +51,11 @@ Checking github.com rate limit: " #[test] #[serial] -#[ignore = "DiagnoseCommand::check_platform captures phpinfo() via ob_start()/ob_get_clean(), \ - which are todo!() in shirabe-php-shim (PHP output buffering and runtime introspection \ - are unmodeled), so the command panics before producing output; beyond that, diagnose \ - checks live http/https connectivity to packagist and the github.com rate limit, so the \ - test also requires real network access (as the PHP original does)"] +#[ignore = "DiagnoseCommand::check_http passes &config.borrow() into a call chain that reaches \ + CurlDownloader::download, which then does self.config.borrow_mut() on the same \ + Config RefCell, panicking with 'RefCell already borrowed'; beyond that, diagnose checks \ + live http/https connectivity to packagist and the github.com rate limit, so the test \ + also requires real network access (as the PHP original does)"] fn test_cmd_success() { let tear_down = init_temp_composer( Some(&serde_json::json!({ -- cgit v1.3.1