diff --git a/README.md b/README.md index b2ec09c..6793911 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,18 @@ -# Phpmyadmin for YunoHost +# phpMyAdmin for YunoHost [![Integration level](https://dash.yunohost.org/integration/phpmyadmin.svg)](https://dash.yunohost.org/appci/app/phpmyadmin) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.maintain.svg) -[![Install Phpmyadmin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=phpmyadmin) +[![Install phpMyAdmin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=phpmyadmin) -> *This package allow you to install Phpmyadmin quickly and simply on a YunoHost server. +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allow you to install phpMyAdmin quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* ## Overview phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement. -**Shipped version:** 4.9.5 +**Shipped version:** 5.0.2 ## Screenshots @@ -26,7 +28,7 @@ phpMyAdmin is a free software tool written in PHP, intended to handle the admini ## Documentation * Official documentation: https://www.phpmyadmin.net/docs/ - * YunoHost documentation: If specific documentation is needed, feel free to contribute. + * YunoHost documentation: https://yunohost.org/#/app_phpmyadmin ## YunoHost specific features @@ -34,9 +36,8 @@ phpMyAdmin is a free software tool written in PHP, intended to handle the admini #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/phpmyadmin/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/phpmyadmin/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/phpmyadmin/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/phpmyadmin/) ## Limitations @@ -45,14 +46,13 @@ phpMyAdmin is a free software tool written in PHP, intended to handle the admini ## Links * Report a bug: https://github.com/YunoHost-Apps/phpmyadmin_ynh/issues - * Phpmyadmin website: https://www.phpmyadmin.net/ - * Phpmyadmin repository: https://github.com/phpmyadmin/phpmyadmin + * phpMyAdmin website: https://www.phpmyadmin.net/ + * phpMyAdmin repository: https://github.com/phpmyadmin/phpmyadmin * YunoHost website: https://yunohost.org/ --- -Developers infos ----------------- +## Developers infos Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing). diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..fb3b300 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,64 @@ +# phpMyAdmin avec YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/phpmyadmin.svg)](https://dash.yunohost.org/appci/app/phpmyadmin) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.maintain.svg) +[![Installer phpMyAdmin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=phpmyadmin) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer phpMyAdmin rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* + +## Vue d'ensemble + +phpMyAdmin est un outil logiciel libre écrit en PHP, destiné à gérer l'administration de MySQL sur le Web. phpMyAdmin prend en charge un large éventail d'opérations sur MySQL et MariaDB. Les opérations fréquemment utilisées (gestion des bases de données, des tables, des colonnes, des relations, des index, des utilisateurs, des autorisations, etc.) peuvent être effectuées via l'interface utilisateur, tandis que vous avez toujours la possibilité d'exécuter directement les instructions SQL. + +**Version incluse :** 5.0.2 + +## Captures d'écran + +![](https://www.phpmyadmin.net/static/images/screenshots/structure.png) + +## Démo + +* [Démo YunoHost](https://demo.yunohost.org/phpmyadmin/) +* [Démo officielle](https://demo.phpmyadmin.net/master-config/) + +## Configuration + +## Documentation + + * Documentation officielle : https://www.phpmyadmin.net/docs/ + * Documentation YunoHost : https://yunohost.org/#/app_phpmyadmin_fr + +## Caractéristiques spécifiques YunoHost + +#### Support multi-utilisateur + +#### Architectures supportées + +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/phpmyadmin/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/phpmyadmin/) + +## Limitations + +## Informations additionnelles + +## Liens + + * Signaler un bug : https://github.com/YunoHost-Apps/phpmyadmin_ynh/issues + * Site de l'application : https://www.phpmyadmin.net/ + * Dépôt de l'application principale : https://github.com/phpmyadmin/phpmyadmin + * Site web YunoHost : https://yunohost.org/ + +--- + +## Developers infos + +Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing). + +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug +or +sudo yunohost app upgrade phpmyadmin -u https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug +``` diff --git a/conf/app.src b/conf/app.src index f46f64f..d7cd70d 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://files.phpmyadmin.net/phpMyAdmin/4.9.5/phpMyAdmin-4.9.5-all-languages.tar.gz -SOURCE_SUM=d1ab98cde370c39dafdaa13ce02fa35cecaaa6d33553fde092604b99660e8835 +SOURCE_URL=https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.tar.gz +SOURCE_SUM=8d5cb67de154262b6e51e6ac6967d0931d28ef39cdc7fbec44011d374eb432ae SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 4796506..303eb96 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -16,7 +16,7 @@ location __PATH__/ { try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 88b5479..e871971 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/manifest.json b/manifest.json index 2c9feac..d835e35 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage MySQL databases over the web", "fr": "Application web de gestion des bases de données MySQL" }, - "version": "4.9.5~ynh1", + "version": "5.0.2~ynh1", "url": "http://www.phpmyadmin.net", "license": "GPL-2.0-only", "maintainer": { @@ -14,7 +14,7 @@ "email": "julien.malik@paraiso.me" }, "requirements": { - "yunohost": ">= 3.5.0" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 0f122b9..46ce7fb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,12 +1,20 @@ #!/bin/bash +#================================================= +# COMMON VARIABLES +#================================================= + +YNH_PHP_VERSION="7.3" +extra_php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-mbstring" + + #================================================= # EXPERIMENTAL HELPERS #================================================= # Execute a command as another user # usage: exec_as USER COMMAND [ARG ...] -exec_as() { +ynh_exec_as() { local USER=$1 shift 1 @@ -19,7 +27,8 @@ exec_as() { # Execute a command with Composer # -# usage: ynh_composer_exec --phpversion=phpversion [--workdir=$final_path] --commands="commands" +# usage: ynh_composer_exec [--phpversion=phpversion] [--workdir=$final_path] --commands="commands" +# | arg: -v, --phpversion - PHP version to use with composer # | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path. # | arg: -c, --commands - Commands to execute. ynh_composer_exec () { @@ -32,7 +41,7 @@ ynh_composer_exec () { # Manage arguments with getopts ynh_handle_getopts_args "$@" workdir="${workdir:-$final_path}" - phpversion="${phpversion:-7.0}" + phpversion="${phpversion:-$YNH_PHP_VERSION}" COMPOSER_HOME="$workdir/.composer" \ php${phpversion} "$workdir/composer.phar" $commands \ @@ -41,18 +50,22 @@ ynh_composer_exec () { # Install and initialize Composer in the given directory # -# usage: ynh_install_composer --phpversion=phpversion [--workdir=$final_path] +# usage: ynh_install_composer [--phpversion=phpversion] [--workdir=$final_path] [--install_args="--optimize-autoloader"] +# | arg: -v, --phpversion - PHP version to use with composer # | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path. +# | arg: -a, --install_args - Additional arguments provided to the composer install. Argument --no-dev already include ynh_install_composer () { # Declare an array to define the options of this helper. - local legacy_args=vw - declare -Ar args_array=( [v]=phpversion= [w]=workdir= ) + local legacy_args=vwa + declare -Ar args_array=( [v]=phpversion= [w]=workdir= [a]=install_args=) local phpversion local workdir + local install_args # Manage arguments with getopts ynh_handle_getopts_args "$@" workdir="${workdir:-$final_path}" - phpversion="${phpversion:-7.0}" + phpversion="${phpversion:-$YNH_PHP_VERSION}" + install_args="${install_args:-}" curl -sS https://getcomposer.org/installer \ | COMPOSER_HOME="$workdir/.composer" \ @@ -60,6 +73,6 @@ ynh_install_composer () { || ynh_die "Unable to install Composer." # update dependencies to create composer.lock - ynh_composer_exec --phpversion="${phpversion}" --workdir="$workdir" --commands="install --no-dev" \ + ynh_composer_exec --phpversion="${phpversion}" --workdir="$workdir" --commands="install --no-dev $install_args" \ || ynh_die "Unable to update core dependencies with Composer." -} +} \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index fa7b254..0a9e6c8 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -# source ../settings/scripts/_common.sh +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= @@ -19,7 +19,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -28,32 +28,32 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Backing up the MySQL database..." +ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql @@ -61,4 +61,4 @@ ynh_mysql_dump_db --database="$db_name" > db.sql # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 14c221d..dd32bb0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -50,23 +50,23 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# Change the path in the NGINX config file if [ $change_path -eq 1 ] then - # Make a backup of the original nginx config file if modified + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -81,7 +81,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -89,4 +89,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression --message="Change of URL completed for phpMyAdmin" --last diff --git a/scripts/install b/scripts/install index 5ea0771..deb7975 100644 --- a/scripts/install +++ b/scripts/install @@ -82,9 +82,9 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=3 +ynh_script_progression --message="Configuring NGINX web server..." --weight=3 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -98,10 +98,10 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --weight=2 +ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 -# Create a dedicated php-fpm config -ynh_add_fpm_config +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # SPECIFIC SETUP @@ -120,7 +120,7 @@ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name #================================================= # CONFIGURE PHPMYADMIN #================================================= -ynh_script_progression --message="Configuring phpmyadmin..." +ynh_script_progression --message="Configuring phpMyAdmin..." ynh_replace_string --match_string="__YNH_PMA_ADMIN_USER__" --replace_string="$db_admin_user" --target_file=../conf/config.inc.php ynh_replace_string --match_string="__YNH_PMA_ADMIN_PASSWORD__" --replace_string="$db_admin_pwd" --target_file=../conf/config.inc.php @@ -137,7 +137,7 @@ ynh_store_file_checksum --file="$final_path/config.inc.php" #================================================= ynh_script_progression --message="Installing dependencies with Composer..." --weight=60 -# Install composer +# Install Composer ynh_install_composer # Install dependencies @@ -170,7 +170,7 @@ yunohost app addaccess --users=$admin $app #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload @@ -178,4 +178,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of phpMyAdmin completed" --last diff --git a/scripts/remove b/scripts/remove index 5ba3715..47fc652 100644 --- a/scripts/remove +++ b/scripts/remove @@ -37,7 +37,7 @@ ynh_mysql_drop_user $db_admin_user #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory" +ynh_script_progression --message="Removing phpMyAdmin main directory" # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -45,17 +45,17 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration" +ynh_script_progression --message="Removing NGINX web server configuration" -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration" --weight=2 +ynh_script_progression --message="Removing PHP-FPM configuration" --weight=2 -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= @@ -72,4 +72,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of phpMyAdmin completed" --last diff --git a/scripts/restore b/scripts/restore index 3e2fccb..6ee3164 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -# source ../settings/scripts/_common.sh +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= @@ -50,7 +50,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring phpMyAdmin main directory..." ynh_restore_file --origin_path="$final_path" @@ -95,20 +95,25 @@ chown $app: $final_path/tmp # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_script_progression --message="Reconfiguring PHP-FPM.." --weight=6 + +# 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" + +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." +ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=php7.0-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression --message="Restoration completed for phpMyAdmin" --last diff --git a/scripts/upgrade b/scripts/upgrade index 7bcb21a..d89e35c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,7 +74,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=15 +ynh_script_progression --message="Backing up phpMyAdmin before upgrading (may take a while)..." --weight=15 # Backup the current version of the app ynh_backup_before_upgrade @@ -109,9 +109,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=3 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=3 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -125,10 +125,10 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=4 +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 -# Create a dedicated php-fpm config -ynh_add_fpm_config +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --package="$extra_php_dependencies" #================================================= # SPECIFIC UPGRADE @@ -161,7 +161,7 @@ fi #================================================= # CONFIGURE PHPMYADMIN #================================================= -ynh_script_progression --message="Reconfiguring phpmyadmin..." +ynh_script_progression --message="Reconfiguring phpMyAdmin..." # Verify the checksum and backup the file if it's different ynh_backup_if_checksum_is_different --file="$final_path/config.inc.php" @@ -176,22 +176,6 @@ cp ../conf/config.inc.php $final_path # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/config.inc.php" -#================================================= -# INSTALL DEPENDENCIES -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - - ynh_script_progression --message="Upgrading dependencies with Composer..." --weight=19 - - # Install composer - ynh_install_composer - - # Install dependencies - ynh_exec_warn_less ynh_composer_exec --commands=\"update --no-dev\" -fi - #================================================= # GENERIC FINALIZATION #================================================= @@ -207,6 +191,21 @@ chmod 640 $final_path/config.inc.php mkdir -p $final_path/tmp chown -R $app: $final_path/tmp +#================================================= +# INSTALL DEPENDENCIES +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + + ynh_script_progression --message="Upgrading dependencies with Composer..." --weight=19 + + # Force dependency to the used PHP version + ynh_exec_warn_less ynh_composer_exec --commands=\"config -g platform.php $YNH_PHP_VERSION\" + # Install dependencies + ynh_exec_warn_less ynh_composer_exec --commands=\"update --no-dev\" +fi + #================================================= # SETUP SSOWAT #================================================= @@ -218,7 +217,7 @@ yunohost app addaccess --users=$admin $app #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload @@ -226,4 +225,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of phpMyAdmin completed" --last