diff --git a/scripts/backup b/scripts/backup index b73f6e9..81b0f6d 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,11 +27,11 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= - ynh_print_info --message="Declaring files to be backed up..." #================================================= @@ -50,7 +50,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/${YNH_PHP_VERSION}/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP A CRON FILE diff --git a/scripts/install b/scripts/install index 0f7ac02..9dbd3e7 100755 --- a/scripts/install +++ b/scripts/install @@ -98,6 +98,7 @@ ynh_script_progression --message="Configuring php-fpm..." # Create a dedicated php-fpm config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP @@ -106,7 +107,7 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie #================================================= ynh_script_progression --message="Installing composer and dependencies..." -ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" +ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" #================================================= # SETUP A CRON diff --git a/scripts/restore b/scripts/restore index f887e96..b7611c6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -29,6 +29,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -75,10 +76,10 @@ chown -R $app: $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Restoring PHP-FPM configuration..." +ynh_script_progression --message="Restoring PHP-FPM configuration..." # Restore the file first, so it can have a backup if different -ynh_restore_file --origin_path="/etc/php/${YNH_PHP_VERSION}/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" @@ -116,7 +117,7 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= ynh_script_progression --message="Reloading nginx web server and php-fpm..." -ynh_systemd_action --service_name=php${YNH_PHP_VERSION}-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 03f90bc..e4e1c74 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,6 +121,7 @@ ynh_script_progression --message="Upgrading php-fpm configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC UPGRADE @@ -129,7 +130,7 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie #================================================= ynh_script_progression --message="Installating composer and dependencies..." -ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir=$final_path +ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" #================================================= # SETUP A CRON