Skip to content

Commit 370252d

Browse files
authored
Merge pull request #998 from jingjingxyk/experiment-feature
Experiment feature
2 parents 5736711 + 1297f15 commit 370252d

File tree

7 files changed

+66
-18
lines changed

7 files changed

+66
-18
lines changed

.github/workflows/auto-cache-pool-tarball.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
php prepare.php +apcu +ds +ssh2 +uuid +protobuf +gettext --with-libavif=1 --show-tarball-hash=1 @macos
8989
php sapi/scripts/download-php-src-archive.php
9090
91-
echo 'cygwin: https://www.cygwin.com/COPYING' > bin/LICENSE
91+
echo 'cygwin: https://www.cygwin.com/COPYING' >> bin/LICENSE
9292
cd ${{ github.workspace }}/pool/
9393
zip -9 -r ${WORK_DIR}/all-deps.zip ext lib php-tar
9494
HASH=$(sha256sum ${WORK_DIR}/all-deps.zip | awk '{print $1}')

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
1717
## 相关文章
1818

19-
- [Swoole-Cli v6.1 将允许对 array/string/stream 类型使用内置方法](https://mp.weixin.qq.com/s/5qnqmjCEb_zxLaT4sR1HAg)
19+
- [Swoole-Cli 介绍、使用说明](https://wenda.swoole.com/detail/108876)
20+
- [Swoole-Cli v6.1 将允许对 array/string/stream 类型使用内置方法](https://mp.weixin.qq.com/s/RmdKC5TLREwjcJFc-upZLQ)
2021
- [Swoole-Cli v5.0.2 增加 opcache/readline 扩展,强化 Cli-Server](https://wenda.swoole.com/detail/108931)
2122
- [Swoole-Cli v5.0.1 使用说明](https://wenda.swoole.com/detail/108876)
2223
- [Swoole-Cli v5.0.0 版本新特性预览之新的运行模式](https://wenda.swoole.com/detail/108706)
2324
- [Swoole-Cli 已提供 Windows 平台 (cygwin64)支持](https://wenda.swoole.com/detail/108743)
24-
- [Swoole-Cli 介绍、使用说明](https://wenda.swoole.com/detail/108876)
25+
- [Swoole RFC ](https://github.com/swoole/rfc/)
2526
- [Swoole v6.1 将提供 typed array 强类型数组实现,增强 PHP 标准库](https://mp.weixin.qq.com/s/yFuxYdNMqxI1VuZg0J07Wg)
2627
- [Swoole v6 2024 重磅更新:Swoole v6 正式发布,增加 16 项新功能](https://mp.weixin.qq.com/s/Ks1x1LNTLdl5jk0sIS6V_w)
2728
- [Swoole v6 协程是否支持 PHP 的 JIT ](https://mp.weixin.qq.com/s/Tm-6XVGQSlz0vDENLB3ylA)

sapi/quickstart/README.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## 一个脚本执行整个构建流程
44

5-
> 定制 build-release-php.sh 脚本 即可开始构建
5+
> 定制 build-release-php.sh 即可开始构建
66
77
```bash
88

9-
cp build-release-example.sh build-release-php.sh
9+
cp build-release-example.sh build-release-php.sh
1010

11-
bash build-release-php.sh
11+
bash build-release-php.sh
1212

1313
```
1414

@@ -22,6 +22,50 @@ bash build-release-php.sh
2222

2323
## [wsl](../../docs/wsl.md)
2424

25+
## 准备 PHP 运行时
26+
27+
```bash
28+
# 准备 PHP 运行时
29+
bash sapi/setup-php-runtime.sh
30+
31+
# 准备PHP 运行时 使用代理
32+
bash sapi/setup-php-runtime.sh --proxy http://192.168.3.26:8015
33+
34+
# 准备PHP 运行时 使用镜像 (镜像源 https://www.swoole.com/download)
35+
bash sapi/setup-php-runtime.sh --mirror china
36+
37+
38+
# 验证
39+
shopt -s expand_aliases
40+
__DIR__=$(pwd)
41+
export PATH="${__DIR__}/runtime/php/:$PATH"
42+
alias php="php -d curl.cainfo=${__DIR__}/runtime/php/cacert.pem -d openssl.cafile=${__DIR__}/runtime/php/cacert.pem"
43+
44+
php -v
45+
composer -v
46+
47+
```
48+
49+
## 准备依赖库源码
50+
51+
```bash
52+
53+
# 源码来源 https://github.com/swoole/swoole-cli/releases/download/${TAG}/all-deps.zip
54+
55+
bash sapi/download-box/download-box-get-archive-from-server.sh
56+
57+
```
58+
59+
## 准备 swoole 源码
60+
61+
> 拉取 swoole-cli 源码时没有拉取子模块,就需要执行这一步
62+
63+
```bash
64+
65+
git submodule update --init -f
66+
67+
```
68+
2569
## 准备运行环境 (linux/macos/windows)
2670

2771
1. [ linux 快速启动 容器 构建环环境 ](linux/README.md)

sapi/quickstart/windows/msys2-build/install-msys2.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,17 @@ fi
5151
pacman -S --needed --noconfirm git curl wget openssl
5252
pacman -S --needed --noconfirm zip unzip xz gcc gcc-libs cmake make
5353
pacman -S --needed --noconfirm re2c
54-
pacman -S --needed --noconfirm openssl-devel libreadline
5554
pacman -S --needed --noconfirm lzip
5655
pacman -S --needed --noconfirm zip unzip
5756
pacman -S --needed --noconfirm zlib-devel
5857
pacman -S --needed --noconfirm bison automake autoconf libtool coreutils
58+
pacman -S --needed --noconfirm openssl-devel libreadline-devel libiconv-devel
5959
pacman -S --needed --noconfirm libcurl-devel libxml2-devel libxslt-devel
6060
pacman -S --needed --noconfirm libbz2-devel liblz4-devel liblzma-devel libcares-devel
61-
pacman -S --needed --noconfirm libyaml-devel libzstd-devel libreadline-devel
62-
pacman -S --needed --noconfirm libssh2-devel libidn2-devel gettext-devel
6361
pacman -S --needed --noconfirm libzstd-devel
64-
pacman -S --needed --noconfirm icu-devel
65-
pacman -S --needed --noconfirm libsqlite-devel libsqlite
62+
pacman -S --needed --noconfirm libyaml-devel
63+
pacman -S --needed --noconfirm libssh2-devel libidn2-devel gettext-devel
64+
pacman -S --needed --noconfirm libsqlite-devel
6665
pacman -S --needed --noconfirm libedit-devel
6766
pacman -S --needed --noconfirm gmp-devel
6867
pacman -S --needed --noconfirm brotli-devel

setup-php-runtime.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ done
9797

9898
case "$MIRROR" in
9999
china)
100-
APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
100+
APP_DOWNLOAD_URL="https://storage.swoole.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
101101
COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar"
102102
if [ $OS = 'windows' ]; then
103-
APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip"
103+
APP_DOWNLOAD_URL="https://storage.swoole.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip"
104104
fi
105105
;;
106106

setup-swoole-cli-runtime.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ try
3636

3737
if ($mirror -eq 'china')
3838
{
39-
$APP_DOWNLOAD_URL = "https://wenda-1252906962.file.myqcloud.com/dist/$APP_NAME-$APP_VERSION-cygwin-x64.zip"
39+
$APP_DOWNLOAD_URL = "https://storage.swoole.com/dist/$APP_NAME-$APP_VERSION-cygwin-x64.zip"
4040
}
4141
if ($proxy -ne '')
4242
{
@@ -47,13 +47,17 @@ try
4747
{
4848
if (Get-Command "curl.exe" -ErrorAction SilentlyContinue)
4949
{
50-
curl.exe -fSLo "$TMP_APP_RUNTIME\$FILE" $APP_DOWNLOAD_URL
50+
curl.exe -H 'Referer: https://www.swoole.com/download' -H 'User-Agent: download swoole-cli runtime with setup-swoole-cli-runtime.ps1' -fSLo "$TMP_APP_RUNTIME\$FILE" $APP_DOWNLOAD_URL
5151
}
5252
else
5353
{
54+
$headers = @{
55+
'User-Agent' = 'download swoole-cli runtime with setup-swoole-cli-runtime.ps1'
56+
'Referer' = 'https://www.swoole.com/download'
57+
}
5458
# Invoke-WebRequest $APP_DOWNLOAD_URL -UseBasicParsing -OutFile $FILE
5559
# Invoke-WebRequest -Uri $APP_DOWNLOAD_URL -OutFile $FILE
56-
irm $APP_DOWNLOAD_URL -outfile "$TMP_APP_RUNTIME\$FILE"
60+
irm $APP_DOWNLOAD_URL -Headers $headers -outfile "$TMP_APP_RUNTIME\$FILE"
5761
}
5862
}
5963

setup-swoole-cli-runtime.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ fi
121121

122122
case "$MIRROR" in
123123
china)
124-
APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
124+
APP_DOWNLOAD_URL="https://storage.swoole.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
125125
COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar"
126126
if [ $OS = 'windows' ]; then
127-
APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip"
127+
APP_DOWNLOAD_URL="https://storage.swoole.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip"
128128
fi
129129
;;
130130

0 commit comments

Comments
 (0)