aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-rpc/php/worker.php
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-26 00:54:21 +0900
committernsfisis <nsfisis@gmail.com>2026-07-26 00:54:21 +0900
commit8e8a3c147aa388c4b0fc021a08b30113eb590727 (patch)
treed48ce77e051538b6746c2b41028b674149b5f464 /crates/shirabe-php-rpc/php/worker.php
parent9bf862774b0bae92967f007f4d49597b73d70bb1 (diff)
downloadphp-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-php-rpc/php/worker.php')
-rw-r--r--crates/shirabe-php-rpc/php/worker.php19
1 files changed, 19 insertions, 0 deletions
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,