aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/diagnose_command.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/src/command/diagnose_command.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/src/command/diagnose_command.rs')
-rw-r--r--crates/shirabe/src/command/diagnose_command.rs22
1 files changed, 8 insertions, 14 deletions
diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs
index d726efd4..13fe8294 100644
--- a/crates/shirabe/src/command/diagnose_command.rs
+++ b/crates/shirabe/src/command/diagnose_command.rs
@@ -44,8 +44,8 @@ use shirabe_php_shim::{
PHP_BINARY, PHP_EOL, PHP_VERSION, PHP_VERSION_ID, PHP_WINDOWS_VERSION_BUILD, PhpMixed, defined,
disk_free_space, extension_loaded, file_exists, filter_var_boolean, function_exists,
get_class_err, hash, implode, ini_get, ioncube_loader_iversion, ioncube_loader_version,
- is_array, is_string, ob_get_clean, ob_start, php_regex, phpinfo, rtrim, str_contains,
- str_replace, str_starts_with, strpos, strstr, strtolower, trim, version_compare,
+ is_array, is_string, php_regex, rtrim, str_contains, str_replace, str_starts_with, strpos,
+ strstr, strtolower, trim, version_compare,
};
#[derive(Debug)]
@@ -1170,19 +1170,13 @@ impl DiagnoseCommand {
warnings.insert("zlib".to_string(), PhpMixed::Bool(true));
}
- ob_start();
- phpinfo(INFO_GENERAL);
- let phpinfo_str = ob_get_clean();
+ let phpinfo_str = shirabe_php_rpc::get_phpinfo(INFO_GENERAL);
let mut phpinfo_match: IndexMap<CaptureKey, String> = IndexMap::new();
- if phpinfo_str.is_some()
- && Preg::is_match3(
- php_regex!(
- "{Configure Command(?: *</td><td class=\"v\">| *=> *)(.*?)(?:</td>|$)}m"
- ),
- phpinfo_str.as_ref().unwrap(),
- Some(&mut phpinfo_match),
- )
- {
+ if Preg::is_match3(
+ php_regex!("{Configure Command(?: *</td><td class=\"v\">| *=> *)(.*?)(?:</td>|$)}m"),
+ &phpinfo_str,
+ Some(&mut phpinfo_match),
+ ) {
let configure = phpinfo_match
.get(&CaptureKey::ByIndex(1))
.cloned()