1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-04 01:24:09 +02:00

default to max supported php version

This commit is contained in:
Robin Appelman 2025-08-26 13:32:18 +02:00
commit 86a68339b4
5 changed files with 122 additions and 49 deletions

View file

@ -106,6 +106,27 @@ impl PhpVersion {
}
}
pub fn from_number(major: u8, minor: u8) -> Option<Self> {
match (major, minor) {
(7, 3) => Some(PhpVersion::Php73),
(7, 4) => Some(PhpVersion::Php74),
(8, 0) => Some(PhpVersion::Php80),
(8, 1) => Some(PhpVersion::Php81),
(8, 2) => Some(PhpVersion::Php82),
(8, 3) => Some(PhpVersion::Php83),
(8, 4) => Some(PhpVersion::Php84),
_ => None,
}
}
pub fn max_minor(major: u8) -> u8 {
match major {
7 => 4,
8 => 4,
_ => 0,
}
}
#[allow(clippy::too_many_arguments)]
pub async fn spawn(
&self,