aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-rpc/src/lib.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-20 08:13:12 +0900
committernsfisis <nsfisis@gmail.com>2026-07-20 08:13:12 +0900
commit087865ef50283350a3cc74a5363ba44fa7dbe5c5 (patch)
treeb27ded5001c46feb587839771347389f609a7c57 /crates/shirabe-php-rpc/src/lib.rs
parenta9dc11a1a0d8d442ab85b3eeb8791f2a8069d528 (diff)
downloadphp-shirabe-087865ef50283350a3cc74a5363ba44fa7dbe5c5.tar.gz
php-shirabe-087865ef50283350a3cc74a5363ba44fa7dbe5c5.tar.zst
php-shirabe-087865ef50283350a3cc74a5363ba44fa7dbe5c5.zip
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.
Diffstat (limited to 'crates/shirabe-php-rpc/src/lib.rs')
-rw-r--r--crates/shirabe-php-rpc/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/shirabe-php-rpc/src/lib.rs b/crates/shirabe-php-rpc/src/lib.rs
index d5d1dafa..9ba02629 100644
--- a/crates/shirabe-php-rpc/src/lib.rs
+++ b/crates/shirabe-php-rpc/src/lib.rs
@@ -58,6 +58,14 @@ pub fn get_extension_info(name: &str) -> String {
}
}
+/// PHP `phpinfo($what)` output, captured via `ob_start()`/`ob_get_clean()`.
+pub fn get_phpinfo(what: i64) -> String {
+ match call("phpinfo", &what.to_string()) {
+ PhpMixed::String(s) => s,
+ other => panic!("PHP RPC: `phpinfo` did not return a string: {other:?}"),
+ }
+}
+
/// PHP `phpversion($extension)`.
pub fn phpversion(extension: &str) -> Option<String> {
match call("phpversion", extension) {