Skip to content

Conversation

chrisboulton
Copy link
Contributor

Pull Request (PR) description

Allows for PHP FPM pool settings to be configured as environment variables (pm_max_children => '${PM_MAX_CHILDREN}') in addition to their existing typed formats.

I debated about the best way to add this, and ended up adding Variant types, along with a single custom type. I did this because there were varying types (Integer[0], Integer[1], Php::Duration) that I didn't want to have to duplicate.

The env based configuration applies to every setting, but for right now I've added it to the most common ones where due to the stricter validation, it would previously fail.

This Pull Request (PR) fixes the following issues

Fixes #649

Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some dumb reflexion since I do not use PHP much…

My feeling is that any parameter which does not accept String should accept a Php::EnvString, right? I see some Stdlib::Absolutepath, Stdlib::Filemode, Integer, Enum['yes', 'no']: should these also be adjusted to allow variables?

Co-authored-by: Romain Tartière <romain@blogreen.org>
@yakatz
Copy link
Member

yakatz commented Apr 22, 2025

@chrisboulton If you are still interested and can rebase this, that would be great. I might have time in the next few days otherwise.

@yakatz yakatz added enhancement New feature or request needs-rebase labels Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data type validation in fpm::pool breaks ability to use environment variables as values

3 participants