blob: a69c805854baf7d949d80291b17d506b0ebddc05 (
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
29
30
31
32
33
34
35
36
|
#!/usr/bin/env sh
#
# See https://getcomposer.org/download/
# https://composer.github.io/pubkeys.html
# https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
#
## Download
##php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
#rm -f 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
EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
mv composer.phar /usr/local/bin/composer
exit $RESULT
|