helpers2.1: fix automigration of phpversion to php_version

This commit is contained in:
Alexandre Aubin 2024-06-30 01:37:56 +02:00
parent a18d5f26f2
commit 3f973669fc
2 changed files with 15 additions and 12 deletions

View file

@ -3,18 +3,6 @@
# (this is used in the apt helpers, big meh ...) # (this is used in the apt helpers, big meh ...)
readonly YNH_DEFAULT_PHP_VERSION=7.4 readonly YNH_DEFAULT_PHP_VERSION=7.4
# Legacy: auto-convert phpversion to php_version (for consistency with nodejs_version, ruby_version, ...)
if [[ -n "${app:-}" ]] && [[ -n "${phpversion:-}" ]]
then
if [[ -z "${php_version:-}" ]]
then
php_version=$phpversion
ynh_app_setting_set --key=php_version --value=$php_version
fi
ynh_app_setting_delete --key=phpversion
unset phpversion
fi
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
# #
# usage: ynh_config_add_phpfpm # usage: ynh_config_add_phpfpm

View file

@ -122,3 +122,18 @@ else:
EOF EOF
eval "$xtrace_enable" eval "$xtrace_enable"
} }
# Legacy: auto-convert phpversion to php_version (for consistency with nodejs_version, ruby_version, ...)
# This has to be here and not in the "php" code file because ynh_app_setting_set/delete need to be defined @_@
if [[ -n "${app:-}" ]] && [[ -n "${phpversion:-}" ]]
then
if [[ -z "${php_version:-}" ]]
then
php_version=$phpversion
ynh_app_setting_set --key=php_version --value=$php_version
fi
ynh_app_setting_delete --key=phpversion
unset phpversion
fi