2020-05-17 19:29:06 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-20 03:26:51 +02:00
|
|
|
EXPECTED_CHECKSUM="$(curl -sL https://composer.github.io/installer.sig)"
|
2020-05-17 19:29:06 +02:00
|
|
|
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 --install-dir=/usr/local/bin --filename=composer
|
|
|
|
RESULT=$?
|
|
|
|
rm composer-setup.php
|
|
|
|
exit $RESULT
|