Browse Source

Merge pull request #357 from YunoHost-Apps/fix-upgrade

Upgrade php version
pull/358/head
Kayou 5 years ago
committed by GitHub
parent
commit
af36b0b9b7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      scripts/upgrade

18
scripts/upgrade

@ -147,12 +147,25 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# If php has changed, remove the old fpm config file
if [ "$phpversion" != $YNH_PHP_VERSION ]
then
ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf"
if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then
ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini"
fi
ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload
phpversion="$YNH_PHP_VERSION"
fi
# Recreate a dedicated PHP-FPM config # Recreate a dedicated PHP-FPM config
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies"
# Delete existing ini configuration file (backward compatibility) # Delete existing ini configuration file (backward compatibility)
if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then
ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini
ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini
fi fi
#================================================= #=================================================
@ -467,9 +480,10 @@ ynh_app_setting_set --app=$app --key=skipped_regex \
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload
#================================================= #=================================================
# FINISH MIGRATION PROCESS # FINISH MIGRATION PROCESS

Loading…
Cancel
Save