aboutsummaryrefslogtreecommitdiff
path: root/share/trashman/composer/unix/install
blob: 0a0328715f34044db0ae9ee2cca05ed2a4aa6414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env sh
#
# Install composer system-wide.
#
# See https://getcomposer.org/download/
#     https://composer.github.io/pubkeys.html
#

# Parameters
SHARE="$1"

# Include basic functions
. $SHARE/trashman/functions || exit 1

# Requirements
trashman_require php wget

# 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') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { 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