From a2f00bb65ee57a0f83fc964f2dc7deaba3e18a99 Mon Sep 17 00:00:00 2001 From: liberodark Date: Mon, 29 Jul 2019 20:00:49 +0200 Subject: [PATCH] add composer --- scripts/install | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/install b/scripts/install index 74ab0e4..303d324 100644 --- a/scripts/install +++ b/scripts/install @@ -119,6 +119,27 @@ ynh_replace_string "yunouser" "$db_name" "$final_path/.env" ynh_replace_string "yunopass" "$db_pwd" "$final_path/.env" ynh_replace_string "yunobase" "$db_name" "$final_path/.env" +#================================================= +# INSTALL COMPOSER +#================================================= + +ynh_print_info "Install composer" + +EXPECTED_SIGNATURE=$(wget https://composer.github.io/installer.sig -O - -q) +curl -s https://getcomposer.org/installer > composer-setup.php +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" = "$ACTUAL_SIGNATURE" ] +then + php composer-setup.php --quiet + RESULT=$? + rm composer-setup.php +else + >&2 echo 'ERROR: Invalid composer installer signature' + rm composer-setup.php + exit 1 +fi + #================================================= # NGINX CONFIGURATION #=================================================