aboutsummaryrefslogtreecommitdiff
path: root/files/getcomposer
blob: b2ef706cccb35588231a698a58563eac0454469c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env sh
#
# See https://getcomposer.org/download/
#     https://composer.github.io/pubkeys.html
#

# Download
#php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
wget https://getcomposer.org/installer -O composer-setup.php || exit 1

php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

if [ -e "composer-setup.php" ]; then
  php composer-setup.php --install-dir=/usr/local/bin --filename=composer
  #php -r "unlink('composer-setup.php');"
  rm composer-setup.php
fi