From a95fe798f24eb9c470ad92d6c07ab56517502df1 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Aug 2022 10:55:58 +0200 Subject: [PATCH] Appease linter: install PHP dependencies with apt helper --- scripts/_common.sh | 8 ++++---- scripts/install | 2 +- scripts/restore | 20 ++++++++++---------- scripts/upgrade | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 1140ac0..7002e04 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -2,16 +2,16 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -pkg_dependencies="" - swap_needed=1024 +# PHP YNH_PHP_VERSION="7.3" YNH_COMPOSER_VERSION="2.0.13" - extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo-mysql php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-zip" +# dependencies used by the app +pkg_dependencies="$extra_php_dependencies" + # Version numbers project_version="1.4.0" #core_version is now retrieved from the manifest diff --git a/scripts/install b/scripts/install index 0efc0a0..83b2f58 100644 --- a/scripts/install +++ b/scripts/install @@ -116,7 +116,7 @@ ynh_add_nginx_config 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" +ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 0f906b9..e63366d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -71,16 +71,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." - -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" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -91,6 +81,16 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=2 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." + +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 + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7ec3cc5..f07d15c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -158,7 +158,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=1 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #=================================================