diff --git a/conf/database.ini.default b/conf/database.ini.default index 0cde2f9..d610f46 100644 --- a/conf/database.ini.default +++ b/conf/database.ini.default @@ -1,4 +1,4 @@ -user = "__DB_NAME__" +user = "__DB_USER__" password = "__DB_PWD__" dbname = "__DB_NAME__" host = "localhost" diff --git a/manifest.json b/manifest.json index 15f2ea6..72fd671 100755 --- a/manifest.json +++ b/manifest.json @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php8.0-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 6ee07a3..4f3a65f 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="8.0" pkg_dependencies="imagemagick php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml" diff --git a/scripts/install b/scripts/install index bff3c0c..b618459 100755 --- a/scripts/install +++ b/scripts/install @@ -23,6 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/restore b/scripts/restore index 378cc93..90cb5b9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -69,16 +69,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..." --weight=5 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion - #================================================= # SPECIFIC RESTORATION #================================================= @@ -89,6 +79,16 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=5 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ad9e17f..a279b05 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,18 +80,9 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - mv "$final_path" "$final_path.old" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/local.config.php $final_path/config/database.ini $final_path/modules $final_path/themes $final_path/files" - cp "$final_path.old/config/local.config.php" "$final_path/config/local.config.php" - cp "$final_path.old/config/database.ini" "$final_path/config/database.ini" - cp -r "$final_path.old/modules" "$final_path/modules" - cp -r "$final_path.old/themes" "$final_path/themes" - cp -r "$final_path.old/files" "$final_path/files" - # delete temp directory - ynh_secure_remove "$final_path.old" fi chmod 750 "$final_path"