From aaa06c50c0ccd7947e7e273a93674c002a6743b5 Mon Sep 17 00:00:00 2001 From: Alexandre Eher Date: Sat, 28 Sep 2019 01:26:59 +0200 Subject: [PATCH] Install composer It's handy to have Composer as package manager out of the box with PHP. Signed-off-by: Alexandre Eher --- bin/install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/install b/bin/install index 31308a4..b6796c0 100755 --- a/bin/install +++ b/bin/install @@ -38,6 +38,15 @@ install_php() { ) } +install_composer() { + local bin_path=$1/bin + + $bin_path/php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + $bin_path/php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" + $bin_path/php composer-setup.php --install-dir=$bin_path --filename=composer + $bin_path/php -r "unlink('composer-setup.php');" +} + construct_configure_options() { local install_path=$1 @@ -227,3 +236,4 @@ get_php_version() { } install_php $ASDF_INSTALL_TYPE $ASDF_INSTALL_VERSION $ASDF_INSTALL_PATH +install_composer $ASDF_INSTALL_PATH