1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

Merge pull request #130 from fflorent/patch-1

Remove dependencies and reinstall them when changing php version
This commit is contained in:
Alexandre Aubin 2024-01-22 17:36:48 +01:00 committed by GitHub
commit 7d592faabe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -114,7 +114,7 @@ ynh_app_config_apply() {
then then
ynh_app_setting_set --app=$app --key=phpversion --value="${old[phpversion]}" ynh_app_setting_set --app=$app --key=phpversion --value="${old[phpversion]}"
ynh_remove_fpm_config ynh_remove_fpm_config
# ^ the helper includes ynh_remove_app_dependencies ynh_remove_app_dependencies
YNH_PHP_VERSION=$phpversion YNH_PHP_VERSION=$phpversion
# ^ ynh_add_config replaces __PHPVERSION__ by __PHP_YNH_VERSION__... # ^ ynh_add_config replaces __PHPVERSION__ by __PHP_YNH_VERSION__...
ynh_app_setting_set --app=$app --key=phpversion --value="$phpversion" ynh_app_setting_set --app=$app --key=phpversion --value="$phpversion"
@ -127,7 +127,10 @@ ynh_app_config_apply() {
ynh_secure_remove --file="$nginx_extra_conf_dir/php.conf" ynh_secure_remove --file="$nginx_extra_conf_dir/php.conf"
else else
ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf" ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf"
ynh_install_app_dependencies "php${phpversion}-fpm" database=$(ynh_app_setting_get --app=$app --key=database)
dependencies="$(ynh_read_manifest -k "resources.apt.packages")"
dependencies_from_raw_bash=$(eval "$(ynh_read_manifest -k "resources.apt.packages_from_raw_bash")" | tr "\n" " ")
ynh_install_app_dependencies "$dependencies $dependencies_from_raw_bash"
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
# ^ the helper takes care of ynh_app_setting_set the phpversion # ^ the helper takes care of ynh_app_setting_set the phpversion
fi fi