New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php: add buildEnv
function for additional config on the CLI SAPI
#79377
Conversation
I think you should name it |
withPackages
function for additional config on the CLI SAPIbuildEnv
function for additional config on the CLI SAPI
@aanderse would you mind taking another look at this? :) |
Hm, Interesting thing here. I've haven't had the time to test it yet. But it looks promising 🙂 |
Resolved the latest merge-conflict with master btw :) |
Initially discussed in NixOS#55460. This patch adds a `buildEnv` function to `php` that has the following features: * `php.buildEnv { extraConfig = /* ... */; }` to specify custom `php.ini` args for the CLI. * `php.buildEnv { exts = phpPackages: [phpPackages.apcu] }` to create a PHP interpreter for the CLI with the `apcu` extension.
Resolved the merge-conflict. @etu any chance to get a review from you? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just tested this locally and it totally works great. I think this is a good step for a more modular PHP setup.
And I mostly use PHP in CLI mode and do miss some modules sometimes that we have packaged but I haven't been bothered to get in... So big thanks for this PR :)
@aanderse do you have anything to add? Otherwise I'd merge tonight :) |
@Ma27 the only thing I have to add is a thank you for your work 😄 |
Motivation for this change
Initially discussed in #55460.
This patch adds a
withPackages
function tophp
that has thefollowing features:
php.buildEnv { extraConfig = /* ... */; }
to specify customphp.ini
args for the CLI.php.buildEnv { exts = phpPackages: [phpPackages.apcu] }
tocreate a PHP interpreter for the CLI with the
apcu
extension.Just realized that it isn't that simple to implement a completely generic wrapper for the PHP ecosystem. I intentionally didn't add any docs, at first I'd like to know if the direction is correct :)
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)