From 1e4883f433940f7aef64d034f040a031f6e10f9b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 9 Mar 2024 18:06:48 +0800 Subject: [PATCH 01/39] update --- .../linux/SDN/OVS/demo-02/bind-br-eth0.sh | 15 +++++++++------ .../linux/SDN/OVS/demo-02/unbind-br-eth0.sh.sh | 10 +++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sapi/quickstart/linux/SDN/OVS/demo-02/bind-br-eth0.sh b/sapi/quickstart/linux/SDN/OVS/demo-02/bind-br-eth0.sh index 1c5acbd3d5..4e13776961 100644 --- a/sapi/quickstart/linux/SDN/OVS/demo-02/bind-br-eth0.sh +++ b/sapi/quickstart/linux/SDN/OVS/demo-02/bind-br-eth0.sh @@ -14,16 +14,19 @@ ip link set br-eth0 up # 激活网桥 { # 本机IP地址: 172.16.124.59 - # 本机网关: 172.16.127.253 + # 本机网关: 172.18.255.253 # 本机掩码: 255.255.240.0 # 广播地址: 172.16.127.255 - ip addr add 172.16.124.60/20 dev br-eth0 - ip route replace default via 172.16.127.253 dev br-eth0 + ip addr add 172.18.246.98/20 dev br-eth0 + ip route replace default via 172.18.255.253 dev br-eth0 - ip route add 100.100.2.136 via 172.16.127.253 dev br-eth0 - ip route add 100.100.2.138 via 172.16.127.253 dev br-eth0 - ip route add 0.0.0.0/0 via 172.16.127.253 dev br-eth0 + ip route add 100.100.2.136 via 172.18.255.253 dev br-eth0 + ip route add 100.100.2.138 via 172.18.255.253 dev br-eth0 + ip route add 0.0.0.0/0 via 172.18.255.253 dev br-eth0 + + ip addr add 10.4.20.2/24 dev br-eth0 + # ip route add 10.4.20.0/24 via 10.4.20.1 dev br-eth0 # 测试例子 # ip route del 100.100.2.136 diff --git a/sapi/quickstart/linux/SDN/OVS/demo-02/unbind-br-eth0.sh.sh b/sapi/quickstart/linux/SDN/OVS/demo-02/unbind-br-eth0.sh.sh index ffd1815a38..21bc9fe019 100644 --- a/sapi/quickstart/linux/SDN/OVS/demo-02/unbind-br-eth0.sh.sh +++ b/sapi/quickstart/linux/SDN/OVS/demo-02/unbind-br-eth0.sh.sh @@ -11,13 +11,13 @@ cd ${__DIR__} ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=' ' { - ip addr add 172.16.124.60/20 dev eth0 + ip addr add 172.18.246.98/20 dev eth0 - ip route replace default via 172.16.127.253 dev eth0 + ip route replace default via 172.18.255.253 dev eth0 - ip route add 100.100.2.136 via 172.16.127.253 dev eth0 - ip route add 100.100.2.138 via 172.16.127.253 dev eth0 - ip route add 0.0.0.0 via 172.16.127.253 dev eth0 + ip route add 100.100.2.136 via 172.18.255.253 dev eth0 + ip route add 100.100.2.138 via 172.18.255.253 dev eth0 + ip route add 0.0.0.0 via 172.18.255.253 dev eth0 } || { echo $? From a1591ad39ddc6b30a1e2dca0a960b898dc5ac375 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 15:07:38 +0800 Subject: [PATCH 02/39] update --- setup-swow-cli-runtime.sh | 154 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 setup-swow-cli-runtime.sh diff --git a/setup-swow-cli-runtime.sh b/setup-swow-cli-runtime.sh new file mode 100644 index 0000000000..3a7ad64c91 --- /dev/null +++ b/setup-swow-cli-runtime.sh @@ -0,0 +1,154 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=${__DIR__} + +cd ${__PROJECT__} + +OS=$(uname -s) +ARCH=$(uname -m) + +case $OS in +'Linux') + OS="linux" + ;; +'Darwin') + OS="macos" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="windows" + ;; + 'MINGW64_NT'*) + OS="windows" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="x64" + ;; +'aarch64' | 'arm64') + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='v8.2.13' +APP_NAME='php-cli' +VERSION='v1.2.0' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +APP_DOWNLOAD_URL="https://github.com/jingjingxyk/build-swow-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" +COMPOSER_DOWNLOAD_URL="https://getcomposer.org/download/latest-stable/composer.phar" +CACERT_DOWNLOAD_URL="https://curl.se/ca/cacert.pem" + +if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://github.com/jingjingxyk/build-swow-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" +fi + +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + MIRROR="" # 暂无镜像 + ;; + --proxy) + export HTTP_PROXY="$2" + export HTTPS_PROXY="$2" + NO_PROXY="127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16" + NO_PROXY="${NO_PROXY},::1/128,fe80::/10,fd00::/8,ff00::/8" + NO_PROXY="${NO_PROXY},localhost" + NO_PROXY="${NO_PROXY},.aliyuncs.com,.aliyun.com,.tencent.com" + NO_PROXY="${NO_PROXY},.myqcloud.com,.swoole.com" + export NO_PROXY="${NO_PROXY},.tsinghua.edu.cn,.ustc.edu.cn,.npmmirror.com" + ;; + --*) + echo "Illegal option $1" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +case "$MIRROR" in +china) + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" + fi + ;; + +esac + +test -f composer.phar || curl -LSo composer.phar ${COMPOSER_DOWNLOAD_URL} +chmod a+x composer.phar + +test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} + +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" + +if [ $OS = 'windows' ]; then + { + APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" + test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + unzip "${APP_RUNTIME}.zip" + echo + exit 0 + } +else + test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz + test -f php || tar -xvf ${APP_RUNTIME}.tar + chmod a+x php + cp -f ${__PROJECT__}/var/runtime/php ${__PROJECT__}/bin/runtime/php +fi + +cd ${__PROJECT__}/var/runtime + +cp -f ${__PROJECT__}/var/runtime/composer.phar ${__PROJECT__}/bin/runtime/composer +cp -f ${__PROJECT__}/var/runtime/cacert.pem ${__PROJECT__}/bin/runtime/cacert.pem + +cat >${__PROJECT__}/bin/runtime/php.ini < Date: Sat, 3 Aug 2024 15:09:48 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E8=B0=83=E6=95=B4=20linux=20workflow=20c?= =?UTF-8?q?onfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux-x86_64.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index 206ac59a92..7ae80bbf3b 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -39,10 +39,6 @@ jobs: run: | git submodule update --init - # 准备数据库容器 - docker-compose version - bash sapi/src/UnitTest/scripts/database/start.sh - sudo mkdir -p /usr/local/swoole-cli uid=$(id -u) && gid=$(id -g) && sudo chown -R ${uid}:${gid} /usr/local/swoole-cli @@ -127,6 +123,12 @@ jobs: bash ./make.sh build bash ./make.sh archive + - name: Start Database + run: | + # 准备数据库容器 + docker-compose version + bash sapi/src/UnitTest/scripts/database/start.sh + - name: Show Build Result run: | ./bin/swoole-cli -v From 72de6e93c5742e39a4bdaf34a7772afcd6bc43ae Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 15:51:20 +0800 Subject: [PATCH 04/39] update --- sapi/quickstart/linux/SDN/OVS/ovs-tunnel-port.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sapi/quickstart/linux/SDN/OVS/ovs-tunnel-port.md diff --git a/sapi/quickstart/linux/SDN/OVS/ovs-tunnel-port.md b/sapi/quickstart/linux/SDN/OVS/ovs-tunnel-port.md new file mode 100644 index 0000000000..8736909705 --- /dev/null +++ b/sapi/quickstart/linux/SDN/OVS/ovs-tunnel-port.md @@ -0,0 +1,14 @@ +## ovn 修改隧道使用的端口 + + https://github.com/ovn-org/ovn/issues/255 + + + for i in $(ovn-sbctl --bare --columns _uuid list encap); do ovn-sbctl set encap $i options:dst_port=6083; done + + + # 单个设置 + ovn-sbctl set encap 1f8c6722-574a-4acf-bd6b-26f6e4d61531 options:dst_port=6083 + + + # 此是指 还没有实现 + ovs-vsctl set open . external_ids:ovn-encap-port=6081 From fbfbb24e5eb57c72be860a59798a4e1500e80908 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 16:03:14 +0800 Subject: [PATCH 05/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20github=20action=20li?= =?UTF-8?q?nux=20docker-composer=20no=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux-x86_64.yml | 2 ++ .../linux/install-docker-compose.sh | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 sapi/quickstart/linux/install-docker-compose.sh diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index 7ae80bbf3b..c487dbb681 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -126,7 +126,9 @@ jobs: - name: Start Database run: | # 准备数据库容器 + export PATH=/usr/libexec/docker/cli-plugins/:$PATH docker-compose version + docker container ls -a bash sapi/src/UnitTest/scripts/database/start.sh - name: Show Build Result diff --git a/sapi/quickstart/linux/install-docker-compose.sh b/sapi/quickstart/linux/install-docker-compose.sh new file mode 100644 index 0000000000..a090c6ce7a --- /dev/null +++ b/sapi/quickstart/linux/install-docker-compose.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -ex +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../../../ + pwd +) +cd ${__PROJECT__} + +if ! docker info >/dev/null 2>&1; then + echo "This script uses docker, and it isn't running - please start docker and try again!" + echo "Docker does not seem to be running, run it first and retry" + exit 1 +fi + +docker info +ls -lh /usr/libexec/docker/cli-plugins/ + +if [ ! -f /usr/libexec/docker/cli-plugins/docker-compose ]; then + + # show more version info + # https://github.com/docker/compose/releases + VERSION="v2.29.1" + + curl -fsSL "https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + + chmod +x /usr/local/bin/docker-compose + +fi + +docker-compose --version From 3824bd5cd616908ad3d52829f0dfa5254aeff9fa Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 18:53:00 +0800 Subject: [PATCH 06/39] update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index d8c83bfa54..98283fd631 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,17 @@ - [swoole-cli 搭建依赖库镜像服务](sapi/download-box/README.md) - [快速初始化构建环境](sapi/quickstart/README.md) +## 立即使用 swoole-cli + +```shell + +curl -fSL https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtime.sh?raw=true | bash + +# 来自 https://www.swoole.com/download +curl -fSL https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtime.sh?raw=true | bash -s -- --mirror china + +``` + ## Clone ```shell From aa0cfb2dbc077ab48064346f69c37eb665d12f05 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 18:56:49 +0800 Subject: [PATCH 07/39] update README.md --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 98283fd631..ce837a2c54 100644 --- a/README.md +++ b/README.md @@ -39,17 +39,6 @@ - [https://github.com/swoole/swoole-cli/releases](https://github.com/swoole/swoole-cli/releases) - [https://github.com/swoole/swoole-src/releases](https://github.com/swoole/swoole-src/releases) -## `swoole-cli`构建文档 - -- [linux 版构建文档](docs/linux.md) -- [macOS 版构建文档](docs/macOS.md) -- [windows Cygwin 版构建文档](docs/Cygwin.md) -- [windows WSL 版构建文档](docs/wsl.md) -- [swoole-cli 构建选项文档](docs/options.md) -- [打包成二进制可执行文件 文档](sapi/samples/sfx/README.md) -- [swoole-cli 搭建依赖库镜像服务](sapi/download-box/README.md) -- [快速初始化构建环境](sapi/quickstart/README.md) - ## 立即使用 swoole-cli ```shell @@ -61,6 +50,17 @@ curl -fSL https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtim ``` +## `swoole-cli`构建文档 + +- [linux 版构建文档](docs/linux.md) +- [macOS 版构建文档](docs/macOS.md) +- [windows Cygwin 版构建文档](docs/Cygwin.md) +- [windows WSL 版构建文档](docs/wsl.md) +- [swoole-cli 构建选项文档](docs/options.md) +- [打包成二进制可执行文件 文档](sapi/samples/sfx/README.md) +- [swoole-cli 搭建依赖库镜像服务](sapi/download-box/README.md) +- [快速初始化构建环境](sapi/quickstart/README.md) + ## Clone ```shell From 2a54cdc3df87b25628a3354de21ae8ec1473020d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 19:30:36 +0800 Subject: [PATCH 08/39] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d20dd7e09..0f6b6a7a28 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ curl -fSL https://github.com/swoole/build-static-php/blob/main/setup-php-cli-run ``` ## `php-cli`构建文档 -======= + - [linux 版构建文档](docs/linux.md) - [macOS 版构建文档](docs/macOS.md) From c202d4fe56df6c1c1cd8027c6f310b79638ddfad Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 19:37:13 +0800 Subject: [PATCH 09/39] update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f6b6a7a28..140c845f5e 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,7 @@ curl -fSL https://github.com/swoole/build-static-php/blob/main/setup-php-cli-run ``` -## `php-cli`构建文档 - +## 构建文档 - [linux 版构建文档](docs/linux.md) - [macOS 版构建文档](docs/macOS.md) From c9d4a793c4aa84cd1e08954260ce349fbbd5e549 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 00:07:47 +0800 Subject: [PATCH 10/39] update --- .github/workflows/linux-x86_64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index a104b82827..7b1f0d2b6b 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -212,7 +212,7 @@ jobs: ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php -r "echo PHP_VERSION;" ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php --list-tests ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php - ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/SwoolePGSQLTest.php + # ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/SwoolePGSQLTest.php - name: production artifacts debug uses: actions/upload-artifact@v4 From 82ae0b908ad206b48b36581ac8f12dd872618c55 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 00:22:31 +0800 Subject: [PATCH 11/39] =?UTF-8?q?=E5=8F=91=E7=89=88=E6=97=B6=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=E4=BD=BF=E7=94=A8=20pool=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-cache-pool-tarball.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-cache-pool-tarball.yml b/.github/workflows/auto-cache-pool-tarball.yml index 8fc9db5554..e083f7f29b 100644 --- a/.github/workflows/auto-cache-pool-tarball.yml +++ b/.github/workflows/auto-cache-pool-tarball.yml @@ -60,6 +60,11 @@ jobs: path: ${{ github.workspace }}/pool/ key: source-code-tarball-pool + - name: Clean Cache On Release + if: startsWith(github.ref, 'refs/tags/') + run: + rm -rf ${{ github.workspace }}/pool/* + - name: Prepare Runtime and Libraries and Extensions run: | set -x @@ -79,8 +84,8 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php +inotify +apcu +ds +xlswriter +ssh2 +pgsql --show-tarball-hash=1 - php prepare.php +apcu +ds +xlswriter +ssh2 +pgsql @macos --show-tarball-hash=1 + php prepare.php +inotify +apcu +ds +xlswriter +ssh2 +pgsql +uuid --show-tarball-hash=1 + php prepare.php +apcu +ds +xlswriter +ssh2 +pgsql +uuid @macos --show-tarball-hash=1 cd ${{ github.workspace }}/pool/ zip -9 -r ${WORK_DIR}/all-deps.zip ext lib From 7142e1475acd0361dfa516ed2a963f40722c63d0 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 07:33:21 +0800 Subject: [PATCH 12/39] update --- .github/workflows/auto-cache-pool-tarball.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-cache-pool-tarball.yml b/.github/workflows/auto-cache-pool-tarball.yml index e083f7f29b..2788d34c26 100644 --- a/.github/workflows/auto-cache-pool-tarball.yml +++ b/.github/workflows/auto-cache-pool-tarball.yml @@ -60,7 +60,7 @@ jobs: path: ${{ github.workspace }}/pool/ key: source-code-tarball-pool - - name: Clean Cache On Release + - name: Clean Source Code Tarball Cache On Release if: startsWith(github.ref, 'refs/tags/') run: rm -rf ${{ github.workspace }}/pool/* @@ -84,8 +84,8 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php +inotify +apcu +ds +xlswriter +ssh2 +pgsql +uuid --show-tarball-hash=1 - php prepare.php +apcu +ds +xlswriter +ssh2 +pgsql +uuid @macos --show-tarball-hash=1 + php prepare.php +inotify +apcu +ds +xlswriter +ssh2 +uuid --show-tarball-hash=1 + php prepare.php +apcu +ds +xlswriter +ssh2 +uuid @macos --show-tarball-hash=1 cd ${{ github.workspace }}/pool/ zip -9 -r ${WORK_DIR}/all-deps.zip ext lib From 2656fbb5863c83879c5906f87fc0a2324f7b74ee Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 09:02:12 +0800 Subject: [PATCH 13/39] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E9=95=9C=E5=83=8F=E6=98=AF=E5=90=A6=E5=AD=98?= =?UTF-8?q?=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/template/make.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index b8bccf4a6f..f03ec6875f 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -332,7 +332,7 @@ container=$(docker ps -a -f name= | tail -n +2 2> /dev/null) base_image=$(docker images :getBaseImageTag() ?> | tail -n +2 2> /dev/null) image=$(docker images :getImageTag() ?> | tail -n +2 2> /dev/null) - CONTAINER_STATE=$(docker inspect -f {{.State.Running}} 2> /dev/null) + CONTAINER_STATE=$(docker inspect -f "{{.State.Running}}" 2> /dev/null) if [[ "${CONTAINER_STATE}" != "true" ]]; then bash ./make.sh docker-stop container='' @@ -348,6 +348,9 @@ else echo ":getImageTag() ?> image does not exist, try to pull" echo "create container with :getImageTag() ?> image" + # check container image exists + # curl -fsSlL --head https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null && echo "exist" || echo "not exists" + # curl -fsSlL --head https://hub.docker.com/v2/repositories//tags/getImageTag() ?>/ > /dev/null && echo "container image exist" || echo "container image not exists" docker run -d --name -v ${__PROJECT_DIR__}:/work :getImageTag() ?> tini -- tail -f /dev/null fi fi From 43d59671bb9e4fdf8e819cd14edbd2129ddfdbef Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 09:31:17 +0800 Subject: [PATCH 14/39] update php-cli-runtime.sh --- setup-php-cli-runtime.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-php-cli-runtime.sh b/setup-php-cli-runtime.sh index af40cb54b4..e694d7e294 100644 --- a/setup-php-cli-runtime.sh +++ b/setup-php-cli-runtime.sh @@ -50,7 +50,7 @@ esac APP_VERSION='v8.2.13' APP_NAME='php-cli' -VERSION='v1.2.2' +VERSION='v1.3.0' mkdir -p bin/runtime mkdir -p var/runtime From c27ade248132391fbfcab4867a64824011781f38 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 16:22:06 +0800 Subject: [PATCH 15/39] fix libiconv download url bug --- sapi/src/builder/library/libiconv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/builder/library/libiconv.php b/sapi/src/builder/library/libiconv.php index 7f74986a23..778368ba4d 100644 --- a/sapi/src/builder/library/libiconv.php +++ b/sapi/src/builder/library/libiconv.php @@ -11,7 +11,7 @@ ->withManual('https://www.gnu.org/software/libiconv/') ->withLicense('https://www.gnu.org/licenses/old-licenses/gpl-2.0.html', Library::LICENSE_GPL) //->withUrl('https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz') - ->withUrl('https://ftpmirror.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz') + ->withUrl('https://ftpmirror.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz') ->withMirrorUrl('https://mirrors.tuna.tsinghua.edu.cn/gnu/libiconv/libiconv-1.17.tar.gz') ->withMirrorUrl('https://mirrors.ustc.edu.cn/gnu/libiconv/libiconv-1.17.tar.gz') From b56c4b920bf7fbcf944e499388733893a94920ff Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 16:31:44 +0800 Subject: [PATCH 16/39] update download-box-get-archive-from-server.sh --- sapi/download-box/download-box-get-archive-from-server.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/download-box/download-box-get-archive-from-server.sh b/sapi/download-box/download-box-get-archive-from-server.sh index 2259e6356c..df8210082b 100644 --- a/sapi/download-box/download-box-get-archive-from-server.sh +++ b/sapi/download-box/download-box-get-archive-from-server.sh @@ -22,8 +22,8 @@ if [ -f "${__PROJECT__}/sapi/PHP-VERSION.conf" ] ; then DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v5.1.3.0/' ALL_DEPS_HASH="5fa1485c2408f05cbc548712917e6dbb8ecd5a631b558d6d512d4a6671f071e5" else - DOMAIN='https://github.com/swoole/build-static-php/releases/download/v1.2.1/' - ALL_DEPS_HASH="feb997287d2e906175da9369788ca995205f374745d9070e2bf227c875467fa4" + DOMAIN='https://github.com/swoole/build-static-php/releases/download/v1.3.2/' + ALL_DEPS_HASH="15769d1003213bf8849ac73bf96bc7629b138a694e8367fb2139756e20c2901d" fi while [ $# -gt 0 ]; do From 31836b940ca19cc5a64055cf0c8e6062e422a304 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 17:33:48 +0800 Subject: [PATCH 17/39] update --- sapi/quickstart/linux/alpine-init.sh | 1 + sapi/quickstart/linux/debian-init.sh | 1 + sapi/quickstart/macos/macos-init.sh | 1 + sapi/tools/gpg-verify.sh | 32 ++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 sapi/tools/gpg-verify.sh diff --git a/sapi/quickstart/linux/alpine-init.sh b/sapi/quickstart/linux/alpine-init.sh index c591361a82..d137a51299 100644 --- a/sapi/quickstart/linux/alpine-init.sh +++ b/sapi/quickstart/linux/alpine-init.sh @@ -58,6 +58,7 @@ apk add python3-dev apk add mercurial apk add gettext-dev apk add pigz parallel +apk add gnupg case "$MIRROR" in china | tuna | ustc) diff --git a/sapi/quickstart/linux/debian-init.sh b/sapi/quickstart/linux/debian-init.sh index 6e715a680a..e2bb423604 100644 --- a/sapi/quickstart/linux/debian-init.sh +++ b/sapi/quickstart/linux/debian-init.sh @@ -125,6 +125,7 @@ apt install -y python3 python3-pip ninja-build diffutils apt install -y yasm nasm apt install -y meson apt install -y netcat-openbsd socat +apt install -y gnupg case "$MIRROR" in china | tuna | ustc) diff --git a/sapi/quickstart/macos/macos-init.sh b/sapi/quickstart/macos/macos-init.sh index b37d86bd45..4ead020231 100644 --- a/sapi/quickstart/macos/macos-init.sh +++ b/sapi/quickstart/macos/macos-init.sh @@ -79,6 +79,7 @@ brew install libtool gettext coreutils libunistring pkg-config cmake # macos 环境下 Homebrew packages : coreutils binutils 不兼容 # 详见: https://github.com/pyenv/pyenv/wiki/Common-build-problems#keg-only-homebrew-packages-are-forcibly-linked--added-to-path brew install jq mercurial +brew install gnupg # 已安装的包 跳过安装 # PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4 autoconf) diff --git a/sapi/tools/gpg-verify.sh b/sapi/tools/gpg-verify.sh new file mode 100644 index 0000000000..d4a5fbb4f5 --- /dev/null +++ b/sapi/tools/gpg-verify.sh @@ -0,0 +1,32 @@ +#!/usr/biin/env bash +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../../ + pwd +) +cd ${__PROJECT__} + +mkdir -p ${__PROJECT__}/var/ + +cd ${__PROJECT__}/var/ + +# curl https://www.gnu.org/usenet/usenet-gpg-key.txt +# https://ftp.gnu.org/gnu/gnu-keyring.gpg + +# test -f gnu-keyring.gpg || curl -Lo gnu-keyring.gpg https://ftp.gnu.org/gnu/gnu-keyring.gpg +test -f gnu-keyring.gpg || curl -Lo gnu-keyring.gpg https://ftpmirror.gnu.org/gnu/gnu-keyring.gpg +# test -f libiconv-1.17.tar.gz.sig || curl -Lo libiconv-1.17.tar.gz.sig https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz.sig +test -f libiconv-1.17.tar.gz.sig || curl -Lo libiconv-1.17.tar.gz.sig https://ftpmirror.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz.sig + +{ + gpg --import gnu-keyring.gpg +} || { + echo $? +} + +# gpg --verify file.sig file +gpg --verify libiconv-1.17.tar.gz.sig ${__PROJECT__}/pool/lib/libiconv-1.17.tar.gz From 3a5ee9d4e2103cad1139d93c705827fe8bc8b5b2 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 17:37:16 +0800 Subject: [PATCH 18/39] update --- sapi/tools/gpg-verify.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/tools/gpg-verify.sh b/sapi/tools/gpg-verify.sh index d4a5fbb4f5..fd1ac866d9 100644 --- a/sapi/tools/gpg-verify.sh +++ b/sapi/tools/gpg-verify.sh @@ -10,9 +10,9 @@ __PROJECT__=$( ) cd ${__PROJECT__} -mkdir -p ${__PROJECT__}/var/ +mkdir -p ${__PROJECT__}/var/gnupg-verify -cd ${__PROJECT__}/var/ +cd ${__PROJECT__}/var/gnupg-verify # curl https://www.gnu.org/usenet/usenet-gpg-key.txt # https://ftp.gnu.org/gnu/gnu-keyring.gpg From 5e074a30b718de773f911f4ce15c1cce0c0a2285 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 20:09:57 +0800 Subject: [PATCH 19/39] update setup-php-cli-runtime.sh --- setup-php-cli-runtime.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-php-cli-runtime.sh b/setup-php-cli-runtime.sh index e694d7e294..45f01d569d 100644 --- a/setup-php-cli-runtime.sh +++ b/setup-php-cli-runtime.sh @@ -50,7 +50,7 @@ esac APP_VERSION='v8.2.13' APP_NAME='php-cli' -VERSION='v1.3.0' +VERSION='v1.3.2' mkdir -p bin/runtime mkdir -p var/runtime From 28d7bfedfd017c90a32bc2646995a145ee51d61a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 20:29:15 +0800 Subject: [PATCH 20/39] update --- setup-go-runtime.sh | 27 +++++++++++++-------------- setup-nodejs-runtime.sh | 2 +- setup-swoole-cli-pre-runtime.sh | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/setup-go-runtime.sh b/setup-go-runtime.sh index b8ad08fc16..c57c7e2a42 100644 --- a/setup-go-runtime.sh +++ b/setup-go-runtime.sh @@ -39,7 +39,7 @@ case $ARCH in 'x86_64') ARCH="amd64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -57,7 +57,7 @@ mkdir -p var/runtime cd ${__PROJECT__}/var/runtime -:<<'EOF' +: <<'EOF' https://go.dev/dl/go1.22.5.windows-amd64.msi @@ -83,7 +83,6 @@ while [ $# -gt 0 ]; do case "$1" in --mirror) MIRROR="$2" - MIRROR="" ;; --proxy) export HTTP_PROXY="$2" @@ -104,25 +103,25 @@ done case "$MIRROR" in china) - APP_DOWNLOAD_URL="https://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + APP_DOWNLOAD_URL="https://golang.google.cn/dl/${APP_NAME}${APP_VERSION}.${OS}-${ARCH}.tar.gz" if [ $OS = 'windows' ]; then - APP_DOWNLOAD_URL="https://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.zip" + APP_DOWNLOAD_URL="https://golang.google.cn/dl/${APP_NAME}${APP_VERSION}.${OS}-${ARCH}.zip" fi ;; esac APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" if [ $OS = 'windows' ]; then - test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} - test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} - unzip "${APP_RUNTIME}.zip" - exit 0 + test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + unzip "${APP_RUNTIME}.zip" + exit 0 else - test -f ${APP_RUNTIME}.tar.gz || curl -LSo ${APP_RUNTIME}.tar.gz ${APP_DOWNLOAD_URL} - test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} - tar -xvf ${APP_RUNTIME}.tar.gz - test -d ${__PROJECT__}/bin/runtime/go && rm -rf ${__PROJECT__}/bin/runtime/go - mv go ${__PROJECT__}/bin/runtime/go + test -f ${APP_RUNTIME}.tar.gz || curl -LSo ${APP_RUNTIME}.tar.gz ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + tar -xvf ${APP_RUNTIME}.tar.gz + test -d ${__PROJECT__}/bin/runtime/go && rm -rf ${__PROJECT__}/bin/runtime/go + mv go ${__PROJECT__}/bin/runtime/go fi cd ${__PROJECT__}/ diff --git a/setup-nodejs-runtime.sh b/setup-nodejs-runtime.sh index e9097c5ffa..1f8a77f6b9 100644 --- a/setup-nodejs-runtime.sh +++ b/setup-nodejs-runtime.sh @@ -6,7 +6,7 @@ __DIR__=$( pwd ) __PROJECT__=$( - cd "${__DIR__}/../" + cd "${__DIR__}/" pwd ) diff --git a/setup-swoole-cli-pre-runtime.sh b/setup-swoole-cli-pre-runtime.sh index 3944bc1c58..63bc40ec02 100644 --- a/setup-swoole-cli-pre-runtime.sh +++ b/setup-swoole-cli-pre-runtime.sh @@ -50,7 +50,7 @@ esac APP_VERSION='v6.0.0-dev' APP_NAME='swoole-cli' -VERSION='swoole-cli-v0.0.7' +VERSION='swoole-cli-v0.0.8' mkdir -p bin/runtime mkdir -p var/runtime From cbc7b8e9e688e00ef69327ecf534232369cce98e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 20:43:09 +0800 Subject: [PATCH 21/39] update --- sapi/quickstart/clean-folder-for-extra-build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index 325796ac43..df60f4176f 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -88,10 +88,12 @@ test -f setup-socat-runtime.sh && rm -rf setup-socat-runtime.sh test -f setup-supervisord.sh && rm -rf setup-supervisord.sh test -f setup-swoole-cli-pre-runtime.sh && rm -rf setup-swoole-cli-pre-runtime.sh test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh +test -f setup-swow-cli-runtime.sh && rm -rf setup-swow-cli-runtime.sh cd ${__PROJECT__} echo '删除完毕' +echo '' From a1d064ef1046bc117d8fc1752632e3e750e33f84 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 4 Aug 2024 20:56:00 +0800 Subject: [PATCH 22/39] update --- .github/workflows/linux-x86_64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index ed91c06bb2..70b6149e76 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -210,7 +210,7 @@ jobs: export PATH=/usr/libexec/docker/cli-plugins/:$PATH docker-compose version docker container ls -a - bash sapi/src/UnitTest/scripts/database/start.sh + # bash sapi/src/UnitTest/scripts/database/start.sh - name: Show Build Result run: | From d9d9b6da862fc51d3e463b5e434b2a4ee48611ce Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 6 Aug 2024 14:05:51 +0800 Subject: [PATCH 23/39] update --- sapi/docker/nginx/README.md | 3 +++ sapi/src/library_builder/electron/README.md | 11 +++++++++++ sapi/src/library_builder/tauri/README.md | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 sapi/docker/nginx/README.md create mode 100644 sapi/src/library_builder/electron/README.md create mode 100644 sapi/src/library_builder/tauri/README.md diff --git a/sapi/docker/nginx/README.md b/sapi/docker/nginx/README.md new file mode 100644 index 0000000000..fcbfaa4531 --- /dev/null +++ b/sapi/docker/nginx/README.md @@ -0,0 +1,3 @@ +# 更多nginx信息 + + https://gitee.com/jingjingxyk/quickstart-nginx-php-fpm.git diff --git a/sapi/src/library_builder/electron/README.md b/sapi/src/library_builder/electron/README.md new file mode 100644 index 0000000000..1b73615173 --- /dev/null +++ b/sapi/src/library_builder/electron/README.md @@ -0,0 +1,11 @@ +## electron + + https://www.electronjs.org/zh/docs/latest/ + +## Chromium Embedded Framework (CEF) + + https://github.com/chromiumembedded/cef + +## ungoogled-chromium + + https://github.com/ungoogled-software/ungoogled-chromium diff --git a/sapi/src/library_builder/tauri/README.md b/sapi/src/library_builder/tauri/README.md new file mode 100644 index 0000000000..3a9caa50ea --- /dev/null +++ b/sapi/src/library_builder/tauri/README.md @@ -0,0 +1,3 @@ +# tauri + + https://tauri.app/zh-cn/ From 3a09e4214961c70a87e959f50a54ed7a0fbdcef7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 6 Aug 2024 14:06:33 +0800 Subject: [PATCH 24/39] update --- sapi/quickstart/linux/extra/archlinux-php-init.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sapi/quickstart/linux/extra/archlinux-php-init.sh diff --git a/sapi/quickstart/linux/extra/archlinux-php-init.sh b/sapi/quickstart/linux/extra/archlinux-php-init.sh new file mode 100644 index 0000000000..305a72322f --- /dev/null +++ b/sapi/quickstart/linux/extra/archlinux-php-init.sh @@ -0,0 +1,5 @@ +pacman -Sy --noconfirm git curl wget openssl which +pacman -Sy --noconfirm cmake autoconf libtool make gcc +pacman -Sy --noconfirm pkg-config unixodbc c-are +pacman -Sy --noconfirm extra/php +pacman -Sy --noconfirm extra/php-redis extra/php-pgsql extra/php-sqlite From 5ee11d4a2f304d3b6c063a7c7c5821f59d55195b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 6 Aug 2024 15:28:19 +0800 Subject: [PATCH 25/39] update --- sapi/src/library_builder/7z.md | 3 +++ sapi/src/library_builder/chromium.md | 14 +++++++++++++- sapi/src/library_builder/compiler.md | 7 +++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/sapi/src/library_builder/7z.md b/sapi/src/library_builder/7z.md index 1e9ab80341..6d91cba1ba 100644 --- a/sapi/src/library_builder/7z.md +++ b/sapi/src/library_builder/7z.md @@ -6,3 +6,6 @@ # 例子,分包大小100MB 7z a -v100m /tmp/jingjingxy.7z ./ + + + https://www.7-zip.org/ diff --git a/sapi/src/library_builder/chromium.md b/sapi/src/library_builder/chromium.md index 18305da177..f7d2daaccb 100644 --- a/sapi/src/library_builder/chromium.md +++ b/sapi/src/library_builder/chromium.md @@ -1,5 +1,17 @@ -chromium 截图 +chromium 截图 打开开发者工具,cmd + shift + p 自带。 按下 F12 + +## electron + + https://www.electronjs.org/zh/docs/latest/ + +## Chromium Embedded Framework (CEF) + + https://github.com/chromiumembedded/cef + +## ungoogled-chromium + + https://github.com/ungoogled-software/ungoogled-chromium diff --git a/sapi/src/library_builder/compiler.md b/sapi/src/library_builder/compiler.md index 9bd980afe2..dabca00fbd 100644 --- a/sapi/src/library_builder/compiler.md +++ b/sapi/src/library_builder/compiler.md @@ -117,3 +117,10 @@ autoheader automake --foreign --copy --add-missing autoconf export CFLAGS="-O2 -Wall -W -Wunused-const-variable=0 -pipe -g" + + + +预处理 gcc -E 、clang -E +编译 gcc -S 、clang -S +汇编 gcc -c 、clang -c +链接 gcc -o 、clang -o From 51d8eb9fd5717e7d758abb03146854d5574d3230 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 14:42:21 +0800 Subject: [PATCH 26/39] update --- sapi/docker/database/README.md | 34 ++++ sapi/docker/database/docker-compose.yaml | 75 ++++---- sapi/docker/database/my.cnf | 9 + .../clean-folder-for-extra-build.sh | 1 + setup-php-fpm-7.4-runtime.sh | 164 ++++++++++++++++++ setup-php-fpm-runtime.sh | 6 +- setup-swow-cli-runtime.sh | 13 ++ 7 files changed, 263 insertions(+), 39 deletions(-) create mode 100644 sapi/docker/database/README.md create mode 100644 sapi/docker/database/my.cnf create mode 100644 setup-php-fpm-7.4-runtime.sh diff --git a/sapi/docker/database/README.md b/sapi/docker/database/README.md new file mode 100644 index 0000000000..e3e7349aa4 --- /dev/null +++ b/sapi/docker/database/README.md @@ -0,0 +1,34 @@ +# mysql + +```shell + + + +# 查看环境变量 +# mysqld --verbose --help + +# 创建用户 +# CREATE USER 'username'@'ipaddress' IDENTIFIED BY 'password'; + +# 修改mysql用户授权 允许远程连接 +# GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; + +# UPDATE user SET host='%' WHERE user='root'; + +# FLUSH PRIVILEGES; + + + +# SHOW PROCESSLIST ; +# select user,host,plugin from mysql.user; + +# status +# SHOW STATUS LIKE 'Ssl_cipher'; + + +# CREATE DATABASE my_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +# jdbc:mysql://10.192.99.1:3306?allowPublicKeyRetrieval=true&useSSL=false + +``` diff --git a/sapi/docker/database/docker-compose.yaml b/sapi/docker/database/docker-compose.yaml index a2d5040f5d..307421e53e 100644 --- a/sapi/docker/database/docker-compose.yaml +++ b/sapi/docker/database/docker-compose.yaml @@ -1,38 +1,41 @@ version: "3" services: - postgresql-server: - # image: postgres:15-alpine - image: postgis/postgis:15-3.3-alpine - hostname: "postgresql" - ports: - - "5432:5432" - environment: - - "POSTGRES_PASSWORD=example" - # 容器内数据目录 /var/lib/postgresql/data - # auth_user: postgres - # auth_password: example - mysql-server: - # image: mysql:8-debian - image: mariadb:10.6.14-focal - command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --tls-version='' - environment: - MYSQL_ROOT_PASSWORD: "example" - # MARIADB_USER: root - MARIADB_PASSWORD: "example" - MARIADB_ROOT_PASSWORD: "example" - ports: - - "3306:3306" - # 容器内数据目录 /var/lib/mysql - redis-server: - image: redis:7-alpine - ports: - - "6379:6379" - # 容器内数据目录 /data - mongodb-server: - image: mongo:latest - environment: - MONGO_INITDB_ROOT_USERNAME: root - MONGO_INITDB_ROOT_PASSWORD: example - ports: - - "27017:27017" - # 容器内数据目录 /data/db + postgresql-server: + # image: postgres:15-alpine + image: postgis/postgis:15-3.3-alpine + hostname: "postgresql" + ports: + - "5432:5432" + environment: + - "POSTGRES_PASSWORD=example" + # 容器内数据目录 /var/lib/postgresql/data + # auth_user: postgres + # auth_password: example + mysql-server: + # image: mysql:9 + image: mariadb:11 + command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --tls-version='' + environment: + MYSQL_ROOT_PASSWORD: "example" + # MARIADB_USER: root + MARIADB_PASSWORD: "example" + MARIADB_ROOT_PASSWORD: "example" + ports: + - "3306:3306" + container_name: mysql-server + # 容器内数据目录 /var/lib/mysql + volumes: + - ./my.cnf:/etc/mysql/conf.d/my.cnf + redis-server: + image: redis:7-alpine + ports: + - "6379:6379" + # 容器内数据目录 /data + mongodb-server: + image: mongo:latest + environment: + MONGO_INITDB_ROOT_USERNAME: root + MONGO_INITDB_ROOT_PASSWORD: example + ports: + - "27017:27017" + # 容器内数据目录 /data/db diff --git a/sapi/docker/database/my.cnf b/sapi/docker/database/my.cnf new file mode 100644 index 0000000000..86e3ce9514 --- /dev/null +++ b/sapi/docker/database/my.cnf @@ -0,0 +1,9 @@ +[mysqld] +skip_ssl + +# bind-address = 0.0.0.0 +# bind-address = :: + +# 跳过密码登录 +# skip-grant-tables + diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index df60f4176f..efe65e8248 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -89,6 +89,7 @@ test -f setup-supervisord.sh && rm -rf setup-supervisord.sh test -f setup-swoole-cli-pre-runtime.sh && rm -rf setup-swoole-cli-pre-runtime.sh test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh test -f setup-swow-cli-runtime.sh && rm -rf setup-swow-cli-runtime.sh +test -f setup-php-fpm-7.4-runtime.sh && rm -rf setup-php-fpm-7.4-runtime.sh cd ${__PROJECT__} diff --git a/setup-php-fpm-7.4-runtime.sh b/setup-php-fpm-7.4-runtime.sh new file mode 100644 index 0000000000..578fcc0417 --- /dev/null +++ b/setup-php-fpm-7.4-runtime.sh @@ -0,0 +1,164 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=${__DIR__} + +cd ${__PROJECT__} + +OS=$(uname -s) +ARCH=$(uname -m) + +case $OS in +'Linux') + OS="linux" + ;; +'Darwin') + OS="macos" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="windows" + ;; + 'MINGW64_NT'*) + OS="windows" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="x64" + ;; +'aarch64' | 'arm64' ) + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='v7.4.33' +APP_NAME='php-fpm' +VERSION='php-fpm-7.4-v1.1.0' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" +COMPOSER_DOWNLOAD_URL="https://getcomposer.org/download/latest-stable/composer.phar" +CACERT_DOWNLOAD_URL="https://curl.se/ca/cacert.pem" + +if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" +fi + +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + ;; + --proxy) + export HTTP_PROXY="$2" + export HTTPS_PROXY="$2" + NO_PROXY="127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16" + NO_PROXY="${NO_PROXY},::1/128,fe80::/10,fd00::/8,ff00::/8" + NO_PROXY="${NO_PROXY},localhost" + NO_PROXY="${NO_PROXY},.aliyuncs.com,.aliyun.com,.tencent.com" + NO_PROXY="${NO_PROXY},.myqcloud.com,.swoole.com" + export NO_PROXY="${NO_PROXY},.tsinghua.edu.cn,.ustc.edu.cn,.npmmirror.com" + ;; + --*) + echo "Illegal option $1" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +case "$MIRROR" in +china) + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" + fi + ;; + +esac + +test -f composer.phar || curl -LSo composer.phar ${COMPOSER_DOWNLOAD_URL} +chmod a+x composer.phar + +test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} + +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" + +if [ $OS = 'windows' ]; then + { + APP_RUNTIME="${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}" + test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + unzip "${APP_RUNTIME}.zip" + echo + exit 0 + } +else + test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz + test -f php-fpm || tar -xvf ${APP_RUNTIME}.tar + chmod a+x php-fpm + cp -f ${__PROJECT__}/var/runtime/php-fpm ${__PROJECT__}/bin/runtime/php-fpm +fi + +cd ${__PROJECT__}/var/runtime + +cp -f ${__PROJECT__}/var/runtime/composer.phar ${__PROJECT__}/bin/runtime/composer +cp -f ${__PROJECT__}/var/runtime/cacert.pem ${__PROJECT__}/bin/runtime/cacert.pem + +cat >${__PROJECT__}/bin/runtime/php.ini <${__PROJECT__}/bin/runtime/php.ini < Date: Wed, 7 Aug 2024 16:02:34 +0800 Subject: [PATCH 27/39] update setup-php-fpm-runtime.sh --- setup-php-fpm-runtime.sh | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/setup-php-fpm-runtime.sh b/setup-php-fpm-runtime.sh index 5d204dd47f..97f6d47b63 100644 --- a/setup-php-fpm-runtime.sh +++ b/setup-php-fpm-runtime.sh @@ -39,7 +39,7 @@ case $ARCH in 'x86_64') ARCH="x64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -148,6 +148,42 @@ expose_php=Off EOF +cat >${__PROJECT__}/bin/runtime/php-fpm.conf <<'EOF' +; 更多配置参考 +; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in +; https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in + +[global] +pid = run/php-fpm.pid +error_log = log/php-fpm.log +daemonize = yes + +[www] +user = nobody +group = nobody + +listen = 9001 +;listen = run/php-fpm.sock + +slowlog = log/$pool.log.slow +request_slowlog_timeout = 30s + + +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 + +; MAIN_PID=$(cat var/run/php-fpm.pid) +; 关闭 php-fpm +; kill -QUIT $MAIN_PID + +; 平滑重启 php-fpm +; kill -USR2 $MAIN_PID + +EOF + cd ${__PROJECT__}/ set +x From f5aa172010c18c6f5c0898af9e76f42a469e8f51 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 18:03:48 +0800 Subject: [PATCH 28/39] update prepare.php --- prepare.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/prepare.php b/prepare.php index 67004199c9..823a44a949 100755 --- a/prepare.php +++ b/prepare.php @@ -188,18 +188,10 @@ $c_compiler = $p->getInputOption('with-c-compiler'); -if ($c_compiler == 'musl-gcc') { - $p->set_C_COMPILER('musl-gcc'); - $p->set_CXX_COMPILER('g++'); - $p->setLinker('ld'); -} elseif ($c_compiler == 'gcc') { +if ($c_compiler == 'gcc') { $p->set_C_COMPILER('gcc'); $p->set_CXX_COMPILER('g++'); $p->setLinker('ld'); -} elseif ($c_compiler == 'x86_64-linux-musl-gcc') { - $p->set_C_COMPILER('x86_64-linux-musl-gcc'); - $p->set_CXX_COMPILER('x86_64-linux-musl-g++'); - $p->setLinker('ld'); } From fdd31a97e560d020a32f20f00245ffd66d8e3ad7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 18:29:05 +0800 Subject: [PATCH 29/39] update --- setup-php-runtime.sh | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/setup-php-runtime.sh b/setup-php-runtime.sh index 6b8bc4b75d..7b2277acc9 100644 --- a/setup-php-runtime.sh +++ b/setup-php-runtime.sh @@ -39,7 +39,7 @@ case $ARCH in 'x86_64') ARCH="x64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -148,6 +148,42 @@ phar.readonly=0 EOF +cat >${__PROJECT__}/bin/runtime/php-fpm.conf <<'EOF' +; 更多配置参考 +; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in +; https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in + +[global] +pid = run/php-fpm.pid +error_log = log/php-fpm.log +daemonize = yes + +[www] +user = nobody +group = nobody + +listen = 9001 +;listen = run/php-fpm.sock + +slowlog = log/$pool.log.slow +request_slowlog_timeout = 30s + + +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 + +; MAIN_PID=$(cat var/run/php-fpm.pid) +; 关闭 php-fpm +; kill -QUIT $MAIN_PID + +; 平滑重启 php-fpm +; kill -USR2 $MAIN_PID + +EOF + cd ${__PROJECT__}/ set +x From 9a0e5292dcf8ad58188a6a7c8b5d95f53c5559c7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 18:30:48 +0800 Subject: [PATCH 30/39] update --- setup-php-runtime.sh | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/setup-php-runtime.sh b/setup-php-runtime.sh index 7b2277acc9..2d4cbc1464 100644 --- a/setup-php-runtime.sh +++ b/setup-php-runtime.sh @@ -148,42 +148,6 @@ phar.readonly=0 EOF -cat >${__PROJECT__}/bin/runtime/php-fpm.conf <<'EOF' -; 更多配置参考 -; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in -; https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in - -[global] -pid = run/php-fpm.pid -error_log = log/php-fpm.log -daemonize = yes - -[www] -user = nobody -group = nobody - -listen = 9001 -;listen = run/php-fpm.sock - -slowlog = log/$pool.log.slow -request_slowlog_timeout = 30s - - -pm = dynamic -pm.max_children = 5 -pm.start_servers = 2 -pm.min_spare_servers = 1 -pm.max_spare_servers = 3 - -; MAIN_PID=$(cat var/run/php-fpm.pid) -; 关闭 php-fpm -; kill -QUIT $MAIN_PID - -; 平滑重启 php-fpm -; kill -USR2 $MAIN_PID - -EOF - cd ${__PROJECT__}/ set +x From 0ff4f3132dbf781cfee2d5febc5d078df6d0dc9b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 18:36:38 +0800 Subject: [PATCH 31/39] update --- setup-php-fpm-7.4-runtime.sh | 38 +++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/setup-php-fpm-7.4-runtime.sh b/setup-php-fpm-7.4-runtime.sh index 578fcc0417..907be497b5 100644 --- a/setup-php-fpm-7.4-runtime.sh +++ b/setup-php-fpm-7.4-runtime.sh @@ -39,7 +39,7 @@ case $ARCH in 'x86_64') ARCH="x64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -148,6 +148,42 @@ expose_php=Off EOF +cat >${__PROJECT__}/bin/runtime/php-fpm.conf <<'EOF' +; 更多配置参考 +; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in +; https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in + +[global] +pid = run/php-fpm.pid +error_log = log/php-fpm.log +daemonize = yes + +[www] +user = nobody +group = nobody + +listen = 9001 +;listen = run/php-fpm.sock + +slowlog = log/$pool.log.slow +request_slowlog_timeout = 30s + + +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 + +; MAIN_PID=$(cat var/run/php-fpm.pid) +; 关闭 php-fpm +; kill -QUIT $MAIN_PID + +; 平滑重启 php-fpm +; kill -USR2 $MAIN_PID + +EOF + cd ${__PROJECT__}/ set +x From 97e8d903eb4ba9023224013155e4b7089cdbaf46 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 19:00:43 +0800 Subject: [PATCH 32/39] update setup-swoole-cli-runtime.sh --- setup-swoole-cli-runtime.sh | 54 +++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/setup-swoole-cli-runtime.sh b/setup-swoole-cli-runtime.sh index 1649b27db3..d83126b980 100644 --- a/setup-swoole-cli-runtime.sh +++ b/setup-swoole-cli-runtime.sh @@ -118,9 +118,9 @@ if [ $OS = 'windows' ]; then else test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz - test -f php || tar -xvf ${APP_RUNTIME}.tar - chmod a+x php - cp -f ${__PROJECT__}/var/runtime/php ${__PROJECT__}/bin/runtime/php + test -f swoole-cli || tar -xvf ${APP_RUNTIME}.tar + chmod a+x swoole-cli + cp -f ${__PROJECT__}/var/runtime/swoole-cli ${__PROJECT__}/bin/runtime/swoole-cli fi cd ${__PROJECT__}/var/runtime @@ -148,19 +148,57 @@ expose_php=Off EOF +cat >${__PROJECT__}/bin/runtime/php-fpm.conf <<'EOF' +; 更多配置参考 +; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in +; https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in + +[global] +pid = run/php-fpm.pid +error_log = log/php-fpm.log +daemonize = yes + +[www] +user = nobody +group = nobody + +listen = 9001 +;listen = run/php-fpm.sock + +slowlog = log/$pool.log.slow +request_slowlog_timeout = 30s + + +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 + +; MAIN_PID=$(cat var/run/php-fpm.pid) +; 关闭 php-fpm +; kill -QUIT $MAIN_PID + +; 平滑重启 php-fpm +; kill -USR2 $MAIN_PID + +EOF + cd ${__PROJECT__}/ set +x +echo " " +echo " USE PHP-FPM RUNTIME :" +echo " " +echo "${__PROJECT__}/bin/runtime/swoole-cli -c ${__PROJECT__}/bin/runtime/php.ini -P --fpm-config ${__PROJECT__}/bin/runtime/php-fpm.conf -p ${__PROJECT__}/runtime/var " echo " " echo " USE PHP-CLI RUNTIME :" echo " " echo " export PATH=\"${__PROJECT__}/bin/runtime:\$PATH\" " echo " " -echo " alias php='php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem' " +echo " alias swoole-cli='swoole-cli -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem' " echo " OR " -echo " alias php='php -c ${__PROJECT__}/bin/runtime/php.ini' " -echo " " -echo " PHP VERSION ${APP_VERSION}" +echo " alias swoole-cli='swoole-cli -c ${__PROJECT__}/bin/runtime/php.ini' " echo " " -export PATH="${__PROJECT__}/bin/runtime:$PATH" +echo " SWOOLE-CLI VERSION ${APP_VERSION}" From 9c26f13e1af91a14be8343ada1c27ddcd6c13b2e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 19:05:46 +0800 Subject: [PATCH 33/39] update --- setup-php-cli-runtime.sh | 56 ++-------- setup-swoole-cli-runtime.sh | 204 ++++++++++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+), 48 deletions(-) create mode 100644 setup-swoole-cli-runtime.sh diff --git a/setup-php-cli-runtime.sh b/setup-php-cli-runtime.sh index 77d22aa3cb..e27b45268a 100644 --- a/setup-php-cli-runtime.sh +++ b/setup-php-cli-runtime.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( @@ -39,7 +39,7 @@ case $ARCH in 'x86_64') ARCH="x64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -118,9 +118,9 @@ if [ $OS = 'windows' ]; then else test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz - test -f swoole-cli || tar -xvf ${APP_RUNTIME}.tar - chmod a+x swoole-cli - cp -f ${__PROJECT__}/var/runtime/swoole-cli ${__PROJECT__}/bin/runtime/swoole-cli + test -f php || tar -xvf ${APP_RUNTIME}.tar + chmod a+x php + cp -f ${__PROJECT__}/var/runtime/php ${__PROJECT__}/bin/runtime/php fi cd ${__PROJECT__}/var/runtime @@ -148,57 +148,17 @@ expose_php=Off EOF -cat >${__PROJECT__}/bin/runtime/php-fpm.conf <<'EOF' -; 更多配置参考 -; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in -; https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in - -[global] -pid = run/php-fpm.pid -error_log = log/php-fpm.log -daemonize = yes - -[www] -user = nobody -group = nobody - -listen = 9001 -;listen = run/php-fpm.sock - -slowlog = log/$pool.log.slow -request_slowlog_timeout = 30s - - -pm = dynamic -pm.max_children = 5 -pm.start_servers = 2 -pm.min_spare_servers = 1 -pm.max_spare_servers = 3 - -; MAIN_PID=$(cat var/run/php-fpm.pid) -; 关闭 php-fpm -; kill -QUIT $MAIN_PID - -; 平滑重启 php-fpm -; kill -USR2 $MAIN_PID - -EOF - cd ${__PROJECT__}/ set +x -echo " " -echo " USE PHP-FPM RUNTIME :" -echo " " -echo "${__PROJECT__}/bin/runtime/swoole-cli -c ${__PROJECT__}/bin/runtime/php.ini -P --fpm-config ${__PROJECT__}/bin/runtime/php-fpm.conf -p ${__PROJECT__}/runtime/var " echo " " echo " USE PHP-CLI RUNTIME :" echo " " echo " export PATH=\"${__PROJECT__}/bin/runtime:\$PATH\" " echo " " -echo " alias swoole-cli='swoole-cli -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem' " +echo " alias php='php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem' " echo " OR " -echo " alias swoole-cli='swoole-cli -c ${__PROJECT__}/bin/runtime/php.ini' " +echo " alias php='php -c ${__PROJECT__}/bin/runtime/php.ini' " echo " " -echo " SWOOLE-CLI VERSION ${APP_VERSION}" +echo " PHP-CLI VERSION ${APP_VERSION}" diff --git a/setup-swoole-cli-runtime.sh b/setup-swoole-cli-runtime.sh new file mode 100644 index 0000000000..d83126b980 --- /dev/null +++ b/setup-swoole-cli-runtime.sh @@ -0,0 +1,204 @@ +#!/usr/bin/env bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=${__DIR__} + +cd ${__PROJECT__} + +OS=$(uname -s) +ARCH=$(uname -m) + +case $OS in +'Linux') + OS="linux" + ;; +'Darwin') + OS="macos" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="windows" + ;; + 'MINGW64_NT'*) + OS="windows" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="x64" + ;; +'aarch64' | 'arm64') + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='v5.1.3' +APP_NAME='swoole-cli' +VERSION='v5.1.3.0' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +APP_DOWNLOAD_URL="https://github.com/swoole/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" +COMPOSER_DOWNLOAD_URL="https://getcomposer.org/download/latest-stable/composer.phar" +CACERT_DOWNLOAD_URL="https://curl.se/ca/cacert.pem" + +if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://github.com/swoole/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" +fi + +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + ;; + --proxy) + export HTTP_PROXY="$2" + export HTTPS_PROXY="$2" + NO_PROXY="127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16" + NO_PROXY="${NO_PROXY},::1/128,fe80::/10,fd00::/8,ff00::/8" + NO_PROXY="${NO_PROXY},localhost" + NO_PROXY="${NO_PROXY},.aliyuncs.com,.aliyun.com,.tencent.com" + NO_PROXY="${NO_PROXY},.myqcloud.com,.swoole.com" + export NO_PROXY="${NO_PROXY},.tsinghua.edu.cn,.ustc.edu.cn,.npmmirror.com" + ;; + --*) + echo "Illegal option $1" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +case "$MIRROR" in +china) + APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" + fi + ;; + +esac + +test -f composer.phar || curl -LSo composer.phar ${COMPOSER_DOWNLOAD_URL} +chmod a+x composer.phar + +test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} + +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" + +if [ $OS = 'windows' ]; then + { + APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" + test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + unzip "${APP_RUNTIME}.zip" + echo + exit 0 + } +else + test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz + test -f swoole-cli || tar -xvf ${APP_RUNTIME}.tar + chmod a+x swoole-cli + cp -f ${__PROJECT__}/var/runtime/swoole-cli ${__PROJECT__}/bin/runtime/swoole-cli +fi + +cd ${__PROJECT__}/var/runtime + +cp -f ${__PROJECT__}/var/runtime/composer.phar ${__PROJECT__}/bin/runtime/composer +cp -f ${__PROJECT__}/var/runtime/cacert.pem ${__PROJECT__}/bin/runtime/cacert.pem + +cat >${__PROJECT__}/bin/runtime/php.ini <${__PROJECT__}/bin/runtime/php-fpm.conf <<'EOF' +; 更多配置参考 +; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in +; https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in + +[global] +pid = run/php-fpm.pid +error_log = log/php-fpm.log +daemonize = yes + +[www] +user = nobody +group = nobody + +listen = 9001 +;listen = run/php-fpm.sock + +slowlog = log/$pool.log.slow +request_slowlog_timeout = 30s + + +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 + +; MAIN_PID=$(cat var/run/php-fpm.pid) +; 关闭 php-fpm +; kill -QUIT $MAIN_PID + +; 平滑重启 php-fpm +; kill -USR2 $MAIN_PID + +EOF + +cd ${__PROJECT__}/ + +set +x + +echo " " +echo " USE PHP-FPM RUNTIME :" +echo " " +echo "${__PROJECT__}/bin/runtime/swoole-cli -c ${__PROJECT__}/bin/runtime/php.ini -P --fpm-config ${__PROJECT__}/bin/runtime/php-fpm.conf -p ${__PROJECT__}/runtime/var " +echo " " +echo " USE PHP-CLI RUNTIME :" +echo " " +echo " export PATH=\"${__PROJECT__}/bin/runtime:\$PATH\" " +echo " " +echo " alias swoole-cli='swoole-cli -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem' " +echo " OR " +echo " alias swoole-cli='swoole-cli -c ${__PROJECT__}/bin/runtime/php.ini' " +echo " " +echo " SWOOLE-CLI VERSION ${APP_VERSION}" From 255483bbdbe9db41ebd0f792cff4a267143ceeee Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 19:16:01 +0800 Subject: [PATCH 34/39] update --- sapi/quickstart/clean-folder-for-extra-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index efe65e8248..ec6ed06921 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -90,6 +90,7 @@ test -f setup-swoole-cli-pre-runtime.sh && rm -rf setup-swoole-cli-pre-runtim test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh test -f setup-swow-cli-runtime.sh && rm -rf setup-swow-cli-runtime.sh test -f setup-php-fpm-7.4-runtime.sh && rm -rf setup-php-fpm-7.4-runtime.sh +test -f setup-swoole-cli-runtime.sh && rm -rf setup-swoole-cli-runtime.sh cd ${__PROJECT__} From 1b19702c29b78caed60489e03463e61e7c7ae321 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 20:49:51 +0800 Subject: [PATCH 35/39] update --- setup-php-cli-7.4-runtime.sh | 164 +++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 setup-php-cli-7.4-runtime.sh diff --git a/setup-php-cli-7.4-runtime.sh b/setup-php-cli-7.4-runtime.sh new file mode 100644 index 0000000000..2b33f1ce32 --- /dev/null +++ b/setup-php-cli-7.4-runtime.sh @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=${__DIR__} + +cd ${__PROJECT__} + +OS=$(uname -s) +ARCH=$(uname -m) + +case $OS in +'Linux') + OS="linux" + ;; +'Darwin') + OS="macos" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="windows" + ;; + 'MINGW64_NT'*) + OS="windows" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="x64" + ;; +'aarch64' | 'arm64') + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='7.4.33' +APP_NAME='php-cli' +VERSION='php-cli-7.4-v1.0.0' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" +COMPOSER_DOWNLOAD_URL="https://getcomposer.org/download/latest-stable/composer.phar" +CACERT_DOWNLOAD_URL="https://curl.se/ca/cacert.pem" + +if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" +fi + +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + ;; + --proxy) + export HTTP_PROXY="$2" + export HTTPS_PROXY="$2" + NO_PROXY="127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16" + NO_PROXY="${NO_PROXY},::1/128,fe80::/10,fd00::/8,ff00::/8" + NO_PROXY="${NO_PROXY},localhost" + NO_PROXY="${NO_PROXY},.aliyuncs.com,.aliyun.com,.tencent.com" + NO_PROXY="${NO_PROXY},.myqcloud.com,.swoole.com" + export NO_PROXY="${NO_PROXY},.tsinghua.edu.cn,.ustc.edu.cn,.npmmirror.com" + ;; + --*) + echo "Illegal option $1" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +case "$MIRROR" in +china) + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" + fi + ;; + +esac + +test -f composer.phar || curl -LSo composer.phar ${COMPOSER_DOWNLOAD_URL} +chmod a+x composer.phar + +test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} + +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" + +if [ $OS = 'windows' ]; then + { + APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" + test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + unzip "${APP_RUNTIME}.zip" + echo + exit 0 + } +else + test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz + test -f php || tar -xvf ${APP_RUNTIME}.tar + chmod a+x php + cp -f ${__PROJECT__}/var/runtime/php ${__PROJECT__}/bin/runtime/php +fi + +cd ${__PROJECT__}/var/runtime + +cp -f ${__PROJECT__}/var/runtime/composer.phar ${__PROJECT__}/bin/runtime/composer +cp -f ${__PROJECT__}/var/runtime/cacert.pem ${__PROJECT__}/bin/runtime/cacert.pem + +cat >${__PROJECT__}/bin/runtime/php.ini < Date: Wed, 7 Aug 2024 20:51:17 +0800 Subject: [PATCH 36/39] update --- sapi/quickstart/clean-folder-for-extra-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index ec6ed06921..6a80f0af85 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -91,6 +91,7 @@ test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh test -f setup-swow-cli-runtime.sh && rm -rf setup-swow-cli-runtime.sh test -f setup-php-fpm-7.4-runtime.sh && rm -rf setup-php-fpm-7.4-runtime.sh test -f setup-swoole-cli-runtime.sh && rm -rf setup-swoole-cli-runtime.sh +test -f setup-php-cli-7.4-runtime.sh && rm -rf setup-php-cli-7.4-runtime.sh cd ${__PROJECT__} From 69f61aa3003b0f9a9cebf3d9fad3b7986f4ae50e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Aug 2024 21:45:23 +0800 Subject: [PATCH 37/39] update --- setup-php-cli-7.3-runtime.sh | 164 +++++++++++++++++++++++++++++++++++ setup-php-cli-7.4-runtime.sh | 2 +- setup-php-fpm-7.4-runtime.sh | 2 +- 3 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 setup-php-cli-7.3-runtime.sh diff --git a/setup-php-cli-7.3-runtime.sh b/setup-php-cli-7.3-runtime.sh new file mode 100644 index 0000000000..9c07f0615c --- /dev/null +++ b/setup-php-cli-7.3-runtime.sh @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=${__DIR__} + +cd ${__PROJECT__} + +OS=$(uname -s) +ARCH=$(uname -m) + +case $OS in +'Linux') + OS="linux" + ;; +'Darwin') + OS="macos" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="windows" + ;; + 'MINGW64_NT'*) + OS="windows" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="x64" + ;; +'aarch64' | 'arm64') + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='v7.3.33' +APP_NAME='php-cli' +VERSION='php-cli-7.3-v1.0.0' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" +COMPOSER_DOWNLOAD_URL="https://getcomposer.org/download/latest-stable/composer.phar" +CACERT_DOWNLOAD_URL="https://curl.se/ca/cacert.pem" + +if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" +fi + +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + ;; + --proxy) + export HTTP_PROXY="$2" + export HTTPS_PROXY="$2" + NO_PROXY="127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16" + NO_PROXY="${NO_PROXY},::1/128,fe80::/10,fd00::/8,ff00::/8" + NO_PROXY="${NO_PROXY},localhost" + NO_PROXY="${NO_PROXY},.aliyuncs.com,.aliyun.com,.tencent.com" + NO_PROXY="${NO_PROXY},.myqcloud.com,.swoole.com" + export NO_PROXY="${NO_PROXY},.tsinghua.edu.cn,.ustc.edu.cn,.npmmirror.com" + ;; + --*) + echo "Illegal option $1" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +case "$MIRROR" in +china) + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + COMPOSER_DOWNLOAD_URL="https://mirrors.tencent.com/composer/composer.phar" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" + fi + ;; + +esac + +test -f composer.phar || curl -LSo composer.phar ${COMPOSER_DOWNLOAD_URL} +chmod a+x composer.phar + +test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} + +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" + +if [ $OS = 'windows' ]; then + { + APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" + test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + unzip "${APP_RUNTIME}.zip" + echo + exit 0 + } +else + test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz + test -f php || tar -xvf ${APP_RUNTIME}.tar + chmod a+x php + cp -f ${__PROJECT__}/var/runtime/php ${__PROJECT__}/bin/runtime/php +fi + +cd ${__PROJECT__}/var/runtime + +cp -f ${__PROJECT__}/var/runtime/composer.phar ${__PROJECT__}/bin/runtime/composer +cp -f ${__PROJECT__}/var/runtime/cacert.pem ${__PROJECT__}/bin/runtime/cacert.pem + +cat >${__PROJECT__}/bin/runtime/php.ini < Date: Wed, 7 Aug 2024 21:47:32 +0800 Subject: [PATCH 38/39] update --- sapi/quickstart/clean-folder-for-extra-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index 6a80f0af85..f3cf964500 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -92,6 +92,7 @@ test -f setup-swow-cli-runtime.sh && rm -rf setup-swow-cli-runtime.sh test -f setup-php-fpm-7.4-runtime.sh && rm -rf setup-php-fpm-7.4-runtime.sh test -f setup-swoole-cli-runtime.sh && rm -rf setup-swoole-cli-runtime.sh test -f setup-php-cli-7.4-runtime.sh && rm -rf setup-php-cli-7.4-runtime.sh +test -f setup-php-cli-7.3-runtime.sh && rm -rf setup-php-cli-7.3-runtime.sh cd ${__PROJECT__} From 08fa4b9f5a0173af08bb0ea53ea95a10a5493173 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 9 Aug 2024 13:49:27 +0800 Subject: [PATCH 39/39] update --- sapi/src/library_builder/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sapi/src/library_builder/README.md b/sapi/src/library_builder/README.md index 0d2168e329..4a1bf53892 100644 --- a/sapi/src/library_builder/README.md +++ b/sapi/src/library_builder/README.md @@ -34,3 +34,8 @@ command -v debian-sa1 > /dev/null && debian-sa1 1 1 nodejs nvm npm-check-updates + + +## 桌面应用程序开发框架比较:Electron、Flutter、Tauri、React Native 和 Qt + +## Flatpak vs. Snap vs. AppImage