From 87d33e01d2cce81ffb74935d100d15593ff38cd9 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 10 Mar 2026 16:26:27 +0100 Subject: [PATCH] Add support for frankenphp --- nix/image/bootstrap.sh | 11 ++++++++--- nix/image/haze.nix | 2 ++ src/service.rs | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/nix/image/bootstrap.sh b/nix/image/bootstrap.sh index a00a950..e9f7303 100755 --- a/nix/image/bootstrap.sh +++ b/nix/image/bootstrap.sh @@ -74,6 +74,11 @@ then '& fi -php-fpm --fpm-config /etc/php-fpm.conf& - -nginx -c /etc/nginx.conf \ No newline at end of file +if [ -n "${FRANKENPHP:-}" ] +then + php-fpm --fpm-config /etc/php-fpm.conf& + + nginx -c /etc/nginx.conf +else + frankenphp run +fi diff --git a/nix/image/haze.nix b/nix/image/haze.nix index 926f0fa..d492ff3 100644 --- a/nix/image/haze.nix +++ b/nix/image/haze.nix @@ -33,6 +33,7 @@ writeShellApplication, vim, helix, + frankenphp, }: let inherit (builtins) toString; inherit (lib) readFile getExe concatStringsSep splitString take; @@ -145,6 +146,7 @@ oracle-instantclient vim helix + frankenphp ]; }; diff --git a/src/service.rs b/src/service.rs index 67325c3..7788821 100644 --- a/src/service.rs +++ b/src/service.rs @@ -207,6 +207,19 @@ impl ServiceTrait for RedisTls { } } +#[derive(Clone, Eq, PartialEq, Debug)] +pub struct FrankenPHP; + +impl ServiceTrait for FrankenPHP { + fn name(&self) -> &str { + "frankenphp" + } + + fn env(&self) -> &[&str] { + &["FRANKENPHP=1"] + } +} + #[derive( Copy, Clone, Debug, PartialEq, EnumString, EnumMessage, EnumIter, IntoStaticStr, Display, )] @@ -281,6 +294,8 @@ pub enum ServiceType { Redis, /// External redis instance with TLS RedisTls, + /// FrankenPHP + FrankenPHP, } #[enum_dispatch] @@ -311,6 +326,7 @@ pub enum Service { Redis(Redis), RedisTls(RedisTls), Preset(PresetService), + FrankenPHP(FrankenPHP), } impl Service { @@ -352,6 +368,7 @@ impl Service { ServiceType::Mail => Some(vec![Service::Mail(Mail)]), ServiceType::Redis => Some(vec![Service::Redis(Redis)]), ServiceType::RedisTls => Some(vec![Service::RedisTls(RedisTls)]), + ServiceType::FrankenPHP => Some(vec![Service::FrankenPHP(FrankenPHP)]), } } else { presets