diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-12 06:29:43 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-15 09:19:39 +0900 |
| commit | bb4684f7d1c51bc1be9c1bda1b00cb52c839cd25 (patch) | |
| tree | 18fcdf1f9c9c64fc68e08bd5fab132808ca1cfcf /crates/shirabe/src/package/version | |
| parent | 9e5bb3e4253dda96345f4d1a3421077a72295048 (diff) | |
| download | php-shirabe-bb4684f7d1c51bc1be9c1bda1b00cb52c839cd25.tar.gz php-shirabe-bb4684f7d1c51bc1be9c1bda1b00cb52c839cd25.tar.zst php-shirabe-bb4684f7d1c51bc1be9c1bda1b00cb52c839cd25.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/version')
| -rw-r--r-- | crates/shirabe/src/package/version/version_selector.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/shirabe/src/package/version/version_selector.rs b/crates/shirabe/src/package/version/version_selector.rs index 775aadc5..1661c749 100644 --- a/crates/shirabe/src/package/version/version_selector.rs +++ b/crates/shirabe/src/package/version/version_selector.rs @@ -17,10 +17,7 @@ use crate::repository::RepositoryInterface; use crate::repository::RepositorySetInterface; use indexmap::IndexMap; use shirabe_pcre::Preg; -use shirabe_php_shim::{ - CmpOp, PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, php_regex, strtolower, - version_compare, -}; +use shirabe_php_shim::{CmpOp, php_regex, strtolower, version_compare}; use shirabe_semver::constraint::AnyConstraint; use shirabe_semver::constraint::SimpleConstraint; @@ -258,10 +255,8 @@ impl VersionSelector { package: PackageInterfaceHandle, ) -> anyhow::Result<String> { if package.get_name().starts_with("ext-") { - let php_version = format!( - "{}.{}.{}", - PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION - ); + let php = shirabe_php_rpc::get_php_version(); + let php_version = format!("{}.{}.{}", php.major, php.minor, php.release); let package_version = package.get_version(); let ext_parts: Vec<&str> = package_version.splitn(4, '.').collect(); let ext_version = ext_parts[..3.min(ext_parts.len())].join("."); |
