aboutsummaryrefslogtreecommitdiff
path: root/files/getcomposer
blob: beedf602ba98fc887bc4ab5e3200dcd2bb1f485e (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') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { 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