2023-04-09 10:55:06 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-09-12 12:54:19 +08:00
|
|
|
# The latest mirror's composer version only support for PHP 7.2.5
|
2023-04-09 10:55:06 +08:00
|
|
|
# And if your PHP version is lesser than that, will be download supported version.
|
2023-09-12 12:54:19 +08:00
|
|
|
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '7.2.5', '>');")
|
2023-04-09 10:55:06 +08:00
|
|
|
|
|
|
|
if [ "$supportLatest" -eq "1" ]; then
|
|
|
|
curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
|
|
|
|
&& chmod +x /usr/bin/composer
|
|
|
|
else
|
2023-09-12 12:54:19 +08:00
|
|
|
curl -ksS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --disable-tls \
|
2023-04-09 10:55:06 +08:00
|
|
|
&& chmod +x /usr/bin/composer \
|
|
|
|
&& rm -rf /tmp/composer-setup.php
|
|
|
|
fi
|