From bb4684f7d1c51bc1be9c1bda1b00cb52c839cd25 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 12 Aug 2026 06:29:43 +0900 Subject: feat(php-shim): drop the modelled PHP version constants The shim reported a fixed PHP 8.1.0 through PHP_VERSION, PHP_VERSION_ID, the major/minor/release triple and the PHP_WINDOWS_VERSION_* trio. Their uses split in two. Some guarded branches PHP only needs on runtimes this port cannot be: proc_get_status reports the exit status on every call, so Symfony's pre-8.3 exit-code cache has nothing to work around; hash_raw and hash_file always offer xxh3, so the sha1 fallback is unreachable; and http_get_last_response_headers is always available, so the pre-8.4 $http_response_header branch is gone. safeJunctions reads the host Windows version rather than PHP state, and joins the Windows work on hold. The rest ask about the PHP the user actually runs, and now reach the worker through a new php-rpc PhpVersion payload: the startup banner and the 7.2.5 warning, self-update's min-php filter, the ext-* recommendation in VersionSelector, the stream User-Agent, and whether PhpFileParser scans for enums. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-symfony-process/src/process.rs | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'crates/shirabe-symfony-process') diff --git a/crates/shirabe-symfony-process/src/process.rs b/crates/shirabe-symfony-process/src/process.rs index b7459d41..87c6c68d 100644 --- a/crates/shirabe-symfony-process/src/process.rs +++ b/crates/shirabe-symfony-process/src/process.rs @@ -62,7 +62,6 @@ pub struct Process { options: IndexMap, process_pipes: Option>, latest_signal: Option, - cached_exit_code: Option, /// Test-only mock state. `None` in production; set via [`Process::__mock`] in tests. mock: Option, } @@ -189,7 +188,6 @@ impl Process { options, process_pipes: None, latest_signal: None, - cached_exit_code: None, mock: None, } } @@ -745,29 +743,6 @@ impl Process { .map(shirabe_php_shim::php_truthy) .unwrap_or(false); - // In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call. - if shirabe_php_shim::PHP_VERSION_ID < 80300 { - let exitcode = self - .process_information - .as_ref() - .unwrap() - .get("exitcode") - .and_then(|v| v.as_int()); - if self.cached_exit_code.is_none() && !running && exitcode != Some(-1) { - self.cached_exit_code = exitcode; - } - - if let Some(cached) = self.cached_exit_code - && !running - && exitcode == Some(-1) - { - self.process_information - .as_mut() - .unwrap() - .insert("exitcode".to_string(), PhpMixed::Int(cached)); - } - } - self.read_pipes(running && blocking, !cfg!(windows) || !running); if !running { -- cgit v1.3.1-4-g156e