From 0efae29f81efd575e75496b6765558e85bdf85d7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Sep 2020 19:02:51 +0200 Subject: [PATCH] Add PHP extensions --- scripts/_common.sh | 1 + scripts/install | 7 +++++++ scripts/remove | 8 ++++++++ scripts/restore | 8 ++++++++ scripts/upgrade | 7 +++++++ 5 files changed, 31 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index b905339..afff2a3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,6 +3,7 @@ #================================================= # PERSONAL HELPERS #================================================= + pkg_dependencies="php${YNH_DEFAULT_PHP_VERSION}cURL php${YNH_DEFAULT_PHP_VERSION}iconv php${YNH_DEFAULT_PHP_VERSION}json php${YNH_DEFAULT_PHP_VERSION}libxml php${YNH_DEFAULT_PHP_VERSION}dom php${YNH_DEFAULT_PHP_VERSION}openssl php${YNH_DEFAULT_PHP_VERSION}DateTime php${YNH_DEFAULT_PHP_VERSION}PCRE php${YNH_DEFAULT_PHP_VERSION}SPL" #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/install b/scripts/install index 9b73377..441adc1 100644 --- a/scripts/install +++ b/scripts/install @@ -52,6 +52,13 @@ ynh_app_setting_set --app=$app --key=lang --value=$lang ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=ldap --value=$ldap +#================================================= +# 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 8ec9909..e005973 100644 --- a/scripts/remove +++ b/scripts/remove @@ -30,6 +30,14 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=2 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index ed23ac0..68b81bf 100644 --- a/scripts/restore +++ b/scripts/restore @@ -84,6 +84,14 @@ chown -R $app: $final_path ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 124d65e..e6c193e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,6 +98,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #=================================================