diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-26 00:54:21 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-26 00:54:21 +0900 |
| commit | 8e8a3c147aa388c4b0fc021a08b30113eb590727 (patch) | |
| tree | d48ce77e051538b6746c2b41028b674149b5f464 /crates/shirabe/src/command | |
| parent | 9bf862774b0bae92967f007f4d49597b73d70bb1 (diff) | |
| download | php-shirabe-8e8a3c147aa388c4b0fc021a08b30113eb590727.tar.gz php-shirabe-8e8a3c147aa388c4b0fc021a08b30113eb590727.tar.zst php-shirabe-8e8a3c147aa388c4b0fc021a08b30113eb590727.zip | |
feat(diagnose-command): report the real curl version
The line was a "TODO: curl_version()" placeholder. Extend the diagnose
payload with curl_version() and the CURL_* constants getCurlVersion()
consults, so the libz/brotli/zstd/ssl/HTTP details come from the PHP
runtime instead of being guessed. curl_version() is only reachable while
the extension is loaded, mirroring the ioncube_loader_* entries.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command')
| -rw-r--r-- | crates/shirabe/src/command/diagnose_command.rs | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs index 178b4e23..3f69722a 100644 --- a/crates/shirabe/src/command/diagnose_command.rs +++ b/crates/shirabe/src/command/diagnose_command.rs @@ -1052,9 +1052,51 @@ impl DiagnoseCommand { return "<error>disabled via disable_functions, using php streams fallback, which reduces performance</error>".to_string(); } - // TODO(phase-d): Shirabe does not use cURL, we will consider what should be shown here - // later. - return "TODO: curl_version()".to_string(); + let version = shirabe_php_rpc::get_diagnostics() + .curl + .as_ref() + .expect("the diagnose payload carries curl details while the extension is loaded"); + let libz_version = version + .libz_version + .as_deref() + .filter(|v| !v.is_empty()) + .unwrap_or("missing"); + let brotli_version = version + .brotli_version + .as_deref() + .filter(|v| !v.is_empty()) + .unwrap_or("missing"); + let ssl_version = version + .ssl_version + .as_deref() + .filter(|v| !v.is_empty()) + .unwrap_or("missing"); + let has_zstd = match (version.features, version.version_zstd) { + (Some(features), Some(zstd)) => features & zstd != 0, + _ => false, + }; + let mut http_versions = "1.0, 1.1".to_string(); + if let (Some(features), Some(http2)) = (version.features, version.version_http2) + && version.has_http_version_2_0 + && http2 & features != 0 + { + http_versions.push_str(", 2"); + } + if let (Some(features), Some(http3)) = (version.features, version.version_http3) + && features & http3 != 0 + { + http_versions.push_str(", 3"); + } + + return format!( + "<comment>{}</comment> libz <comment>{}</comment> brotli <comment>{}</comment> zstd <comment>{}</comment> ssl <comment>{}</comment> HTTP <comment>{}</comment>", + version.version, + libz_version, + brotli_version, + if has_zstd { "supported" } else { "missing" }, + ssl_version, + http_versions, + ); } "<error>missing, using php streams fallback, which reduces performance</error>".to_string() |
