添加 下载PHP 运行时使用中国镜像;linux 中国镜像源

This commit is contained in:
jingjingxyk
2023-04-25 15:17:16 +08:00
parent 65d66c6073
commit 4b7b2291aa
3 changed files with 72 additions and 2 deletions

View File

@@ -28,6 +28,30 @@ __PROJECT__=$(cd ${__DIR__}/../ && pwd)
__PHP_RUNTIME_URL__="https://github.com/swoole/swoole-src/releases/download/v4.8.13/swoole-cli-v4.8.13-${__OS_FIXED__}-${__ARCH__}.tar.xz"
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
# use china mirror
# bash bin/setup-runtime --mirror china
mirror=''
while [ $# -gt 0 ]; do
case "$1" in
--mirror)
mirror="$2"
shift
;;
--*)
echo "Illegal option $1"
;;
esac
shift $(($# > 0 ? 1 : 0))
done
case "$mirror" in
china)
__PHP_RUNTIME_URL__="https://wenda-1252906962.file.myqcloud.com/dist/swoole-cli-v4.8.13-${__OS_FIXED__}-${__ARCH__}.tar.xz"
__COMPOSER_URL__="https://mirrors.aliyun.com/composer/composer.phar"
;;
esac
# download static-php binary (currently using swoole-cli temporarily)
test -d ${__PROJECT__}/downloads || mkdir ${__PROJECT__}/downloads
# download static php binary