2016-08-04 18:49:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-01-27 01:59:20 +01:00
|
|
|
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
|
2016-08-04 18:49:50 +02:00
|
|
|
php -r "copy('{{ composer_get_url }}', '{{ composer_setup }}');"
|
2017-01-27 01:59:20 +01:00
|
|
|
ACTUAL_SIGNATURE=$(php -r "echo hash_file('{{ composer_signature_type }}', 'composer-setup.php');")
|
2016-08-04 18:49:50 +02:00
|
|
|
|
2017-01-27 01:59:20 +01:00
|
|
|
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
|
|
|
|
then
|
|
|
|
>&2 echo 'ERROR: Invalid installer signature'
|
|
|
|
rm composer-setup.php
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-08-04 18:49:50 +02:00
|
|
|
|
2017-01-27 01:59:20 +01:00
|
|
|
php {{ composer_setup }} --install-dir={{ composer_dest_dir }} --filename={{ composer_exec_name }} --quiet
|
|
|
|
RESULT=$?
|
|
|
|
php -r "unlink('{{ composer_setup }}');"
|
|
|
|
chmod 755 {{ composer_dest_dir }}/{{ composer_exec_name }}
|
|
|
|
exit $RESULT
|