Composer-download now has the official download code in it.
This commit is contained in:
parent
96306e89f0
commit
4e244a8895
@ -1,13 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# https://getcomposer.org/
|
# https://getcomposer.org/
|
||||||
if [ -x `which wget` ]; then
|
EXPECTED_SIGNATURE=$(wget https://composer.github.io/installer.sig -O - -q)
|
||||||
echo "wget found."
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
wget -q https://getcomposer.org/installer -O - | php
|
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
|
||||||
elif [ -x `which curl` ]; then
|
|
||||||
echo "curl found."
|
if [ "$EXPECTED_SIGNATURE" = "$ACTUAL_SIGNATURE" ]; then
|
||||||
curl -sS https://getcomposer.org/installer | php
|
php composer-setup.php --quiet
|
||||||
|
RESULT=$?
|
||||||
|
rm composer-setup.php
|
||||||
|
exit $RESULT
|
||||||
else
|
else
|
||||||
echo "Please install wget or curl to download Composer."
|
>&2 echo 'ERROR: Invalid installer signature'
|
||||||
|
rm composer-setup.php
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "./composer.phar" ]; then
|
if [ -f "./composer.phar" ]; then
|
||||||
|
Reference in New Issue
Block a user