From daa1acf091627f4f1af63ad44eee988048fa4136 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 11 Aug 2026 23:52:28 +0900 Subject: chore(php-shim): drop the HHVM_VERSION constant The constant was None and defined("HHVM_VERSION") reports it undefined, so every branch guarded by it was dead: shirabe is a Rust binary and never runs on HHVM. HhvmDetector keeps probing for an `hhvm` binary in PATH, which is what actually produces the hhvm platform package. Two of the dropped branches ask about the PHP runtime that consumes the result rather than about shirabe itself -- the class loader's Hack file lookup and the class map parser's enum scanning -- so both get a TODO(php-runtime) marker. --- crates/shirabe/src/util/stream_context_factory.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'crates/shirabe/src/util/stream_context_factory.rs') diff --git a/crates/shirabe/src/util/stream_context_factory.rs b/crates/shirabe/src/util/stream_context_factory.rs index 6a63537d..7706a5cd 100644 --- a/crates/shirabe/src/util/stream_context_factory.rs +++ b/crates/shirabe/src/util/stream_context_factory.rs @@ -9,9 +9,8 @@ use crate::util::http::ProxyManager; use indexmap::IndexMap; use shirabe_ca_bundle::CaBundle; use shirabe_php_shim::{ - HHVM_VERSION, PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PhpMixed, - array_replace_recursive, extension_loaded, function_exists, php_uname, stream_context_create, - stripos, uasort, + PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PhpMixed, array_replace_recursive, + extension_loaded, function_exists, php_uname, stream_context_create, stripos, uasort, }; pub struct StreamContextFactory; @@ -148,14 +147,10 @@ impl StreamContextFactory { } } - let php_version = if HHVM_VERSION.is_some() { - format!("HHVM {}", HHVM_VERSION.unwrap()) - } else { - format!( - "PHP {}.{}.{}", - PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION - ) - }; + let php_version = format!( + "PHP {}.{}.{}", + PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION + ); let http_version = if for_curl { // PHP reports `cURL ` here. Shirabe's "curl" transport is backed by reqwest, -- cgit v1.3.1-4-g156e