Repository navigation
[BUGFIX] Let docker-php-setting change a setting - #627
Merged
Merged
Conversation
docker-php-setting printed its usage text and exited with 1 for every valid call, because it required more than two arguments, and its loop over the arguments shifted the first one away whatever it was. It now takes an optional --raw first, then the setting and its value. A new image test sets memory_limit and error_reporting with it, also against PHP_MEMORY_LIMIT, and reads them from PHP and PHP-FPM. The command is documented under "Tools for your Dockerfile", and its known issue is removed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
docker-php-settingprinted its usage text and exited with 1 on every valid call, for exampledocker-php-setting memory_limit 512M. It required more than two arguments ($# -le 2), and its loop over the arguments shifted the first one away, whatever it was. It now takes an optional--rawfirst, then the setting and its value.Related issue: #269 (
RUN docker-php-setting short_open_tag Onfails with the usage text), closed in 2018 without a fix.Changes
provisioning/php/general/bin/usr-bin/docker-php-setting:--rawonly as the first argument, at least two arguments;make generate.testDockerPhpSettingChangesASettinginPhpChecks. In a container withPHP_MEMORY_LIMIT=256M, it runsdocker-php-setting memory_limit 384Manddocker-php-setting --raw error_reporting E_ERROR. It expects384Mand1from the CLI, andmemory_limit => 384Mfromphp-fpm -i.docs/customization.mdlists the command under "Tools for your Dockerfile", with both examples from the test, and says atphp.inithat the command appends to that file.How it was verified
The commands of the new test, in a container with
PHP_MEMORY_LIMIT=256M:php:8.5384M 1andmemory_limit => 384M => 384M, exit code 0php:8.5-alpine"With the new script" is the published image with the script of this pull request mounted over
/usr/local/bin/docker-php-setting. The setting wins overPHP_MEMORY_LIMIT, becausephp.iniis loaded as99-docker.iniafter98-webdevops.ini. Also checked there: one argument and--rawalone print the usage text and exit with 1;date.timezone Europe/Berlinis written as"Europe/Berlin",max_execution_time 120without quotes.Rebased on master with #625 and #626;
ci/console generatechanges nothing. The CI run of this pull request runs the new test in every PHP image, on amd64 and arm64.