diff --git a/scripts/_common.sh b/scripts/_common.sh index b7c971c..9b5fd8f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,11 @@ YNH_PHP_VERSION="8.0" +php_dependencies="php$YNH_PHP_VERSION-fpm" + +# dependencies used by the app (must be on a single line) +pkg_dependencies="$php_dependencies" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 5052f2e..32225e7 100755 --- a/scripts/install +++ b/scripts/install @@ -56,6 +56,13 @@ ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # STANDARD MODIFICATIONS #================================================= diff --git a/scripts/remove b/scripts/remove index 4a7848b..5240afe 100755 --- a/scripts/remove +++ b/scripts/remove @@ -43,6 +43,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 900c312..d70f61b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -70,6 +70,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4b61a09..dc97bd5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,6 +99,13 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #=================================================