From 8e8a3c147aa388c4b0fc021a08b30113eb590727 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 26 Jul 2026 00:54:21 +0900 Subject: 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) --- crates/shirabe-php-rpc/php/worker.php | 19 +++++++++++++++++++ 1 file changed, 19 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 1e5b726d..6c3ab443 100644 --- a/crates/shirabe-php-rpc/php/worker.php +++ b/crates/shirabe-php-rpc/php/worker.php @@ -99,6 +99,24 @@ $dispatch = [ $ini[$setting] = $value === false ? null : $value; } + // curl_version() only exists while the extension is loaded; DiagnoseCommand reads these + // details only after its own extension_loaded('curl') check. + $curl = null; + if (extension_loaded('curl')) { + $version = curl_version(); + $curl = [ + 'version' => (string) ($version['version'] ?? ''), + 'libz_version' => $version['libz_version'] ?? null, + 'brotli_version' => $version['brotli_version'] ?? null, + 'ssl_version' => $version['ssl_version'] ?? null, + 'features' => $version['features'] ?? null, + 'version_zstd' => defined('CURL_VERSION_ZSTD') ? CURL_VERSION_ZSTD : null, + 'version_http2' => defined('CURL_VERSION_HTTP2') ? CURL_VERSION_HTTP2 : null, + 'has_http_version_2_0' => defined('CURL_HTTP_VERSION_2_0'), + 'version_http3' => defined('CURL_VERSION_HTTP3') ? CURL_VERSION_HTTP3 : null, + ]; + } + ob_start(); phpinfo(INFO_GENERAL); $phpinfo = (string) ob_get_clean(); @@ -115,6 +133,7 @@ $dispatch = [ 'ioncube_loader_iversion' => extension_loaded('ionCube Loader') ? ioncube_loader_iversion() : 0, 'ioncube_loader_version' => extension_loaded('ionCube Loader') ? ioncube_loader_version() : '', 'phpinfo_general' => $phpinfo, + 'curl' => $curl, 'extensions' => $extensions, 'functions' => $functions, 'ini' => $ini, -- cgit v1.3.1