1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

php versions

This commit is contained in:
Robin Appelman 2021-03-14 20:02:54 +01:00
commit 6b922733e2
11 changed files with 322 additions and 13 deletions

View file

@ -14,10 +14,10 @@ use tokio::time::{sleep, timeout};
#[derive(Clone, Debug, Eq, PartialEq)]
#[allow(dead_code)]
pub enum PhpVersion {
Latest,
// Php80,
Php80,
Php74,
// Php73,
Php73,
Php72,
}
impl FromStr for PhpVersion {
@ -26,7 +26,11 @@ impl FromStr for PhpVersion {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"7" => Ok(PhpVersion::Php74),
"7.2" => Ok(PhpVersion::Php72),
"7.3" => Ok(PhpVersion::Php73),
"7.4" => Ok(PhpVersion::Php74),
"8" => Ok(PhpVersion::Php80),
"8.0" => Ok(PhpVersion::Php80),
_ => Err(()),
}
}
@ -36,15 +40,19 @@ impl PhpVersion {
fn image(&self) -> &'static str {
// for now only 7.4
match self {
PhpVersion::Latest => "icewind1991/haze:7.4",
PhpVersion::Php72 => "icewind1991/haze:7.2",
PhpVersion::Php73 => "icewind1991/haze:7.3",
PhpVersion::Php74 => "icewind1991/haze:7.4",
PhpVersion::Php80 => "icewind1991/haze:8.0",
}
}
pub fn name(&self) -> &'static str {
match self {
PhpVersion::Latest => "7.4",
PhpVersion::Php72 => "7.2",
PhpVersion::Php73 => "7.3",
PhpVersion::Php74 => "7.4",
PhpVersion::Php80 => "8.0",
}
}
@ -110,6 +118,6 @@ impl PhpVersion {
impl Default for PhpVersion {
fn default() -> Self {
PhpVersion::Latest
PhpVersion::Php80
}
}