From 1e4883f433940f7aef64d034f040a031f6e10f9b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 9 Mar 2024 18:06:48 +0800 Subject: [PATCH 001/226] 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 89e09517deeee44af9667d4a1eb5c271be2ca153 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 6 Jul 2024 20:50:54 +0800 Subject: [PATCH 002/226] =?UTF-8?q?=E9=AA=8C=E8=AF=81=20swoole=20v6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux-aarch64.yml | 2 +- .github/workflows/linux-x86_64.yml | 4 +- .github/workflows/macos-aarch64.yml | 2 +- .github/workflows/macos-x86_64.yml | 2 +- ext/swoole | 2 +- sapi/src/builder/extension/swoole_v6.php | 82 ++++++++++++++++++++++++ sapi/src/builder/library/liburing.php | 34 ++++++++++ sapi/src/constants.php | 2 + 8 files changed, 124 insertions(+), 6 deletions(-) create mode 100644 sapi/src/builder/extension/swoole_v6.php create mode 100644 sapi/src/builder/library/liburing.php diff --git a/.github/workflows/linux-aarch64.yml b/.github/workflows/linux-aarch64.yml index 6299352826..261f479e1b 100644 --- a/.github/workflows/linux-aarch64.yml +++ b/.github/workflows/linux-aarch64.yml @@ -127,7 +127,7 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php +inotify +apcu +ds +xlswriter +ssh2 --with-swoole-pgsql=1 --with-libavif=1 + php prepare.php +inotify +apcu +ds +xlswriter +ssh2 -swoole +swoole_v6 --with-libavif=1 bash make.sh all-library diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index c404a17688..16e88c2fbf 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -116,7 +116,7 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php +inotify +apcu +ds +xlswriter +ssh2 --with-swoole-pgsql=1 + php prepare.php +inotify +apcu +ds +xlswriter +ssh2 -swoole +swoole_v6 -opcache bash ./make.sh all-library @@ -136,7 +136,7 @@ jobs: ./bin/swoole-cli -r "echo PHP_VERSION;" ./bin/swoole-cli ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php --list-tests ./bin/swoole-cli ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php - ./bin/swoole-cli ./vendor/bin/phpunit ./sapi/src/UnitTest/SwoolePGSQLTest.php + # ./bin/swoole-cli ./vendor/bin/phpunit ./sapi/src/UnitTest/SwoolePGSQLTest.php - name: production artifacts debug uses: actions/upload-artifact@v4 diff --git a/.github/workflows/macos-aarch64.yml b/.github/workflows/macos-aarch64.yml index 383bd2f257..ddd738ccda 100644 --- a/.github/workflows/macos-aarch64.yml +++ b/.github/workflows/macos-aarch64.yml @@ -117,7 +117,7 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php --without-docker=1 +ds +apcu +xlswriter +ssh2 --with-build-type=release --with-swoole-pgsql=1 + php prepare.php --without-docker=1 +ds +apcu +xlswriter +ssh2 -swoole +swoole_v6 --with-build-type=release - name: Build run: | diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml index 91a0b3e356..4bcb371ebc 100644 --- a/.github/workflows/macos-x86_64.yml +++ b/.github/workflows/macos-x86_64.yml @@ -116,7 +116,7 @@ jobs: composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile - php prepare.php --without-docker=1 +ds +apcu +xlswriter +ssh2 --with-build-type=release + php prepare.php --without-docker=1 +ds +apcu +xlswriter +ssh2 -swoole +swoole_v6 --with-build-type=release - name: Build run: | diff --git a/ext/swoole b/ext/swoole index 8e8db8b45f..43b1518188 160000 --- a/ext/swoole +++ b/ext/swoole @@ -1 +1 @@ -Subproject commit 8e8db8b45fdf81513363054a3cfce8bc5c50906d +Subproject commit 43b1518188669d163c9360fc98acc8bf528b0916 diff --git a/sapi/src/builder/extension/swoole_v6.php b/sapi/src/builder/extension/swoole_v6.php new file mode 100644 index 0000000000..a9cfe5c8a3 --- /dev/null +++ b/sapi/src/builder/extension/swoole_v6.php @@ -0,0 +1,82 @@ +isLinux() && 0) { + // 构建报错 + $options .= ' --enable-iouring '; + $dependentLibraries[] = 'liburing'; + $p->withExportVariable('URING_CFLAGS', '$(pkg-config --cflags --static liburing)'); + $p->withExportVariable('URING_LIBS', '$(pkg-config --libs --static liburing)'); + } + + + $ext = (new Extension('swoole_v6')) + ->withHomePage('https://github.com/swoole/swoole-src') + ->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2) + ->withManual('https://wiki.swoole.com/#/') + ->withOptions($options) + ->withBuildCached(false) + ->withDependentLibraries(...$dependentLibraries) + ->withDependentExtensions(...$dependentExtensions); + + $p->addExtension($ext); + + $libs = $p->isMacos() ? '-lc++' : ' -lstdc++ '; + $p->withVariable('LIBS', '$LIBS ' . $libs); + + $p->withExportVariable('CARES_CFLAGS', '$(pkg-config --cflags --static libcares)'); + $p->withExportVariable('CARES_LIBS', '$(pkg-config --libs --static libcares)'); + + + // 使用扩展钩子 下载 swoole v6 源码 + $p->withBeforeConfigureScript('swoole_v6', function (Preprocessor $p) { + $workdir = $p->getWorkDir(); + $cmd = <<addLibrary( + (new Library('liburing')) # io_uring iouring + ->withHomePage('https://github.com/axboe/liburing.git') + ->withLicense('https://github.com/axboe/liburing/blob/master/COPYING', Library::LICENSE_LGPL) + ->withManual('hhttps://github.com/axboe/liburing') + ->withUrl('https://github.com/axboe/liburing/archive/refs/tags/liburing-2.6.tar.gz') + ->withPrefix($liburing_prefix) + ->withConfigure( + <<withScriptAfterInstall( + <<withBinPath($liburing_prefix . '/bin/') + ->withPkgName('liburing') + ); +}; diff --git a/sapi/src/constants.php b/sapi/src/constants.php index ca465042e1..77052b7dfd 100644 --- a/sapi/src/constants.php +++ b/sapi/src/constants.php @@ -54,3 +54,5 @@ define("LIBUUID_PREFIX", $p->getGlobalPrefix() . '/libuuid'); define("LIBINTL_PREFIX", $p->getGlobalPrefix() . '/libintl'); define("LIBUNISTRING_PREFIX", $p->getGlobalPrefix() . '/libunistring'); + +define("LIBURING_PREFIX", $p->getGlobalPrefix() . '/liburing'); From 70a588281c3bfacd7be35ba0885f699031ceba9c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 6 Jul 2024 20:52:45 +0800 Subject: [PATCH 003/226] update swoole version --- ext/swoole | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/swoole b/ext/swoole index 43b1518188..936402ef72 160000 --- a/ext/swoole +++ b/ext/swoole @@ -1 +1 @@ -Subproject commit 43b1518188669d163c9360fc98acc8bf528b0916 +Subproject commit 936402ef72031780a9f6ba1d662eddc635275eb0 From f56b217ca492190fc68475c6bb172019d1d077f7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 7 Jul 2024 00:24:40 +0800 Subject: [PATCH 004/226] update extension.smd --- docs/extensions.md | 2 ++ prepare.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/extensions.md b/docs/extensions.md index 04805421f9..4017dbdfd6 100644 --- a/docs/extensions.md +++ b/docs/extensions.md @@ -42,6 +42,7 @@ | gd | ✅ | ✅ | ✅ | ✅ | | opcache | ✅ | ✅ | ✅ | ✅ | | swoole | ✅ | ✅ | ✅ | ✅ | +| mongodb | ✅ | ✅ | ❌ | ✅ | | ssh2 | ✅ | ✅ | ❌ | ❌ | | apcu | ✅ | ✅ | ❌ | ❌ | | ds | ✅ | ✅ | ✅ | ❌ | @@ -51,3 +52,4 @@ | mailparse | ✅ | ✅ | ❌ | ❌ | + diff --git a/prepare.php b/prepare.php index c3501151a3..29af23c4aa 100755 --- a/prepare.php +++ b/prepare.php @@ -53,7 +53,7 @@ $p->setLogicalProcessors('$(nproc 2> /dev/null)'); } -$p->setExtraCflags('-fno-ident -Os'); +$p->setExtraCflags(' -Os'); // Generate make.sh $p->execute(); From deb87eff32e80789b97b1617c6c8aa5178e3955b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 7 Jul 2024 00:26:29 +0800 Subject: [PATCH 005/226] update build-release-example.sh --- build-release-example.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-release-example.sh b/build-release-example.sh index 3558e5f0ca..c8ac644788 100644 --- a/build-release-example.sh +++ b/build-release-example.sh @@ -158,7 +158,7 @@ php -v if [ ${WITH_PHP_COMPOSER} -eq 1 ] ; then export COMPOSER_ALLOW_SUPERUSER=1 if [ "$MIRROR" = 'china' ]; then - composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/ + composer config -g repos.packagist composer https://mirrors.tencent.com/composer/ # composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ else composer config -g repos.packagist composer https://packagist.org From 0a6c9cfd5924d566b1f837c5c4d1d7fd92449ed0 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 7 Jul 2024 00:32:48 +0800 Subject: [PATCH 006/226] update cygwin-config.sh --- sapi/scripts/cygwin/cygwin-config.sh | 2 ++ sapi/src/builder/extension/swoole_v6.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sapi/scripts/cygwin/cygwin-config.sh b/sapi/scripts/cygwin/cygwin-config.sh index f0b13609a9..3ba407bf1f 100755 --- a/sapi/scripts/cygwin/cygwin-config.sh +++ b/sapi/scripts/cygwin/cygwin-config.sh @@ -52,6 +52,8 @@ test -f Makefile && make clean --enable-swoole --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ + --enable-swoole-thread \ + --enable-zts \ --enable-redis \ --with-imagick \ --with-yaml \ diff --git a/sapi/src/builder/extension/swoole_v6.php b/sapi/src/builder/extension/swoole_v6.php index a9cfe5c8a3..896d2c5da6 100644 --- a/sapi/src/builder/extension/swoole_v6.php +++ b/sapi/src/builder/extension/swoole_v6.php @@ -77,6 +77,7 @@ mv swoole {$workdir}/ext/ EOF; - return $cmd; + //return $cmd; + return ''; }); }; From 5f34feb33823a5ce49d7d764d8aae8a30b13512f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 7 Jul 2024 00:36:18 +0800 Subject: [PATCH 007/226] swoole v6 disable opcache on linux x86_64 --- sapi/src/UnitTest/MainTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/UnitTest/MainTest.php b/sapi/src/UnitTest/MainTest.php index ee864fc094..51b166023e 100644 --- a/sapi/src/UnitTest/MainTest.php +++ b/sapi/src/UnitTest/MainTest.php @@ -21,7 +21,7 @@ public function testExtesnions(): void $this->assertContains('swoole', $exts); $this->assertContains('gd', $exts); $this->assertContains('imagick', $exts); - $this->assertContains('opcache', $exts); + # $this->assertContains('opcache', $exts); $this->assertContains('redis', $exts); $this->assertContains('mongodb', $exts); } From 98f7dea03196c8609699c522a0d8524f639e392d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 7 Jul 2024 01:21:13 +0800 Subject: [PATCH 008/226] cygwin disalble opcache --- sapi/scripts/cygwin/cygwin-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/scripts/cygwin/cygwin-config.sh b/sapi/scripts/cygwin/cygwin-config.sh index 3ba407bf1f..238c1196bc 100755 --- a/sapi/scripts/cygwin/cygwin-config.sh +++ b/sapi/scripts/cygwin/cygwin-config.sh @@ -17,7 +17,6 @@ cd ${__PROJECT__} test -f Makefile && make clean ./configure --prefix=/usr --disable-all \ --disable-fiber-asm \ - --enable-opcache \ --without-pcre-jit \ --with-openssl --enable-openssl \ --with-curl \ @@ -61,3 +60,4 @@ test -f Makefile && make clean # --with-pdo-sqlite \ +# --enable-opcache \ From 5ea08353a49dbb49522325e3661179178de0fd5a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 7 Jul 2024 21:24:12 +0800 Subject: [PATCH 009/226] update docs --- docs/extensions.md | 105 ++++++++++++++++++++++++--------------------- docs/macOS.md | 13 +++--- docs/upgrade.md | 15 +++++++ 3 files changed, 78 insertions(+), 55 deletions(-) create mode 100644 docs/upgrade.md diff --git a/docs/extensions.md b/docs/extensions.md index 4017dbdfd6..ef7d55e87a 100644 --- a/docs/extensions.md +++ b/docs/extensions.md @@ -1,55 +1,60 @@ # support extensions (x64) -| extension name | linux6 | macos | windows(cygwin) | default enabled | -|----------------|--------|-------|-----------------|-----------------| -| curl | ✅ | ✅ | ✅ | ✅ | -| iconv | ✅ | ✅ | ✅ | ✅ | -| bcmath | ✅ | ✅ | ✅ | ✅ | -| pcntl | ✅ | ✅ | ✅ | ✅ | -| filter | ✅ | ✅ | ✅ | ✅ | -| session | ✅ | ✅ | ✅ | ✅ | -| tokenizer | ✅ | ✅ | ✅ | ✅ | -| mbstring | ✅ | ✅ | ✅ | ✅ | -| ctype | ✅ | ✅ | ✅ | ✅ | -| zlib | ✅ | ✅ | ✅ | ✅ | -| zip | ✅ | ✅ | ✅ | ✅ | -| posix | ✅ | ✅ | ✅ | ✅ | -| sockets | ✅ | ✅ | ✅ | ✅ | -| pdo | ✅ | ✅ | ✅ | ✅ | -| sqlite3 | ✅ | ✅ | ✅ | ✅ | -| phar | ✅ | ✅ | ✅ | ✅ | -| mysqlnd | ✅ | ✅ | ✅ | ✅ | -| mysqli | ✅ | ✅ | ✅ | ✅ | -| intl | ✅ | ✅ | ✅ | ✅ | -| fileinfo | ✅ | ✅ | ✅ | ✅ | -| pdo_mysql | ✅ | ✅ | ✅ | ✅ | -| soap | ✅ | ✅ | ✅ | ✅ | -| xsl | ✅ | ✅ | ✅ | ✅ | -| gmp | ✅ | ✅ | ✅ | ✅ | -| exif | ✅ | ✅ | ✅ | ✅ | -| sodium | ✅ | ✅ | ✅ | ✅ | -| openssl | ✅ | ✅ | ✅ | ✅ | -| readline | ✅ | ✅ | ✅ | ✅ | -| libxml | ✅ | ✅ | ✅ | ✅ | -| xml | ✅ | ✅ | ✅ | ✅ | -| xmlreader | ✅ | ✅ | ✅ | ✅ | -| xmlwriter | ✅ | ✅ | ✅ | ✅ | -| dom | ✅ | ✅ | ✅ | ✅ | -| simplexml | ✅ | ✅ | ✅ | ✅ | -| redis | ✅ | ✅ | ✅ | ✅ | -| yaml | ✅ | ✅ | ✅ | ✅ | -| imagick | ✅ | ✅ | ✅ | ✅ | -| gd | ✅ | ✅ | ✅ | ✅ | -| opcache | ✅ | ✅ | ✅ | ✅ | -| swoole | ✅ | ✅ | ✅ | ✅ | -| mongodb | ✅ | ✅ | ❌ | ✅ | -| ssh2 | ✅ | ✅ | ❌ | ❌ | -| apcu | ✅ | ✅ | ❌ | ❌ | -| ds | ✅ | ✅ | ✅ | ❌ | -| inotify | ✅ | ❌ | ❌ | ❌ | -| protobuf | ❌ | ❌ | ❌ | ❌ | -| uuid | ✅ | ✅ | ❌ | ❌ | -| mailparse | ✅ | ✅ | ❌ | ❌ | +| extension name | linux | macos | windows(cygwin) | default enabled | +|----------------|-------|-------|-----------------|-----------------| +| curl | ✅ | ✅ | ✅ | ✅ | +| iconv | ✅ | ✅ | ✅ | ✅ | +| bcmath | ✅ | ✅ | ✅ | ✅ | +| pcntl | ✅ | ✅ | ✅ | ✅ | +| filter | ✅ | ✅ | ✅ | ✅ | +| session | ✅ | ✅ | ✅ | ✅ | +| tokenizer | ✅ | ✅ | ✅ | ✅ | +| mbstring | ✅ | ✅ | ✅ | ✅ | +| ctype | ✅ | ✅ | ✅ | ✅ | +| zlib | ✅ | ✅ | ✅ | ✅ | +| zip | ✅ | ✅ | ✅ | ✅ | +| posix | ✅ | ✅ | ✅ | ✅ | +| sockets | ✅ | ✅ | ✅ | ✅ | +| pdo | ✅ | ✅ | ✅ | ✅ | +| sqlite3 | ✅ | ✅ | ✅ | ✅ | +| phar | ✅ | ✅ | ✅ | ✅ | +| mysqlnd | ✅ | ✅ | ✅ | ✅ | +| mysqli | ✅ | ✅ | ✅ | ✅ | +| intl | ✅ | ✅ | ✅ | ✅ | +| fileinfo | ✅ | ✅ | ✅ | ✅ | +| pdo_mysql | ✅ | ✅ | ✅ | ✅ | +| soap | ✅ | ✅ | ✅ | ✅ | +| xsl | ✅ | ✅ | ✅ | ✅ | +| gmp | ✅ | ✅ | ✅ | ✅ | +| exif | ✅ | ✅ | ✅ | ✅ | +| sodium | ✅ | ✅ | ✅ | ✅ | +| openssl | ✅ | ✅ | ✅ | ✅ | +| readline | ✅ | ✅ | ✅ | ✅ | +| libxml | ✅ | ✅ | ✅ | ✅ | +| xml | ✅ | ✅ | ✅ | ✅ | +| xmlreader | ✅ | ✅ | ✅ | ✅ | +| xmlwriter | ✅ | ✅ | ✅ | ✅ | +| dom | ✅ | ✅ | ✅ | ✅ | +| simplexml | ✅ | ✅ | ✅ | ✅ | +| redis | ✅ | ✅ | ✅ | ✅ | +| yaml | ✅ | ✅ | ✅ | ✅ | +| imagick | ✅ | ✅ | ✅ | ✅ | +| gd | ✅ | ✅ | ✅ | ✅ | +| opcache | ✅ | ✅ | ✅ | ✅ | +| swoole | ✅ | ✅ | ✅ | ✅ | +| mongodb | ✅ | ✅ | ❌ | ✅ | +| ssh2 | ✅ | ✅ | ❌ | ❌ | +| apcu | ✅ | ✅ | ❌ | ❌ | +| ds | ✅ | ✅ | ✅ | ❌ | +| inotify | ✅ | ❌ | ❌ | ❌ | +| protobuf | ❌ | ❌ | ❌ | ❌ | +| uuid | ✅ | ✅ | ❌ | ❌ | +| mailparse | ✅ | ✅ | ❌ | ❌ | +## 查看 新增的扩展 和 移除的扩展 +```bash +./bin/swoole-cli diff.php + +``` diff --git a/docs/macOS.md b/docs/macOS.md index b1d97da9cd..abeba44e8f 100644 --- a/docs/macOS.md +++ b/docs/macOS.md @@ -172,14 +172,17 @@ export LIBSODIUM_LIBS=$(pkg-config --libs libsodium) ## Mac安装应用“提示文件已损坏”或“来自身份不明开发者”解决方法 -> 解压以后执行如下命令: +> note: macos clearing the com.apple.quarantine extended attribute +> macos环境下 首次运行提示无权限 ,通过清除扩展属性 解决 ```bash +# 查看扩展属性 +xattr ./bin/swoole-cli +# 移除扩展属性 +sudo xattr -d com.apple.quarantine ./bin/swoole-cli - sudo xattr -d com.apple.quarantine ./swoole-cli - - file ./bin/swoole-cli - otool -L ./bin/swoole-cli +file ./bin/swoole-cli +otool -L ./bin/swoole-cli ``` diff --git a/docs/upgrade.md b/docs/upgrade.md new file mode 100644 index 0000000000..12a359c29f --- /dev/null +++ b/docs/upgrade.md @@ -0,0 +1,15 @@ +## 升级 PHP 版本 步骤 + +> 1、修改 sapi/PHP-VERSION.conf 文件里版本号即可 +> 2、执行同步源码脚本, 拉取 PHP 官方源码 到本项目 + +```shell + +# 测试同步源码 +php sync-source-code.php + +# 正式同步源码 +php sync-source-code.php --action run + + +``` From 825fafa2520f243e8610666d05e772fa95b8b7bf Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 01:11:33 +0800 Subject: [PATCH 010/226] update setup-php-runtime.sh --- setup-php-runtime.sh | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/setup-php-runtime.sh b/setup-php-runtime.sh index 3cb838eeae..57dd3c9894 100644 --- a/setup-php-runtime.sh +++ b/setup-php-runtime.sh @@ -49,6 +49,8 @@ case $ARCH in esac SWOOLE_VERSION='v5.1.3' +APP_VERSION='v5.1.3' +APP_NAME='swoole-cli' VERSION='v5.1.3.0' mkdir -p bin/runtime @@ -56,12 +58,12 @@ mkdir -p var/runtime cd ${__PROJECT__}/var/runtime -SWOOLE_CLI_DOWNLOAD_URL="https://github.com/swoole/swoole-cli/releases/download/${VERSION}/swoole-cli-${SWOOLE_VERSION}-${OS}-${ARCH}.tar.xz" +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 - SWOOLE_CLI_DOWNLOAD_URL="https://github.com/swoole/swoole-cli/releases/download/${VERSION}/swoole-cli-${SWOOLE_VERSION}-cygwin-${ARCH}.zip" + APP_DOWNLOAD_URL="https://github.com/swoole/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" fi MIRROR='' @@ -89,10 +91,10 @@ done case "$MIRROR" in china) - SWOOLE_CLI_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/swoole-cli-${SWOOLE_VERSION}-${OS}-${ARCH}.tar.xz" + 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 - SWOOLE_CLI_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/swoole-cli-${SWOOLE_VERSION}-cygwin-${ARCH}.zip" + APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" fi ;; @@ -103,25 +105,20 @@ chmod a+x composer.phar test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} -SWOOLE_CLI_RUNTIME="swoole-cli-${SWOOLE_VERSION}-${OS}-${ARCH}" +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" if [ $OS = 'windows' ]; then { - SWOOLE_CLI_RUNTIME="swoole-cli-${SWOOLE_VERSION}-cygwin-${ARCH}" - test -f ${SWOOLE_CLI_RUNTIME}.zip || curl -LSo ${SWOOLE_CLI_RUNTIME}.zip ${SWOOLE_CLI_DOWNLOAD_URL} - test -d ${SWOOLE_CLI_RUNTIME} && rm -rf ${SWOOLE_CLI_RUNTIME} - unzip "${SWOOLE_CLI_RUNTIME}.zip" - test -d ${__PROJECT__}/${SWOOLE_CLI_RUNTIME} && rm -rf ${__PROJECT__}/${SWOOLE_CLI_RUNTIME} - cp -f composer.phar ${SWOOLE_CLI_RUNTIME}/bin/ - #cp -f ${SWOOLE_CLI_RUNTIME}/bin/swoole-cli.exe ${SWOOLE_CLI_RUNTIME}/bin/php.exe - mv ${SWOOLE_CLI_RUNTIME} ${__PROJECT__} - echo + 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" exit 0 } else - test -f ${SWOOLE_CLI_RUNTIME}.tar.xz || curl -LSo ${SWOOLE_CLI_RUNTIME}.tar.xz ${SWOOLE_CLI_DOWNLOAD_URL} - test -f ${SWOOLE_CLI_RUNTIME}.tar || xz -d -k ${SWOOLE_CLI_RUNTIME}.tar.xz - test -f swoole-cli || tar -xvf ${SWOOLE_CLI_RUNTIME}.tar + 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/php fi @@ -135,6 +132,19 @@ cat >${__PROJECT__}/bin/runtime/php.ini < Date: Tue, 9 Jul 2024 01:34:10 +0800 Subject: [PATCH 011/226] update setup-php-runtime.sh --- setup-php-runtime.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/setup-php-runtime.sh b/setup-php-runtime.sh index 57dd3c9894..c63dc79e6d 100644 --- a/setup-php-runtime.sh +++ b/setup-php-runtime.sh @@ -48,7 +48,6 @@ case $ARCH in ;; esac -SWOOLE_VERSION='v5.1.3' APP_VERSION='v5.1.3' APP_NAME='swoole-cli' VERSION='v5.1.3.0' From 9d557e52923e94bfc52a33ac43cb8cc13079c31e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 11:38:13 +0800 Subject: [PATCH 012/226] updaete --- setup-swoole-cli-pre-runtime.sh | 45 +++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/setup-swoole-cli-pre-runtime.sh b/setup-swoole-cli-pre-runtime.sh index 378c66036b..b3e0c5d13f 100644 --- a/setup-swoole-cli-pre-runtime.sh +++ b/setup-swoole-cli-pre-runtime.sh @@ -48,7 +48,8 @@ case $ARCH in ;; esac -SWOOLE_VERSION='v6.0.0-dev' +APP_VERSION='v6.0.0-dev' +APP_NAME='swoole-cli' VERSION='swoole-cli-v0.0.6' mkdir -p bin/runtime @@ -56,13 +57,12 @@ mkdir -p var/runtime cd ${__PROJECT__}/var/runtime - -SWOOLE_CLI_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/swoole-cli-${SWOOLE_VERSION}-${OS}-${ARCH}.tar.xz" +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 - SWOOLE_CLI_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/swoole-cli-${SWOOLE_VERSION}-cygwin-${ARCH}.zip" + APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" fi MIRROR='' @@ -70,8 +70,8 @@ while [ $# -gt 0 ]; do case "$1" in --mirror) MIRROR="$2" - # dev beta alpha 版本镜像不可用 - MIRROR='' + # dev beta alpha + MIRROR="" ;; --proxy) export HTTP_PROXY="$2" @@ -92,10 +92,10 @@ done case "$MIRROR" in china) - SWOOLE_CLI_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/swoole-cli-${SWOOLE_VERSION}-${OS}-${ARCH}.tar.xz" + 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 - SWOOLE_CLI_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/swoole-cli-${SWOOLE_VERSION}-cygwin-${ARCH}.zip" + APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" fi ;; @@ -106,20 +106,20 @@ chmod a+x composer.phar test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} -SWOOLE_CLI_RUNTIME="swoole-cli-${SWOOLE_VERSION}-${OS}-${ARCH}" +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" if [ $OS = 'windows' ]; then { - SWOOLE_CLI_RUNTIME="swoole-cli-${SWOOLE_VERSION}-cygwin-${ARCH}" - test -f ${SWOOLE_CLI_RUNTIME}.zip || curl -LSo ${SWOOLE_CLI_RUNTIME}.zip ${SWOOLE_CLI_DOWNLOAD_URL} - test -d ${SWOOLE_CLI_RUNTIME} && rm -rf ${SWOOLE_CLI_RUNTIME} - unzip "${SWOOLE_CLI_RUNTIME}.zip" + 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" exit 0 } else - test -f ${SWOOLE_CLI_RUNTIME}.tar.xz || curl -LSo ${SWOOLE_CLI_RUNTIME}.tar.xz ${SWOOLE_CLI_DOWNLOAD_URL} - test -f ${SWOOLE_CLI_RUNTIME}.tar || xz -d -k ${SWOOLE_CLI_RUNTIME}.tar.xz - test -f swoole-cli || tar -xvf ${SWOOLE_CLI_RUNTIME}.tar + 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/php fi @@ -133,6 +133,19 @@ cat >${__PROJECT__}/bin/runtime/php.ini < Date: Tue, 9 Jul 2024 11:55:56 +0800 Subject: [PATCH 013/226] =?UTF-8?q?dev=20debug=20=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E5=90=AF=E7=94=A8=20swoole=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/builder/extension/swoole.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sapi/src/builder/extension/swoole.php b/sapi/src/builder/extension/swoole.php index 06572fd90f..a6e6497255 100644 --- a/sapi/src/builder/extension/swoole.php +++ b/sapi/src/builder/extension/swoole.php @@ -13,6 +13,12 @@ $options .= ' --with-swoole-odbc=unixODBC,' . UNIX_ODBC_PREFIX . ' '; $options .= ' --enable-swoole-sqlite '; + if (in_array($p->getBuildType(), ['dev', 'debug'])) { + $options .= ' --enable-debug '; + $options .= ' --enable-debug-log '; + $options .= ' --enable-trace-log '; + } + $ext = (new Extension('swoole')) ->withOptions($options) ->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2) From 4a3a7dd0ad833cfa26589f2731efd64d80b83652 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 12:20:49 +0800 Subject: [PATCH 014/226] enable swoole debug config --- sapi/src/builder/extension/swoole.php | 1 - sapi/src/builder/extension/swoole_latest.php | 6 ++++++ sapi/src/builder/extension/swoole_v4080.php | 6 ++++++ sapi/src/builder/extension/swoole_v5.1.x.php | 8 +++++++- sapi/src/builder/extension/swoole_v5000.php | 6 ++++++ sapi/src/builder/extension/swoole_v6000.php | 6 ++++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/sapi/src/builder/extension/swoole.php b/sapi/src/builder/extension/swoole.php index 494fb24801..152ed806b9 100644 --- a/sapi/src/builder/extension/swoole.php +++ b/sapi/src/builder/extension/swoole.php @@ -21,7 +21,6 @@ $options .= ' --enable-swoole-sqlite '; $options .= ' --with-swoole-odbc=unixODBC,' . UNIX_ODBC_PREFIX . ' '; - if (in_array($p->getBuildType(), ['dev', 'debug'])) { $options .= ' --enable-debug '; $options .= ' --enable-debug-log '; diff --git a/sapi/src/builder/extension/swoole_latest.php b/sapi/src/builder/extension/swoole_latest.php index 177316b849..71111e9155 100644 --- a/sapi/src/builder/extension/swoole_latest.php +++ b/sapi/src/builder/extension/swoole_latest.php @@ -17,6 +17,12 @@ $options .= ' --enable-swoole-pgsql '; $options .= ' --with-swoole-odbc=unixODBC,' . UNIX_ODBC_PREFIX . ' '; + if (in_array($p->getBuildType(), ['dev', 'debug'])) { + $options .= ' --enable-debug '; + $options .= ' --enable-debug-log '; + $options .= ' --enable-trace-log '; + } + $ext = (new Extension('swoole_latest')) ->withAliasName('swoole') ->withHomePage('https://github.com/swoole/swoole-src') diff --git a/sapi/src/builder/extension/swoole_v4080.php b/sapi/src/builder/extension/swoole_v4080.php index 8cb8a1eee7..7f5bd5cdbb 100644 --- a/sapi/src/builder/extension/swoole_v4080.php +++ b/sapi/src/builder/extension/swoole_v4080.php @@ -14,6 +14,12 @@ $options .= ' --with-openssl-dir=' . OPENSSL_PREFIX; $options .= ' --with-brotli-dir=' . BROTLI_PREFIX; + if (in_array($p->getBuildType(), ['dev', 'debug'])) { + $options .= ' --enable-debug '; + $options .= ' --enable-debug-log '; + $options .= ' --enable-trace-log '; + } + $ext = (new Extension('swoole_v4080')) ->withAliasName('swoole') ->withHomePage('https://github.com/swoole/swoole-src') diff --git a/sapi/src/builder/extension/swoole_v5.1.x.php b/sapi/src/builder/extension/swoole_v5.1.x.php index ab208827e9..8299630d29 100644 --- a/sapi/src/builder/extension/swoole_v5.1.x.php +++ b/sapi/src/builder/extension/swoole_v5.1.x.php @@ -13,6 +13,12 @@ $options .= ' --with-swoole-odbc=unixODBC,' . UNIX_ODBC_PREFIX . ' '; $options .= ' --enable-swoole-sqlite '; + if (in_array($p->getBuildType(), ['dev', 'debug'])) { + $options .= ' --enable-debug '; + $options .= ' --enable-debug-log '; + $options .= ' --enable-trace-log '; + } + $ext = (new Extension('swoole_v5.1.x')) ->withOptions($options) ->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2) @@ -25,7 +31,7 @@ git clone -b 5.1.x --depth=1 https://github.com/swoole/swoole-src.git EOF ) - ->withDependentExtensions('curl', 'openssl', 'sockets', 'mysqlnd', 'pdo' ); + ->withDependentExtensions('curl', 'openssl', 'sockets', 'mysqlnd', 'pdo'); $ext->withDependentLibraries(...$depends); $p->addExtension($ext); diff --git a/sapi/src/builder/extension/swoole_v5000.php b/sapi/src/builder/extension/swoole_v5000.php index 7f6434ba72..0bd5433458 100644 --- a/sapi/src/builder/extension/swoole_v5000.php +++ b/sapi/src/builder/extension/swoole_v5000.php @@ -19,6 +19,12 @@ $dependentLibraries[] = 'pgsql'; } + if (in_array($p->getBuildType(), ['dev', 'debug'])) { + $options .= ' --enable-debug '; + $options .= ' --enable-debug-log '; + $options .= ' --enable-trace-log '; + } + $ext = (new Extension('swoole_v5000')) ->withAliasName('swoole') ->withHomePage('https://github.com/swoole/swoole-src') diff --git a/sapi/src/builder/extension/swoole_v6000.php b/sapi/src/builder/extension/swoole_v6000.php index 91e881a5e0..3dc1065dc7 100644 --- a/sapi/src/builder/extension/swoole_v6000.php +++ b/sapi/src/builder/extension/swoole_v6000.php @@ -6,6 +6,7 @@ return function (Preprocessor $p) { $swoole_tag = 'v6.0'; + $swoole_tag = 'master'; $file = "swoole-{$swoole_tag}.tar.gz"; $url = "https://github.com/swoole/swoole-src/archive/refs/tags/{$swoole_tag}.tar.gz"; @@ -28,6 +29,11 @@ $options .= ' --enable-zts '; + if (in_array($p->getBuildType(), ['dev', 'debug'])) { + $options .= ' --enable-debug '; + $options .= ' --enable-debug-log '; + $options .= ' --enable-trace-log '; + } $ext = (new Extension('swoole_v6000')) ->withAliasName('swoole') From 93f09dd166de131c1df3316642ec5921423f3dae Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 12:33:51 +0800 Subject: [PATCH 015/226] update swoole_v4080 --- sapi/src/builder/extension/swoole_v4080.php | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/src/builder/extension/swoole_v4080.php b/sapi/src/builder/extension/swoole_v4080.php index 7f5bd5cdbb..72125e7062 100644 --- a/sapi/src/builder/extension/swoole_v4080.php +++ b/sapi/src/builder/extension/swoole_v4080.php @@ -13,6 +13,7 @@ $options .= ' --enable-http2 --enable-brotli '; $options .= ' --with-openssl-dir=' . OPENSSL_PREFIX; $options .= ' --with-brotli-dir=' . BROTLI_PREFIX; + $options .= ' --enable-swoole-json ' ; if (in_array($p->getBuildType(), ['dev', 'debug'])) { $options .= ' --enable-debug '; From 54bee6aa2347ecf4a574ebbd9d4f03fd0381b75c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 13:08:30 +0800 Subject: [PATCH 016/226] format code --- sapi/src/builder/extension/imagick.php | 4 +++- sapi/src/builder/library/imagemagick.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sapi/src/builder/extension/imagick.php b/sapi/src/builder/extension/imagick.php index d47901b33c..5a6006af83 100644 --- a/sapi/src/builder/extension/imagick.php +++ b/sapi/src/builder/extension/imagick.php @@ -9,7 +9,7 @@ (new Extension('imagick')) ->withOptions('--with-imagick=' . IMAGEMAGICK_PREFIX) ->withPeclVersion('3.6.0') - ->withFileHash('md5','f7b5e9b23fb844e5eb035203d316bc63') + ->withFileHash('md5', 'f7b5e9b23fb844e5eb035203d316bc63') ->withHomePage('https://github.com/Imagick/imagick') ->withLicense('https://github.com/Imagick/imagick/blob/master/LICENSE', Extension::LICENSE_PHP) ->withMd5sum('f7b5e9b23fb844e5eb035203d316bc63') @@ -17,3 +17,5 @@ ->withDependentExtensions('tokenizer') ); }; +//构建的过程中,会自动 下载 PHP-Parser +//https://codeload.github.com/nikic/PHP-Parser/ diff --git a/sapi/src/builder/library/imagemagick.php b/sapi/src/builder/library/imagemagick.php index 12850068af..d47c033a55 100644 --- a/sapi/src/builder/library/imagemagick.php +++ b/sapi/src/builder/library/imagemagick.php @@ -13,7 +13,7 @@ ->withLicense('https://imagemagick.org/script/license.php', Library::LICENSE_APACHE2) ->withUrl('https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-20.tar.gz') ->withFile('ImageMagick-v7.1.1-20.tar.gz') - ->withFileHash('md5','90eb1a9263b47b7e844eb817fe08932c') + ->withFileHash('md5', '90eb1a9263b47b7e844eb817fe08932c') ->withPrefix($imagemagick_prefix) ->withConfigure( << Date: Tue, 9 Jul 2024 15:34:50 +0800 Subject: [PATCH 017/226] update swoole_v6 --- sapi/src/builder/extension/swoole_v6.php | 45 ++++-------- sapi/src/builder/extension/swoole_v6000.php | 81 --------------------- 2 files changed, 15 insertions(+), 111 deletions(-) delete mode 100644 sapi/src/builder/extension/swoole_v6000.php diff --git a/sapi/src/builder/extension/swoole_v6.php b/sapi/src/builder/extension/swoole_v6.php index 896d2c5da6..6d756e336c 100644 --- a/sapi/src/builder/extension/swoole_v6.php +++ b/sapi/src/builder/extension/swoole_v6.php @@ -6,6 +6,7 @@ return function (Preprocessor $p) { $swoole_tag = 'v6.0'; + $swoole_tag = 'master'; $file = "swoole-{$swoole_tag}.tar.gz"; $url = "https://github.com/swoole/swoole-src/archive/refs/tags/{$swoole_tag}.tar.gz"; @@ -23,6 +24,12 @@ $options .= ' --enable-swoole-thread '; $options .= ' --enable-zts '; + if (in_array($p->getBuildType(), ['dev', 'debug'])) { + $options .= ' --enable-debug '; + $options .= ' --enable-debug-log '; + $options .= ' --enable-trace-log '; + } + //linux 环境下 启用 opcache 扩展时构建报错,需要禁用 opcache if ($p->isLinux() && 0) { @@ -39,7 +46,15 @@ ->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2) ->withManual('https://wiki.swoole.com/#/') ->withOptions($options) + ->withFile($file) + ->withDownloadScript( + 'swoole-src', + <<withBuildCached(false) + ->withAutoUpdateFile() ->withDependentLibraries(...$dependentLibraries) ->withDependentExtensions(...$dependentExtensions); @@ -50,34 +65,4 @@ $p->withExportVariable('CARES_CFLAGS', '$(pkg-config --cflags --static libcares)'); $p->withExportVariable('CARES_LIBS', '$(pkg-config --libs --static libcares)'); - - - // 使用扩展钩子 下载 swoole v6 源码 - $p->withBeforeConfigureScript('swoole_v6', function (Preprocessor $p) { - $workdir = $p->getWorkDir(); - $cmd = <<isLinux()) { - $options .= ' --enable-iouring '; - $dependentLibraries[] = 'liburing'; - } - - $options .= ' --enable-zts '; - - if (in_array($p->getBuildType(), ['dev', 'debug'])) { - $options .= ' --enable-debug '; - $options .= ' --enable-debug-log '; - $options .= ' --enable-trace-log '; - } - - $ext = (new Extension('swoole_v6000')) - ->withAliasName('swoole') - ->withHomePage('https://github.com/swoole/swoole-src') - ->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2) - ->withManual('https://wiki.swoole.com/#/') - ->withOptions($options) - ->withFile($file) - ->withDownloadScript( - 'swoole-src', - <<withBuildCached(false) - ->withAutoUpdateFile() - ->withDependentLibraries(...$dependentLibraries) - ->withDependentExtensions(...$dependentExtensions); - - //call_user_func_array([$ext, 'withDependentLibraries'], $dependentLibraries); - //call_user_func_array([$ext, 'withDependentExtensions'], $dependentExtensions); - - $p->addExtension($ext); - - $libs = $p->isMacos() ? '-lc++' : ' -lstdc++ '; - $p->withVariable('LIBS', '$LIBS ' . $libs); - - // 扩展钩子 写法 (下载 swoole v6 源码) - $p->withBeforeConfigureScript('swoole_v6', function (Preprocessor $p) { - $workdir = $p->getWorkDir(); - $cmd = <<withExportVariable('CARES_CFLAGS', '$(pkg-config --cflags --static libcares)'); - $p->withExportVariable('CARES_LIBS', '$(pkg-config --libs --static libcares)'); - -}; From fda8ad068cb0dc64c60b2965469c4788d412be12 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 15:47:42 +0800 Subject: [PATCH 018/226] fix conflict --- sapi/quickstart/clean-folder-for-extra-build.sh | 6 +++++- setup-supervisord.sh | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index d2bb1b550f..d78c2f88ae 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -19,7 +19,7 @@ if [ $GIT_BRANCH = 'new_dev' ] ;then exit 0 fi -echo '正在执行删除无关的文件或者文件建' +echo '正在执行删除无关的文件或者文件夹' cd ${__DIR__}/linux/ @@ -70,6 +70,7 @@ test -f ovn.yml && rm -rf ovn.yml cd ${__PROJECT__} +<<<<<<< HEAD test -f setup-aria2-runtime.sh && rm -rf setup-aria2-runtime.sh test -f setup-ffmpeg-runtime.sh && rm -rf setup-ffmpeg-runtime.sh test -f setup-php-cli-runtime.sh && rm -rf setup-php-cli-runtime.sh @@ -82,7 +83,10 @@ test -f setup-socat-runtime.sh && rm -rf setup-socat-runtime.sh test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh test -f setup-socat-runtime.sh && rm -rf setup-socat-runtime.sh test -f setup-swoole-cli-pre-runtime.sh && rm -rf setup-swoole-cli-pre-runtime.sh +test -f setup-supervisord.sh && rm -rf setup-supervisord.sh cd ${__PROJECT__} echo '删除完毕' + + diff --git a/setup-supervisord.sh b/setup-supervisord.sh index 86e861e46f..6bbcab2236 100644 --- a/setup-supervisord.sh +++ b/setup-supervisord.sh @@ -61,6 +61,7 @@ else fi + # systemd for supervisord # https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html @@ -68,3 +69,4 @@ fi # supervisord configure # http://supervisord.org/configuration.html + From 026bd2b4492dbdc487d0661456744e4e146c00af Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 15:50:08 +0800 Subject: [PATCH 019/226] fix conflict --- .../linux/SDN/OVS/test-download-file.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sapi/quickstart/linux/SDN/OVS/test-download-file.sh diff --git a/sapi/quickstart/linux/SDN/OVS/test-download-file.sh b/sapi/quickstart/linux/SDN/OVS/test-download-file.sh new file mode 100644 index 0000000000..bee5436b3b --- /dev/null +++ b/sapi/quickstart/linux/SDN/OVS/test-download-file.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +__DIR__=$(cd "$(dirname "$0")";pwd) +cd ${__DIR__} +set -uex + +RESULT_CODE=0 +while [ $RESULT_CODE -eq 0 ]; do + curl -Lo /dev/null http://10.1.20.4/all-deps.zip + RESULT_CODE=$? + sleep 1 # 每隔1秒检查一次 +done + + + From 2ba25609b29a90d7862d10aa201ef82821a20386 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 22 Jun 2024 23:49:54 +0800 Subject: [PATCH 020/226] update --- sapi/quickstart/linux/SDN/OVS/shell-daemon.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sapi/quickstart/linux/SDN/OVS/shell-daemon.sh diff --git a/sapi/quickstart/linux/SDN/OVS/shell-daemon.sh b/sapi/quickstart/linux/SDN/OVS/shell-daemon.sh new file mode 100644 index 0000000000..ef138a9b1b --- /dev/null +++ b/sapi/quickstart/linux/SDN/OVS/shell-daemon.sh @@ -0,0 +1,2 @@ + +nohup ./run > output.log 2> error.log & From 9f7783e23bded4a2be6aaa889063a9053163693d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 15:52:22 +0800 Subject: [PATCH 021/226] update --- sapi/quickstart/linux/SDN/OVS/test-download-file.sh | 2 ++ setup-supervisord.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/linux/SDN/OVS/test-download-file.sh b/sapi/quickstart/linux/SDN/OVS/test-download-file.sh index bee5436b3b..23aae9e6b8 100644 --- a/sapi/quickstart/linux/SDN/OVS/test-download-file.sh +++ b/sapi/quickstart/linux/SDN/OVS/test-download-file.sh @@ -4,6 +4,8 @@ __DIR__=$(cd "$(dirname "$0")";pwd) cd ${__DIR__} set -uex + + RESULT_CODE=0 while [ $RESULT_CODE -eq 0 ]; do curl -Lo /dev/null http://10.1.20.4/all-deps.zip diff --git a/setup-supervisord.sh b/setup-supervisord.sh index 6bbcab2236..0e301c27f8 100644 --- a/setup-supervisord.sh +++ b/setup-supervisord.sh @@ -63,10 +63,8 @@ fi # systemd for supervisord - # https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html # supervisord configure # http://supervisord.org/configuration.html - From 89ec08d2710dbb8bb5b5b3d5547459cac41c8b7d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 15:53:33 +0800 Subject: [PATCH 022/226] update --- sapi/quickstart/clean-folder-for-extra-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index d78c2f88ae..32ce5e7ff1 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -70,7 +70,6 @@ test -f ovn.yml && rm -rf ovn.yml cd ${__PROJECT__} -<<<<<<< HEAD test -f setup-aria2-runtime.sh && rm -rf setup-aria2-runtime.sh test -f setup-ffmpeg-runtime.sh && rm -rf setup-ffmpeg-runtime.sh test -f setup-php-cli-runtime.sh && rm -rf setup-php-cli-runtime.sh @@ -85,6 +84,7 @@ test -f setup-socat-runtime.sh && rm -rf setup-socat-runtime.sh test -f setup-swoole-cli-pre-runtime.sh && rm -rf setup-swoole-cli-pre-runtime.sh test -f setup-supervisord.sh && rm -rf setup-supervisord.sh + cd ${__PROJECT__} echo '删除完毕' From 586faf1db938d35fd6d508507baf26a999086e47 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 16:21:47 +0800 Subject: [PATCH 023/226] update cygwin-config.sh --- sapi/scripts/cygwin/cygwin-config.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapi/scripts/cygwin/cygwin-config.sh b/sapi/scripts/cygwin/cygwin-config.sh index 1cf8e07a38..fdf84400ee 100755 --- a/sapi/scripts/cygwin/cygwin-config.sh +++ b/sapi/scripts/cygwin/cygwin-config.sh @@ -61,15 +61,15 @@ test -f Makefile && make clean --enable-swoole --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ - --enable-swoole-thread \ - --enable-zts \ --enable-redis \ --with-imagick \ --with-yaml \ --with-readline -# --with-zip # cygwin libzip-devel 版本库暂不支持函数 zip_encryption_method_supported (2020年新增函数) +# --with-zip # cygwin libzip-devel 版本库暂不支持函数 zip_encryption_method_supported (2020年新增函数) # --with-pdo-pgsql \ # --with-pgsql # --with-pdo-sqlite \ # --enable-opcache \ +# --enable-swoole-thread \ +# --enable-zts \ From 1174276af97698bbd64e4d39ca463f2fe97cc891 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 16:43:40 +0800 Subject: [PATCH 024/226] update --- sapi/src/builder/extension/imagick.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/builder/extension/imagick.php b/sapi/src/builder/extension/imagick.php index 5a6006af83..017acac9e8 100644 --- a/sapi/src/builder/extension/imagick.php +++ b/sapi/src/builder/extension/imagick.php @@ -18,4 +18,4 @@ ); }; //构建的过程中,会自动 下载 PHP-Parser -//https://codeload.github.com/nikic/PHP-Parser/ +//https://github.com/nikic/PHP-Parser/ From cbaf0a25acc7b60045604b91191edf074a59d7a8 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 16:51:04 +0800 Subject: [PATCH 025/226] format code --- sapi/src/builder/extension/apcu.php | 2 +- sapi/src/builder/extension/ds.php | 2 +- sapi/src/builder/extension/imagick.php | 5 ++++- sapi/src/builder/extension/inotify.php | 2 +- sapi/src/builder/extension/mongodb.php | 2 +- sapi/src/builder/extension/protobuf.php | 4 ++-- sapi/src/builder/extension/redis.php | 2 +- sapi/src/builder/extension/ssh2.php | 2 +- sapi/src/builder/extension/xlswriter.php | 2 +- sapi/src/builder/extension/yaml.php | 2 +- sapi/src/builder/library/bison.php | 2 +- sapi/src/builder/library/brotli.php | 2 +- sapi/src/builder/library/bzip2.php | 2 +- sapi/src/builder/library/cares.php | 2 +- sapi/src/builder/library/curl.php | 2 +- sapi/src/builder/library/freetype.php | 2 +- sapi/src/builder/library/gmp.php | 2 +- sapi/src/builder/library/icu.php | 2 +- sapi/src/builder/library/imagemagick.php | 2 +- sapi/src/builder/library/libedit.php | 2 +- sapi/src/builder/library/libgif.php | 2 +- sapi/src/builder/library/libiconv.php | 2 +- sapi/src/builder/library/libjpeg.php | 2 +- sapi/src/builder/library/liblz4.php | 3 +-- sapi/src/builder/library/libpng.php | 3 ++- sapi/src/builder/library/libsodium.php | 2 +- sapi/src/builder/library/libssh2.php | 2 +- sapi/src/builder/library/libwebp.php | 2 +- sapi/src/builder/library/libxml2.php | 2 +- sapi/src/builder/library/libxslt.php | 2 +- sapi/src/builder/library/libyaml.php | 3 +-- sapi/src/builder/library/libzip.php | 2 +- sapi/src/builder/library/libzstd.php | 2 +- sapi/src/builder/library/ncurses.php | 2 +- sapi/src/builder/library/nghttp2.php | 2 +- sapi/src/builder/library/nghttp3.php | 2 +- sapi/src/builder/library/ngtcp2.php | 2 +- sapi/src/builder/library/oniguruma.php | 2 +- sapi/src/builder/library/openssl.php | 2 +- sapi/src/builder/library/readline.php | 2 +- sapi/src/builder/library/sqlite3.php | 2 +- sapi/src/builder/library/unix_odbc.php | 2 +- sapi/src/builder/library/zlib.php | 2 +- 43 files changed, 48 insertions(+), 46 deletions(-) diff --git a/sapi/src/builder/extension/apcu.php b/sapi/src/builder/extension/apcu.php index 4b2400acb0..2e55edd44a 100644 --- a/sapi/src/builder/extension/apcu.php +++ b/sapi/src/builder/extension/apcu.php @@ -8,7 +8,7 @@ (new Extension('apcu')) ->withOptions('--enable-apcu') ->withPeclVersion('5.1.22') - ->withFileHash('md5','2e1fb1f09725ada616e873c4e4012ff6') + ->withFileHash('md5', '2e1fb1f09725ada616e873c4e4012ff6') ->withHomePage('https://github.com/krakjoe/apcu.git') ->withManual('https://www.php.net/apcu') ->withLicense('https://github.com/krakjoe/apcu/blob/master/LICENSE', Extension::LICENSE_PHP) diff --git a/sapi/src/builder/extension/ds.php b/sapi/src/builder/extension/ds.php index 1640f9dccd..0c935b7055 100644 --- a/sapi/src/builder/extension/ds.php +++ b/sapi/src/builder/extension/ds.php @@ -8,7 +8,7 @@ (new Extension('ds')) ->withOptions(' --enable-ds') ->withPeclVersion('1.4.0') - ->withFileHash('md5','d7e64fbb53b567908d63155ec2a8f548') + ->withFileHash('md5', 'd7e64fbb53b567908d63155ec2a8f548') ->withHomePage('https://github.com/php-ds/ext-ds') ->withManual('https://www.php.net/ds') ->withLicense('https://github.com/php-ds/ext-ds/blob/master/LICENSE', Extension::LICENSE_MIT) diff --git a/sapi/src/builder/extension/imagick.php b/sapi/src/builder/extension/imagick.php index 1f0346cddc..f4ccd59f2a 100644 --- a/sapi/src/builder/extension/imagick.php +++ b/sapi/src/builder/extension/imagick.php @@ -9,10 +9,13 @@ (new Extension('imagick')) ->withOptions('--with-imagick=' . IMAGEMAGICK_PREFIX) ->withPeclVersion('3.6.0') - ->withFileHash('md5','f7b5e9b23fb844e5eb035203d316bc63') + ->withFileHash('md5', 'f7b5e9b23fb844e5eb035203d316bc63') ->withHomePage('https://github.com/Imagick/imagick') ->withLicense('https://github.com/Imagick/imagick/blob/master/LICENSE', Extension::LICENSE_PHP) ->withMd5sum('f7b5e9b23fb844e5eb035203d316bc63') ->withDependentLibraries('imagemagick') ); }; + +//构建的过程中,会自动 下载 PHP-Parser +//https://github.com/nikic/PHP-Parser/ diff --git a/sapi/src/builder/extension/inotify.php b/sapi/src/builder/extension/inotify.php index 8b6b9d1808..356b5f249a 100644 --- a/sapi/src/builder/extension/inotify.php +++ b/sapi/src/builder/extension/inotify.php @@ -12,6 +12,6 @@ ->withHomePage('https://www.php.net/inotify') ->withOptions('--enable-inotify') ->withPeclVersion('3.0.0') - ->withFileHash('md5','084a5a5af53a5eb85dae7c7d2c95048f') + ->withFileHash('md5', '084a5a5af53a5eb85dae7c7d2c95048f') ); }; diff --git a/sapi/src/builder/extension/mongodb.php b/sapi/src/builder/extension/mongodb.php index fafc74b323..451d376f21 100644 --- a/sapi/src/builder/extension/mongodb.php +++ b/sapi/src/builder/extension/mongodb.php @@ -33,7 +33,7 @@ ->withHomePage('https://www.mongodb.com/docs/drivers/php/') ->withOptions($options) ->withPeclVersion('1.14.2') - ->withFileHash('md5','b6de193d467f77d8fd7b27845c19e476') + ->withFileHash('md5', 'b6de193d467f77d8fd7b27845c19e476') ; $depends = ['icu', 'openssl', 'zlib', 'libzstd']; diff --git a/sapi/src/builder/extension/protobuf.php b/sapi/src/builder/extension/protobuf.php index 3b1b50d355..c19c137a5b 100644 --- a/sapi/src/builder/extension/protobuf.php +++ b/sapi/src/builder/extension/protobuf.php @@ -8,14 +8,14 @@ (new Extension('protobuf')) ->withOptions('--enable-protobuf') ->withPeclVersion('3.21.6') - ->withFileHash('md5','30fd6011881fa67878805c394e425577') + ->withFileHash('md5', '30fd6011881fa67878805c394e425577') ->withHomePage('https://developers.google.com/protocol-buffers') ->withManual('https://protobuf.dev/reference/php/php-generated/') ); $p->withBeforeConfigureScript('protobuf', function (Preprocessor $p) { // compatible with redis - $workdir= $p->getWorkDir(); + $workdir = $p->getWorkDir(); if ($p->isMacos()) { $cmd = <<withOptions('--enable-redis') ->withPeclVersion('5.3.7') - ->withFileHash('md5','1ed6793902214cc02467666ba69dd2be') + ->withFileHash('md5', '1ed6793902214cc02467666ba69dd2be') ->withHomePage('https://github.com/phpredis/phpredis') ->withLicense('https://github.com/phpredis/phpredis/blob/develop/COPYING', Extension::LICENSE_PHP) ); diff --git a/sapi/src/builder/extension/ssh2.php b/sapi/src/builder/extension/ssh2.php index 9f75754e57..32dcc9291f 100644 --- a/sapi/src/builder/extension/ssh2.php +++ b/sapi/src/builder/extension/ssh2.php @@ -8,7 +8,7 @@ (new Extension('ssh2')) ->withOptions('--with-ssh2=' . LIBSSH2_PREFIX) ->withPeclVersion('1.4') - ->withFileHash('md5','d4ff155a741fcc33c4439a6e20323afd') + ->withFileHash('md5', 'd4ff155a741fcc33c4439a6e20323afd') ->withHomePage('https://github.com/php/pecl-networking-ssh2') ->withManual('https://www.php.net/ssh2') ->withLicense('https://www.php.net/license/', Extension::LICENSE_PHP) diff --git a/sapi/src/builder/extension/xlswriter.php b/sapi/src/builder/extension/xlswriter.php index edd35e5a5d..1491cd52db 100644 --- a/sapi/src/builder/extension/xlswriter.php +++ b/sapi/src/builder/extension/xlswriter.php @@ -10,7 +10,7 @@ ->withHomePage('https://github.com/viest/php-ext-xlswriter') ->withLicense('https://github.com/viest/php-ext-xlswriter/blob/master/LICENSE', Extension::LICENSE_BSD) ->withPeclVersion('1.5.5') - ->withFileHash('md5','924847f19c20a6d071e91b7d2488021d') + ->withFileHash('md5', '924847f19c20a6d071e91b7d2488021d') ->withOptions(' --with-xlswriter --enable-reader --with-openssl=' . OPENSSL_PREFIX) ->withDependentLibraries('openssl') ); diff --git a/sapi/src/builder/extension/yaml.php b/sapi/src/builder/extension/yaml.php index e25ac522ae..d710094f49 100644 --- a/sapi/src/builder/extension/yaml.php +++ b/sapi/src/builder/extension/yaml.php @@ -9,7 +9,7 @@ (new Extension('yaml')) ->withOptions('--with-yaml=' . LIBYAML_PREFIX) ->withPeclVersion('2.2.2') - ->withFileHash('md5','22678c1238f2c6848ff7d74b780a8307') + ->withFileHash('md5', '22678c1238f2c6848ff7d74b780a8307') ->withHomePage('https://github.com/php/pecl-file_formats-yaml') ->withLicense('https://github.com/php/pecl-file_formats-yaml/blob/php7/LICENSE', Extension::LICENSE_MIT) ->withDependentLibraries('libyaml') diff --git a/sapi/src/builder/library/bison.php b/sapi/src/builder/library/bison.php index 9e74898732..41c518741f 100644 --- a/sapi/src/builder/library/bison.php +++ b/sapi/src/builder/library/bison.php @@ -9,7 +9,7 @@ (new Library('bison')) ->withHomePage('https://www.gnu.org/software/bison/') ->withUrl('https://ftpmirror.gnu.org/gnu/bison/bison-3.8.tar.gz') - ->withFileHash('md5','b9971f4f58690b7737ab7592d5a0a4e0') + ->withFileHash('md5', 'b9971f4f58690b7737ab7592d5a0a4e0') ->withLicense('https://www.gnu.org/licenses/gpl-3.0.html', Library::LICENSE_GPL) ->withConfigure( " diff --git a/sapi/src/builder/library/brotli.php b/sapi/src/builder/library/brotli.php index c87330706d..ac8c00b684 100644 --- a/sapi/src/builder/library/brotli.php +++ b/sapi/src/builder/library/brotli.php @@ -11,7 +11,7 @@ ->withManual('https://github.com/google/brotli')//有多种构建方式,选择cmake 构建 ->withLicense('https://github.com/google/brotli/blob/master/LICENSE', Library::LICENSE_MIT) ->withUrl('https://github.com/google/brotli/archive/refs/tags/v1.0.9.tar.gz') - ->withFileHash('md5','c2274f0c7af8470ad514637c35bcee7d') + ->withFileHash('md5', 'c2274f0c7af8470ad514637c35bcee7d') ->withFile('brotli-1.0.9.tar.gz') ->withPrefix($brotli_prefix) ->withBuildScript( diff --git a/sapi/src/builder/library/bzip2.php b/sapi/src/builder/library/bzip2.php index ec72cbfda4..30378f8bb5 100644 --- a/sapi/src/builder/library/bzip2.php +++ b/sapi/src/builder/library/bzip2.php @@ -10,7 +10,7 @@ ->withHomePage('https://www.sourceware.org/bzip2/') ->withManual('https://www.sourceware.org/bzip2/docs.html') ->withUrl('https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz') - ->withFileHash('md5','67e051268d0c475ea773822f7500d0e5') + ->withFileHash('md5', '67e051268d0c475ea773822f7500d0e5') ->withPrefix($bzip2_prefix) ->withMakeOptions('PREFIX=' . $bzip2_prefix) ->withMakeInstallOptions('PREFIX=' . $bzip2_prefix) diff --git a/sapi/src/builder/library/cares.php b/sapi/src/builder/library/cares.php index 64b6a6aae3..b21657b187 100644 --- a/sapi/src/builder/library/cares.php +++ b/sapi/src/builder/library/cares.php @@ -10,7 +10,7 @@ ->withManual('https://c-ares.org/') ->withLicense('https://c-ares.org/license.html', Library::LICENSE_MIT) ->withUrl('https://github.com/c-ares/c-ares/releases/download/cares-1_24_0/c-ares-1.24.0.tar.gz') - ->withFileHash('md5','25b872ee1c3bee8ff5f49b5f31307002') + ->withFileHash('md5', '25b872ee1c3bee8ff5f49b5f31307002') ->withPrefix(CARES_PREFIX) ->withConfigure('./configure --prefix=' . CARES_PREFIX . ' --enable-static --disable-shared --disable-tests') ->withPkgName('libcares') diff --git a/sapi/src/builder/library/curl.php b/sapi/src/builder/library/curl.php index 0ff664fece..2375e15e7f 100644 --- a/sapi/src/builder/library/curl.php +++ b/sapi/src/builder/library/curl.php @@ -15,7 +15,7 @@ ->withManual('https://curl.se/docs/install.html') ->withLicense('https://github.com/curl/curl/blob/master/COPYING', Library::LICENSE_SPEC) ->withUrl('https://curl.se/download/curl-8.4.0.tar.gz') - ->withFileHash('md5','533e8a3b1228d5945a6a512537bea4c7') + ->withFileHash('md5', '533e8a3b1228d5945a6a512537bea4c7') ->withPrefix($curl_prefix) ->withConfigure( <<withUrl('https://sourceforge.net/projects/freetype/files/freetype2/2.13.2/freetype-2.13.2.tar.gz') ->withMd5sum('d99447cf00c5f2679918f66f2b5771f6') - ->withFileHash('md5','d99447cf00c5f2679918f66f2b5771f6') + ->withFileHash('md5', 'd99447cf00c5f2679918f66f2b5771f6') ->withPrefix($freetype_prefix) ->withConfigure( <<withManual('https://gmplib.org/') ->withLicense('https://www.gnu.org/licenses/old-licenses/gpl-2.0.html', Library::LICENSE_GPL) ->withUrl('https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.lz') - ->withFileHash('md5','db3f4050677df3ff2bd23422c0d3caa1') + ->withFileHash('md5', 'db3f4050677df3ff2bd23422c0d3caa1') ->withPrefix($gmp_prefix) ->withConfigure( <<withUrl('https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz') - ->withFileHash('md5','b8a4b8cf77f2e2f6e1341eac0aab2fc4') + ->withFileHash('md5', 'b8a4b8cf77f2e2f6e1341eac0aab2fc4') ->withManual('https://unicode-org.github.io/icu/userguide/icu_data/#overview') ->withPrefix($icu_prefix) ->withConfigure( diff --git a/sapi/src/builder/library/imagemagick.php b/sapi/src/builder/library/imagemagick.php index 12850068af..d47c033a55 100644 --- a/sapi/src/builder/library/imagemagick.php +++ b/sapi/src/builder/library/imagemagick.php @@ -13,7 +13,7 @@ ->withLicense('https://imagemagick.org/script/license.php', Library::LICENSE_APACHE2) ->withUrl('https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-20.tar.gz') ->withFile('ImageMagick-v7.1.1-20.tar.gz') - ->withFileHash('md5','90eb1a9263b47b7e844eb817fe08932c') + ->withFileHash('md5', '90eb1a9263b47b7e844eb817fe08932c') ->withPrefix($imagemagick_prefix) ->withConfigure( <<withHomePage('https://thrysoee.dk/editline/') ->withLicense('http://www.netbsd.org/Goals/redistribution.html', Library::LICENSE_BSD) ->withUrl('https://thrysoee.dk/editline/libedit-20230828-3.1.tar.gz') - ->withFileHash('md5','16bb2ab0d33bce3467f5cd4ec7d8f3ee') + ->withFileHash('md5', '16bb2ab0d33bce3467f5cd4ec7d8f3ee') ->withPrefix($libedit_prefix) ->withConfigure( <<withLicense('https://giflib.sourceforge.net/intro.html', Library::LICENSE_SPEC) ->withUrl('https://sourceforge.net/projects/giflib/files/giflib-5.2.1.tar.gz') ->withMd5sum('6f03aee4ebe54ac2cc1ab3e4b0a049e5') - ->withFileHash('md5','6f03aee4ebe54ac2cc1ab3e4b0a049e5') + ->withFileHash('md5', '6f03aee4ebe54ac2cc1ab3e4b0a049e5') ->withPrefix($libgif_prefix) ->withMakeOptions('libgif.a') ->withMakeInstallCommand('') diff --git a/sapi/src/builder/library/libiconv.php b/sapi/src/builder/library/libiconv.php index 8cf48d487e..d59e417ae6 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') - ->withFileHash('md5','d718cd5a59438be666d1575855be72c3') + ->withFileHash('md5', 'd718cd5a59438be666d1575855be72c3') ->withPrefix($libiconv_prefix) ->withConfigure('./configure --prefix=' . $libiconv_prefix . ' enable_static=yes enable_shared=no') ->withBinPath($libiconv_prefix . '/bin/') diff --git a/sapi/src/builder/library/libjpeg.php b/sapi/src/builder/library/libjpeg.php index a008e0d2d1..5d5986bda6 100644 --- a/sapi/src/builder/library/libjpeg.php +++ b/sapi/src/builder/library/libjpeg.php @@ -11,7 +11,7 @@ ->withLicense('https://github.com/libjpeg-turbo/libjpeg-turbo/blob/main/LICENSE.md', Library::LICENSE_BSD) ->withUrl('https://codeload.github.com/libjpeg-turbo/libjpeg-turbo/tar.gz/refs/tags/2.1.2') ->withFile('libjpeg-turbo-2.1.2.tar.gz') - ->withFileHash('md5','f02d78311298468c5c1d278507ad42f2') + ->withFileHash('md5', 'f02d78311298468c5c1d278507ad42f2') ->withPrefix($libjpeg_prefix) ->withConfigure( <<addLibrary( @@ -13,7 +12,7 @@ ->withLicense('https://github.com/lz4/lz4/blob/dev/LICENSE', Library::LICENSE_BSD) ->withUrl('https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz') ->withFile('lz4-v1.9.4.tar.gz') - ->withFileHash('md5','e9286adb64040071c5e23498bf753261') + ->withFileHash('md5', 'e9286adb64040071c5e23498bf753261') ->withPkgName('liblz4') ->withPrefix($liblz4_prefix) ->withConfigure( diff --git a/sapi/src/builder/library/libpng.php b/sapi/src/builder/library/libpng.php index 65232956bb..64470b3881 100644 --- a/sapi/src/builder/library/libpng.php +++ b/sapi/src/builder/library/libpng.php @@ -29,7 +29,8 @@ EOF ) */ - ->withBuildScript(<<withBuildScript( + <<withLicense('https://en.wikipedia.org/wiki/ISC_license', Library::LICENSE_SPEC) ->withHomePage('https://doc.libsodium.org/') ->withUrl('https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz') - ->withFileHash('md5','3ca9ebc13b6b4735acae0a6a4c4f9a95') + ->withFileHash('md5', '3ca9ebc13b6b4735acae0a6a4c4f9a95') ->withPrefix(LIBSODIUM_PREFIX) ->withConfigure('./configure --prefix=' . LIBSODIUM_PREFIX . ' --enable-static --disable-shared') ->withPkgName('libsodium') diff --git a/sapi/src/builder/library/libssh2.php b/sapi/src/builder/library/libssh2.php index ec89dec5eb..817b210d70 100644 --- a/sapi/src/builder/library/libssh2.php +++ b/sapi/src/builder/library/libssh2.php @@ -14,7 +14,7 @@ ->withManual('https://github.com/libssh2/libssh2.git') ->withManual('https://github.com/libssh2/libssh2/blob/master/docs/INSTALL_CMAKE.md') ->withUrl('https://libssh2.org/download/libssh2-1.11.0.tar.gz') - ->withFileHash('md5','a01d543fd891ca48fe47726540d50b17') + ->withFileHash('md5', 'a01d543fd891ca48fe47726540d50b17') ->withPrefix($libssh2_prefix) ->withBuildScript( <<withLicense('https://github.com/webmproject/libwebp/blob/main/COPYING', Library::LICENSE_SPEC) ->withUrl('https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz') ->withFile('libwebp-v1.3.2.tar.gz') - ->withFileHash('md5','827d510b73c73fca3343140556dd2943') + ->withFileHash('md5', '827d510b73c73fca3343140556dd2943') ->withPrefix($libwebp_prefix) ->withConfigure( <<withManual('https://gitlab.gnome.org/GNOME/libxml2/-/wikis') ->withLicense('https://www.opensource.org/licenses/mit-license.html', Library::LICENSE_MIT) ->withUrl('https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.10/libxml2-v2.9.10.tar.gz') - ->withFileHash('md5','b18faee9173c3378c910f6d7d1493115') + ->withFileHash('md5', 'b18faee9173c3378c910f6d7d1493115') ->withPrefix($libxml2_prefix) ->withConfigure( <<withManual('https://gitlab.gnome.org/GNOME/libxslt/-/wikis/home') ->withLicense('http://www.opensource.org/licenses/mit-license.html', Library::LICENSE_MIT) ->withUrl('https://gitlab.gnome.org/GNOME/libxslt/-/archive/v1.1.34/libxslt-v1.1.34.tar.gz') - ->withFileHash('md5','0b89ee955fd13326d40e762242da7f84') + ->withFileHash('md5', '0b89ee955fd13326d40e762242da7f84') ->withPrefix($libxslt_prefix) ->withConfigure( <<withManual('https://pyyaml.org/wiki/LibYAML') ->withLicense('https://pyyaml.org/wiki/LibYAML', Library::LICENSE_MIT) ->withUrl('https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz') - ->withFileHash('md5','bb15429d8fb787e7d3f1c83ae129a999') + ->withFileHash('md5', 'bb15429d8fb787e7d3f1c83ae129a999') ->withPrefix(LIBYAML_PREFIX) ->withConfigure('./configure --prefix=' . LIBYAML_PREFIX . ' --enable-static --disable-shared') ->withPkgName('yaml-0.1') - ); }; diff --git a/sapi/src/builder/library/libzip.php b/sapi/src/builder/library/libzip.php index bf69b38a5d..61cb3b3dd6 100644 --- a/sapi/src/builder/library/libzip.php +++ b/sapi/src/builder/library/libzip.php @@ -15,7 +15,7 @@ ->withHomePage('https://libzip.org/') ->withLicense('https://libzip.org/license/', Library::LICENSE_BSD) ->withUrl('https://libzip.org/download/libzip-1.9.2.tar.gz') - ->withFileHash('md5','345a88add7e9dd58aa029ac5b5b361ad') + ->withFileHash('md5', '345a88add7e9dd58aa029ac5b5b361ad') ->withManual('https://libzip.org') ->withPrefix($libzip_prefix) ->withConfigure( diff --git a/sapi/src/builder/library/libzstd.php b/sapi/src/builder/library/libzstd.php index 0b74634b2a..3974e4ca0c 100644 --- a/sapi/src/builder/library/libzstd.php +++ b/sapi/src/builder/library/libzstd.php @@ -14,7 +14,7 @@ ->withLicense('https://github.com/facebook/zstd/blob/dev/COPYING', Library::LICENSE_GPL) ->withUrl('https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz') ->withFile('zstd-1.5.2.tar.gz') - ->withFileHash('md5','072b10f71f5820c24761a65f31f43e73') + ->withFileHash('md5', '072b10f71f5820c24761a65f31f43e73') ->withPrefix($libzstd_prefix) ->withConfigure( <<withUrl('https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz') ->withMirrorUrl('https://mirrors.tuna.tsinghua.edu.cn/gnu/ncurses/ncurses-6.3.tar.gz') ->withMirrorUrl('https://mirrors.ustc.edu.cn/gnu/ncurses/ncurses-6.3.tar.gz') - ->withFileHash('md5','a2736befde5fee7d2b7eb45eb281cdbe') + ->withFileHash('md5', 'a2736befde5fee7d2b7eb45eb281cdbe') ->withPrefix($ncurses_prefix) ->withConfigure( <<withManual('https://nghttp2.org/') ->withLicense('https://github.com/nghttp2/nghttp2/blob/master/COPYING', Library::LICENSE_MIT) ->withUrl('https://github.com/nghttp2/nghttp2/releases/download/v1.57.0/nghttp2-1.57.0.tar.gz') - ->withFileHash('md5','d4c92d9a85e551bb084964d2be05929c') + ->withFileHash('md5', 'd4c92d9a85e551bb084964d2be05929c') ->withPrefix($nghttp2_prefix) ->withConfigure( <<withManual('https://nghttp2.org/nghttp3/') ->withUrl('https://github.com/ngtcp2/nghttp3/archive/refs/tags/v1.0.0.tar.gz') ->withFile('nghttp3-v1.0.0.tar.gz') - ->withFileHash('md5','0446cce05f003bace3ac51277181ae51') + ->withFileHash('md5', '0446cce05f003bace3ac51277181ae51') ->withPrefix($nghttp3_prefix) ->withConfigure( <<withManual('https://curl.se/docs/http3.html') ->withUrl('https://github.com/ngtcp2/ngtcp2/releases/download/v1.1.0/ngtcp2-1.1.0.tar.gz') ->withFile('ngtcp2-1.1.0.tar.gz') - ->withFileHash('md5','e05c501244a2af34b492753763c74e04') + ->withFileHash('md5', 'e05c501244a2af34b492753763c74e04') ->withPrefix($ngtcp2_prefix) ->withConfigure( <<withHomePage('https://github.com/kkos/oniguruma.git') ->withUrl('https://github.com/kkos/oniguruma/archive/refs/tags/v6.9.9.tar.gz') ->withFile('oniguruma-v6.9.9.tar.gz') - ->withFileHash('md5','6a3defb3d5e57c2fa4b6f3b4ec6de28b') + ->withFileHash('md5', '6a3defb3d5e57c2fa4b6f3b4ec6de28b') ->withPrefix($oniguruma_prefix) ->withConfigure( './autogen.sh && ./configure --prefix=' . $oniguruma_prefix . ' --enable-static --disable-shared' diff --git a/sapi/src/builder/library/openssl.php b/sapi/src/builder/library/openssl.php index 2c68e394ec..1c71e9449d 100644 --- a/sapi/src/builder/library/openssl.php +++ b/sapi/src/builder/library/openssl.php @@ -13,7 +13,7 @@ ->withLicense('https://github.com/openssl/openssl/blob/master/LICENSE.txt', Library::LICENSE_APACHE2) ->withManual('https://www.openssl.org/docs/') ->withUrl('https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.4-quic1.tar.gz') - ->withFileHash('md5','ba2d8774a51a38f2481aad43d05aea57') + ->withFileHash('md5', 'ba2d8774a51a38f2481aad43d05aea57') ->withPrefix($openssl_prefix) ->withConfigure( <<withUrl('https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz') ->withMirrorUrl('https://mirrors.tuna.tsinghua.edu.cn/gnu/readline/readline-8.2.tar.gz') ->withMirrorUrl('https://mirrors.ustc.edu.cn/gnu/readline/readline-8.2.tar.gz') - ->withFileHash('md5','4aa1b31be779e6b84f9a96cb66bc50f6') + ->withFileHash('md5', '4aa1b31be779e6b84f9a96cb66bc50f6') ->withPrefix(READLINE_PREFIX) ->withConfigure( <<withLicense('https://www.sqlite.org/copyright.html', Library::LICENSE_SPEC) ->withManual('https://www.sqlite.org/docs.html') ->withUrl('https://www.sqlite.org/2023/sqlite-autoconf-3430200.tar.gz') - ->withFileHash('sha256','6d422b6f62c4de2ca80d61860e3a3fb693554d2f75bb1aaca743ccc4d6f609f0') + ->withFileHash('sha256', '6d422b6f62c4de2ca80d61860e3a3fb693554d2f75bb1aaca743ccc4d6f609f0') ->withPrefix($sqlite3_prefix) ->withConfigure( <<withHomePage('https://github.com/lurcher/unixODBC') ->withLicense('https://github.com/lurcher/unixODBC/blob/master/LICENSE', Library::LICENSE_LGPL) ->withUrl('https://github.com/lurcher/unixODBC/releases/download/2.3.11/unixODBC-2.3.11.tar.gz') - ->withFileHash('md5','0ff1fdbcb4c3c7dc2357f3fd6ba09169') + ->withFileHash('md5', '0ff1fdbcb4c3c7dc2357f3fd6ba09169') ->withPrefix($unix_odbc_prefix) ->withconfigure( <<withLicense('https://zlib.net/zlib_license.html', Library::LICENSE_SPEC) ->withUrl('https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz') ->withFile('zlib-v1.3.1.tar.gz') - ->withFileHash('md5','ddb17dbbf2178807384e57ba0d81e6a1') + ->withFileHash('md5', 'ddb17dbbf2178807384e57ba0d81e6a1') ->withPrefix(ZLIB_PREFIX) ->withConfigure('./configure --prefix=' . ZLIB_PREFIX . ' --static') ->withPkgName('zlib') From 76acdadc05a3974b77792fe585aebbd49ba5e9ed Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 17:42:13 +0800 Subject: [PATCH 026/226] test coturn --- sapi/src/builder/extension/common.php | 1 + sapi/src/builder/library/coturn.php | 4 ++-- sapi/src/builder/library/prometheus_client_c.php | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sapi/src/builder/extension/common.php b/sapi/src/builder/extension/common.php index 07141c2e99..996375243d 100644 --- a/sapi/src/builder/extension/common.php +++ b/sapi/src/builder/extension/common.php @@ -193,6 +193,7 @@ $depends = ['dav1d'] ; $depends = ['sdl2'] ; $depends = ['v4l_utils'] ; + $depends = ['prometheus_client_c'] ; $ext = (new Extension('common')) diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index d410d81983..b24292e8c0 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -181,8 +181,8 @@ 'hiredis', //'libsctp', 'libmongoc', - // 'prometheus_client_c' - //'libsctp' + // 'prometheus_client_c' + //'libsctp' ) ); }; diff --git a/sapi/src/builder/library/prometheus_client_c.php b/sapi/src/builder/library/prometheus_client_c.php index 74565bcc2b..108caf3e1d 100644 --- a/sapi/src/builder/library/prometheus_client_c.php +++ b/sapi/src/builder/library/prometheus_client_c.php @@ -13,7 +13,12 @@ ->withUrl('https://github.com/digitalocean/prometheus-client-c/archive/refs/tags/v0.1.3.tar.gz') ->withFile('prometheus-client-c-v0.1.3.tar.gz') ->withPrefix($prometheus_client_c_prefix) + ->withMakeOptions('build') ->withBinPath($prometheus_client_c_prefix . '/bin/') - ->withDependentLibraries('openssl', 'readline') + ->withDependentLibraries( + 'openssl', + 'readline', + 'libmicrohttpd' + ) ); }; From 5375bb2832986a94931350630ad6aaab26889453 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 21:40:15 +0800 Subject: [PATCH 027/226] update --- sapi/src/builder/extension/common.php | 1 + sapi/src/builder/library/cjose.php | 63 ++++++++++ sapi/src/builder/library/hiredis.php | 2 +- sapi/src/builder/library/jansson.php | 2 - sapi/src/builder/library/libmicrohttpd.php | 9 +- sapi/src/builder/library/liboauth2.php | 109 ++++++++++++++++++ .../builder/library/prometheus_client_c.php | 30 ++++- sapi/src/constants.php | 2 + sapi/src/library_builder/VRRP.md | 1 + sapi/src/library_builder/debug-php.md | 1 + 10 files changed, 210 insertions(+), 10 deletions(-) create mode 100644 sapi/src/builder/library/cjose.php create mode 100644 sapi/src/builder/library/liboauth2.php create mode 100644 sapi/src/library_builder/VRRP.md diff --git a/sapi/src/builder/extension/common.php b/sapi/src/builder/extension/common.php index 996375243d..b26f853499 100644 --- a/sapi/src/builder/extension/common.php +++ b/sapi/src/builder/extension/common.php @@ -194,6 +194,7 @@ $depends = ['sdl2'] ; $depends = ['v4l_utils'] ; $depends = ['prometheus_client_c'] ; + $depends = ['liboauth2'] ; $ext = (new Extension('common')) diff --git a/sapi/src/builder/library/cjose.php b/sapi/src/builder/library/cjose.php new file mode 100644 index 0000000000..4ed9b11334 --- /dev/null +++ b/sapi/src/builder/library/cjose.php @@ -0,0 +1,63 @@ +withHomePage('https://github.com/OpenIDC/cjose.git') + ->withLicense('cjose ', Library::LICENSE_MIT) + ->withManual('https://github.com/OpenIDC/cjose.git') + ->withUrl('https://github.com/OpenIDC/cjose/archive/refs/tags/v0.6.2.3.tar.gz') + ->withFile('cjose-v0.6.2.3.tar.gz') + + + ->withPrefix($cjose_prefix) + ->withBuildCached(false) + + ->withConfigure( + <<withPkgName('libexample') + ->withBinPath($cjose_prefix . '/bin/') + //依赖其它静态链接库 + ->withDependentLibraries( + 'openssl', + 'jansson' + ) + ; + + $p->addLibrary($lib); + + /* + //导入需要的变量 + + $p->withExportVariable('LIBPQ_CFLAGS', '$(pkg-config --cflags --static libpq)'); + $p->withExportVariable('LIBPQ_LIBS', '$(pkg-config --libs --static libpq)'); + + */ +}; + diff --git a/sapi/src/builder/library/hiredis.php b/sapi/src/builder/library/hiredis.php index 3913c3bbed..3eee8aedd9 100644 --- a/sapi/src/builder/library/hiredis.php +++ b/sapi/src/builder/library/hiredis.php @@ -39,6 +39,6 @@ EOF ) ->withPkgName('hiredis') - ///->withDependentLibraries('openssl') + ->withDependentLibraries('openssl') ); }; diff --git a/sapi/src/builder/library/jansson.php b/sapi/src/builder/library/jansson.php index 5491039f69..775212b8a1 100644 --- a/sapi/src/builder/library/jansson.php +++ b/sapi/src/builder/library/jansson.php @@ -13,8 +13,6 @@ ->withManual('https://github.com/akheron/jansson.git') ->withLicense('https://github.com/akheron/jansson/blob/master/LICENSE', Library::LICENSE_MIT) ->withPrefix($jansson_prefix) - ->withCleanBuildDirectory() - ->withCleanPreInstallDirectory($jansson_prefix) ->withConfigure( <<isMacos()) { + throw new \Exception('libmicrohttpd only linux !'); + } $lib = new Library('libmicrohttpd'); $lib->withHomePage('https://www.gnu.org/software/libmicrohttpd/') ->withLicense('http://www.gnu.org/licenses/lgpl-2.1.html', Library::LICENSE_LGPL) @@ -27,14 +30,10 @@ --with-libiconv-prefix={$libiconv_prefix} \ --with-libcurl={$curl_prefix} - - EOF ) ->withPkgName('libmicrohttpd') - ->withDependentLibraries('curl', 'libiconv') - - ; + ->withDependentLibraries('curl', 'libiconv'); $p->addLibrary($lib); }; diff --git a/sapi/src/builder/library/liboauth2.php b/sapi/src/builder/library/liboauth2.php new file mode 100644 index 0000000000..7b1a880305 --- /dev/null +++ b/sapi/src/builder/library/liboauth2.php @@ -0,0 +1,109 @@ +withHomePage('https://github.com/OpenIDC/liboauth2.git') + ->withLicense('http://www.gnu.org/licenses/lgpl-2.1.html', Library::LICENSE_LGPL) + ->withManual('https://github.com/OpenIDC/liboauth2.git') + ->withUrl('https://github.com/OpenIDC/liboauth2/archive/refs/tags/v1.6.3.tar.gz') + ->withFile('liboauth2-v1.6.3.tar.gz') + ->withPrefix($example_prefix) + + + ->withBuildCached(false) + ->withInstallCached(false) + /* 使用 autoconfig automake 构建 start */ + ->withConfigure( + <<withScriptAfterInstall( + <<withPkgName('libexample') + ->withBinPath($example_prefix . '/bin/') + //依赖其它静态链接库 + ->withDependentLibraries( + 'zlib', + 'openssl', + 'curl', + 'pcre2', + 'hiredis', + 'jansson', + 'cjose' + + )/* + + //默认不需要此配置,特殊目录才需要配置 + ->withLdflags('-L' . $example_prefix . '/lib64') + + //默认不需要此配置,特殊目录才需要配置 + ->withPkgConfig($example_prefix . '/lib/ib64/pkgconfig') + + */ + ; + + $p->addLibrary($lib); + + + /* + + //只有当没有 pkgconfig 配置文件才需要编写这里配置; 例子: src/builder/library/bzip2.php + + $p->withVariable('CPPFLAGS', '$CPPFLAGS -I' . $example_prefix . '/include'); + $p->withVariable('LDFLAGS', '$LDFLAGS -L' . $example_prefix . '/lib'); + $p->withVariable('LIBS', '$LIBS -lexample '); + + */ + + /* + //导入需要的变量 + + $p->withExportVariable('LIBPQ_CFLAGS', '$(pkg-config --cflags --static libpq)'); + $p->withExportVariable('LIBPQ_LIBS', '$(pkg-config --libs --static libpq)'); + + */ +}; + diff --git a/sapi/src/builder/library/prometheus_client_c.php b/sapi/src/builder/library/prometheus_client_c.php index 108caf3e1d..e52ed22477 100644 --- a/sapi/src/builder/library/prometheus_client_c.php +++ b/sapi/src/builder/library/prometheus_client_c.php @@ -13,12 +13,38 @@ ->withUrl('https://github.com/digitalocean/prometheus-client-c/archive/refs/tags/v0.1.3.tar.gz') ->withFile('prometheus-client-c-v0.1.3.tar.gz') ->withPrefix($prometheus_client_c_prefix) - ->withMakeOptions('build') + ->withBuildScript( + << CMakeLists.txt <withBinPath($prometheus_client_c_prefix . '/bin/') ->withDependentLibraries( 'openssl', 'readline', - 'libmicrohttpd' + //'libmicrohttpd' ) ); }; diff --git a/sapi/src/constants.php b/sapi/src/constants.php index 22d81bafcd..07c5a155a8 100644 --- a/sapi/src/constants.php +++ b/sapi/src/constants.php @@ -337,5 +337,7 @@ define("PULSE_AUDIO_PREFIX", $p->getGlobalPrefix() . '/pulse_audio'); define("V4L_UTILS_PREFIX", $p->getGlobalPrefix() . '/v4l_utils'); +define("LIBOAUTH2_PREFIX", $p->getGlobalPrefix() . '/liboauth2'); +define("CJOSE_PREFIX", $p->getGlobalPrefix() . '/cjose'); define("EXAMPLE_PREFIX", $p->getGlobalPrefix() . '/example'); diff --git a/sapi/src/library_builder/VRRP.md b/sapi/src/library_builder/VRRP.md new file mode 100644 index 0000000000..9a39dc6329 --- /dev/null +++ b/sapi/src/library_builder/VRRP.md @@ -0,0 +1 @@ +虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP) diff --git a/sapi/src/library_builder/debug-php.md b/sapi/src/library_builder/debug-php.md index 36cd1dc07b..9d263a6d87 100644 --- a/sapi/src/library_builder/debug-php.md +++ b/sapi/src/library_builder/debug-php.md @@ -2,6 +2,7 @@ ## 调试 PHP ```bash +algrind --leak-check=full --error-exitcode=1 --show-possibly-lost=no --read-inline-info=yes --keep-debuginfo=yes --undef-value-errors=no php your_file.php USE_ZEND_ALLOC=0 valgrind --log-file=/tmp/valgrind.log php your_file.php From 1323014e4cc8db187790cad10dc3500d1a999de0 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 9 Jul 2024 22:17:00 +0800 Subject: [PATCH 028/226] update --- sapi/src/builder/extension/coturn.php | 8 +++----- sapi/src/builder/library/coturn.php | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sapi/src/builder/extension/coturn.php b/sapi/src/builder/extension/coturn.php index e729d710fc..ffb8ebd902 100644 --- a/sapi/src/builder/extension/coturn.php +++ b/sapi/src/builder/extension/coturn.php @@ -20,12 +20,10 @@ $coturn_prefix = COTURN_PREFIX; $system_arch = $p->getSystemArch(); $cmd = <<getOsType() == 'macos') { diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index b24292e8c0..58b0c6dd97 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -182,7 +182,8 @@ //'libsctp', 'libmongoc', // 'prometheus_client_c' - //'libsctp' + //'libsctp', + //'liboauth2' ) ); }; From 12ec67c0f18a9e802cdd8f00b77128121463f61f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 13:34:09 +0800 Subject: [PATCH 029/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E5=8E=9F=E5=AD=90=E5=AE=B9=E5=99=A8=E9=95=9C=E5=83=8F=20AtomHu?= =?UTF-8?q?b?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/docker/Dockerfile | 5 +- sapi/docker/Dockerfile-arm64 | 28 ------- sapi/docker/build-export-container.sh | 75 ++++++++++++------- .../linux/run-alpine-container-full.sh | 2 +- sapi/quickstart/linux/run-alpine-container.sh | 16 ++++ sapi/quickstart/linux/run-debian-container.sh | 18 ++++- sapi/src/template/make.php | 4 +- 7 files changed, 90 insertions(+), 58 deletions(-) delete mode 100644 sapi/docker/Dockerfile-arm64 diff --git a/sapi/docker/Dockerfile b/sapi/docker/Dockerfile index 5b4d43fb72..902198e189 100644 --- a/sapi/docker/Dockerfile +++ b/sapi/docker/Dockerfile @@ -1,4 +1,7 @@ -FROM alpine:3.18 +ARG BASE_IMAGE='alpine:3.18' +FROM ${BASH_IMAGE} +# FROM alpine:3.18 + ARG MIRROR="" diff --git a/sapi/docker/Dockerfile-arm64 b/sapi/docker/Dockerfile-arm64 deleted file mode 100644 index 1beaf16be6..0000000000 --- a/sapi/docker/Dockerfile-arm64 +++ /dev/null @@ -1,28 +0,0 @@ -FROM arm64v8/alpine:3.18 - -ARG MIRROR="" - -# setup source repo, install dependencies -RUN test -f /etc/apk/repositories.save || cp /etc/apk/repositories /etc/apk/repositories.save -RUN if [ "${MIRROR}" = "ustc" -o "${MIRROR}" = "china" ]; then { sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories ; } fi -RUN if [ "${MIRROR}" = "tuna" ]; then { sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories ; } fi - -RUN apk update -RUN apk upgrade -RUN apk add vim -RUN apk add alpine-sdk -RUN apk add xz -RUN apk add autoconf -RUN apk add automake -RUN apk add linux-headers -RUN apk add clang -RUN apk add clang-dev -RUN apk add lld -RUN apk add libtool -RUN apk add cmake -RUN apk add bison -RUN apk add re2c -RUN apk add bash -RUN apk add tini -RUN apk add libc++-static libltdl-static -WORKDIR /work diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index ea5aafde7f..1e2f745e7f 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -1,5 +1,9 @@ #!/bin/bash +:<<'COMMENT' + 从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器 +COMMENT + set -exu __DIR__=$( cd "$(dirname "$0")" @@ -12,6 +16,42 @@ __PROJECT__=$( cd ${__DIR__} cd ${__PROJECT__} + +CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18' +MIRROR='' +PLATFORM='' +ARCH=$(uname -m) +case $ARCH in +'x86_64') + PLATFORM='linux/amd64' + ;; +'aarch64') + PLATFORM='linux/arm64' + ;; +esac + +while [ $# -gt 0 ]; do + case "$1" in + --platform) + PLATFORM="$2" + ;; + --mirror) + MIRROR="$2" + ;; + --*) + echo "Illegal option $1" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +case "$MIRROR" in + china | openatom) + CONTAINER_BASE_IMAGE="hub.atomgit.com/library/alpine:3.18" + ;; +esac + + mkdir -p var/build-export-container/ cd ${__PROJECT__}/var/build-export-container/ @@ -22,13 +62,19 @@ docker cp $container_id:/usr/local/swoole-cli/ . cat > Dockerfile <<'EOF' -FROM alpine:3.18 +ARG BASE_IMAGE='alpine:3.18' +FROM ${BASH_IMAGE} + +# FROM alpine:3.18 + +ARG MIRROR="" RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ENV TZ=Etc/UTC RUN test -f /etc/apk/repositories.save || cp /etc/apk/repositories /etc/apk/repositories.save -RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories +RUN if [ "${MIRROR}" = "ustc" -o "${MIRROR}" = "china" ]; then { sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories ; } fi +RUN if [ "${MIRROR}" = "tuna" ]; then { sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories ; } fi RUN apk add ca-certificates tini ADD ./swoole-cli /usr/local/swoole-cli @@ -44,29 +90,6 @@ EOF -PLATFORM='' -ARCH=$(uname -m) -case $ARCH in -'x86_64') - PLATFORM='linux/amd64' - ;; -'aarch64') - PLATFORM='linux/arm64' - ;; -esac - -while [ $# -gt 0 ]; do - case "$1" in - --platform) - PLATFORM="$2" - ;; - --*) - echo "Illegal option $1" - ;; - esac - shift $(($# > 0 ? 1 : 0)) -done - ARCH=$(uname -m) TIME=$(date -u '+%Y%m%dT%H%M%SZ') VERSION="1.6" @@ -74,7 +97,7 @@ TAG="v${VERSION}-${ARCH}-${TIME}" IMAGE="docker.io/phpswoole/swoole-cli-builder:${TAG}" -docker build -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} +docker build -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" echo ${IMAGE} echo ${IMAGE} > container-image.txt diff --git a/sapi/quickstart/linux/run-alpine-container-full.sh b/sapi/quickstart/linux/run-alpine-container-full.sh index 6d7b41eee0..ff2a42a03c 100644 --- a/sapi/quickstart/linux/run-alpine-container-full.sh +++ b/sapi/quickstart/linux/run-alpine-container-full.sh @@ -40,7 +40,7 @@ while [ $# -gt 0 ]; do --mirror) MIRROR="$2" ;; - --dev-shm) + --dev-shm) #使用 /dev/shm 加快构建速度 DEV_SHM=1 ;; esac diff --git a/sapi/quickstart/linux/run-alpine-container.sh b/sapi/quickstart/linux/run-alpine-container.sh index 96c36630ee..bcd371082f 100644 --- a/sapi/quickstart/linux/run-alpine-container.sh +++ b/sapi/quickstart/linux/run-alpine-container.sh @@ -18,7 +18,23 @@ cd ${__DIR__} echo $? } cd ${__DIR__} + IMAGE=alpine:3.18 +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + case "$MIRROR" in + china | openatom) + IMAGE="hub.atomgit.com/library/alpine:3.18" + ;; + esac + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + cd ${__DIR__} docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work $IMAGE tail -f /dev/null diff --git a/sapi/quickstart/linux/run-debian-container.sh b/sapi/quickstart/linux/run-debian-container.sh index 8d6d206c9d..13f09fd579 100644 --- a/sapi/quickstart/linux/run-debian-container.sh +++ b/sapi/quickstart/linux/run-debian-container.sh @@ -18,8 +18,24 @@ cd ${__DIR__} echo $? } cd ${__DIR__} -IMAGE=debian:11 + IMAGE=debian:12 +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + case "$MIRROR" in + china | openatom) + IMAGE="hub.atomgit.com/library/debian:12" + ;; + esac + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + + cd ${__DIR__} docker run --rm --name swoole-cli-debian-dev -d -v ${__PROJECT__}:/work -w /work $IMAGE tail -f /dev/null diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index a53d54200c..8b10de635e 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -314,11 +314,13 @@ if [ "$1" = "docker-build" ] ;then MIRROR="" + CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18' if [ -n "$2" ]; then MIRROR=$2 + CONTAINER_BASE_IMAGE="hub.atomgit.com/library/alpine:3.18" fi cd ${__PROJECT_DIR__}/sapi/docker - docker build -t :getBaseImageTag() ?> -f getBaseImageDockerFile() ?> . --build-arg="MIRROR=${MIRROR}" + docker build -t :getBaseImageTag() ?> -f Dockerfile . --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" exit 0 elif [ "$1" = "docker-bash" ] ;then container=$(docker ps -a -f name= | tail -n +2 2> /dev/null) From 2d274a1128d7c7a83dc7828e6730d941b1289f0a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 13:41:52 +0800 Subject: [PATCH 030/226] update run-alpine-container-full.sh --- sapi/quickstart/linux/run-alpine-container-full.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/run-alpine-container-full.sh b/sapi/quickstart/linux/run-alpine-container-full.sh index ff2a42a03c..a13fac2b1d 100644 --- a/sapi/quickstart/linux/run-alpine-container-full.sh +++ b/sapi/quickstart/linux/run-alpine-container-full.sh @@ -40,7 +40,7 @@ while [ $# -gt 0 ]; do --mirror) MIRROR="$2" ;; - --dev-shm) #使用 /dev/shm 加快构建速度 + --dev-shm) #使用 /dev/shm 目录加快构建速度 DEV_SHM=1 ;; esac From 822ba868180b28a41cbadcd3cb51de20672d631d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 13:46:53 +0800 Subject: [PATCH 031/226] fix dockerfile BUG --- sapi/docker/Dockerfile | 2 +- sapi/docker/build-export-container.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sapi/docker/Dockerfile b/sapi/docker/Dockerfile index 902198e189..2a14505886 100644 --- a/sapi/docker/Dockerfile +++ b/sapi/docker/Dockerfile @@ -1,5 +1,5 @@ ARG BASE_IMAGE='alpine:3.18' -FROM ${BASH_IMAGE} +FROM ${BASE_IMAGE} # FROM alpine:3.18 diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index 1e2f745e7f..a0c958b4cd 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -63,8 +63,7 @@ docker cp $container_id:/usr/local/swoole-cli/ . cat > Dockerfile <<'EOF' ARG BASE_IMAGE='alpine:3.18' -FROM ${BASH_IMAGE} - +FROM ${BASE_IMAGE} # FROM alpine:3.18 ARG MIRROR="" From 86fc38b2d284ffea30865d51f633aafae5edd029 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 13:52:22 +0800 Subject: [PATCH 032/226] fix dockerfile BUG --- sapi/docker/Dockerfile | 2 +- sapi/docker/build-export-container.sh | 2 +- sapi/src/template/make.php | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sapi/docker/Dockerfile b/sapi/docker/Dockerfile index 2a14505886..bb15e4ec29 100644 --- a/sapi/docker/Dockerfile +++ b/sapi/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE='alpine:3.18' +ARG BASE_IMAGE="alpine:3.18" FROM ${BASE_IMAGE} # FROM alpine:3.18 diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index a0c958b4cd..9bd1115749 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -62,7 +62,7 @@ docker cp $container_id:/usr/local/swoole-cli/ . cat > Dockerfile <<'EOF' -ARG BASE_IMAGE='alpine:3.18' +ARG BASE_IMAGE="alpine:3.18" FROM ${BASE_IMAGE} # FROM alpine:3.18 diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index 8b10de635e..8d0cd630a2 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -317,7 +317,11 @@ CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18' if [ -n "$2" ]; then MIRROR=$2 - CONTAINER_BASE_IMAGE="hub.atomgit.com/library/alpine:3.18" + case "$MIRROR" in + china | openatom | ustc | tuna) + CONTAINER_BASE_IMAGE="hub.atomgit.com/library/alpine:3.18" + ;; + esac fi cd ${__PROJECT_DIR__}/sapi/docker docker build -t :getBaseImageTag() ?> -f Dockerfile . --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" From 6f34c5ebf844995f7934e1d18fc54864851f9db5 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 14:02:58 +0800 Subject: [PATCH 033/226] update make.php --- sapi/src/template/make.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index 8d0cd630a2..cfbdc8e924 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -287,7 +287,7 @@ } help() { - echo "./make.sh docker-build [china|ustc|tuna]" + echo "./make.sh docker-build [ china | ustc |tuna ]" echo "./make.sh docker-bash" echo "./make.sh docker-commit" echo "./make.sh docker-push" @@ -324,7 +324,9 @@ esac fi cd ${__PROJECT_DIR__}/sapi/docker - docker build -t :getBaseImageTag() ?> -f Dockerfile . --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" + echo "MIRROR=${MIRROR}" + echo "BASE_IMAGE=${CONTAINER_BASE_IMAGE}" + docker build --no-cache -t :getBaseImageTag() ?> -f Dockerfile . --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" exit 0 elif [ "$1" = "docker-bash" ] ;then container=$(docker ps -a -f name= | tail -n +2 2> /dev/null) @@ -445,7 +447,7 @@ echo $LIBS elif [ "$1" = "sync" ] ;then PHP_CLI=$(which php) - test -f ${__PROJECT_DIR__}/bin/runtime/php && PHP_CLI="${__PROJECT_DIR__}/bin/runtime/php -d curl.cainfo=${__PROJECT_DIR__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT_DIR__}/bin/runtime/cacert.pem" + test -f ${__PROJECT_DIR__}/bin/runtime/php && PHP_CLI="${__PROJECT_DIR__}/bin/runtime/php -c ${__PROJECT_DIR__}/bin/runtime/php.ini -d curl.cainfo=${__PROJECT_DIR__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT_DIR__}/bin/runtime/cacert.pem" $PHP_CLI -v $PHP_CLI sync-source-code.php --action run exit 0 From 5610fa073e68b5ab23f8130dafd9fdbfb4f6cf0c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 14:04:33 +0800 Subject: [PATCH 034/226] update make.php --- sapi/src/template/make.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index cfbdc8e924..b8bccf4a6f 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -287,7 +287,7 @@ } help() { - echo "./make.sh docker-build [ china | ustc |tuna ]" + echo "./make.sh docker-build [ china | ustc | tuna ]" echo "./make.sh docker-bash" echo "./make.sh docker-commit" echo "./make.sh docker-push" From fae3e9b48e607e54cc2be9984f018514357dc665 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 14:10:55 +0800 Subject: [PATCH 035/226] update --- sapi/docker/build-export-container.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index 9bd1115749..6229e2f427 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -1,7 +1,8 @@ #!/bin/bash :<<'COMMENT' - 从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器 + 从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 和 导出镜像到磁盘 + COMMENT set -exu @@ -96,6 +97,8 @@ TAG="v${VERSION}-${ARCH}-${TIME}" IMAGE="docker.io/phpswoole/swoole-cli-builder:${TAG}" +echo "MIRROR=${MIRROR}" +echo "BASE_IMAGE=${CONTAINER_BASE_IMAGE}" docker build -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" echo ${IMAGE} From 0338526647e46cc85220a9a709af09c2e82e8c8d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 14:42:32 +0800 Subject: [PATCH 036/226] update cygwin-config.sh --- sapi/scripts/cygwin/cygwin-config.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sapi/scripts/cygwin/cygwin-config.sh b/sapi/scripts/cygwin/cygwin-config.sh index ee34e3db76..f92f4a6e80 100755 --- a/sapi/scripts/cygwin/cygwin-config.sh +++ b/sapi/scripts/cygwin/cygwin-config.sh @@ -14,6 +14,7 @@ cd ${__PROJECT__} ./buildconf --force test -f Makefile && make clean ./configure --prefix=/usr --disable-all \ + --enable-opcache \ --disable-fiber-asm \ --without-pcre-jit \ --with-openssl --enable-openssl \ @@ -49,8 +50,6 @@ test -f Makefile && make clean --enable-swoole --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ - --enable-swoole-thread \ - --enable-zts \ --enable-redis \ --with-imagick \ --with-yaml \ @@ -60,5 +59,7 @@ test -f Makefile && make clean # --with-pdo-pgsql \ # --with-pgsql # --with-pdo-sqlite \ -# --enable-opcache \ +# swoole v6 参数 +# --enable-swoole-thread \ +# --enable-zts \ From ea686677864d6ed1823120f685e9bbd8ec1e104f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 14:47:07 +0800 Subject: [PATCH 037/226] fix error --- sapi/scripts/cygwin/cygwin-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/scripts/cygwin/cygwin-config.sh b/sapi/scripts/cygwin/cygwin-config.sh index c88883348e..b96135ec02 100755 --- a/sapi/scripts/cygwin/cygwin-config.sh +++ b/sapi/scripts/cygwin/cygwin-config.sh @@ -74,4 +74,4 @@ test -f Makefile && make clean # swoole v6 参数 # --enable-swoole-thread \ # --enable-zts \ ->>>>>>> experiment-feature + From dabfd94ff55ef6d2d8843b32bc6f1986e69ffd5d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 17:30:12 +0800 Subject: [PATCH 038/226] fix cygwin build error --- sapi/scripts/cygwin/cygwin-config.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/sapi/scripts/cygwin/cygwin-config.sh b/sapi/scripts/cygwin/cygwin-config.sh index b96135ec02..99cc69270f 100755 --- a/sapi/scripts/cygwin/cygwin-config.sh +++ b/sapi/scripts/cygwin/cygwin-config.sh @@ -40,7 +40,6 @@ test -f Makefile && make clean --enable-mbstring \ --enable-ctype \ --with-zlib \ - --with-zip \ --enable-posix \ --enable-sockets \ --enable-pdo \ From 08fb3bfaf53961ec6534af13b9ab33422ab31971 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 17:57:37 +0800 Subject: [PATCH 039/226] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=20docker-bash=20?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E5=AE=B9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linux/connection-swoole-cli-builder.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sapi/quickstart/linux/connection-swoole-cli-builder.sh diff --git a/sapi/quickstart/linux/connection-swoole-cli-builder.sh b/sapi/quickstart/linux/connection-swoole-cli-builder.sh new file mode 100644 index 0000000000..8fd8ffcd10 --- /dev/null +++ b/sapi/quickstart/linux/connection-swoole-cli-builder.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) + +cd ${__DIR__} + +docker exec -it swoole-cli-builder sh + From a9b98099ff7337c3abde786daf5f1895eda58501 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 20:03:51 +0800 Subject: [PATCH 040/226] update --- sapi/docker/Dockerfile-arm64 | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 sapi/docker/Dockerfile-arm64 diff --git a/sapi/docker/Dockerfile-arm64 b/sapi/docker/Dockerfile-arm64 deleted file mode 100644 index eb94815acf..0000000000 --- a/sapi/docker/Dockerfile-arm64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM arm64v8/alpine:3.18 - -ARG MIRROR="" - -# setup source repo, install dependencies -RUN test -f /etc/apk/repositories.save || cp /etc/apk/repositories /etc/apk/repositories.save -RUN if [ "${MIRROR}" = "ustc" -o "${MIRROR}" = "china" ]; then { sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories ; } fi -RUN if [ "${MIRROR}" = "tuna" ]; then { sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories ; } fi - - -RUN apk update -RUN apk upgrade -RUN apk add vim -RUN apk add alpine-sdk -RUN apk add xz -RUN apk add autoconf -RUN apk add automake -RUN apk add linux-headers -RUN apk add clang -RUN apk add clang-dev -RUN apk add lld -RUN apk add libtool -RUN apk add cmake -RUN apk add bison -RUN apk add re2c -RUN apk add bash -RUN apk add tini -RUN apk add libc++-static libltdl-static -RUN apk add gettext-dev -RUN apk add pigz parallel -WORKDIR /work - From 102bfe1d50f67b10df4241faf28b97c7b861b1b1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 20:38:18 +0800 Subject: [PATCH 041/226] update install-docker.sh --- sapi/quickstart/linux/install-docker.sh | 35 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/sapi/quickstart/linux/install-docker.sh b/sapi/quickstart/linux/install-docker.sh index 46c4b77ce7..c8b0f7f8fc 100644 --- a/sapi/quickstart/linux/install-docker.sh +++ b/sapi/quickstart/linux/install-docker.sh @@ -15,18 +15,6 @@ mkdir -p ${__PROJECT__}/var cd ${__PROJECT__}/var -# https://github.com/docker/docker-install.git - - -# test -f get-docker.sh || curl -fsSL https://get.docker.com -o get-docker.sh -test -f get-docker.sh || curl -fsSL https://github.com/docker/docker-install/blob/master/install.sh?raw=true -o get-docker.sh - -if [ -n "$http_proxy" ] || [ -n "$https_proxy" ] || [ -n "$HTTP_PROXY" ] || [ -n "$HTTPS_PROXY" ]; then - echo 'Please delete proxy settings !' - echo 'Execute this script again !' - exit 0 -fi - MIRROR='' while [ $# -gt 0 ]; do case "$1" in @@ -40,8 +28,29 @@ while [ $# -gt 0 ]; do shift $(($# > 0 ? 1 : 0)) done + +# https://github.com/docker/docker-install.git +# test -f get-docker.sh || curl -fsSL https://get.docker.com -o get-docker.sh + +case "$MIRROR" in +china | ustc | tuna) + test -f get-docker.sh || curl -fsSL https://gitee.com/jingjingxyk/docker-install/raw/master/install.sh -o get-docker.sh + ;; +*) + test -f get-docker.sh || curl -fsSL https://github.com/docker/docker-install/blob/master/install.sh?raw=true -o get-docker.sh + ;; +esac + + +if [ -n "$http_proxy" ] || [ -n "$https_proxy" ] || [ -n "$HTTP_PROXY" ] || [ -n "$HTTPS_PROXY" ]; then + echo 'Please delete proxy settings !' + echo 'Execute this script again !' + exit 0 +fi + + case "$MIRROR" in -china|ustc) +china | ustc) sed -i "s@https://mirrors.aliyun.com/docker-ce@https://mirrors.ustc.edu.cn/docker-ce@g" get-docker.sh sed -i "s@Aliyun)@china)@g" get-docker.sh sh get-docker.sh --mirror china From e5a5b19cc44b6ad2962686828d71dac054fb197f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 21:19:32 +0800 Subject: [PATCH 042/226] update linux.md --- docs/linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/linux.md b/docs/linux.md index ebba0ba790..f9873d1ea2 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -16,7 +16,8 @@ bash setup-php-runtime.sh composer install --no-interaction --no-autoloader --no-scripts --profile composer dump-autoload --optimize --profile -php prepare.php +inotify +apcu +ds +xlswriter +ssh2 +uuid +# 生成构建脚本 make.sh +php prepare.php --without-docker --skip-download=1 bash ./make.sh docker-build bash ./make.sh docker-bash From d1e05c745025e2408916ea223d32b50e78cfac1e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 21:41:39 +0800 Subject: [PATCH 043/226] update --- sapi/quickstart/linux/connection-swoole-cli-rhel.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/sapi/quickstart/linux/connection-swoole-cli-rhel.sh b/sapi/quickstart/linux/connection-swoole-cli-rhel.sh index e134764d4d..1c43e2c667 100644 --- a/sapi/quickstart/linux/connection-swoole-cli-rhel.sh +++ b/sapi/quickstart/linux/connection-swoole-cli-rhel.sh @@ -9,7 +9,4 @@ __DIR__=$( cd ${__DIR__} docker exec -it swoole-cli-rhel-dev bash -<<<<<<< HEAD -======= ->>>>>>> build_native_php From 5276f29fc7ed87b9c6132810b71fa42432f463d8 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 10 Jul 2024 21:58:30 +0800 Subject: [PATCH 044/226] update run rhel container --- sapi/quickstart/linux/rhel-init.sh | 5 +-- sapi/quickstart/linux/run-rhel-container.sh | 36 +++++++++++++++++++ sapi/quickstart/linux/run-ubuntu-container.sh | 17 ++++++++- 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/sapi/quickstart/linux/rhel-init.sh b/sapi/quickstart/linux/rhel-init.sh index 6cfe1bbab2..d75491b9de 100644 --- a/sapi/quickstart/linux/rhel-init.sh +++ b/sapi/quickstart/linux/rhel-init.sh @@ -76,12 +76,13 @@ dnf makecache yum install -y git wget ca-certificates -yum install -y autoconf automake clang lld libtool cmake bison gettext zip unzip +yum install -y autoconf automake clang lld libtool cmake bison gettext zip unzip yum install -y pkg-config bzip2 flex -yum install -y curl-minimal +yum install -y curl-minimal yum install -y xz +yum install -y socat exit 0 yum install -y clang-tools re2c lzip coreutils p7zip diff --git a/sapi/quickstart/linux/run-rhel-container.sh b/sapi/quickstart/linux/run-rhel-container.sh index 6666d2dace..aaf36e645b 100644 --- a/sapi/quickstart/linux/run-rhel-container.sh +++ b/sapi/quickstart/linux/run-rhel-container.sh @@ -24,5 +24,41 @@ cd ${__DIR__} IMAGE=almalinux:9 IMAGE=rockylinux:9 +OS="rocky" +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --os) + OS="$2" + ;; + --mirror) + MIRROR="$2" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + + + +case "$OS" in + rocky) + IMAGE=rockylinux:9 + case "$MIRROR" in + china | openatom) + IMAGE="hub.atomgit.com/library/rockylinux:9" + ;; + esac + ;; + alma) + IMAGE=almalinux:9 + case "$MIRROR" in + china | openatom) + IMAGE="hub.atomgit.com/library/almalinux:9" + ;; + esac + ;; +esac + + cd ${__DIR__} docker run --rm --name swoole-cli-rhel-dev -d -v ${__PROJECT__}:/work -w /work $IMAGE tail -f /dev/null diff --git a/sapi/quickstart/linux/run-ubuntu-container.sh b/sapi/quickstart/linux/run-ubuntu-container.sh index 64908bc1b3..a4646cdc06 100644 --- a/sapi/quickstart/linux/run-ubuntu-container.sh +++ b/sapi/quickstart/linux/run-ubuntu-container.sh @@ -18,7 +18,22 @@ cd ${__DIR__} echo $? } cd ${__DIR__} -IMAGE=ubuntu:22.04 +IMAGE=ubuntu:23.10 + +MIRROR='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + case "$MIRROR" in + china | openatom) + IMAGE="hub.atomgit.com/library/ubuntu:23.10" + ;; + esac + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done cd ${__DIR__} docker run --rm --name swoole-cli-ubuntu-dev -d -v ${__PROJECT__}:/work -w /work $IMAGE tail -f /dev/null From d12d1c9979413e5b1c36f2c10cc9e1a814e857c1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 01:48:14 +0800 Subject: [PATCH 045/226] update --- setup-go-runtime.sh | 138 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 setup-go-runtime.sh diff --git a/setup-go-runtime.sh b/setup-go-runtime.sh new file mode 100644 index 0000000000..b8ad08fc16 --- /dev/null +++ b/setup-go-runtime.sh @@ -0,0 +1,138 @@ +#!/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="darwin" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="windows" + ;; + 'MINGW64_NT'*) + OS="windows" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="amd64" + ;; +'aarch64' | 'arm64' ) + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='1.22.5' +APP_NAME='go' +VERSION='1.22.5' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +:<<'EOF' + +https://go.dev/dl/go1.22.5.windows-amd64.msi + +https://go.dev/dl/go1.22.5.darwin-arm64.pkg + +https://go.dev/dl/go1.22.5.darwin-amd64.pkg +https://go.dev/dl/go1.22.5.linux-amd64.tar.gz +https://go.dev/dl/go1.21.12.linux-arm64.tar.gz +https://go.dev/dl/go1.21.12.windows-amd64.zip +https://go.dev/dl/go1.21.12.darwin-arm64.tar.gz +https://go.dev/dl/go1.21.12.darwin-amd64.tar.gz + +EOF + +APP_DOWNLOAD_URL="https://go.dev/dl/${APP_NAME}${APP_VERSION}.${OS}-${ARCH}.tar.gz" + +if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://go.dev/dl/${APP_NAME}${APP_VERSION}.${OS}-${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://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://swoole-cli.jingjingxyk.com/${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 +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 +fi + +cd ${__PROJECT__}/ + +set +x + +echo " " +echo " USE PHP RUNTIME :" +echo " " +echo " export PATH=\"${__PROJECT__}/bin/runtime/go/bin/:\$PATH\" " +echo " " +export PATH="${__PROJECT__}/bin/runtime/go/bin/:$PATH" +go version From 3affb13f94d7172f5ecc433cb6a17d39bc7f7fd9 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 01:54:30 +0800 Subject: [PATCH 046/226] update --- sapi/quickstart/clean-folder-for-extra-build.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index 32ce5e7ff1..dadcc50d4f 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -71,18 +71,17 @@ test -f ovn.yml && rm -rf ovn.yml cd ${__PROJECT__} test -f setup-aria2-runtime.sh && rm -rf setup-aria2-runtime.sh -test -f setup-ffmpeg-runtime.sh && rm -rf setup-ffmpeg-runtime.sh -test -f setup-php-cli-runtime.sh && rm -rf setup-php-cli-runtime.sh -test -f setup-supervisord.sh && rm -rf setup-supervisord.sh test -f setup-coturn-runtime.sh && rm -rf setup-coturn-runtime.sh +test -f setup-ffmpeg-runtime.sh && rm -rf setup-ffmpeg-runtime.sh +test -f setup-go-runtime.sh && rm -rf setup-go-runtime.sh test -f setup-nginx-runtime.sh && rm -rf setup-nginx-runtime.sh +test -f setup-php-cli-runtime.sh && rm -rf setup-php-cli-runtime.sh test -f setup-php-fpm-runtime.sh && rm -rf setup-php-fpm-runtime.sh test -f setup-privoxy-runtime.sh && rm -rf setup-privoxy-runtime.sh test -f setup-socat-runtime.sh && rm -rf setup-socat-runtime.sh -test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh -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-supervisord.sh && rm -rf setup-supervisord.sh +test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh cd ${__PROJECT__} From 14deb83e90822f47c0364b6af9150008fb1d7cd6 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 02:02:12 +0800 Subject: [PATCH 047/226] update clean-folder-fox-extra-build.sh --- .../clean-folder-for-extra-build.sh | 1 + setup-nodejs-runtime.sh | 144 ++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 setup-nodejs-runtime.sh diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index dadcc50d4f..bc8fb28af4 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -75,6 +75,7 @@ test -f setup-coturn-runtime.sh && rm -rf setup-coturn-runtime.sh test -f setup-ffmpeg-runtime.sh && rm -rf setup-ffmpeg-runtime.sh test -f setup-go-runtime.sh && rm -rf setup-go-runtime.sh test -f setup-nginx-runtime.sh && rm -rf setup-nginx-runtime.sh +test -f setup-nodejs-runtime.sh && rm -rf setup-nodejs-runtime.sh test -f setup-php-cli-runtime.sh && rm -rf setup-php-cli-runtime.sh test -f setup-php-fpm-runtime.sh && rm -rf setup-php-fpm-runtime.sh test -f setup-privoxy-runtime.sh && rm -rf setup-privoxy-runtime.sh diff --git a/setup-nodejs-runtime.sh b/setup-nodejs-runtime.sh new file mode 100644 index 0000000000..baa078afd4 --- /dev/null +++ b/setup-nodejs-runtime.sh @@ -0,0 +1,144 @@ +#!/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="darwin" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="win" + ;; + 'MINGW64_NT'*) + OS="win" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="x64" + ;; +'aarch64' | 'arm64' ) + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='v20.15.1' +APP_NAME='node' +VERSION='v20.15.1' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +:<<'EOF' +https://nodejs.org/dist/v20.15.1/node-v20.15.1-darwin-x64.tar.gz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-darwin-arm64.tar.gz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-linux-arm64.tar.xz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-linux-arm64.tar.xz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-win-arm64.zip +https://nodejs.org/dist/v20.15.1/node-v20.15.1-win-x64.zip +EOF + +APP_DOWNLOAD_URL="https://nodejs.org/dist/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + +if [ $OS = 'win' ]; then + APP_DOWNLOAD_URL="https://nodejs.org/dist/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${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://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.zip" + fi + ;; +esac + +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" +if [ $OS = 'win' ]; 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 + } +else + if [ $OS = "darwin" ]; then + 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 + + 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 -d ${APP_RUNTIME} || tar -xvf ${APP_RUNTIME}.tar + fi + test -d ${__PROJECT__}/bin/runtime/node && rm -rf ${__PROJECT__}/bin/runtime/node + mv ${APP_RUNTIME} ${__PROJECT__}/bin/runtime/node +fi + + +cd ${__PROJECT__}/ + +set +x + +echo " " +echo " USE PHP RUNTIME :" +echo " " +echo " export PATH=\"${__PROJECT__}/bin/runtime/node/bin/:\$PATH\" " +echo " " +export PATH="${__PROJECT__}/bin/runtime/node/bin/:$PATH" +node -v +npm -v +npx -v From f8aaf4a22b095fc9eab7e23794e6891769551cb6 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 11:27:25 +0800 Subject: [PATCH 048/226] update --- setup-php-runtime.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup-php-runtime.sh b/setup-php-runtime.sh index c63dc79e6d..6b8bc4b75d 100644 --- a/setup-php-runtime.sh +++ b/setup-php-runtime.sh @@ -144,6 +144,7 @@ opcache.jit=1254 opcache.jit_buffer_size=480M expose_php=Off +phar.readonly=0 EOF From d0989eecea79a0f93928907b01e31c481dee0938 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 12:16:11 +0800 Subject: [PATCH 049/226] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E4=BE=8B=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/builder/library/aaa_example.php | 37 +++++++++++------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/sapi/src/builder/library/aaa_example.php b/sapi/src/builder/library/aaa_example.php index 5d93676777..470012d42b 100644 --- a/sapi/src/builder/library/aaa_example.php +++ b/sapi/src/builder/library/aaa_example.php @@ -12,9 +12,10 @@ $lib->withHomePage('https://opencv.org/') ->withLicense('http://www.gnu.org/licenses/lgpl-2.1.html', Library::LICENSE_LGPL) ->withManual('https://github.com/opencv/opencv.git') - /* - //设置现在文件 hash 值验证,hash 值不匹配,下载文件的自动被丢弃 + /* + * + //设置现在文件 hash 值验证,hash 值不匹配,下载文件的自动被丢弃 ->withFileHash('sha1', '32ead1982fed95c52060cd92187a411de3376ac9') ->withFileHash('md5','538378de497a830092cd497e2f963b5d') ->withFileHash('sha256','5dc841d2dc9f492d57d4550c114f15a03d5ee0275975571ebd82a1fca8604176') @@ -68,26 +69,18 @@ EOF ) ->withPrefix($example_prefix) - /* - - // 当--with-build_type=dev 时 如下2个配置才生效 - - // 自动清理构建目录 - ->withCleanBuildDirectory() - // 自动清理安装目录 - ->withCleanPreInstallDirectory($example_prefix) + /* //明确申明 不使用构建缓存 例子: thirdparty/openssl (每次都解压全新源代码到此目录) ->withBuildCached(false) //明确申明 不使用库缓存 例子: /usr/local/swoole-cli/zlib (每次构建都需要安装到此目录) - ->withBuildCached(false) + ->withInstallCached(false) */ - # 构建源码可以使用cmake 、 autoconfig 、 meson 构建等 @@ -178,6 +171,9 @@ PACKAGES='openssl ' PACKAGES="\$PACKAGES zlib" + OPENSSL_CFLAGS=$(pkg-config --cflags --static openssl) + OPENSSL_LIBS=$(pkg-config --libs --static openssl) + CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES)" \ LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) " \ LIBS="$(pkg-config --libs-only-l --static \$PACKAGES)" \ @@ -197,9 +193,8 @@ /* 使用 autoconfig automake 构建 end */ - /* + /* 默认不需要此配置 - //默认不需要此配置 ->withScriptAfterInstall( <<withScriptAfterInstall( <<withPkgName('libexample') ->withBinPath($example_prefix . '/bin/') //依赖其它静态链接库 - ->withDependentLibraries('zlib', 'openssl')/* + ->withDependentLibraries('zlib', 'openssl') + /* + //默认不需要此配置,特殊目录才需要配置 ->withLdflags('-L' . $example_prefix . '/lib64') @@ -248,6 +246,7 @@ ->withPkgConfig($example_prefix . '/lib/ib64/pkgconfig') */ + ; $p->addLibrary($lib); @@ -263,12 +262,10 @@ */ - /* - //导入需要的变量 + /* 导入需要的变量 $p->withExportVariable('LIBPQ_CFLAGS', '$(pkg-config --cflags --static libpq)'); $p->withExportVariable('LIBPQ_LIBS', '$(pkg-config --libs --static libpq)'); */ }; - From 655837f1412a9fd93e13543ba9d28cb0a2ad0f9c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 12:17:09 +0800 Subject: [PATCH 050/226] update webui --- sapi/webUI/.gitignore | 4 +- sapi/webUI/README.md | 5 + sapi/webUI/bootstrap.php | 6 +- sapi/webUI/deploy.sh | 16 ++++ sapi/webUI/phar-builder.php | 7 ++ sapi/webUI/setup-nodejs-runtime.sh | 144 +++++++++++++++++++++++++++++ sapi/webUI/start-browser.sh | 2 +- 7 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 sapi/webUI/deploy.sh create mode 100644 sapi/webUI/phar-builder.php create mode 100644 sapi/webUI/setup-nodejs-runtime.sh diff --git a/sapi/webUI/.gitignore b/sapi/webUI/.gitignore index bf818ff34d..86209cded8 100644 --- a/sapi/webUI/.gitignore +++ b/sapi/webUI/.gitignore @@ -1,7 +1,9 @@ ./data ./.idea -./deploy.sh ./node_modules ./public/ajax/ ./public/data/ ./package-lock.json +./var/ +./bin/ +./myapp.phar diff --git a/sapi/webUI/README.md b/sapi/webUI/README.md index 6a3b9d78ee..a243ad1699 100644 --- a/sapi/webUI/README.md +++ b/sapi/webUI/README.md @@ -3,6 +3,11 @@ ## 启动 web ui ```shell + +bash build-release-example.sh --webui +# 或者 +php prepare.php --without-docker --skip-download=1 --with-web-ui=1 + # 准备数据 bash sapi/webUI/sync-webui-data.sh diff --git a/sapi/webUI/bootstrap.php b/sapi/webUI/bootstrap.php index 058a215e1d..3cd1399307 100644 --- a/sapi/webUI/bootstrap.php +++ b/sapi/webUI/bootstrap.php @@ -34,7 +34,11 @@ if ($request_uri == '/') { $path = '/index.html'; } - $file = realpath(__DIR__ . '/public/') . $path; + //$file = realpath(__DIR__ . '/public/') . $path; + $file = __DIR__ . '/public/' . $path; + echo __DIR__ . PHP_EOL; + echo $file; + echo PHP_EOL; //printf("%s,%s%s", $path, $file,PHP_EOL); $result = []; diff --git a/sapi/webUI/deploy.sh b/sapi/webUI/deploy.sh new file mode 100644 index 0000000000..5c95b4fbdd --- /dev/null +++ b/sapi/webUI/deploy.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=${__DIR__} +cd ${__PROJECT__} +bash setup-nodejs-runtime.sh + +export PATH="${__PROJECT__}/bin/runtime/node/bin/:$PATH" + +npm install + +bash sync-frontend-library.sh diff --git a/sapi/webUI/phar-builder.php b/sapi/webUI/phar-builder.php new file mode 100644 index 0000000000..5a0d38b5f1 --- /dev/null +++ b/sapi/webUI/phar-builder.php @@ -0,0 +1,7 @@ +buildFromDirectory(__DIR__); +$phar->startBuffering(); +$phar->setStub($phar->createDefaultStub('bootstrap.php')); +$phar->stopBuffering(); diff --git a/sapi/webUI/setup-nodejs-runtime.sh b/sapi/webUI/setup-nodejs-runtime.sh new file mode 100644 index 0000000000..baa078afd4 --- /dev/null +++ b/sapi/webUI/setup-nodejs-runtime.sh @@ -0,0 +1,144 @@ +#!/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="darwin" + ;; +*) + case $OS in + 'MSYS_NT'*) + OS="win" + ;; + 'MINGW64_NT'*) + OS="win" + ;; + *) + echo '暂未配置的 OS ' + exit 0 + ;; + esac + ;; +esac + +case $ARCH in +'x86_64') + ARCH="x64" + ;; +'aarch64' | 'arm64' ) + ARCH="arm64" + ;; +*) + echo '暂未配置的 ARCH ' + exit 0 + ;; +esac + +APP_VERSION='v20.15.1' +APP_NAME='node' +VERSION='v20.15.1' + +mkdir -p bin/runtime +mkdir -p var/runtime + +cd ${__PROJECT__}/var/runtime + +:<<'EOF' +https://nodejs.org/dist/v20.15.1/node-v20.15.1-darwin-x64.tar.gz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-darwin-arm64.tar.gz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-linux-arm64.tar.xz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-linux-arm64.tar.xz +https://nodejs.org/dist/v20.15.1/node-v20.15.1-win-arm64.zip +https://nodejs.org/dist/v20.15.1/node-v20.15.1-win-x64.zip +EOF + +APP_DOWNLOAD_URL="https://nodejs.org/dist/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + +if [ $OS = 'win' ]; then + APP_DOWNLOAD_URL="https://nodejs.org/dist/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${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://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + if [ $OS = 'windows' ]; then + APP_DOWNLOAD_URL="https://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.zip" + fi + ;; +esac + +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" +if [ $OS = 'win' ]; 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 + } +else + if [ $OS = "darwin" ]; then + 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 + + 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 -d ${APP_RUNTIME} || tar -xvf ${APP_RUNTIME}.tar + fi + test -d ${__PROJECT__}/bin/runtime/node && rm -rf ${__PROJECT__}/bin/runtime/node + mv ${APP_RUNTIME} ${__PROJECT__}/bin/runtime/node +fi + + +cd ${__PROJECT__}/ + +set +x + +echo " " +echo " USE PHP RUNTIME :" +echo " " +echo " export PATH=\"${__PROJECT__}/bin/runtime/node/bin/:\$PATH\" " +echo " " +export PATH="${__PROJECT__}/bin/runtime/node/bin/:$PATH" +node -v +npm -v +npx -v diff --git a/sapi/webUI/start-browser.sh b/sapi/webUI/start-browser.sh index 5d1ef88c71..d1314f48f9 100644 --- a/sapi/webUI/start-browser.sh +++ b/sapi/webUI/start-browser.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( From 3570c9fbbafbe63f66396638b53b362531015934 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 13:21:09 +0800 Subject: [PATCH 051/226] udpate build-export-container.sh --- sapi/docker/build-export-container.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index 6229e2f427..a2469d2d14 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -1,7 +1,8 @@ #!/bin/bash :<<'COMMENT' - 从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 和 导出镜像到磁盘 + + 从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 ,并把新容器镜像导出为文件 COMMENT @@ -19,6 +20,7 @@ cd ${__PROJECT__} CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18' +CONTAIENR_NAME='swoole-cli-builder' MIRROR='' PLATFORM='' ARCH=$(uname -m) @@ -39,6 +41,10 @@ while [ $# -gt 0 ]; do --mirror) MIRROR="$2" ;; + --quickstart-container) + CONTAIENR_NAME='swoole-cli-alpine-dev' + # 从quickstart 生成的容器中拷贝 /usr/local/swoole-cli/ 文件夹,并生成新容器镜像 + ;; --*) echo "Illegal option $1" ;; @@ -58,8 +64,8 @@ cd ${__PROJECT__}/var/build-export-container/ test -d swoole-cli && rm -rf swoole-cli -container_id='swoole-cli-builder' -docker cp $container_id:/usr/local/swoole-cli/ . + +docker cp ${CONTAIENR_NAME}:/usr/local/swoole-cli/ . cat > Dockerfile <<'EOF' From b95dad0d5a615e641a1f5af231ddb159ed78223d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 14:18:37 +0800 Subject: [PATCH 052/226] add coturn README.MD --- sapi/quickstart/linux/SDN/coturn/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sapi/quickstart/linux/SDN/coturn/README.md diff --git a/sapi/quickstart/linux/SDN/coturn/README.md b/sapi/quickstart/linux/SDN/coturn/README.md new file mode 100644 index 0000000000..e69de29bb2 From d84f1f282d51e845991737332bdc2bc0f15f1698 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 14:19:29 +0800 Subject: [PATCH 053/226] update build-export-container.sh --- sapi/docker/build-export-container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index a2469d2d14..193ec72eb7 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -105,7 +105,7 @@ IMAGE="docker.io/phpswoole/swoole-cli-builder:${TAG}" echo "MIRROR=${MIRROR}" echo "BASE_IMAGE=${CONTAINER_BASE_IMAGE}" -docker build -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" +docker build --no-cache -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" echo ${IMAGE} echo ${IMAGE} > container-image.txt From 10f8510b4753c5d065ff8fb86ebece3f367da1b1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 15:40:48 +0800 Subject: [PATCH 054/226] add generate-php-extension.sh --- sapi/genereate-php-extension-example.sh | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sapi/genereate-php-extension-example.sh diff --git a/sapi/genereate-php-extension-example.sh b/sapi/genereate-php-extension-example.sh new file mode 100644 index 0000000000..afbcfad04f --- /dev/null +++ b/sapi/genereate-php-extension-example.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + + +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +if [ -f ${__DIR__}/prepare.php ] ; then + __PROJECT__=$( + cd ${__DIR__}/ + pwd + ) +else + __PROJECT__=$( + cd ${__DIR__}/../ + pwd + ) +fi + +cd ${__DIR__} + + +export PATH="${__PROJECT__}/bin/runtime:$PATH" + +alias php='php -c ${__PROJECT__}/bin/runtime/php.ini' +php ${__PROJECT__}/sapi/DownloadPHPSourceCode.php + + +php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --help +# 创建扩展 +php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --ext example --author jingjingxyk --std + From 6ac0886b299e56f3880f4d223ded0d1272bfebc7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 15:43:00 +0800 Subject: [PATCH 055/226] add generate-php-extension.sh --- sapi/tools/genereate-php-extension-example.sh | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sapi/tools/genereate-php-extension-example.sh diff --git a/sapi/tools/genereate-php-extension-example.sh b/sapi/tools/genereate-php-extension-example.sh new file mode 100644 index 0000000000..a455c6120f --- /dev/null +++ b/sapi/tools/genereate-php-extension-example.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + + +:<<'COMMENT' + +创建 PHP 扩展 辅助工具 + +COMMENT + +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +if [ -f ${__DIR__}/prepare.php ] ; then + __PROJECT__=$( + cd ${__DIR__}/ + pwd + ) +else + __PROJECT__=$( + cd ${__DIR__}/../ + pwd + ) +fi + +cd ${__DIR__} + + +export PATH="${__PROJECT__}/bin/runtime:$PATH" + +alias php='php -c ${__PROJECT__}/bin/runtime/php.ini' +php ${__PROJECT__}/sapi/DownloadPHPSourceCode.php + + +php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --help + +# 创建扩展 +php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --ext example --author jingjingxyk --std + From 3170120f959f3529f6e62b4b707ff9b601ad13ce Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 15:45:31 +0800 Subject: [PATCH 056/226] update --- sapi/tools/genereate-php-extension-example.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/tools/genereate-php-extension-example.sh b/sapi/tools/genereate-php-extension-example.sh index a455c6120f..f114af5787 100644 --- a/sapi/tools/genereate-php-extension-example.sh +++ b/sapi/tools/genereate-php-extension-example.sh @@ -18,7 +18,7 @@ if [ -f ${__DIR__}/prepare.php ] ; then ) else __PROJECT__=$( - cd ${__DIR__}/../ + cd ${__DIR__}/../../ pwd ) fi From 94d0d6a81de547dc25249cd87cd49db7e7f4195a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 15:46:17 +0800 Subject: [PATCH 057/226] update --- sapi/genereate-php-extension-example.sh | 32 ------------------------- 1 file changed, 32 deletions(-) delete mode 100644 sapi/genereate-php-extension-example.sh diff --git a/sapi/genereate-php-extension-example.sh b/sapi/genereate-php-extension-example.sh deleted file mode 100644 index afbcfad04f..0000000000 --- a/sapi/genereate-php-extension-example.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - - -__DIR__=$( - cd "$(dirname "$0")" - pwd -) -if [ -f ${__DIR__}/prepare.php ] ; then - __PROJECT__=$( - cd ${__DIR__}/ - pwd - ) -else - __PROJECT__=$( - cd ${__DIR__}/../ - pwd - ) -fi - -cd ${__DIR__} - - -export PATH="${__PROJECT__}/bin/runtime:$PATH" - -alias php='php -c ${__PROJECT__}/bin/runtime/php.ini' -php ${__PROJECT__}/sapi/DownloadPHPSourceCode.php - - -php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --help -# 创建扩展 -php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --ext example --author jingjingxyk --std - From 42bc155742036a4e844b3e86ee1633b44cd248b7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 15:49:17 +0800 Subject: [PATCH 058/226] update DownloadPHPSourcecode.php --- diff.php | 2 +- sapi/{ => scripts}/DownloadPHPSourceCode.php | 2 +- sync-source-code.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename sapi/{ => scripts}/DownloadPHPSourceCode.php (95%) diff --git a/diff.php b/diff.php index 29133a825c..b8a1d3fac7 100755 --- a/diff.php +++ b/diff.php @@ -18,7 +18,7 @@ ->remove('core'); ob_start(); -require_once __DIR__ . '/sapi/DownloadPHPSourceCode.php'; +require_once __DIR__ . '/sapi/scripts/DownloadPHPSourceCode.php'; $php_source_folder = PHP_SRC_DIR; ob_end_clean(); diff --git a/sapi/DownloadPHPSourceCode.php b/sapi/scripts/DownloadPHPSourceCode.php similarity index 95% rename from sapi/DownloadPHPSourceCode.php rename to sapi/scripts/DownloadPHPSourceCode.php index 0d048f4b34..be0ae36f8f 100644 --- a/sapi/DownloadPHPSourceCode.php +++ b/sapi/scripts/DownloadPHPSourceCode.php @@ -1,6 +1,6 @@ Date: Thu, 11 Jul 2024 15:53:02 +0800 Subject: [PATCH 059/226] update generate-php-extension-example.sh --- sapi/tools/genereate-php-extension-example.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/tools/genereate-php-extension-example.sh b/sapi/tools/genereate-php-extension-example.sh index f114af5787..a186ada5f6 100644 --- a/sapi/tools/genereate-php-extension-example.sh +++ b/sapi/tools/genereate-php-extension-example.sh @@ -29,7 +29,7 @@ cd ${__DIR__} export PATH="${__PROJECT__}/bin/runtime:$PATH" alias php='php -c ${__PROJECT__}/bin/runtime/php.ini' -php ${__PROJECT__}/sapi/DownloadPHPSourceCode.php +php ${__PROJECT__}/sapi/scripts/DownloadPHPSourceCode.php php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --help From 188f95436ab0833d5dc30249b02c6a5166bd182f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 15:55:36 +0800 Subject: [PATCH 060/226] update generate-php-extension-example.sh --- sapi/tools/genereate-php-extension-example.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sapi/tools/genereate-php-extension-example.sh b/sapi/tools/genereate-php-extension-example.sh index a186ada5f6..63ce4f43fc 100644 --- a/sapi/tools/genereate-php-extension-example.sh +++ b/sapi/tools/genereate-php-extension-example.sh @@ -35,5 +35,7 @@ php ${__PROJECT__}/sapi/scripts/DownloadPHPSourceCode.php php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --help # 创建扩展 +# 使用 `--dir ${__PROJECT__}/../ ` # 指定生成扩展的目录 + php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --ext example --author jingjingxyk --std From 1dc9eab242673077cd6b09a316aba10c1436ffcc Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 16:26:28 +0800 Subject: [PATCH 061/226] update make.php --- sapi/src/template/make.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index 114aa1a466..07d02e92cb 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -274,10 +274,12 @@ cd phpSrcDir ?>/ - # 添加扩展 + # 添加非内置扩展 if [ ! -z "$(ls -A ${__PROJECT_DIR__}/ext/)" ] ;then cp -rf ${__PROJECT_DIR__}/ext/* phpSrcDir ?>/ext/ fi + + cd phpSrcDir ?>/ # 对扩展源代码执行预处理 before_configure_script From a1d0b514dde753d2d06282e56492d58636958931 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 22:33:35 +0800 Subject: [PATCH 062/226] add getWorkExtDir() for extension hook --- sapi/src/Preprocessor.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 69b0119d4d..bce3f105a7 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -270,6 +270,10 @@ public function getWorkDir(): string return $this->workDir; } + public function getWorkExtDir(): string + { + return $this->workDir . '/ext/'; + } public function setExtraLdflags(string $flags) { $this->extraLdflags = $flags; @@ -330,8 +334,7 @@ public function donotInstallLibrary() /** * @param string $url * @param string $file - * @param string $md5sum - * @throws Exception + * @param object|null $project [ $lib or $ext ] */ protected function downloadFile(string $url, string $file, object $project = null) { @@ -832,7 +835,7 @@ public function execute(): void $this->setExtensionDependency(); if ($this->getInputOption('skip-download')) { - $this->generateLibraryDownloadLinks(); + $this->generateDownloadLinks(); } $this->generateFile(__DIR__ . '/template/make.php', $this->rootDir . '/make.sh'); @@ -868,7 +871,7 @@ public function execute(): void } } - protected function generateLibraryDownloadLinks(): void + protected function generateDownloadLinks(): void { $this->mkdirIfNotExists($this->getRootDir() . '/var/download-box/', 0755, true); From c746325cdeff9c294efc3729588f52573993ea91 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 22:48:57 +0800 Subject: [PATCH 063/226] format code --- sapi/src/Preprocessor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index bce3f105a7..c7d9320975 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -274,6 +274,7 @@ public function getWorkExtDir(): string { return $this->workDir . '/ext/'; } + public function setExtraLdflags(string $flags) { $this->extraLdflags = $flags; From 342ddb34c0da137ef2a90524765c2160de63e5d0 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 22:54:31 +0800 Subject: [PATCH 064/226] update prepare.php --- prepare.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/prepare.php b/prepare.php index c3501151a3..1ee22402de 100755 --- a/prepare.php +++ b/prepare.php @@ -12,13 +12,19 @@ $p = Preprocessor::getInstance(); $p->parseArguments($argc, $argv); +$buildType = $p->getBuildType(); +if ($p->getInputOption('with-build-type')) { + $buildType = $p->getInputOption('with-build-type'); + $p->setBuildType($buildType); +} + # clean old make.sh -if (($p->getInputOption('with-build-type') == 'dev') && file_exists(__DIR__ . '/make.sh')) { +if (($buildType == 'dev') && file_exists(__DIR__ . '/make.sh')) { unlink(__DIR__ . '/make.sh'); } // Sync code from php-src -$p->setPhpSrcDir($homeDir . '/.phpbrew/build/php-' . BUILD_PHP_VERSION); +$p->setPhpSrcDir($p->getWorkDir() . '/var/php-' . BUILD_PHP_VERSION); // Compile directly on the host machine, not in the docker container if ($p->getInputOption('without-docker') || ($p->isMacos())) { @@ -26,11 +32,6 @@ $p->setBuildDir(__DIR__ . '/thirdparty'); } -$buildType = $p->getBuildType(); -if ($p->getInputOption('with-build-type')) { - $buildType = $p->getInputOption('with-build-type'); - $p->setBuildType($buildType); -} if ($p->getInputOption('with-global-prefix')) { $p->setGlobalPrefix($p->getInputOption('with-global-prefix')); From 3ba47bf1bfed52f9f67cacc8d118786bf2350936 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 23:05:41 +0800 Subject: [PATCH 065/226] update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e26677db6a..c3d018f4cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# build static php-cli runtime +# build static php-cli runtime and php-fpm -构建静态 原生 php-cli 运行时 +构建静态 原生 php-cli 运行时 和 fastcgi 进程管理器 php-fpm ## 说明 From 382e478cb4688b1bfa0265b5a62bacb069c0a919 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 00:53:33 +0800 Subject: [PATCH 066/226] update alpine-php-init.sh --- sapi/quickstart/linux/extra/alpine-php-init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/quickstart/linux/extra/alpine-php-init.sh b/sapi/quickstart/linux/extra/alpine-php-init.sh index bac0fa6b94..335ee3f980 100644 --- a/sapi/quickstart/linux/extra/alpine-php-init.sh +++ b/sapi/quickstart/linux/extra/alpine-php-init.sh @@ -1,2 +1,3 @@ apk add php-cli php-iconv php-mbstring php-phar php-openssl php-posix php-curl php-tokenizer php-dom php-xmlwriter php-xml php-simplexml +apk add php81-dev From dba7e36bb6c93f1289d23bcaf0ca0400f800d5a1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 10:04:37 +0800 Subject: [PATCH 067/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=20=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E5=AE=89=E8=A3=85=20swoole=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extra/swoole-install/alpine-init-for-swoole.sh | 1 + .../linux/extra/swoole-install/build-swoole.sh | 11 +++++++++++ .../extra/swoole-install/debian-init-for-swoole.sh | 3 +++ .../extra/swoole-install/macos-init-for-swoole.sh | 1 + .../extra/swoole-install/rhel-init-for-swoole.sh | 4 ++++ 5 files changed, 20 insertions(+) create mode 100644 sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh create mode 100644 sapi/quickstart/linux/extra/swoole-install/build-swoole.sh create mode 100644 sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh create mode 100644 sapi/quickstart/linux/extra/swoole-install/macos-init-for-swoole.sh create mode 100644 sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh new file mode 100644 index 0000000000..a82c500e03 --- /dev/null +++ b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh @@ -0,0 +1 @@ +apk add curl-dev c-ares-dev diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh new file mode 100644 index 0000000000..73ebc8744b --- /dev/null +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -0,0 +1,11 @@ +mkdir -p ~/build && \ +cd ~/build && \ +rm -rf ./swoole-src && \ +curl -o ./tmp/swoole.tar.gz https://github.com/swoole/swoole-src/archive/master.tar.gz -L && \ +tar zxvf ./tmp/swoole.tar.gz && \ +mv swoole-src* swoole-src && \ +cd swoole-src && \ +phpize && \ +./configure \ +--enable-openssl --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares --enable-swoole-pgsql && \ +sudo make && sudo make install diff --git a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh new file mode 100644 index 0000000000..283fb68e1e --- /dev/null +++ b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh @@ -0,0 +1,3 @@ +sudo apt-get install -y libc-ares-dev libcurl4-openssl-dev +sudo apt-get install -y libpcre3 libpcre3-dev + diff --git a/sapi/quickstart/linux/extra/swoole-install/macos-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/macos-init-for-swoole.sh new file mode 100644 index 0000000000..eb06198cf9 --- /dev/null +++ b/sapi/quickstart/linux/extra/swoole-install/macos-init-for-swoole.sh @@ -0,0 +1 @@ +brew install c-ares diff --git a/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh new file mode 100644 index 0000000000..92d4b69ccf --- /dev/null +++ b/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh @@ -0,0 +1,4 @@ +yum install glibc-headers +yum install gcc-c++ + +yum install c-ares-devel libcurl-devel pcre-devel From d2cc242ea8183eba2e0594b4f03175900784cc07 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 10:07:07 +0800 Subject: [PATCH 068/226] cygwin disable swoole enable thread --- sapi/scripts/cygwin/cygwin-config.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sapi/scripts/cygwin/cygwin-config.sh b/sapi/scripts/cygwin/cygwin-config.sh index ee34e3db76..a16ae8ed85 100755 --- a/sapi/scripts/cygwin/cygwin-config.sh +++ b/sapi/scripts/cygwin/cygwin-config.sh @@ -49,8 +49,6 @@ test -f Makefile && make clean --enable-swoole --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ - --enable-swoole-thread \ - --enable-zts \ --enable-redis \ --with-imagick \ --with-yaml \ @@ -61,4 +59,5 @@ test -f Makefile && make clean # --with-pgsql # --with-pdo-sqlite \ # --enable-opcache \ - +# --enable-swoole-thread \ +# --enable-zts \ From 5a664b7821bd9216eae305ba73e2b44e36a8f447 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 10:20:17 +0800 Subject: [PATCH 069/226] update --- .../extra/swoole-install/macos-init-for-swoole.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sapi/quickstart/{linux => macos}/extra/swoole-install/macos-init-for-swoole.sh (100%) diff --git a/sapi/quickstart/linux/extra/swoole-install/macos-init-for-swoole.sh b/sapi/quickstart/macos/extra/swoole-install/macos-init-for-swoole.sh similarity index 100% rename from sapi/quickstart/linux/extra/swoole-install/macos-init-for-swoole.sh rename to sapi/quickstart/macos/extra/swoole-install/macos-init-for-swoole.sh From 6a1fc53f2b589bcfc52b2a6fc485173a93eb89f1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 11:34:21 +0800 Subject: [PATCH 070/226] update --- .../extra/swoole-install/build-swoole.sh | 67 ++++++++++++++++--- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index 73ebc8744b..b6ff55e381 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -1,11 +1,58 @@ -mkdir -p ~/build && \ -cd ~/build && \ -rm -rf ./swoole-src && \ -curl -o ./tmp/swoole.tar.gz https://github.com/swoole/swoole-src/archive/master.tar.gz -L && \ -tar zxvf ./tmp/swoole.tar.gz && \ -mv swoole-src* swoole-src && \ -cd swoole-src && \ -phpize && \ +#!/usr/bin/env bash + +mkdir -p /tmp/build + +cd /tmp/build/ +test -d swoole-src && rm -rf ./swoole-src + + +MIRROR='' +DEBUG=0 +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + MIRROR="$2" + ;; + --debug) + DEBUG=1 + ;; + --*) + echo "no found mirror option $1" + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +case "$MIRROR" in +china ) + git clone -b master --single-branch --depth=1 https://gitee.com/swoole/swoole.git swoole-src + ;; +*) + git clone -b master --single-branch --depth=1 https://github.com/swoole/swoole-src.git + ;; +esac + +OPTIONS=''; +if [ $DEBUG -eq 1 ] ;then + OPTIONS='--enable-debug --enable-debug-log --enable-trace-log' +fi + + +cd swoole-src + +phpize ./configure \ ---enable-openssl --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares --enable-swoole-pgsql && \ -sudo make && sudo make install +--enable-openssl \ +--enable-sockets \ +--enable-mysqlnd \ +--enable-cares \ +--enable-swoole-curl \ +--enable-swoole-pgsql \ +--enable-swoole-sqlite \ +--enable-swoole-thread \ +--enable-zts \ +$OPTIONS + + + +make && sudo make install From 26b8c7e66c9b53628f8fae8ca7bf68889d8c7a03 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 11:39:41 +0800 Subject: [PATCH 071/226] update --- .../linux/extra/swoole-install/alpine-init-for-swoole.sh | 1 + sapi/quickstart/linux/extra/swoole-install/build-swoole.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh index a82c500e03..d0a9fdd664 100644 --- a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh @@ -1 +1,2 @@ +apk add autoconf automake make libtool cmake bison re2c apk add curl-dev c-ares-dev diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index b6ff55e381..f50b1a5e29 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +set -x mkdir -p /tmp/build cd /tmp/build/ From ed2aee844bd766020ada7d59ba12a298e2d51bcc Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 11:43:15 +0800 Subject: [PATCH 072/226] update --- sapi/quickstart/linux/extra/swoole-install/build-swoole.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index f50b1a5e29..57d508564b 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -50,7 +50,6 @@ phpize --enable-swoole-pgsql \ --enable-swoole-sqlite \ --enable-swoole-thread \ ---enable-zts \ $OPTIONS From 2cdf7542e6c8413340b72611dd7a578e33424194 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 11:44:07 +0800 Subject: [PATCH 073/226] update --- .../linux/extra/swoole-install/alpine-init-for-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh index d0a9fdd664..89e27d982a 100644 --- a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh @@ -1,2 +1,2 @@ -apk add autoconf automake make libtool cmake bison re2c +apk add autoconf automake make libtool cmake bison re2c gcc g++ apk add curl-dev c-ares-dev From 90d6cecc26fd83095a0138d5376d1e89e1e0c810 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 11:50:16 +0800 Subject: [PATCH 074/226] update --- .../linux/extra/swoole-install/alpine-init-for-swoole.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh index 89e27d982a..000bee4413 100644 --- a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh @@ -1,2 +1,2 @@ -apk add autoconf automake make libtool cmake bison re2c gcc g++ -apk add curl-dev c-ares-dev +apk add autoconf automake make libtool cmake bison re2c gcc g++ libpq-dev sqlite-dev +apk add curl-dev c-ares-dev libpq-dev sqlite-dev From e2a5b106dcd958c4b57b7622a323f6ea30d4c754 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 11:55:02 +0800 Subject: [PATCH 075/226] update --- .../linux/extra/swoole-install/alpine-init-for-swoole.sh | 2 +- .../linux/extra/swoole-install/debian-init-for-swoole.sh | 2 +- .../linux/extra/swoole-install/rhel-init-for-swoole.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh index 000bee4413..92e5999ad5 100644 --- a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh @@ -1,2 +1,2 @@ apk add autoconf automake make libtool cmake bison re2c gcc g++ libpq-dev sqlite-dev -apk add curl-dev c-ares-dev libpq-dev sqlite-dev +apk add curl-dev c-ares-dev postgresql-dev sqlite-dev diff --git a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh index 283fb68e1e..e1b5544897 100644 --- a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh @@ -1,3 +1,3 @@ sudo apt-get install -y libc-ares-dev libcurl4-openssl-dev -sudo apt-get install -y libpcre3 libpcre3-dev +sudo apt-get install -y libpcre3 libpcre3-dev libpq-dev diff --git a/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh index 92d4b69ccf..4689ebd24a 100644 --- a/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh @@ -1,4 +1,4 @@ yum install glibc-headers yum install gcc-c++ -yum install c-ares-devel libcurl-devel pcre-devel +yum install c-ares-devel libcurl-devel pcre-devel postgresql-devel From b75ace03a5d1beaed31f067cd49b69a020640826 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:04:51 +0800 Subject: [PATCH 076/226] update --- .../linux/extra/swoole-install/alpine-init-for-swoole.sh | 4 ++-- sapi/quickstart/linux/extra/swoole-install/build-swoole.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh index 92e5999ad5..11d569e6f0 100644 --- a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh @@ -1,2 +1,2 @@ -apk add autoconf automake make libtool cmake bison re2c gcc g++ libpq-dev sqlite-dev -apk add curl-dev c-ares-dev postgresql-dev sqlite-dev +apk add autoconf automake make libtool cmake bison re2c gcc g++ +apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index 57d508564b..293578b148 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -49,9 +49,10 @@ phpize --enable-swoole-curl \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ ---enable-swoole-thread \ -$OPTIONS +--with-swoole-odbc="unixODBC,/usr" \ +$OPTIONS \ +# --enable-swoole-thread \ make && sudo make install From e0f1d80a714ba5affdc92e979781856a7d89b4bc Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:14:24 +0800 Subject: [PATCH 077/226] update --- .../linux/extra/swoole-install/alpine-init-for-swoole.sh | 2 +- sapi/quickstart/linux/extra/swoole-install/build-swoole.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh index 11d569e6f0..8d7a9ac700 100644 --- a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh @@ -1,2 +1,2 @@ apk add autoconf automake make libtool cmake bison re2c gcc g++ -apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc +apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc-dev diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index 293578b148..6c1b264fc5 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -55,4 +55,7 @@ $OPTIONS \ # --enable-swoole-thread \ -make && sudo make install + +make +make test +make install From 012d806fe2b9a95067e14100f83255839ba2a133 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:16:30 +0800 Subject: [PATCH 078/226] update --- .../linux/extra/swoole-install/debian-init-for-swoole.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh index e1b5544897..1a5d69af7e 100644 --- a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh @@ -1,3 +1,3 @@ -sudo apt-get install -y libc-ares-dev libcurl4-openssl-dev -sudo apt-get install -y libpcre3 libpcre3-dev libpq-dev +apt-get install -y libc-ares-dev libcurl4-openssl-dev +apt-get install -y libpcre3 libpcre3-dev libpq-dev From 4913bf0e7f9df82f026c1f1e1af878e0730f1338 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:17:30 +0800 Subject: [PATCH 079/226] update --- .../linux/extra/swoole-install/debian-init-for-swoole.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh index 1a5d69af7e..f11b358ff3 100644 --- a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh @@ -1,3 +1,2 @@ apt-get install -y libc-ares-dev libcurl4-openssl-dev -apt-get install -y libpcre3 libpcre3-dev libpq-dev - +apt-get install -y libpcre3 libpcre3-dev libpq-dev unixodbc-dev From ef6ef879149e198761176db79c0898758aed5c15 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:18:54 +0800 Subject: [PATCH 080/226] update --- .../linux/extra/swoole-install/debian-init-for-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh index f11b358ff3..ad8f3e1fec 100644 --- a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh @@ -1,2 +1,2 @@ apt-get install -y libc-ares-dev libcurl4-openssl-dev -apt-get install -y libpcre3 libpcre3-dev libpq-dev unixodbc-dev +apt-get install -y libpcre3 libpcre3-dev libpq-dev libsqlite3-dev unixodbc-dev From f5359a2963ee92bbcb539a84eaf811738cb2a7c2 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:23:28 +0800 Subject: [PATCH 081/226] update --- sapi/quickstart/linux/extra/swoole-install/build-swoole.sh | 2 +- .../linux/extra/swoole-install/debian-init-for-swoole.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index 6c1b264fc5..4ed95322eb 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -54,7 +54,7 @@ $OPTIONS \ # --enable-swoole-thread \ - +# --enable-iouring make make test diff --git a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh index ad8f3e1fec..c87a1900f4 100644 --- a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh @@ -1,2 +1,3 @@ apt-get install -y libc-ares-dev libcurl4-openssl-dev apt-get install -y libpcre3 libpcre3-dev libpq-dev libsqlite3-dev unixodbc-dev +apt-get install -y libbrotli-dev From 3749d3f35f8b76b110f0a3b120d2231e3490d37f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:25:52 +0800 Subject: [PATCH 082/226] update --- .../quickstart/linux/extra/swoole-install/build-swoole.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index 4ed95322eb..b6ceffc0c9 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -8,6 +8,7 @@ test -d swoole-src && rm -rf ./swoole-src MIRROR='' DEBUG=0 +ENABLE_TEST=0 while [ $# -gt 0 ]; do case "$1" in --mirror) @@ -16,6 +17,9 @@ while [ $# -gt 0 ]; do --debug) DEBUG=1 ;; + --test) + ENABLE_TEST=1 + ;; --*) echo "no found mirror option $1" ;; @@ -57,5 +61,7 @@ $OPTIONS \ # --enable-iouring make -make test + +test $ENABLE_TEST -eq 1 && make test + make install From 6669f56f7646ff376366e5e32c2282c6268a482d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 12:31:01 +0800 Subject: [PATCH 083/226] update --- sapi/quickstart/linux/extra/swoole-install/build-swoole.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh index b6ceffc0c9..31614d40cc 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh @@ -60,7 +60,8 @@ $OPTIONS \ # --enable-swoole-thread \ # --enable-iouring -make + +make -j $(`nproc 2> /dev/null || sysctl -n hw.ncpu`) test $ENABLE_TEST -eq 1 && make test From 033696ae7c5231f574b22af415039e36c114733b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 13:37:10 +0800 Subject: [PATCH 084/226] update --- .../quickstart/linux/extra/debian-php-init.sh | 8 +++---- .../swoole-install/macos-init-for-swoole.sh | 1 - .../swoole-install/alpine-init-for-swoole.sh | 0 .../extra => }/swoole-install/build-swoole.sh | 22 +++++++++++++++++-- .../swoole-install/debian-init-for-swoole.sh | 0 .../swoole-install/macos-init-for-swoole.sh | 6 +++++ .../swoole-install/rhel-init-for-swoole.sh | 0 7 files changed, 29 insertions(+), 8 deletions(-) delete mode 100644 sapi/quickstart/macos/extra/swoole-install/macos-init-for-swoole.sh rename sapi/quickstart/{linux/extra => }/swoole-install/alpine-init-for-swoole.sh (100%) rename sapi/quickstart/{linux/extra => }/swoole-install/build-swoole.sh (65%) rename sapi/quickstart/{linux/extra => }/swoole-install/debian-init-for-swoole.sh (100%) create mode 100644 sapi/quickstart/swoole-install/macos-init-for-swoole.sh rename sapi/quickstart/{linux/extra => }/swoole-install/rhel-init-for-swoole.sh (100%) diff --git a/sapi/quickstart/linux/extra/debian-php-init.sh b/sapi/quickstart/linux/extra/debian-php-init.sh index 99a9fdfed6..27832f963c 100644 --- a/sapi/quickstart/linux/extra/debian-php-init.sh +++ b/sapi/quickstart/linux/extra/debian-php-init.sh @@ -2,10 +2,8 @@ apt install -y php-cli php-pear php-dev php-curl php-intl apt install -y php-mbstring php-tokenizer php-xml - # apt install -y php-mysqlnd php-pgsql php-sqlite3 php-redis php-mongodb -curl -Lo /usr/local/bin/composer.phar https://getcomposer.org/download/latest-stable/composer.phar - -ln -sf /usr/local/bin/composer.phar /usr/local/bin/composer -chmod a+x /usr/local/bin/composer +# curl -Lo /usr/local/bin/composer.phar https://getcomposer.org/download/latest-stable/composer.phar +# ln -sf /usr/local/bin/composer.phar /usr/local/bin/composer +# chmod a+x /usr/local/bin/composer diff --git a/sapi/quickstart/macos/extra/swoole-install/macos-init-for-swoole.sh b/sapi/quickstart/macos/extra/swoole-install/macos-init-for-swoole.sh deleted file mode 100644 index eb06198cf9..0000000000 --- a/sapi/quickstart/macos/extra/swoole-install/macos-init-for-swoole.sh +++ /dev/null @@ -1 +0,0 @@ -brew install c-ares diff --git a/sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh similarity index 100% rename from sapi/quickstart/linux/extra/swoole-install/alpine-init-for-swoole.sh rename to sapi/quickstart/swoole-install/alpine-init-for-swoole.sh diff --git a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh similarity index 65% rename from sapi/quickstart/linux/extra/swoole-install/build-swoole.sh rename to sapi/quickstart/swoole-install/build-swoole.sh index 31614d40cc..c131470c35 100644 --- a/sapi/quickstart/linux/extra/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -44,6 +44,24 @@ fi cd swoole-src +UNIXODBC_PREFIX='/usr/' +OS=$(uname -s) +ARCH=$(uname -m) +case "$OS-$ARCH" in +'Darwin-x86_64') + export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ + UNIXODBC_PREFIX='/usr/local/opt/unixodbc/' + ;; +'Darwin-arm64') + export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ + UNIXODBC_PREFIX='/opt/homebrew/opt/unixodbc/' + ;; +*) + ;; +esac + + + phpize ./configure \ --enable-openssl \ @@ -53,7 +71,7 @@ phpize --enable-swoole-curl \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ ---with-swoole-odbc="unixODBC,/usr" \ +--with-swoole-odbc="unixODBC,${UNIXODBC_PREFIX}" \ $OPTIONS \ @@ -61,7 +79,7 @@ $OPTIONS \ # --enable-iouring -make -j $(`nproc 2> /dev/null || sysctl -n hw.ncpu`) +make # -j $(`nproc 2> /dev/null || sysctl -n hw.ncpu`) test $ENABLE_TEST -eq 1 && make test diff --git a/sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/swoole-install/debian-init-for-swoole.sh similarity index 100% rename from sapi/quickstart/linux/extra/swoole-install/debian-init-for-swoole.sh rename to sapi/quickstart/swoole-install/debian-init-for-swoole.sh diff --git a/sapi/quickstart/swoole-install/macos-init-for-swoole.sh b/sapi/quickstart/swoole-install/macos-init-for-swoole.sh new file mode 100644 index 0000000000..7bfa5b8e52 --- /dev/null +++ b/sapi/quickstart/swoole-install/macos-init-for-swoole.sh @@ -0,0 +1,6 @@ + +export HOMEBREW_NO_ANALYTICS=1 +export HOMEBREW_NO_AUTO_UPDATE=1 +export HOMEBREW_INSTALL_FROM_API=1 + +brew install c-ares libpq unixodbc brotli curl diff --git a/sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh similarity index 100% rename from sapi/quickstart/linux/extra/swoole-install/rhel-init-for-swoole.sh rename to sapi/quickstart/swoole-install/rhel-init-for-swoole.sh From 7534893d15d0096b0925855e6c0bdc11b9940791 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 13:40:09 +0800 Subject: [PATCH 085/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index c131470c35..e74a5a6b6c 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -36,10 +36,6 @@ china ) ;; esac -OPTIONS=''; -if [ $DEBUG -eq 1 ] ;then - OPTIONS='--enable-debug --enable-debug-log --enable-trace-log' -fi cd swoole-src @@ -60,10 +56,15 @@ case "$OS-$ARCH" in ;; esac +OPTIONS=''; +if [ $DEBUG -eq 1 ] ;then + OPTIONS=' --enable-debug --enable-debug-log --enable-trace-log ' +fi phpize ./configure \ +$OPTIONS \ --enable-openssl \ --enable-sockets \ --enable-mysqlnd \ @@ -72,7 +73,7 @@ phpize --enable-swoole-pgsql \ --enable-swoole-sqlite \ --with-swoole-odbc="unixODBC,${UNIXODBC_PREFIX}" \ -$OPTIONS \ + # --enable-swoole-thread \ From 6c582e7ae0b4b646198165f48179cf9f5c8f28dd Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 13:48:23 +0800 Subject: [PATCH 086/226] update --- sapi/quickstart/linux/extra/rhel-php-init.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sapi/quickstart/linux/extra/rhel-php-init.sh diff --git a/sapi/quickstart/linux/extra/rhel-php-init.sh b/sapi/quickstart/linux/extra/rhel-php-init.sh new file mode 100644 index 0000000000..ee765470d1 --- /dev/null +++ b/sapi/quickstart/linux/extra/rhel-php-init.sh @@ -0,0 +1,2 @@ +yum install -y php-cli php-pear php-devel php-curl php-intl +yum install -y php-mbstring php-tokenizer php-xml From efe9791c2f180e62fc4747cb40158b1e394fa4b3 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 13:52:14 +0800 Subject: [PATCH 087/226] update --- sapi/quickstart/swoole-install/rhel-init-for-swoole.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh index 4689ebd24a..ae1314a8b8 100644 --- a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh @@ -1,4 +1,4 @@ -yum install glibc-headers -yum install gcc-c++ +yum install -y glibc-headers +yum install -y gcc-c++ -yum install c-ares-devel libcurl-devel pcre-devel postgresql-devel +yum install-y c-ares-devel libcurl-devel pcre-devel postgresql-devel From 54baac2516082700ea83d5078ed866aeadf6a467 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 13:53:13 +0800 Subject: [PATCH 088/226] update --- sapi/quickstart/swoole-install/rhel-init-for-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh index ae1314a8b8..f30454cd19 100644 --- a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh @@ -1,4 +1,4 @@ yum install -y glibc-headers yum install -y gcc-c++ -yum install-y c-ares-devel libcurl-devel pcre-devel postgresql-devel +yum install-y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC From 22ff4eff3b00014a19012a31d0862cd4b1ea4483 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 13:54:22 +0800 Subject: [PATCH 089/226] update --- sapi/quickstart/swoole-install/rhel-init-for-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh index f30454cd19..097a759060 100644 --- a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh @@ -1,4 +1,4 @@ yum install -y glibc-headers yum install -y gcc-c++ -yum install-y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC +yum install-y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC brotli-devel From 52c34e1cf9e586a61950febc1c7b439b5b00969b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 13:54:46 +0800 Subject: [PATCH 090/226] update --- sapi/quickstart/swoole-install/rhel-init-for-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh index 097a759060..a98a8fa1c0 100644 --- a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh @@ -1,4 +1,4 @@ yum install -y glibc-headers yum install -y gcc-c++ -yum install-y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC brotli-devel +yum install -y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC brotli-devel From e839496b11e165663f647c118fcd612e3ebd09c9 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:19:03 +0800 Subject: [PATCH 091/226] update --- .../quickstart/swoole-install/build-swoole.sh | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index e74a5a6b6c..c2622c65c9 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -2,8 +2,9 @@ set -x mkdir -p /tmp/build +# shellcheck disable=SC2164 cd /tmp/build/ -test -d swoole-src && rm -rf ./swoole-src +test -d swoole-src && rm -rf ./swoole-src ; MIRROR='' @@ -41,30 +42,41 @@ esac cd swoole-src UNIXODBC_PREFIX='/usr/' +SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" OS=$(uname -s) ARCH=$(uname -m) case "$OS-$ARCH" in 'Darwin-x86_64') export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ UNIXODBC_PREFIX='/usr/local/opt/unixodbc/' + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" ;; 'Darwin-arm64') export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ UNIXODBC_PREFIX='/opt/homebrew/opt/unixodbc/' + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" + ;; + 'Linux-*') + OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') + case "$OS_RELEASE" in + 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) + SWOOLE_ODBC_OPTIONS='' + esac ;; *) ;; esac -OPTIONS=''; + +SWOOLE_DEBUG_OPTIONS=''; if [ $DEBUG -eq 1 ] ;then - OPTIONS=' --enable-debug --enable-debug-log --enable-trace-log ' + SWOOLE_DEBUG_OPTIONS=' --enable-debug --enable-debug-log --enable-trace-log ' fi phpize ./configure \ -$OPTIONS \ +"${SWOOLE_DEBUG_OPTIONS}" \ --enable-openssl \ --enable-sockets \ --enable-mysqlnd \ @@ -72,7 +84,7 @@ $OPTIONS \ --enable-swoole-curl \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ ---with-swoole-odbc="unixODBC,${UNIXODBC_PREFIX}" \ +"${SWOOLE_ODBC_OPTIONS}" \ From 54b79adc5a69bb9ef5cf55b865811edeb3c1cbb8 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:20:20 +0800 Subject: [PATCH 092/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index c2622c65c9..f2c87b46ef 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -76,7 +76,7 @@ fi phpize ./configure \ -"${SWOOLE_DEBUG_OPTIONS}" \ +${SWOOLE_DEBUG_OPTIONS} \ --enable-openssl \ --enable-sockets \ --enable-mysqlnd \ @@ -84,7 +84,7 @@ phpize --enable-swoole-curl \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ -"${SWOOLE_ODBC_OPTIONS}" \ +${SWOOLE_ODBC_OPTIONS} \ From ac59237ce0eb133d5c6a7cd65fe5b5264d9b53d7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:21:37 +0800 Subject: [PATCH 093/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index f2c87b46ef..afd6dd0b7e 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -61,6 +61,7 @@ case "$OS-$ARCH" in case "$OS_RELEASE" in 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) SWOOLE_ODBC_OPTIONS='' + ;; esac ;; *) From 9077f5464a0ab9f83c87e587563a8fbcc41ae56c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:22:40 +0800 Subject: [PATCH 094/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index afd6dd0b7e..ab5ada425e 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -56,7 +56,7 @@ case "$OS-$ARCH" in UNIXODBC_PREFIX='/opt/homebrew/opt/unixodbc/' SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" ;; - 'Linux-*') +"Linux-*") OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') case "$OS_RELEASE" in 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) From f6042076930954b4d09cbd20c2efd3c219f2e9d1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:25:02 +0800 Subject: [PATCH 095/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index ab5ada425e..048acba6d2 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -60,7 +60,7 @@ case "$OS-$ARCH" in OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') case "$OS_RELEASE" in 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) - SWOOLE_ODBC_OPTIONS='' + SWOOLE_ODBC_OPTIONS="" ;; esac ;; From d87f3072d0ab5fe4a1438bce26116912a07f15ea Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:25:53 +0800 Subject: [PATCH 096/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index 048acba6d2..f9bd819ead 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -58,11 +58,15 @@ case "$OS-$ARCH" in ;; "Linux-*") OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') + case "$OS_RELEASE" in 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) SWOOLE_ODBC_OPTIONS="" ;; esac + echo "$OS_RELEASE" + echo $SWOOLE_ODBC_OPTIONS + ;; *) ;; From 2f4812939e5fe18e3820202876a5fe1ea83a915a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:27:12 +0800 Subject: [PATCH 097/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index f9bd819ead..e73aa29a3e 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -56,7 +56,7 @@ case "$OS-$ARCH" in UNIXODBC_PREFIX='/opt/homebrew/opt/unixodbc/' SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" ;; -"Linux-*") +Linux-*) OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') case "$OS_RELEASE" in From 1a3370020614a6b4f0fc889256bfbe099202d012 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:30:04 +0800 Subject: [PATCH 098/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 8 ++------ sapi/quickstart/swoole-install/rhel-init-for-swoole.sh | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index e73aa29a3e..b54b34787b 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -46,27 +46,23 @@ SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" OS=$(uname -s) ARCH=$(uname -m) case "$OS-$ARCH" in -'Darwin-x86_64') +Darwin-x86_64) export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ UNIXODBC_PREFIX='/usr/local/opt/unixodbc/' SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" ;; -'Darwin-arm64') +Darwin-arm64) export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ UNIXODBC_PREFIX='/opt/homebrew/opt/unixodbc/' SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" ;; Linux-*) OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') - case "$OS_RELEASE" in 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) SWOOLE_ODBC_OPTIONS="" ;; esac - echo "$OS_RELEASE" - echo $SWOOLE_ODBC_OPTIONS - ;; *) ;; diff --git a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh index a98a8fa1c0..51f100e171 100644 --- a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh @@ -1,4 +1,4 @@ yum install -y glibc-headers yum install -y gcc-c++ -yum install -y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC brotli-devel +yum install -y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC brotli-devel sqlite-devel From 6dbb3c76951f5efc651503cb54dbbd269947faba Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 14:56:13 +0800 Subject: [PATCH 099/226] update --- sapi/quickstart/README.md | 5 +++++ sapi/quickstart/ssh-r-example.sh | 20 ------------------- .../quickstart/swoole-install/build-swoole.sh | 2 +- 3 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 sapi/quickstart/ssh-r-example.sh diff --git a/sapi/quickstart/README.md b/sapi/quickstart/README.md index 1bd6250640..3310d403c0 100644 --- a/sapi/quickstart/README.md +++ b/sapi/quickstart/README.md @@ -118,3 +118,8 @@ bash make.sh archive 1. [PHP 7.4.x 升级到 PHP 8.0.x 的变更](https://www.php.net/manual/zh/migration80.php) ## [PHP 版本查看](https://github.com/php/php-src/tags) + +## 容器仓库 + +1. [dockerhub](https://hub.docker.com/search?image_filter=official) +1. [开放原子容器镜像仓库](https://hub.atomgit.com/) diff --git a/sapi/quickstart/ssh-r-example.sh b/sapi/quickstart/ssh-r-example.sh deleted file mode 100644 index ea120ad15d..0000000000 --- a/sapi/quickstart/ssh-r-example.sh +++ /dev/null @@ -1,20 +0,0 @@ -ip='sdn.jingjingxyk.com' -keyfile=/home/jingingxyk/private-key.pem - -{ - ssh -o StrictHostKeyChecking=no \ - -o ExitOnForwardFailure=yes \ - -o TCPKeepAlive=yes \ - -o ServerAliveInterval=15 \ - -o ServerAliveCountMax=3 \ - -i $keyfile \ - -v -CTgN \ - -R 172.23.149.62:2000:127.0.0.1:9501 \ - root@$ip -} || { - echo $? - -} - - -# curl -x socks5h://127.0.0.1:2000 -v https://www.google.com diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index b54b34787b..7ff067f730 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -76,6 +76,7 @@ fi phpize + ./configure \ ${SWOOLE_DEBUG_OPTIONS} \ --enable-openssl \ @@ -88,7 +89,6 @@ ${SWOOLE_DEBUG_OPTIONS} \ ${SWOOLE_ODBC_OPTIONS} \ - # --enable-swoole-thread \ # --enable-iouring From 8c2e45ce306f52cb6523c11565410391f76c1994 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 15:20:00 +0800 Subject: [PATCH 100/226] update --- .../quickstart/swoole-install/build-swoole.sh | 50 +++++++++++++------ .../swoole-install/debian-init-for-swoole.sh | 2 +- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index 7ff067f730..801e18f798 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -4,12 +4,13 @@ mkdir -p /tmp/build # shellcheck disable=SC2164 cd /tmp/build/ -test -d swoole-src && rm -rf ./swoole-src ; MIRROR='' DEBUG=0 ENABLE_TEST=0 +VERSION_LATEST=0 + while [ $# -gt 0 ]; do case "$1" in --mirror) @@ -18,6 +19,9 @@ while [ $# -gt 0 ]; do --debug) DEBUG=1 ;; + --latest) + VERSION_LATEST=1 + ;; --test) ENABLE_TEST=1 ;; @@ -28,40 +32,54 @@ while [ $# -gt 0 ]; do shift $(($# > 0 ? 1 : 0)) done +# 保持源码最新 +test $VERSION_LATEST -eq 1 && test -d swoole-src && rm -rf swoole-src + case "$MIRROR" in china ) - git clone -b master --single-branch --depth=1 https://gitee.com/swoole/swoole.git swoole-src + test -d swoole-src || git clone -b master --single-branch --depth=1 https://gitee.com/swoole/swoole.git swoole-src ;; *) - git clone -b master --single-branch --depth=1 https://github.com/swoole/swoole-src.git + test -d swoole-src || git clone -b master --single-branch --depth=1 https://github.com/swoole/swoole-src.git ;; esac -cd swoole-src +SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,/usr\"" +SWOOLE_IO_URING='' +SWOOLE_DEBUG_OPTIONS=''; +SWOOLE_THREAD_OPTION=''; + +if [ $DEBUG -eq 1 ] ;then + SWOOLE_DEBUG_OPTIONS=' --enable-debug --enable-debug-log --enable-trace-log ' +fi + +# shellcheck disable=SC2046 +if [ $(php -r "echo PHP_ZTS;") -eq 1 ] ; then + SWOOLE_THREAD_OPTION="--enable-swoole-thread" +fi -UNIXODBC_PREFIX='/usr/' -SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" OS=$(uname -s) ARCH=$(uname -m) case "$OS-$ARCH" in Darwin-x86_64) export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ - UNIXODBC_PREFIX='/usr/local/opt/unixodbc/' - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,/usr/local/opt/unixodbc/\"" ;; Darwin-arm64) export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ - UNIXODBC_PREFIX='/opt/homebrew/opt/unixodbc/' - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,${UNIXODBC_PREFIX}\"" + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,/opt/homebrew/opt/unixodbc/\"" ;; Linux-*) OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') case "$OS_RELEASE" in 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) - SWOOLE_ODBC_OPTIONS="" - ;; + SWOOLE_ODBC_OPTIONS="" + ;; + 'debian' | 'ubuntu' ) + SWOOLE_IO_URING=' --enable-iouring ' + ;; esac ;; *) @@ -69,12 +87,10 @@ Linux-*) esac -SWOOLE_DEBUG_OPTIONS=''; -if [ $DEBUG -eq 1 ] ;then - SWOOLE_DEBUG_OPTIONS=' --enable-debug --enable-debug-log --enable-trace-log ' -fi +cd swoole-src + phpize ./configure \ @@ -87,6 +103,8 @@ ${SWOOLE_DEBUG_OPTIONS} \ --enable-swoole-pgsql \ --enable-swoole-sqlite \ ${SWOOLE_ODBC_OPTIONS} \ +${SWOOLE_IO_URING} \ +${SWOOLE_THREAD_OPTION} # --enable-swoole-thread \ diff --git a/sapi/quickstart/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/swoole-install/debian-init-for-swoole.sh index c87a1900f4..4e15348050 100644 --- a/sapi/quickstart/swoole-install/debian-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/debian-init-for-swoole.sh @@ -1,3 +1,3 @@ apt-get install -y libc-ares-dev libcurl4-openssl-dev apt-get install -y libpcre3 libpcre3-dev libpq-dev libsqlite3-dev unixodbc-dev -apt-get install -y libbrotli-dev +apt-get install -y libbrotli-dev liburing-dev From 41f2f58d4eaa52ad75f36ad11af41346654c3e8b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 15:21:52 +0800 Subject: [PATCH 101/226] update --- sapi/quickstart/swoole-install/alpine-init-for-swoole.sh | 2 +- sapi/quickstart/swoole-install/build-swoole.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh index 8d7a9ac700..2ed431cf5b 100644 --- a/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh @@ -1,2 +1,2 @@ apk add autoconf automake make libtool cmake bison re2c gcc g++ -apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc-dev +apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc-dev liburing-dev diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index 801e18f798..aba93ddaeb 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -77,7 +77,7 @@ Linux-*) 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) SWOOLE_ODBC_OPTIONS="" ;; - 'debian' | 'ubuntu' ) + 'debian' | 'ubuntu' | 'alpine' ) SWOOLE_IO_URING=' --enable-iouring ' ;; esac From bb11cc2440dd0b193b8fe45ec7c0151b6c87c915 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 15:26:17 +0800 Subject: [PATCH 102/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index aba93ddaeb..d353aac78e 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -46,7 +46,7 @@ esac -SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,/usr\"" +SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/usr" SWOOLE_IO_URING='' SWOOLE_DEBUG_OPTIONS=''; SWOOLE_THREAD_OPTION=''; @@ -65,11 +65,11 @@ ARCH=$(uname -m) case "$OS-$ARCH" in Darwin-x86_64) export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,/usr/local/opt/unixodbc/\"" + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/usr/local/opt/unixodbc/" ;; Darwin-arm64) export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=\"unixODBC,/opt/homebrew/opt/unixodbc/\"" + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/opt/homebrew/opt/unixodbc/" ;; Linux-*) OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') From 9447024bce2d26f02d0e0828a55b1f06c81f298c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 15:29:17 +0800 Subject: [PATCH 103/226] update --- sapi/quickstart/swoole-install/alpine-init-for-swoole.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh index 2ed431cf5b..dbbcff1165 100644 --- a/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh +++ b/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh @@ -1,2 +1,2 @@ apk add autoconf automake make libtool cmake bison re2c gcc g++ -apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc-dev liburing-dev +apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc-dev liburing-dev linux-headers From 6cd630d144554e8ac0abd7df9630b965df7947c4 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 15:37:31 +0800 Subject: [PATCH 104/226] update --- sapi/quickstart/swoole-install/build-swoole.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/build-swoole.sh index d353aac78e..84fba1582b 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/build-swoole.sh @@ -74,10 +74,10 @@ Darwin-arm64) Linux-*) OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') case "$OS_RELEASE" in - 'rocky' | 'almalinux' | 'rhel' | 'centos' | 'fedora' ) - SWOOLE_ODBC_OPTIONS="" + 'rocky' | 'almalinux' ) # | 'rhel' | 'centos' | 'fedora' # 未测试 + SWOOLE_ODBC_OPTIONS="" # 缺少 unixODBC-devel ;; - 'debian' | 'ubuntu' | 'alpine' ) + 'debian' | 'ubuntu' ) # | 'alpine' # 构建报错 SWOOLE_IO_URING=' --enable-iouring ' ;; esac From dfc7b214e06e1e5ee65a1771201f08075d625770 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 16:55:43 +0800 Subject: [PATCH 105/226] update --- sapi/quickstart/linux/extra/debian-php-init.sh | 2 +- sapi/quickstart/swoole-install/FAQ.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 sapi/quickstart/swoole-install/FAQ.md diff --git a/sapi/quickstart/linux/extra/debian-php-init.sh b/sapi/quickstart/linux/extra/debian-php-init.sh index 27832f963c..6b66685e34 100644 --- a/sapi/quickstart/linux/extra/debian-php-init.sh +++ b/sapi/quickstart/linux/extra/debian-php-init.sh @@ -2,7 +2,7 @@ apt install -y php-cli php-pear php-dev php-curl php-intl apt install -y php-mbstring php-tokenizer php-xml -# apt install -y php-mysqlnd php-pgsql php-sqlite3 php-redis php-mongodb +apt install -y php-mysqlnd php-pgsql php-sqlite3 php-redis php-mongodb # curl -Lo /usr/local/bin/composer.phar https://getcomposer.org/download/latest-stable/composer.phar # ln -sf /usr/local/bin/composer.phar /usr/local/bin/composer diff --git a/sapi/quickstart/swoole-install/FAQ.md b/sapi/quickstart/swoole-install/FAQ.md new file mode 100644 index 0000000000..d806410192 --- /dev/null +++ b/sapi/quickstart/swoole-install/FAQ.md @@ -0,0 +1,7 @@ +## 配置扩展加载优先级 + 每个扩展配置一个配置文件 + 配置文件名称以数字开头 , .ini结尾 + +## php.ini 配置文件 curl、socks5、mysqld 扩展应该在 swoole 扩展之前加载 + https://github.com/swoole/swoole-src/issues/4085 + From f30c13f71834a695b21188cd4aa3e5d1d2ad494f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 16:57:17 +0800 Subject: [PATCH 106/226] update --- sapi/quickstart/linux/extra/alpine-php-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/alpine-php-init.sh b/sapi/quickstart/linux/extra/alpine-php-init.sh index 0e3259a863..4f06533c2e 100644 --- a/sapi/quickstart/linux/extra/alpine-php-init.sh +++ b/sapi/quickstart/linux/extra/alpine-php-init.sh @@ -1,3 +1,3 @@ apk add php-cli php81-dev -apk add php-iconv php-mbstring php-phar php-openssl php-posix php-curl php-tokenizer php-dom php-xmlwriter php-xml php-simplexml +apk add php-iconv php-mbstring php-phar php-openssl php-posix php-curl php-tokenizer php-dom php-xmlwriter php-xml php-simplexml php-mysqlnd From c8f0e22b788e4e20dd52c4100dfbb8a2bb1409aa Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 16:59:05 +0800 Subject: [PATCH 107/226] update --- sapi/quickstart/linux/extra/alpine-php-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/alpine-php-init.sh b/sapi/quickstart/linux/extra/alpine-php-init.sh index 4f06533c2e..85a1bac37c 100644 --- a/sapi/quickstart/linux/extra/alpine-php-init.sh +++ b/sapi/quickstart/linux/extra/alpine-php-init.sh @@ -1,3 +1,3 @@ -apk add php-cli php81-dev +apk add php82-cli php82-dev apk add php-iconv php-mbstring php-phar php-openssl php-posix php-curl php-tokenizer php-dom php-xmlwriter php-xml php-simplexml php-mysqlnd From b9586482de240ecf37ccc0ba80ef48287ce9f6b8 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 17:04:26 +0800 Subject: [PATCH 108/226] update --- sapi/quickstart/linux/extra/alpine-php-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/extra/alpine-php-init.sh b/sapi/quickstart/linux/extra/alpine-php-init.sh index 85a1bac37c..9752a4c19b 100644 --- a/sapi/quickstart/linux/extra/alpine-php-init.sh +++ b/sapi/quickstart/linux/extra/alpine-php-init.sh @@ -1,3 +1,3 @@ apk add php82-cli php82-dev -apk add php-iconv php-mbstring php-phar php-openssl php-posix php-curl php-tokenizer php-dom php-xmlwriter php-xml php-simplexml php-mysqlnd +apk add php82-iconv php82-mbstring php82-phar php82-openssl php82-posix php82-curl php82-tokenizer php82-dom php82-xmlwriter php82-xml php82-simplexml php82-mysqlnd From fb6b1ee4d73969e0acaffe9812b4923c4b7d3b32 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 17:10:30 +0800 Subject: [PATCH 109/226] update --- sapi/quickstart/linux/extra/debian-php-init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapi/quickstart/linux/extra/debian-php-init.sh b/sapi/quickstart/linux/extra/debian-php-init.sh index 6b66685e34..d781e7dcc5 100644 --- a/sapi/quickstart/linux/extra/debian-php-init.sh +++ b/sapi/quickstart/linux/extra/debian-php-init.sh @@ -1,3 +1,6 @@ +export DEBIAN_FRONTEND=noninteractive +export TZ="Etc/UTC" +ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone apt install -y php-cli php-pear php-dev php-curl php-intl apt install -y php-mbstring php-tokenizer php-xml From b302c1c578e43985e4bc00f57f9257fc4186259c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 19:15:45 +0800 Subject: [PATCH 110/226] update --- .../quickstart/linux/extra/alpine-php-init.sh | 20 ++++++++++++++++-- .../quickstart/linux/extra/debian-php-init.sh | 4 ++++ sapi/quickstart/macos/extra/php-init.sh | 4 ++++ sapi/quickstart/swoole-install/FAQ.md | 20 ++++++++++++++++++ sapi/quickstart/swoole-install/README.md | 21 +++++++++++++++++++ .../{build-swoole.sh => install.sh} | 17 ++++++++++++++- 6 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 sapi/quickstart/swoole-install/README.md rename sapi/quickstart/swoole-install/{build-swoole.sh => install.sh} (84%) diff --git a/sapi/quickstart/linux/extra/alpine-php-init.sh b/sapi/quickstart/linux/extra/alpine-php-init.sh index 9752a4c19b..6aa87e21dd 100644 --- a/sapi/quickstart/linux/extra/alpine-php-init.sh +++ b/sapi/quickstart/linux/extra/alpine-php-init.sh @@ -1,3 +1,19 @@ -apk add php82-cli php82-dev -apk add php82-iconv php82-mbstring php82-phar php82-openssl php82-posix php82-curl php82-tokenizer php82-dom php82-xmlwriter php82-xml php82-simplexml php82-mysqlnd +apk add php82-cli php82-dev +apk add php82-iconv php82-mbstring php82-phar php82-openssl +apk add php82-posix php82-tokenizer php82-intl +apk add php82-dom php82-xmlwriter php82-xml php82-simplexml +apk add php82-pdo php82-sockets php82-curl php82-mysqlnd php82-pgsql php82-sqlite3 +apk add php82-redis php82-mongodb + +# curl -Lo /usr/local/bin/composer.phar https://getcomposer.org/download/latest-stable/composer.phar +# ln -sf /usr/local/bin/composer.phar /usr/local/bin/composer +# chmod a+x /usr/local/bin/composer + +php82 -v +php82 --ini +php --ini | grep ".ini files" + +ln -sf /usr/bin/php82 /usr/bin/php +ln -sf /usr/bin/phpize82 /usr/bin/phpize +ln -sf /usr/bin/php-config82 /usr/bin/php-config diff --git a/sapi/quickstart/linux/extra/debian-php-init.sh b/sapi/quickstart/linux/extra/debian-php-init.sh index d781e7dcc5..c7836e5711 100644 --- a/sapi/quickstart/linux/extra/debian-php-init.sh +++ b/sapi/quickstart/linux/extra/debian-php-init.sh @@ -10,3 +10,7 @@ apt install -y php-mysqlnd php-pgsql php-sqlite3 php-redis php-mongodb # curl -Lo /usr/local/bin/composer.phar https://getcomposer.org/download/latest-stable/composer.phar # ln -sf /usr/local/bin/composer.phar /usr/local/bin/composer # chmod a+x /usr/local/bin/composer + +php -v +php -ini +php --ini | grep ".ini files" diff --git a/sapi/quickstart/macos/extra/php-init.sh b/sapi/quickstart/macos/extra/php-init.sh index 3b0b5d6258..ebf7430dac 100644 --- a/sapi/quickstart/macos/extra/php-init.sh +++ b/sapi/quickstart/macos/extra/php-init.sh @@ -18,3 +18,7 @@ export HOMEBREW_INSTALL_FROM_API=1 brew install php +php -v +php -ini +php --ini | grep ".ini files" +php --ini | grep "Scan for additional .ini files in:" diff --git a/sapi/quickstart/swoole-install/FAQ.md b/sapi/quickstart/swoole-install/FAQ.md index d806410192..2ee3b751ae 100644 --- a/sapi/quickstart/swoole-install/FAQ.md +++ b/sapi/quickstart/swoole-install/FAQ.md @@ -5,3 +5,23 @@ ## php.ini 配置文件 curl、socks5、mysqld 扩展应该在 swoole 扩展之前加载 https://github.com/swoole/swoole-src/issues/4085 + +```bash + +# 查看配置所在目录 +php --ini | grep ".ini files" + +PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) + +if [ ${OS} == 'Linux' ] && [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then + tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF +extension=swoole.so +swoole.use_shortname=Off +EOF + +fi + +php --ri swoole + +``` + diff --git a/sapi/quickstart/swoole-install/README.md b/sapi/quickstart/swoole-install/README.md new file mode 100644 index 0000000000..67be0a57f9 --- /dev/null +++ b/sapi/quickstart/swoole-install/README.md @@ -0,0 +1,21 @@ +# 快速安装 swoole + + +## 安装 +1. linux +2. maoc + +### linux +#### debian +1. debian +1. ubuntu + +### rhel +1. rockylinux +1. almalinux +1. redhat +1. +### other + + +### diff --git a/sapi/quickstart/swoole-install/build-swoole.sh b/sapi/quickstart/swoole-install/install.sh similarity index 84% rename from sapi/quickstart/swoole-install/build-swoole.sh rename to sapi/quickstart/swoole-install/install.sh index 84fba1582b..30f1c6c269 100644 --- a/sapi/quickstart/swoole-install/build-swoole.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -104,9 +104,10 @@ ${SWOOLE_DEBUG_OPTIONS} \ --enable-swoole-sqlite \ ${SWOOLE_ODBC_OPTIONS} \ ${SWOOLE_IO_URING} \ -${SWOOLE_THREAD_OPTION} +${SWOOLE_THREAD_OPTION} \ +# --with-php-config=/usr/bin/php-config # --enable-swoole-thread \ # --enable-iouring @@ -116,3 +117,17 @@ make # -j $(`nproc 2> /dev/null || sysctl -n hw.ncpu`) test $ENABLE_TEST -eq 1 && make test make install + + +PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) + +if [ ${OS} == 'Linux' ] && [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then + tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF +extension=swoole.so +swoole.use_shortname=Off +EOF +fi + +php -v +php --ini +php --ini | grep ".ini files" From d6208ff541dedfd81f704f3a29b9cf7f7af70a45 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 19:19:46 +0800 Subject: [PATCH 111/226] update --- sapi/quickstart/swoole-install/FAQ.md | 2 ++ sapi/quickstart/swoole-install/install.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sapi/quickstart/swoole-install/FAQ.md b/sapi/quickstart/swoole-install/FAQ.md index 2ee3b751ae..d83a051be4 100644 --- a/sapi/quickstart/swoole-install/FAQ.md +++ b/sapi/quickstart/swoole-install/FAQ.md @@ -11,9 +11,11 @@ # 查看配置所在目录 php --ini | grep ".ini files" +# 配置 90-swoole.ini PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) if [ ${OS} == 'Linux' ] && [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then + tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF extension=swoole.so swoole.use_shortname=Off diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index 30f1c6c269..67429fae82 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -122,10 +122,12 @@ make install PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) if [ ${OS} == 'Linux' ] && [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then + tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF extension=swoole.so swoole.use_shortname=Off EOF + fi php -v From 8305ac41a063602e657020cb43a5cff7a9793643 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 19:30:26 +0800 Subject: [PATCH 112/226] update --- sapi/quickstart/swoole-install/FAQ.md | 21 +++++++++++++++------ sapi/quickstart/swoole-install/install.sh | 8 ++++++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/sapi/quickstart/swoole-install/FAQ.md b/sapi/quickstart/swoole-install/FAQ.md index d83a051be4..b0fbd695a8 100644 --- a/sapi/quickstart/swoole-install/FAQ.md +++ b/sapi/quickstart/swoole-install/FAQ.md @@ -1,10 +1,16 @@ -## 配置扩展加载优先级 - 每个扩展配置一个配置文件 - 配置文件名称以数字开头 , .ini结尾 +## 查看扩展加载顺序 + +```bash + +ls -lh `php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs` + +``` ## php.ini 配置文件 curl、socks5、mysqld 扩展应该在 swoole 扩展之前加载 https://github.com/swoole/swoole-src/issues/4085 + 编译php 时 扫描目录配置 --with-config-file-scan-dir + ```bash @@ -14,9 +20,12 @@ php --ini | grep ".ini files" # 配置 90-swoole.ini PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) -if [ ${OS} == 'Linux' ] && [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then - - tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF +if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then + SUDO='' + if [ ! -w "${PHP_INI_SCAN_DIR}" ] ; then + SUDO='sudo' + fi + ${SUDO} tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF extension=swoole.so swoole.use_shortname=Off EOF diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index 67429fae82..2bb3bf425a 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -121,9 +121,13 @@ make install PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) -if [ ${OS} == 'Linux' ] && [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then +if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then + SUDO='' + if [ ! -w "${PHP_INI_SCAN_DIR}" ] ; then + SUDO='sudo' + fi - tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF + ${SUDO} tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF extension=swoole.so swoole.use_shortname=Off EOF From bb7d1ba8ebd74ea0fcc870ca3a05571df09787cf Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 20:02:06 +0800 Subject: [PATCH 113/226] update --- sapi/quickstart/swoole-install/install.sh | 39 ++++++++++++++++------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index 2bb3bf425a..2730a678d7 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -1,5 +1,13 @@ #!/usr/bin/env bash set -x + + + + + + + + mkdir -p /tmp/build # shellcheck disable=SC2164 @@ -60,18 +68,25 @@ if [ $(php -r "echo PHP_ZTS;") -eq 1 ] ; then SWOOLE_THREAD_OPTION="--enable-swoole-thread" fi +CPU_LOGICAL_PROCESSORS=4 OS=$(uname -s) ARCH=$(uname -m) -case "$OS-$ARCH" in -Darwin-x86_64) - export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/usr/local/opt/unixodbc/" - ;; -Darwin-arm64) - export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/opt/homebrew/opt/unixodbc/" +case "$OS" in +Darwin) + CPU_LOGICAL_PROCESSORS=$(sysctl -n hw.ncpu) + case "$ARCH" in + x86_64) + export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/usr/local/opt/unixodbc/" + ;; + arm64) + export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ + SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/opt/homebrew/opt/unixodbc/" + ;; + esac ;; -Linux-*) +Linux) + CPU_LOGICAL_PROCESSORS=$(grep "processor" /proc/cpuinfo | sort -u | wc -l) OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') case "$OS_RELEASE" in 'rocky' | 'almalinux' ) # | 'rhel' | 'centos' | 'fedora' # 未测试 @@ -88,7 +103,6 @@ esac - cd swoole-src phpize @@ -112,13 +126,16 @@ ${SWOOLE_THREAD_OPTION} \ # --enable-iouring -make # -j $(`nproc 2> /dev/null || sysctl -n hw.ncpu`) +make -j $(CPU_LOGICAL_PROCESSORS) test $ENABLE_TEST -eq 1 && make test make install + +# 创建 swoole.ini + PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then From f00331c0256a5d81255e1a495af9833cdb3d6edf Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 20:05:47 +0800 Subject: [PATCH 114/226] update --- sapi/quickstart/swoole-install/install.sh | 1 + sapi/src/builder/library/libyuv.php | 0 2 files changed, 1 insertion(+) create mode 100644 sapi/src/builder/library/libyuv.php diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index 2730a678d7..a34b0d5da5 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -154,3 +154,4 @@ fi php -v php --ini php --ini | grep ".ini files" +php --ri swoole diff --git a/sapi/src/builder/library/libyuv.php b/sapi/src/builder/library/libyuv.php new file mode 100644 index 0000000000..e69de29bb2 From 018574e5e63233ae82dd74b7cc57acd31a0b7fdd Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 20:43:39 +0800 Subject: [PATCH 115/226] update --- sapi/quickstart/swoole-install/install.sh | 17 ++++++-- sapi/src/builder/extension/common.php | 1 + sapi/src/builder/library/libyuv.php | 50 +++++++++++++++++++++++ sapi/src/constants.php | 1 + 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index a34b0d5da5..3e95ccf6a3 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -1,10 +1,19 @@ #!/usr/bin/env bash set -x - - - - +PHP=$(which php) +PHPIZE=$(which phpize) +PHP_CONFIG=$(which php-config) + + +if test -x "${PHP}" -a -x "${PHPIZE}" -a -x "${PHP_CONFIG}" ; then + ${PHP} -v + ${PHPIZE} --help + ${PHP_CONFIG} --help +else + echo 'no found PHP ' + exit 0 +fi diff --git a/sapi/src/builder/extension/common.php b/sapi/src/builder/extension/common.php index b26f853499..26602ce0d1 100644 --- a/sapi/src/builder/extension/common.php +++ b/sapi/src/builder/extension/common.php @@ -195,6 +195,7 @@ $depends = ['v4l_utils'] ; $depends = ['prometheus_client_c'] ; $depends = ['liboauth2'] ; + $depends = ['libyuv'] ; $ext = (new Extension('common')) diff --git a/sapi/src/builder/library/libyuv.php b/sapi/src/builder/library/libyuv.php index e69de29bb2..7d8eea43fb 100644 --- a/sapi/src/builder/library/libyuv.php +++ b/sapi/src/builder/library/libyuv.php @@ -0,0 +1,50 @@ +withHomePage('https://chromium.googlesource.com/libyuv/libyuv') + ->withLicense('https://chromium.googlesource.com/libyuv/libyuv/+/refs/heads/main/LICENSE', Library::LICENSE_SPEC) + ->withManual('https://chromium.googlesource.com/libyuv/libyuv') + ->withFile('libyuv-latest.tar.gz') + ->withDownloadScript( + 'libyuv', + <<withPreInstallCommand( + 'alpine', + <<withPrefix($libyuv_prefix) + + ->withBuildCached(false) + + ->withInstallCached(false) + + ->withBuildScript( + <<withPkgName('libexample') + ->withBinPath($libyuv_prefix . '/bin/') + ->withDependentLibraries('zlib', 'openssl') + + ; + $p->addLibrary($lib); + +}; diff --git a/sapi/src/constants.php b/sapi/src/constants.php index 07c5a155a8..6f031a093b 100644 --- a/sapi/src/constants.php +++ b/sapi/src/constants.php @@ -339,5 +339,6 @@ define("V4L_UTILS_PREFIX", $p->getGlobalPrefix() . '/v4l_utils'); define("LIBOAUTH2_PREFIX", $p->getGlobalPrefix() . '/liboauth2'); define("CJOSE_PREFIX", $p->getGlobalPrefix() . '/cjose'); +define("LIBYUV_PREFIX", $p->getGlobalPrefix() . '/libyuv'); define("EXAMPLE_PREFIX", $p->getGlobalPrefix() . '/example'); From 9d915b83ec74c9a9e7cedf0e1dc7b608789562ab Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 20:45:42 +0800 Subject: [PATCH 116/226] update --- sapi/quickstart/swoole-install/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index 3e95ccf6a3..698cb3d649 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -135,7 +135,7 @@ ${SWOOLE_THREAD_OPTION} \ # --enable-iouring -make -j $(CPU_LOGICAL_PROCESSORS) +make -j ${CPU_LOGICAL_PROCESSORS} test $ENABLE_TEST -eq 1 && make test From 73438aa8e0828ded753294978a5e95d7ddbb9975 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Fri, 12 Jul 2024 23:49:15 +0800 Subject: [PATCH 117/226] update --- sapi/src/builder/extension/common.php | 2 +- sapi/src/builder/library/depot_tools.php | 51 +++++++++++++++ sapi/src/builder/library/gn.php | 45 +++++++++++++ sapi/src/builder/library/libyuv.php | 64 ++++++++++++++----- .../builder/library_shared/depot_tools.php | 1 - sapi/src/constants.php | 1 + setup-privoxy-runtime.sh | 36 +++++++++-- 7 files changed, 179 insertions(+), 21 deletions(-) create mode 100644 sapi/src/builder/library/depot_tools.php create mode 100644 sapi/src/builder/library/gn.php diff --git a/sapi/src/builder/extension/common.php b/sapi/src/builder/extension/common.php index 26602ce0d1..6bbb31aa0f 100644 --- a/sapi/src/builder/extension/common.php +++ b/sapi/src/builder/extension/common.php @@ -195,7 +195,7 @@ $depends = ['v4l_utils'] ; $depends = ['prometheus_client_c'] ; $depends = ['liboauth2'] ; - $depends = ['libyuv'] ; + $depends = ['depot_tools','libyuv'] ; $ext = (new Extension('common')) diff --git a/sapi/src/builder/library/depot_tools.php b/sapi/src/builder/library/depot_tools.php new file mode 100644 index 0000000000..0b891cc494 --- /dev/null +++ b/sapi/src/builder/library/depot_tools.php @@ -0,0 +1,51 @@ +withHomePage('https://chromium.googlesource.com/chromium/tools/depot_tools') + ->withLicense( + 'https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main/LICENSE', + Library::LICENSE_SPEC + ) + ->withManual('https://gn.googlesource.com/gn') + ->withManual( + 'https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up' + ) + ->withFile('depot_tools-latest.tar.gz') + ->withDownloadScript( + 'depot-tools-latest', + <<withPrefix($depot_tools_prefix) + ->withBuildCached(false) + //->withAutoUpdateFile() + ->withBuildScript( + <<getGlobalPrefix()} + # 禁止 DEPOT_TOOLS 自动更新 + export DEPOT_TOOLS_UPDATE=0 + +EOF + ) + ->withBinPath($depot_tools_prefix) + ->disableDefaultLdflags() + ->disablePkgName() + ->disableDefaultPkgConfig() + ->withSkipBuildLicense(); + + $p->addLibrary($lib); +}; diff --git a/sapi/src/builder/library/gn.php b/sapi/src/builder/library/gn.php new file mode 100644 index 0000000000..fc2fa7308d --- /dev/null +++ b/sapi/src/builder/library/gn.php @@ -0,0 +1,45 @@ +withHomePage('https://gn.googlesource.com/gn') + ->withLicense( + 'https://gn.googlesource.com/gn/+/refs/heads/main/LICENSE', + Library::LICENSE_SPEC + ) + ->withManual('https://gn.googlesource.com/gn') + ->withManual( + 'https://gn.googlesource.com/gn' + ) + ->withFile('gn-latest.tar.gz') + ->withDownloadScript( + 'depot_tools', + <<withPrefix($gn_prefix) + ->withBuildCached(false) + ->withBuildScript( + <<withBinPath($depot_tools_prefix . '/bin/') + ->disableDefaultLdflags() + ->disablePkgName() + ->disableDefaultPkgConfig() + ->withSkipBuildLicense(); + + $p->addLibrary($lib); +}; diff --git a/sapi/src/builder/library/libyuv.php b/sapi/src/builder/library/libyuv.php index 7d8eea43fb..a64959900f 100644 --- a/sapi/src/builder/library/libyuv.php +++ b/sapi/src/builder/library/libyuv.php @@ -4,45 +4,79 @@ use SwooleCli\Preprocessor; return function (Preprocessor $p) { - $libyuv_prefix = EXAMPLE_PREFIX; - $libyuv_prefix = EXAMPLE_PREFIX; - $openssl_prefix = OPENSSL_PREFIX; - $gettext_prefix = GETTEXT_PREFIX; - $cares_prefix = CARES_PREFIX; + $depot_tools_prefix = DEPOT_TOOLS_PREFIX; + $libyuv_prefix = LIBYUV_PREFIX; + $libjpeg_prefix = JPEG_PREFIX; //文件名称 和 库名称一致 $lib = new Library('libyuv'); $lib->withHomePage('https://chromium.googlesource.com/libyuv/libyuv') ->withLicense('https://chromium.googlesource.com/libyuv/libyuv/+/refs/heads/main/LICENSE', Library::LICENSE_SPEC) ->withManual('https://chromium.googlesource.com/libyuv/libyuv') ->withFile('libyuv-latest.tar.gz') + //->withAutoUpdateFile() ->withDownloadScript( 'libyuv', <<withPreInstallCommand( - 'alpine', + ->withDownloadScript( + 'libyuv', <<withPrefix($libyuv_prefix) - + //->withAutoUpdateFile() ->withBuildCached(false) - - ->withInstallCached(false) - + //->withInstallCached(false) ->withBuildScript( <<withBuildScript( + <<withPkgName('libexample') +EOF + ) + ->withScriptAfterInstall( + <<withBinPath($libyuv_prefix . '/bin/') - ->withDependentLibraries('zlib', 'openssl') + ->withDependentLibraries('libjpeg') ; $p->addLibrary($lib); diff --git a/sapi/src/builder/library_shared/depot_tools.php b/sapi/src/builder/library_shared/depot_tools.php index 24e00675e7..e67a31aafe 100644 --- a/sapi/src/builder/library_shared/depot_tools.php +++ b/sapi/src/builder/library_shared/depot_tools.php @@ -24,7 +24,6 @@ ) ->withPrefix($depot_tools_prefix) ->withBuildCached(false) - ->withInstallCached(false) ->withBuildScript( <<getGlobalPrefix() . '/depot_tools'); +define("GN_PREFIX", $p->getGlobalPrefix() . '/gn'); define("HARFBUZZ_PREFIX", $p->getGlobalPrefix() . '/harfbuzz'); diff --git a/setup-privoxy-runtime.sh b/setup-privoxy-runtime.sh index 8d69a2de5c..dbf7995c0d 100644 --- a/setup-privoxy-runtime.sh +++ b/setup-privoxy-runtime.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( @@ -115,7 +115,9 @@ else test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} tar -xvf ${APP_RUNTIME}.tar chmod a+x privoxy/sbin/privoxy - cp -rf ${__PROJECT__}/var/runtime/${APP_NAME} ${__PROJECT__}/bin/runtime/${APP_NAME} + mkdir -p ${__PROJECT__}/bin/runtime/${APP_NAME} + test -d ${__PROJECT__}/bin/runtime/${APP_NAME} && rm -rf ${__PROJECT__}/bin/runtime/${APP_NAME} + cp -rf ${__PROJECT__}/var/runtime/${APP_NAME}/. ${__PROJECT__}/bin/runtime/${APP_NAME} fi cd ${__PROJECT__}/var/runtime @@ -125,15 +127,41 @@ cp -f ${__PROJECT__}/var/runtime/cacert.pem ${__PROJECT__}/bin/runtime/cacert.pe cd ${__PROJECT__}/ + +tee ${__PROJECT__}/bin/runtime/privoxy/privoxy-start.sh <<'EOF' +#!/usr/bin/env bash +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) + +cd ${__DIR__}/ + ./sbin/privoxy --no-daemon etc/config +EOF + + set +x echo " " echo " USE PRIVOXY RUNTIME :" echo " " -echo " export PATH=\"${__PROJECT__}/bin/runtime:\$PATH\" " -echo " " +echo " change file ./bin/runtime/privoxy/etc/config " +echo '' +echo ' listen-address 0.0.0.0:8118' +echo ' forward-socks5 /' +echo " confdir ${__PROJECT__}/bin/runtime/privoxy/etc" +echo " logdir ${__PROJECT__}/bin/runtime/privoxy/var/log/privoxy" +echo '# debug 1' +echo '# debug 512' +echo '# debug 1024' +echo '' echo " cd ./bin/runtime/privoxy " echo " ./sbin/privoxy --no-daemon etc/config " +echo '' +echo ' OR ' +echo '' +echo ' bash bin/runtime/privoxy/start-privoxy.sh' echo " " export PATH="${__PROJECT__}/bin/runtime:$PATH" From 755bccac0eccc5617709a4bf6f26e808d7ed0a01 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 00:38:31 +0800 Subject: [PATCH 118/226] update --- sapi/src/builder/extension/proxychains.php | 7 +++- sapi/src/builder/library/proxychains.php | 8 +++- .../builder/library_shared/proxychains.php | 41 +++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 sapi/src/builder/library_shared/proxychains.php diff --git a/sapi/src/builder/extension/proxychains.php b/sapi/src/builder/extension/proxychains.php index c0eb450200..f8e52180c8 100644 --- a/sapi/src/builder/extension/proxychains.php +++ b/sapi/src/builder/extension/proxychains.php @@ -23,7 +23,7 @@ $cmd = <<getOsType() == 'macos') { $cmd .= <<getOsType() == 'macos' ? ' ' : ' -static '; + $ldflags = $p->getOsType() == 'macos' ? ' ' : ' --static '; + $libsctp = $p->getOsType() == 'macos' ? ' ' : ' libsctp '; + $libcpp = $p->getOsType() == 'macos' ? '-lc++' : ' -lstdc++ '; + $lib = new Library('proxychains'); $lib ->withHomePage('https://github.com/rofl0r/proxychains-ng.git') ->withManual('https://github.com/rofl0r/proxychains-ng.git') @@ -25,7 +31,7 @@ ./configure --help CFLAGS=" -std=gnu11 " \ - LDFLAGS=" -static -std=gnu11 " \ + LDFLAGS=" {$cflags} -std=gnu11 " \ ./configure \ --prefix={$proxychains_prefix} \ --enable-shared=no \ diff --git a/sapi/src/builder/library_shared/proxychains.php b/sapi/src/builder/library_shared/proxychains.php new file mode 100644 index 0000000000..1fa022126e --- /dev/null +++ b/sapi/src/builder/library_shared/proxychains.php @@ -0,0 +1,41 @@ +withHomePage('https://github.com/rofl0r/proxychains-ng.git') + ->withManual('https://github.com/rofl0r/proxychains-ng.git') + ->withLicense('https://github.com/rofl0r/proxychains-ng/blob/master/COPYING', Library::LICENSE_GPL) + ->withFile('proxychains-latest.tar.gz') + ->withDownloadScript( + 'proxychains-ng', + <<withPrefix($proxychains_prefix) + ->withBuildCached(false) + ->withInstallCached(false) + ->withConfigure( + <<withBinPath($proxychains_prefix . '/bin/') + //->withDependentLibraries('zlib', 'openssl') + + ; + + $p->addLibrary($lib); + +}; From 5ce110eeeb954b0a58e6f10efba909f8c4df173a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 01:01:16 +0800 Subject: [PATCH 119/226] update --- sapi/quickstart/swoole-install/install.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index 698cb3d649..b008389e4e 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -52,6 +52,7 @@ done # 保持源码最新 test $VERSION_LATEST -eq 1 && test -d swoole-src && rm -rf swoole-src + case "$MIRROR" in china ) test -d swoole-src || git clone -b master --single-branch --depth=1 https://gitee.com/swoole/swoole.git swoole-src @@ -62,7 +63,6 @@ china ) esac - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/usr" SWOOLE_IO_URING='' SWOOLE_DEBUG_OPTIONS=''; @@ -129,6 +129,10 @@ ${SWOOLE_ODBC_OPTIONS} \ ${SWOOLE_IO_URING} \ ${SWOOLE_THREAD_OPTION} \ +if [ $? -ne 0 ] ; then + echo $? + exit 0 +fi # --with-php-config=/usr/bin/php-config # --enable-swoole-thread \ @@ -137,15 +141,27 @@ ${SWOOLE_THREAD_OPTION} \ make -j ${CPU_LOGICAL_PROCESSORS} +if [ $? -ne 0 ] ; then + echo $? + exit 0 +fi + test $ENABLE_TEST -eq 1 && make test make install - +if [ $? -ne 0 ] ; then + echo $? + exit 0 +fi # 创建 swoole.ini PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) +if [ $? -ne 0 ] ; then + echo $? + exit 0 +fi if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then SUDO='' From 0fe88e9792b6dc19fd210f61c3c3c4501344d283 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 02:05:06 +0800 Subject: [PATCH 120/226] update --- sapi/quickstart/swoole-install/install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index b008389e4e..208345daa2 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash + +__DIR__=$(cd "$(dirname "$0")";pwd) set -x PHP=$(which php) @@ -146,7 +148,12 @@ if [ $? -ne 0 ] ; then exit 0 fi -test $ENABLE_TEST -eq 1 && make test +if test $ENABLE_TEST -eq 1 ; then + cd /tmp/build/swoole-src/tests/include/lib/ + composer install + cd /tmp/build/swoole-src/ + make test +fi make install if [ $? -ne 0 ] ; then @@ -171,7 +178,7 @@ if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then ${SUDO} tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF extension=swoole.so -swoole.use_shortname=Off +swoole.use_shortname=On EOF fi From ca715f41d6d1b9bd771614e9892b3a93169c2600 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 02:15:14 +0800 Subject: [PATCH 121/226] updaet --- sapi/quickstart/swoole-install/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh index 208345daa2..f1717970fa 100644 --- a/sapi/quickstart/swoole-install/install.sh +++ b/sapi/quickstart/swoole-install/install.sh @@ -116,6 +116,8 @@ esac cd swoole-src +test -f ext-src/.libs/php_swoole.o && make clean + phpize ./configure \ From 3d53a29d3281b867d418e070d2fd2f682ed186e3 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 14:56:01 +0800 Subject: [PATCH 122/226] update --- sapi/quickstart/swoole-install/FAQ.md | 2 +- sapi/quickstart/swoole-install/README.md | 8 ++++++++ sapi/src/library_builder/git.md | 18 ++++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/sapi/quickstart/swoole-install/FAQ.md b/sapi/quickstart/swoole-install/FAQ.md index b0fbd695a8..3cbfd65819 100644 --- a/sapi/quickstart/swoole-install/FAQ.md +++ b/sapi/quickstart/swoole-install/FAQ.md @@ -6,7 +6,7 @@ ls -lh `php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ ``` -## php.ini 配置文件 curl、socks5、mysqld 扩展应该在 swoole 扩展之前加载 +## php.ini 配置文件 curl、sockets、mysqld 扩展应该在 swoole 扩展之前加载 https://github.com/swoole/swoole-src/issues/4085 编译php 时 扫描目录配置 --with-config-file-scan-dir diff --git a/sapi/quickstart/swoole-install/README.md b/sapi/quickstart/swoole-install/README.md index 67be0a57f9..9437f5345c 100644 --- a/sapi/quickstart/swoole-install/README.md +++ b/sapi/quickstart/swoole-install/README.md @@ -19,3 +19,11 @@ ### +```bash + +curl -fSL https://gitee.com/jingjingxyk/swoole-cli/raw/new_dev/sapi/quickstart/swoole-install/install.sh | bash -s -- --mirror china --latest + +curl -fSL https://github.com/jingjingxyk/swoole-cli/blob/new_dev/sapi/quickstart/swoole-install/install.sh?raw=true | bash -s -- --mirror china --latest + + +``` diff --git a/sapi/src/library_builder/git.md b/sapi/src/library_builder/git.md index 6747cab804..7e413c9d45 100644 --- a/sapi/src/library_builder/git.md +++ b/sapi/src/library_builder/git.md @@ -9,8 +9,8 @@ sort | uniq ``` - # 删除子模块 + ```bash git submodule deinit ext/swoole @@ -24,13 +24,16 @@ git rm -rf ext/swoole/ ``` ## 创建空的新分支 + ```bash git checkout --orphan static-php-cli-next git rm -rf . ``` + ## 清理未跟踪的文件 谨慎使用 + ```bash git clean -df ``` @@ -43,12 +46,14 @@ git fsck --lost-found # 查看记录 ``` ## 合并时不保留commit 信息 + ```bash git merge --squash branch_name ``` ## 当前分支 hash + ```bash git rev-parse HEAD @@ -64,6 +69,7 @@ git reset --hard c761f5c # 回退到指定的版本 ``` ## 节省网络流量 + ```bash git clone --recurse-submodules --single-branch -b main --progress --depth=1 @@ -86,8 +92,8 @@ git gc --prune=now ``` - ## 单个文件回滚 + ```bash git log @@ -128,11 +134,13 @@ git rm -rf . ``` ## 合并两个无关的仓库 + ```bash git merge --allow-unrelated-histories ``` ## 查看提交日志 + ```bash git log --oneline @@ -154,3 +162,9 @@ git config --global --add safe.directory "$GITHUB_WORKSPACE" ``` +## 设置 分支 跟踪 + +```bash + +git branch --set-upstream-to=origin/main main +``` From 359ce827db599e84d54b7a58108200f5d53c42c4 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 14:57:34 +0800 Subject: [PATCH 123/226] 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 bc8fb28af4..4524025c01 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -68,6 +68,8 @@ test -f kubernetes.yml && rm -rf kubernetes.yml test -f ovn.yml && rm -rf ovn.yml test -f ovn.yml && rm -rf ovn.yml +cd ${__PROJECT__}/sapi/quickstart +test -d swoole-install && rm -rf swoole-install cd ${__PROJECT__} test -f setup-aria2-runtime.sh && rm -rf setup-aria2-runtime.sh From e3376a2f01ff9a5ca5dcec663ef5869f2262f649 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 21:38:17 +0800 Subject: [PATCH 124/226] update --- sapi/src/builder/extension/phpy.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/sapi/src/builder/extension/phpy.php b/sapi/src/builder/extension/phpy.php index 10fc813c17..8e8dba4faf 100644 --- a/sapi/src/builder/extension/phpy.php +++ b/sapi/src/builder/extension/phpy.php @@ -5,13 +5,24 @@ use SwooleCli\Extension; return function (Preprocessor $p) { - $python3_prefix = PYTHON3_PREFIX; + // anaconda 安装包 + // https://repo.anaconda.com/archive/ - $options = '--enable-phpy '; - $options .= ' --with-python-version=3.12'; + $python_config = $p->getInputOption('with-python-config'); + $python_dir = $p->getInputOption('with-python-dir'); + $python_version = $p->getInputOption('with-python-version'); + if(!empty($python_config) && !empty($python_dir) && !empty($python_version)) { + $options = '--enable-phpy '; + } else { + throw new \Exception('phpy config python-config error '); + } + + + # $options .= ' --with-python-version=3.12'; + $options .= ' --with-python-version=' . $python_version; # $options .= ' --with-python-dir=/opt/anaconda3'; - $options .= ' --with-python-dir=' . $python3_prefix; - $options .= ' --with-python-config=' . $python3_prefix . '/bin/python3-config'; + $options .= ' --with-python-dir=' . $python_dir; + $options .= ' --with-python-config=' . $python_config; $tag = 'v1.0.4'; @@ -28,8 +39,8 @@ git clone -b main --depth=1 https://github.com/swoole/phpy.git EOF ) - ->withDependentExtensions('curl', 'openssl', 'sockets', 'mysqlnd', 'pdo') - ->withDependentLibraries('curl', 'openssl', 'cares', 'zlib', 'brotli', 'nghttp2', 'python3'); + ->withDependentExtensions('swoole') + ->withDependentLibraries('curl', 'openssl', 'cares', 'zlib', 'brotli', 'nghttp2'); //'python3' $p->addExtension($ext); $libs = $p->isMacos() ? '-lc++' : ' -lstdc++ '; @@ -38,5 +49,3 @@ }; - - From 9c09d1c1475d93b8b9af3d34702d80806201dc94 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 13 Jul 2024 22:25:42 +0800 Subject: [PATCH 125/226] update phpy --- sapi/src/builder/extension/phpy.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sapi/src/builder/extension/phpy.php b/sapi/src/builder/extension/phpy.php index 8e8dba4faf..a268bd8679 100644 --- a/sapi/src/builder/extension/phpy.php +++ b/sapi/src/builder/extension/phpy.php @@ -8,21 +8,22 @@ // anaconda 安装包 // https://repo.anaconda.com/archive/ + $options = '--enable-phpy '; + $python_config = $p->getInputOption('with-python-config'); $python_dir = $p->getInputOption('with-python-dir'); $python_version = $p->getInputOption('with-python-version'); if(!empty($python_config) && !empty($python_dir) && !empty($python_version)) { - $options = '--enable-phpy '; + $options .= ' --with-python-version=' . $python_version; + $options .= ' --with-python-dir=' . $python_dir; + $options .= ' --with-python-config=' . $python_config; } else { throw new \Exception('phpy config python-config error '); } # $options .= ' --with-python-version=3.12'; - $options .= ' --with-python-version=' . $python_version; # $options .= ' --with-python-dir=/opt/anaconda3'; - $options .= ' --with-python-dir=' . $python_dir; - $options .= ' --with-python-config=' . $python_config; $tag = 'v1.0.4'; From b9ec549af91543a68d84c9ada0300147f39b79ad Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 14 Jul 2024 21:22:11 +0800 Subject: [PATCH 126/226] update --- sapi/quickstart/bsd/bsd-init.sh | 25 +++++++++++++++++++++---- sapi/quickstart/linux/rhel-init.sh | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/sapi/quickstart/bsd/bsd-init.sh b/sapi/quickstart/bsd/bsd-init.sh index 5f4482bf56..b060f679d5 100644 --- a/sapi/quickstart/bsd/bsd-init.sh +++ b/sapi/quickstart/bsd/bsd-init.sh @@ -1,12 +1,29 @@ +# 换源帮助 +# https://mirrors.ustc.edu.cn/help/freebsd-pkg.html +cat /etc/pkg/FreeBSD.conf -cp -f /etc/pkg/FreeBSD.conf /etc/pkg/FreeBSD.conf.bak +# cp -f /etc/pkg/FreeBSD.conf /etc/pkg/FreeBSD.conf.bak -sed -i.t "s@pkg+http://pkg.FreeBSD.org/@https://mirrors.ustc.edu.cn/freebsd-pkg/@" /etc/pkg/FreeBSD.conf -sed -i.t 's@"srv"@"none"@' /etc/pkg/FreeBSD.conf +# sed -i.t "s@pkg+http://pkg.FreeBSD.org/@https://mirrors.ustc.edu.cn/freebsd-pkg/@" /etc/pkg/FreeBSD.conf +# sed -i.t 's@"srv"@"none"@' /etc/pkg/FreeBSD.conf + +mkdir -p /usr/local/etc/pkg/repos/ + + + +cat > /usr/local/etc/pkg/repos/FreeBSD.conf <<"EOF-CONFIG" +FreeBSD: { + url: "http://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly", +} + +"EOF-CONFIG" + +cat /usr/local/etc/pkg/repos/FreeBSD.conf env ASSUME_ALWAYS_YES=YES pkg update -f env ASSUME_ALWAYS_YES=YES pkg update env ASSUME_ALWAYS_YES=YES pkg upgrade -env ASSUME_ALWAYS_YES=YES pkg install git curl cmake llvm wget +env ASSUME_ALWAYS_YES=YES pkg bootstrap -f +env ASSUME_ALWAYS_YES=YES pkg install git curl cmake llvm wget openssl socat diff --git a/sapi/quickstart/linux/rhel-init.sh b/sapi/quickstart/linux/rhel-init.sh index d75491b9de..157e5eb33f 100644 --- a/sapi/quickstart/linux/rhel-init.sh +++ b/sapi/quickstart/linux/rhel-init.sh @@ -80,7 +80,7 @@ yum install -y autoconf automake clang lld libtool cmake bison gettext zip u yum install -y pkg-config bzip2 flex -yum install -y curl-minimal +yum install -y curl-minimal curl which yum install -y xz yum install -y socat From 93188b50e141fdf982755034ab2bbd36ae6bfe50 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 14 Jul 2024 23:39:07 +0800 Subject: [PATCH 127/226] update --- sapi/quickstart/linux/rhel-init.sh | 4 ++- sapi/tools/genereate-php-extension.sh | 40 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 sapi/tools/genereate-php-extension.sh diff --git a/sapi/quickstart/linux/rhel-init.sh b/sapi/quickstart/linux/rhel-init.sh index 157e5eb33f..6b107d4fd9 100644 --- a/sapi/quickstart/linux/rhel-init.sh +++ b/sapi/quickstart/linux/rhel-init.sh @@ -80,7 +80,9 @@ yum install -y autoconf automake clang lld libtool cmake bison gettext zip u yum install -y pkg-config bzip2 flex -yum install -y curl-minimal curl which +{ yum install -y curl; } || { echo $?; } +{ yum install -y curl-minimal; } || { echo $?; } +yum install -y which yum install -y xz yum install -y socat diff --git a/sapi/tools/genereate-php-extension.sh b/sapi/tools/genereate-php-extension.sh new file mode 100644 index 0000000000..13a5215f33 --- /dev/null +++ b/sapi/tools/genereate-php-extension.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + + +:<<'COMMENT' + +创建 PHP 扩展 辅助工具 + +COMMENT + +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +if [ -f ${__DIR__}/prepare.php ] ; then + __PROJECT__=$( + cd ${__DIR__}/ + pwd + ) +else + __PROJECT__=$( + cd ${__DIR__}/../../ + pwd + ) +fi + +cd ${__DIR__} + + +export PATH="${__PROJECT__}/bin/runtime:$PATH" + +alias php='php -c ${__PROJECT__}/bin/runtime/php.ini' +php ${__PROJECT__}/sapi/scripts/DownloadPHPSourceCode.php + + +php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --help + +# 创建扩展 +test -d ${__PROJECT__}/../wubi && rm -rf ${__PROJECT__}/../wubi + +php ${__PROJECT__}/var/php-8.2.13/ext/ext_skel.php --ext wubi --author jingjingxyk -std --dir ${__PROJECT__}/../ From 50aca6692a91a9302aa5bbba9000de70b1aa5621 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 11:57:58 +0800 Subject: [PATCH 128/226] fix bug --- setup-aria2-runtime.sh | 4 ++-- setup-coturn-runtime.sh | 4 ++-- setup-ffmpeg-runtime.sh | 4 ++-- setup-privoxy-runtime.sh | 4 ++-- setup-socat-runtime.sh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/setup-aria2-runtime.sh b/setup-aria2-runtime.sh index b120396430..8a23f8c637 100644 --- a/setup-aria2-runtime.sh +++ b/setup-aria2-runtime.sh @@ -89,9 +89,9 @@ done case "$MIRROR" in china) - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" if [ $OS = 'windows' ]; then - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" fi ;; diff --git a/setup-coturn-runtime.sh b/setup-coturn-runtime.sh index e8c568b200..af0f8399f2 100644 --- a/setup-coturn-runtime.sh +++ b/setup-coturn-runtime.sh @@ -89,9 +89,9 @@ done case "$MIRROR" in china) - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" if [ $OS = 'windows' ]; then - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" fi ;; diff --git a/setup-ffmpeg-runtime.sh b/setup-ffmpeg-runtime.sh index b5227b2274..7e6198e06c 100644 --- a/setup-ffmpeg-runtime.sh +++ b/setup-ffmpeg-runtime.sh @@ -89,9 +89,9 @@ done case "$MIRROR" in china) - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" if [ $OS = 'windows' ]; then - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" fi ;; diff --git a/setup-privoxy-runtime.sh b/setup-privoxy-runtime.sh index dbf7995c0d..058002cf28 100644 --- a/setup-privoxy-runtime.sh +++ b/setup-privoxy-runtime.sh @@ -89,9 +89,9 @@ done case "$MIRROR" in china) - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" if [ $OS = 'windows' ]; then - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" fi ;; diff --git a/setup-socat-runtime.sh b/setup-socat-runtime.sh index 89db484428..ea097040cb 100644 --- a/setup-socat-runtime.sh +++ b/setup-socat-runtime.sh @@ -89,9 +89,9 @@ done case "$MIRROR" in china) - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" if [ $OS = 'windows' ]; then - APP_DOWNLOAD_URL="https://php-cli.jingjingxyk/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" + APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip" fi ;; From cb75af65f9f4ed88355927eee8979ee6b37c9ff0 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 21:15:06 +0800 Subject: [PATCH 129/226] =?UTF-8?q?uuid=20=E7=BC=96=E8=AF=91=E6=97=B6?= =?UTF-8?q?=E9=9C=80=E8=A6=81=20gettext-dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/docker/Dockerfile | 1 + sapi/quickstart/linux/alpine-init.sh | 2 +- sapi/quickstart/linux/extra/alpine-php-init.sh | 14 +++++++++++++- sapi/quickstart/linux/extra/debian-php-init.sh | 10 ++++++---- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/sapi/docker/Dockerfile b/sapi/docker/Dockerfile index bb15e4ec29..a87f57101d 100644 --- a/sapi/docker/Dockerfile +++ b/sapi/docker/Dockerfile @@ -15,4 +15,5 @@ RUN apk upgrade RUN apk add vim alpine-sdk xz autoconf automake linux-headers clang-dev clang lld libtool cmake bison re2c gettext coreutils RUN apk add bash tini RUN apk add libc++-static libltdl-static +RUN apk add gettext-dev WORKDIR /work diff --git a/sapi/quickstart/linux/alpine-init.sh b/sapi/quickstart/linux/alpine-init.sh index 2f50393af0..7328fdbab0 100644 --- a/sapi/quickstart/linux/alpine-init.sh +++ b/sapi/quickstart/linux/alpine-init.sh @@ -44,7 +44,7 @@ apk update apk add vim alpine-sdk xz autoconf automake linux-headers clang-dev clang lld libtool cmake bison re2c gettext coreutils gcc g++ apk add bash zip unzip flex pkgconf ca-certificates -apk add tar gzip zip unzip bzip2 +apk add tar gzip zip unzip bzip2 gettext-dev apk add bash 7zip # apk add bash p7zip diff --git a/sapi/quickstart/linux/extra/alpine-php-init.sh b/sapi/quickstart/linux/extra/alpine-php-init.sh index bac0fa6b94..c00d49f09b 100644 --- a/sapi/quickstart/linux/extra/alpine-php-init.sh +++ b/sapi/quickstart/linux/extra/alpine-php-init.sh @@ -1,2 +1,14 @@ +apk add php82-cli php82-dev +apk add php82-iconv php82-mbstring php82-phar php82-openssl +apk add php82-posix php82-tokenizer php82-intl +apk add php82-dom php82-xmlwriter php82-xml php82-simplexml +apk add php82-pdo php82-sockets php82-curl php82-mysqlnd php82-pgsql php82-sqlite3 +apk add php82-redis php82-mongodb -apk add php-cli php-iconv php-mbstring php-phar php-openssl php-posix php-curl php-tokenizer php-dom php-xmlwriter php-xml php-simplexml +php82 -v +php82 --ini +php82 --ini | grep ".ini files" + +ln -sf /usr/bin/php82 /usr/bin/php +ln -sf /usr/bin/phpize82 /usr/bin/phpize +ln -sf /usr/bin/php-config82 /usr/bin/php-config diff --git a/sapi/quickstart/linux/extra/debian-php-init.sh b/sapi/quickstart/linux/extra/debian-php-init.sh index 9ec4ce99c7..463b2dd8dd 100644 --- a/sapi/quickstart/linux/extra/debian-php-init.sh +++ b/sapi/quickstart/linux/extra/debian-php-init.sh @@ -1,4 +1,6 @@ - -apt install -y php-cli php-pear php-dev php-curl php-intl - -# apt install -y php-mysqlnd php-pgsql php-sqlite3 php-redis php-mongodb +export TZ="Etc/UTC" +ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone +apt update -y +apt install -y php-cli php-pear php-dev php-curl php-intl +apt install -y php-mbstring php-tokenizer php-xml +apt install -y php-mysqlnd php-pgsql php-sqlite3 php-redis php-mongodb From c28b99ac18b447723a7e0ed4f4e2aa263d59640c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 21:40:44 +0800 Subject: [PATCH 130/226] update container image --- sapi/quickstart/linux/run-alpine-container-full.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/quickstart/linux/run-alpine-container-full.sh b/sapi/quickstart/linux/run-alpine-container-full.sh index 82e2c7f63f..832ddc896a 100644 --- a/sapi/quickstart/linux/run-alpine-container-full.sh +++ b/sapi/quickstart/linux/run-alpine-container-full.sh @@ -50,7 +50,7 @@ done case $ARCH in 'x86_64') - TAG=all-dependencies-alpine-3.17-php8-v1.0.0-x86_64-20231113T125520Z + TAG=all-dependencies-alpine-3.18-php8-v1.0.0-x86_64-20240715T132512Z IMAGE=docker.io/jingjingxyk/build-swoole-cli:${TAG} if [ "$MIRROR" = 'china' ] ; then IMAGE=registry.cn-beijing.aliyuncs.com/jingjingxyk-public/app:${TAG} From 5ca1e2ea0d410cd316eb4afccb3c82ef67d99ff2 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 21:45:18 +0800 Subject: [PATCH 131/226] update container image --- sapi/docker/build-export-container.sh | 2 +- sapi/quickstart/linux/run-alpine-container-full.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index 193ec72eb7..432281cdde 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -41,7 +41,7 @@ while [ $# -gt 0 ]; do --mirror) MIRROR="$2" ;; - --quickstart-container) + ) CONTAIENR_NAME='swoole-cli-alpine-dev' # 从quickstart 生成的容器中拷贝 /usr/local/swoole-cli/ 文件夹,并生成新容器镜像 ;; diff --git a/sapi/quickstart/linux/run-alpine-container-full.sh b/sapi/quickstart/linux/run-alpine-container-full.sh index a13fac2b1d..5d07e15388 100644 --- a/sapi/quickstart/linux/run-alpine-container-full.sh +++ b/sapi/quickstart/linux/run-alpine-container-full.sh @@ -49,7 +49,7 @@ done case $ARCH in 'x86_64') - TAG=all-dependencies-alpine-3.17-php8-v1.0.0-x86_64-20231113T100559Z + TAG=all-dependencies-alpine-3.18-php8-v1.0.0-x86_64-20240715T132512Z IMAGE=docker.io/jingjingxyk/build-swoole-cli:${TAG} if [ "$MIRROR" = 'china' ] ; then IMAGE=registry.cn-beijing.aliyuncs.com/jingjingxyk-public/app:${TAG} From 0bf2203b6882e2a99d19f2b76bed250839e28561 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 21:57:55 +0800 Subject: [PATCH 132/226] update build-release-example.sh --- build-release-example.sh | 238 +++++++++++++++++++-------------------- 1 file changed, 113 insertions(+), 125 deletions(-) diff --git a/build-release-example.sh b/build-release-example.sh index 7c6060c39e..3ca027a1f8 100644 --- a/build-release-example.sh +++ b/build-release-example.sh @@ -1,20 +1,19 @@ #!/bin/bash - __DIR__=$( cd "$(dirname "$0")" pwd ) __PROJECT__=${__DIR__} -if [ ! -f ${__DIR__}/prepare.php ] ; then +if [ ! -f ${__DIR__}/prepare.php ]; then echo 'no found prepare.php' exit 0 fi cd ${__PROJECT__} -if [ ! -d ext/swoole/.git ] ; then +if [ ! -d ext/swoole/.git ]; then git submodule update --init --recursive fi @@ -39,7 +38,6 @@ case $OS in esac - IN_DOCKER=0 WITH_DOWNLOAD_BOX=0 WITH_BUILD_CONTAINER=0 @@ -55,7 +53,6 @@ MIRROR='' LIBRARY_INSTALL_PREFIX=/usr/local/swoole-cli OPTIONS='' - while [ $# -gt 0 ]; do case "$1" in --mirror) @@ -101,12 +98,12 @@ while [ $# -gt 0 ]; do shift $(($# > 0 ? 1 : 0)) done -if [ "$OS" = 'linux' ] ; then - if [ ! "$BASH_VERSION" ] ; then - echo "Please use bash to run this script ($0) " 1>&2 - echo "fix : " 1>&2 - echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-minimal.sh " 1>&2 - exit 1 +if [ "$OS" = 'linux' ]; then + if [ ! "$BASH_VERSION" ]; then + echo "Please use bash to run this script ($0) " 1>&2 + echo "fix : " 1>&2 + echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-minimal.sh " 1>&2 + exit 1 fi fi @@ -115,65 +112,65 @@ CMDS_NUMS=0 CMDS=("flex" "pkg-config" "cmake" "re2c" "bison" "curl" "automake" "libtool" "clang" "xz" "zip" "unzip" "autoconf") CMDS_LEN=${#CMDS[@]} for cmd in "${CMDS[@]}"; do - if command -v "$cmd" >/dev/null 2>&1; then - # echo "$cmd exists" - ((CMDS_NUMS++)) - fi + if command -v "$cmd" >/dev/null 2>&1; then + # echo "$cmd exists" + ((CMDS_NUMS++)) + fi done -if [ "$OS" = 'linux' ] ; then - OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') - - if [ -f /.dockerenv ]; then - IN_DOCKER=1 - if test $CMDS_LEN -ne $CMDS_NUMS ;then - { - if [ "$MIRROR" = 'china' ] ; then - if [ "$OS_RELEASE" = 'alpine' ]; then - sh sapi/quickstart/linux/alpine-init.sh --mirror china - elif [ "$OS_RELEASE" = 'debian' ]; then - bash sapi/quickstart/linux/debian-init.sh --mirror china - else - echo 'no support OS' - exit 0 - fi - else - if [ "$OS_RELEASE" = 'alpine' ]; then - sh sapi/quickstart/linux/alpine-init.sh - elif [ "$OS_RELEASE" = 'debian' ]; then - bash sapi/quickstart/linux/debian-init.sh - else - echo 'no support OS' - exit 0 - fi - fi - } - fi - git config --global --add safe.directory ${__PROJECT__} - else - # docker inspect -f {{.State.Running}} download-box-web-server - if [ "`docker inspect -f {{.State.Running}} swoole-cli-builder`" = "true" ]; then - echo " build container is running " +if [ "$OS" = 'linux' ]; then + OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '\n' | tr -d '\"') + + if [ -f /.dockerenv ]; then + IN_DOCKER=1 + if test $CMDS_LEN -ne $CMDS_NUMS; then + { + if [ "$MIRROR" = 'china' ]; then + if [ "$OS_RELEASE" = 'alpine' ]; then + sh sapi/quickstart/linux/alpine-init.sh --mirror china + elif [ "$OS_RELEASE" = 'debian' ]; then + bash sapi/quickstart/linux/debian-init.sh --mirror china + else + echo 'no support OS' + exit 0 + fi + else + if [ "$OS_RELEASE" = 'alpine' ]; then + sh sapi/quickstart/linux/alpine-init.sh + elif [ "$OS_RELEASE" = 'debian' ]; then + bash sapi/quickstart/linux/debian-init.sh else - echo " build container no running " + echo 'no support OS' + exit 0 + fi fi - OPTIONS="${OPTIONS} --without-docker=1 " + } + fi + git config --global --add safe.directory ${__PROJECT__} + else + # docker inspect -f {{.State.Running}} download-box-web-server + if [ "$(docker inspect -f {{.State.Running}} swoole-cli-builder)" = "true" ]; then + echo " build container is running " + else + echo " build container no running " fi + OPTIONS="${OPTIONS} --without-docker=1 " + fi fi -if [ "$OS" = 'macos' ] ; then - if test $CMDS_LEN -ne $CMDS_NUMS ; then - { - if [ "$MIRROR" = 'china' ] ; then - bash sapi/quickstart/macos/macos-init.sh --mirror china - else - bash sapi/quickstart/macos/macos-init.sh - fi - } +if [ "$OS" = 'macos' ]; then + if test $CMDS_LEN -ne $CMDS_NUMS; then + { + if [ "$MIRROR" = 'china' ]; then + bash sapi/quickstart/macos/macos-init.sh --mirror china + else + bash sapi/quickstart/macos/macos-init.sh + fi + } fi OWNER=$(stat -f "%Su" "${LIBRARY_INSTALL_PREFIX}") CURRENT_USER=$(whoami) - if test "${OWNER}" != "${CURRENT_USER}" ; then + if test "${OWNER}" != "${CURRENT_USER}"; then id -u ${CURRENT_USER} echo "创建目录: ${LIBRARY_INSTALL_PREFIX} ,并修改所属者为: ${CURRENT_USER} " sudo mkdir -p ${LIBRARY_INSTALL_PREFIX} @@ -182,14 +179,14 @@ if [ "$OS" = 'macos' ] ; then fi -bash sapi/quickstart/clean-folder.sh +test -f sapi/quickstart/clean-folder.sh && bash sapi/quickstart/clean-folder.sh -if [ ! -f "${__PROJECT__}/bin/runtime/php" ] ;then - if [ "$MIRROR" = 'china' ] ; then - bash sapi/quickstart/setup-php-runtime.sh --mirror china - else - bash sapi/quickstart/setup-php-runtime.sh - fi +if [ ! -f "${__PROJECT__}/bin/runtime/php" ]; then + if [ "$MIRROR" = 'china' ]; then + bash sapi/quickstart/setup-php-runtime.sh --mirror china + else + bash sapi/quickstart/setup-php-runtime.sh + fi fi export PATH="${__PROJECT__}/bin/runtime:$PATH" @@ -197,31 +194,29 @@ alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.c php -v +if [ ${WITH_PHP_COMPOSER} -eq 1 ]; then + export COMPOSER_ALLOW_SUPERUSER=1 + if [ "$MIRROR" = 'china' ]; then + composer config -g repos.packagist composer https://mirrors.tencent.com/composer/ + # composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ + else + composer config -g repos.packagist composer https://packagist.org + fi + # composer suggests --all + # composer dump-autoload + # composer fund -if [ ${WITH_PHP_COMPOSER} -eq 1 ] ; then - export COMPOSER_ALLOW_SUPERUSER=1 - if [ "$MIRROR" = 'china' ]; then - composer config -g repos.packagist composer https://mirrors.tencent.com/composer/ - # composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ - else - composer config -g repos.packagist composer https://packagist.org - fi - # composer suggests --all - # composer dump-autoload - # composer fund - - # composer update --optimize-autoloader - # composer update --optimize-autoloader --no-dev + # composer update --optimize-autoloader + # composer update --optimize-autoloader --no-dev - # composer update --no-interaction --optimize-autoloader - # composer install --no-interaction --optimize-autoloader - composer install --no-interaction --no-autoloader --no-scripts # --no-dev - composer dump-autoload --optimize --profile + # composer update --no-interaction --optimize-autoloader + # composer install --no-interaction --optimize-autoloader + composer install --no-interaction --no-autoloader --no-scripts # --no-dev + composer dump-autoload --optimize --profile - composer config -g --unset repos.packagist + composer config -g --unset repos.packagist fi - # 可用配置参数 # --with-swoole-pgsql=1 # --with-libavif=1 @@ -240,56 +235,53 @@ fi # --with-c-compiler=[gcc|clang] 默认clang # --with-download-mirror-url=https://php-cli.jingjingxyk.com/ - - # 定制构建选项 OPTIONS="${OPTIONS} +apcu +ds +xlswriter +ssh2 +uuid " OPTIONS="${OPTIONS} --with-global-prefix=${LIBRARY_INSTALL_PREFIX}" # OPTIONS="${OPTIONS} @macos" +if [ ${IN_DOCKER} -eq 1 ]; then + { + # 容器中 -if [ ${IN_DOCKER} -eq 1 ] ; then -{ -# 容器中 - - php prepare.php +inotify ${OPTIONS} + php prepare.php +inotify ${OPTIONS} -} else { -# 容器外 - php prepare.php --without-docker=1 ${OPTIONS} + } +else + { + # 容器外 + php prepare.php --without-docker=1 ${OPTIONS} -} + } fi - -if [ ${WITH_DOWNLOAD_BOX} -eq 1 ] ; then - echo " please exec script: " - echo " bash sapi/download-box/download-box-batch-downloader.sh " - echo " bash sapi/download-box/download-box-init.sh " - exit 0 +if [ ${WITH_DOWNLOAD_BOX} -eq 1 ]; then + echo " please exec script: " + echo " bash sapi/download-box/download-box-batch-downloader.sh " + echo " bash sapi/download-box/download-box-init.sh " + exit 0 fi -if [ ${WITH_BUILD_CONTAINER} -eq 1 ] ; then - echo " please exec script: " - if [ "$MIRROR" = 'china' ]; then - echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh --composer_mirror tencent --mirror ustc " - else - echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh " - fi - exit 0 +if [ ${WITH_BUILD_CONTAINER} -eq 1 ]; then + echo " please exec script: " + if [ "$MIRROR" = 'china' ]; then + echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh --composer_mirror tencent --mirror ustc " + else + echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh " + fi + exit 0 fi -if [ ${WITH_WEB_UI} -eq 1 ] ; then - echo " please exec script: " - echo " bash sapi/webUI/webui-init-data.sh " - echo " php sapi/webUI/bootstrap.php " - exit 0 +if [ ${WITH_WEB_UI} -eq 1 ]; then + echo " please exec script: " + echo " bash sapi/webUI/webui-init-data.sh " + echo " php sapi/webUI/bootstrap.php " + exit 0 fi - -if [ "$OS" = 'linux' ] && [ ${IN_DOCKER} -eq 0 ] ; then - echo ' please run in container !' - exit 0 +if [ "$OS" = 'linux' ] && [ ${IN_DOCKER} -eq 0 ]; then + echo ' please run in container !' + exit 0 fi bash make-install-deps.sh @@ -323,7 +315,3 @@ exit 0 # bash build-release.sh --mirror china --webui # bash sapi/webUI/webui-init-data.sh # php sapi/webUI/bootstrap.php - - - - From 4065d4db856f8117a54345dca6460d34f08e7228 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 22:02:32 +0800 Subject: [PATCH 133/226] format code build-release-exmaple.sh --- build-release-example.sh | 197 ++++++++++++++++++--------------------- 1 file changed, 92 insertions(+), 105 deletions(-) diff --git a/build-release-example.sh b/build-release-example.sh index 19835ca0e4..d6e23f4be9 100644 --- a/build-release-example.sh +++ b/build-release-example.sh @@ -1,20 +1,19 @@ #!/bin/bash - __DIR__=$( cd "$(dirname "$0")" pwd ) __PROJECT__=${__DIR__} -if [ ! -f ${__DIR__}/prepare.php ] ; then +if [ ! -f ${__DIR__}/prepare.php ]; then echo 'no found prepare.php' exit 0 fi cd ${__PROJECT__} -if [ ! -d ext/swoole/.git ] ; then +if [ ! -d ext/swoole/.git ]; then git submodule update --init --recursive fi @@ -39,7 +38,6 @@ case $OS in esac - IN_DOCKER=0 WITH_DOWNLOAD_BOX=0 WITH_BUILD_CONTAINER=0 @@ -55,7 +53,6 @@ MIRROR='' LIBRARY_INSTALL_PREFIX=/usr/local/swoole-cli OPTIONS='' - while [ $# -gt 0 ]; do case "$1" in --mirror) @@ -101,12 +98,12 @@ while [ $# -gt 0 ]; do shift $(($# > 0 ? 1 : 0)) done -if [ "$OS" = 'linux' ] ; then - if [ ! "$BASH_VERSION" ] ; then - echo "Please use bash to run this script ($0) " 1>&2 - echo "fix : " 1>&2 - echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-minimal.sh " 1>&2 - exit 1 +if [ "$OS" = 'linux' ]; then + if [ ! "$BASH_VERSION" ]; then + echo "Please use bash to run this script ($0) " 1>&2 + echo "fix : " 1>&2 + echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-minimal.sh " 1>&2 + exit 1 fi fi @@ -115,49 +112,49 @@ CMDS_NUMS=0 CMDS=("flex" "pkg-config" "cmake" "re2c" "bison" "curl" "automake" "libtool" "clang" "xz" "zip" "unzip" "autoconf") CMDS_LEN=${#CMDS[@]} for cmd in "${CMDS[@]}"; do - if command -v "$cmd" >/dev/null 2>&1; then - # echo "$cmd exists" - ((CMDS_NUMS++)) - fi + if command -v "$cmd" >/dev/null 2>&1; then + # echo "$cmd exists" + ((CMDS_NUMS++)) + fi done -if [ "$OS" = 'linux' ] ; then - if [ -f /.dockerenv ]; then - IN_DOCKER=1 - if test $CMDS_LEN -ne $CMDS_NUMS ;then - { - if [ "$MIRROR" = 'china' ] ; then - sh sapi/quickstart/linux/alpine-init.sh --mirror china - else - sh sapi/quickstart/linux/alpine-init.sh - fi - } +if [ "$OS" = 'linux' ]; then + if [ -f /.dockerenv ]; then + IN_DOCKER=1 + if test $CMDS_LEN -ne $CMDS_NUMS; then + { + if [ "$MIRROR" = 'china' ]; then + sh sapi/quickstart/linux/alpine-init.sh --mirror china + else + sh sapi/quickstart/linux/alpine-init.sh fi - git config --global --add safe.directory ${__PROJECT__} + } + fi + git config --global --add safe.directory ${__PROJECT__} + else + # docker inspect -f {{.State.Running}} download-box-web-server + if [ "$(docker inspect -f {{.State.Running}} swoole-cli-builder)" = "true" ]; then + echo " build container is running " else - # docker inspect -f {{.State.Running}} download-box-web-server - if [ "`docker inspect -f {{.State.Running}} swoole-cli-builder`" = "true" ]; then - echo " build container is running " - else - echo " build container no running " - fi - OPTIONS="${OPTIONS} --without-docker=1 " + echo " build container no running " fi + OPTIONS="${OPTIONS} --without-docker=1 " + fi fi -if [ "$OS" = 'macos' ] ; then - if test $CMDS_LEN -ne $CMDS_NUMS ; then - { - if [ "$MIRROR" = 'china' ] ; then - bash sapi/quickstart/macos/macos-init.sh --mirror china - else - bash sapi/quickstart/macos/macos-init.sh - fi - } +if [ "$OS" = 'macos' ]; then + if test $CMDS_LEN -ne $CMDS_NUMS; then + { + if [ "$MIRROR" = 'china' ]; then + bash sapi/quickstart/macos/macos-init.sh --mirror china + else + bash sapi/quickstart/macos/macos-init.sh + fi + } fi OWNER=$(stat -f "%Su" "${LIBRARY_INSTALL_PREFIX}") CURRENT_USER=$(whoami) - if test "${OWNER}" != "${CURRENT_USER}" ; then + if test "${OWNER}" != "${CURRENT_USER}"; then id -u ${CURRENT_USER} echo "创建目录: ${LIBRARY_INSTALL_PREFIX} ,并修改所属者为: ${CURRENT_USER} " sudo mkdir -p ${LIBRARY_INSTALL_PREFIX} @@ -166,13 +163,12 @@ if [ "$OS" = 'macos' ] ; then fi - -if [ ! -f "${__PROJECT__}/bin/runtime/php" ] ;then - if [ "$MIRROR" = 'china' ] ; then - bash sapi/quickstart/setup-php-runtime.sh --mirror china - else - bash sapi/quickstart/setup-php-runtime.sh - fi +if [ ! -f "${__PROJECT__}/bin/runtime/php" ]; then + if [ "$MIRROR" = 'china' ]; then + bash sapi/quickstart/setup-php-runtime.sh --mirror china + else + bash sapi/quickstart/setup-php-runtime.sh + fi fi export PATH="${__PROJECT__}/bin/runtime:$PATH" @@ -180,26 +176,24 @@ alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.c php -v +if [ ${WITH_PHP_COMPOSER} -eq 1 ]; then + export COMPOSER_ALLOW_SUPERUSER=1 + if [ "$MIRROR" = 'china' ]; then + composer config -g repos.packagist composer https://mirrors.tencent.com/composer/ + # composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ + else + composer config -g repos.packagist composer https://packagist.org + fi + # composer suggests --all + # composer dump-autoload -if [ ${WITH_PHP_COMPOSER} -eq 1 ] ; then - export COMPOSER_ALLOW_SUPERUSER=1 - if [ "$MIRROR" = 'china' ]; then - composer config -g repos.packagist composer https://mirrors.tencent.com/composer/ - # composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ - else - composer config -g repos.packagist composer https://packagist.org - fi - # composer suggests --all - # composer dump-autoload - - # composer update --optimize-autoloader - composer install --no-interaction --no-autoloader --no-scripts --profile # --no-dev - composer dump-autoload --optimize --profile + # composer update --optimize-autoloader + composer install --no-interaction --no-autoloader --no-scripts --profile # --no-dev + composer dump-autoload --optimize --profile - composer config -g --unset repos.packagist + composer config -g --unset repos.packagist fi - # 可用配置参数 # --with-swoole-pgsql=1 # --with-libavif=1 @@ -216,56 +210,53 @@ fi # --with-override-default-enabled-ext=0 # --with-download-mirror-url=https://php-cli.jingjingxyk.com/ - - # 定制构建选项 OPTIONS="${OPTIONS} +apcu +ds +xlswriter +ssh2 +uuid " OPTIONS="${OPTIONS} --with-global-prefix=${LIBRARY_INSTALL_PREFIX}" # OPTIONS="${OPTIONS} @macos" +if [ ${IN_DOCKER} -eq 1 ]; then + { + # 容器中 -if [ ${IN_DOCKER} -eq 1 ] ; then -{ -# 容器中 - - php prepare.php +inotify ${OPTIONS} + php prepare.php +inotify ${OPTIONS} -} else { -# 容器外 - php prepare.php --without-docker=1 ${OPTIONS} + } +else + { + # 容器外 + php prepare.php --without-docker=1 ${OPTIONS} -} + } fi - -if [ ${WITH_DOWNLOAD_BOX} -eq 1 ] ; then - echo " please exec script: " - echo " bash sapi/download-box/download-box-batch-downloader.sh " - echo " bash sapi/download-box/download-box-init.sh " - exit 0 +if [ ${WITH_DOWNLOAD_BOX} -eq 1 ]; then + echo " please exec script: " + echo " bash sapi/download-box/download-box-batch-downloader.sh " + echo " bash sapi/download-box/download-box-init.sh " + exit 0 fi -if [ ${WITH_BUILD_CONTAINER} -eq 1 ] ; then - echo " please exec script: " - if [ "$MIRROR" = 'china' ]; then - echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh --composer_mirror tencent --mirror ustc " - else - echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh " - fi - exit 0 +if [ ${WITH_BUILD_CONTAINER} -eq 1 ]; then + echo " please exec script: " + if [ "$MIRROR" = 'china' ]; then + echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh --composer_mirror tencent --mirror ustc " + else + echo " bash sapi/multistage-build-dependencies-container/all-dependencies-build-container.sh " + fi + exit 0 fi -if [ ${WITH_WEB_UI} -eq 1 ] ; then - echo " please exec script: " - echo " bash sapi/webUI/webui-init-data.sh " - echo " php sapi/webUI/bootstrap.php " - exit 0 +if [ ${WITH_WEB_UI} -eq 1 ]; then + echo " please exec script: " + echo " bash sapi/webUI/webui-init-data.sh " + echo " php sapi/webUI/bootstrap.php " + exit 0 fi - -if [ "$OS" = 'linux' ] && [ ${IN_DOCKER} -eq 0 ] ; then - echo ' please run in container !' - exit 0 +if [ "$OS" = 'linux' ] && [ ${IN_DOCKER} -eq 0 ]; then + echo ' please run in container !' + exit 0 fi bash make-install-deps.sh @@ -299,7 +290,3 @@ exit 0 # bash build-release.sh --mirror china --webui # bash sapi/webUI/webui-init-data.sh # php sapi/webUI/bootstrap.php - - - - From 832eaa246e3973de24fabf8794388fcb6c2419dd Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 22:23:09 +0800 Subject: [PATCH 134/226] add comment --- sapi/src/template/make.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index 07d02e92cb..41a3cd2b3e 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -34,6 +34,8 @@ extraOptions?> " +# --with-config-file-scan-dir=getGlobalPrefix() ?>/etc/php/conf.d/ \ +# --with-config-file-path=getGlobalPrefix() ?>/etc/php/ \ libraryList as $item) : ?> make_name?>() { From 403f4571c7a693d5b112f0c235b828f9931c2b81 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 22:36:37 +0800 Subject: [PATCH 135/226] update --- sapi/docker/build-export-container.sh | 28 ++++++++++----------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/sapi/docker/build-export-container.sh b/sapi/docker/build-export-container.sh index 432281cdde..039fb89ae1 100644 --- a/sapi/docker/build-export-container.sh +++ b/sapi/docker/build-export-container.sh @@ -1,6 +1,6 @@ #!/bin/bash -:<<'COMMENT' +: <<'COMMENT' 从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 ,并把新容器镜像导出为文件 @@ -18,7 +18,6 @@ __PROJECT__=$( cd ${__DIR__} cd ${__PROJECT__} - CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18' CONTAIENR_NAME='swoole-cli-builder' MIRROR='' @@ -40,11 +39,11 @@ while [ $# -gt 0 ]; do ;; --mirror) MIRROR="$2" - ;; - ) + ;; + --quickstart-container) CONTAIENR_NAME='swoole-cli-alpine-dev' # 从quickstart 生成的容器中拷贝 /usr/local/swoole-cli/ 文件夹,并生成新容器镜像 - ;; + ;; --*) echo "Illegal option $1" ;; @@ -53,22 +52,19 @@ while [ $# -gt 0 ]; do done case "$MIRROR" in - china | openatom) - CONTAINER_BASE_IMAGE="hub.atomgit.com/library/alpine:3.18" - ;; +china | openatom) + CONTAINER_BASE_IMAGE="hub.atomgit.com/library/alpine:3.18" + ;; esac - mkdir -p var/build-export-container/ cd ${__PROJECT__}/var/build-export-container/ test -d swoole-cli && rm -rf swoole-cli - docker cp ${CONTAIENR_NAME}:/usr/local/swoole-cli/ . - -cat > Dockerfile <<'EOF' +cat >Dockerfile <<'EOF' ARG BASE_IMAGE="alpine:3.18" FROM ${BASE_IMAGE} # FROM alpine:3.18 @@ -94,8 +90,6 @@ ENTRYPOINT ["tini", "--"] EOF - - ARCH=$(uname -m) TIME=$(date -u '+%Y%m%dT%H%M%SZ') VERSION="1.6" @@ -105,16 +99,14 @@ IMAGE="docker.io/phpswoole/swoole-cli-builder:${TAG}" echo "MIRROR=${MIRROR}" echo "BASE_IMAGE=${CONTAINER_BASE_IMAGE}" -docker build --no-cache -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" +docker build --no-cache -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}" echo ${IMAGE} -echo ${IMAGE} > container-image.txt +echo ${IMAGE} >container-image.txt IMAGE_FILE="swoole-cli-builder.tar" docker save -o ${IMAGE_FILE} ${IMAGE} tar -cJvf "${IMAGE_FILE}.xz" ${IMAGE_FILE} - # docker load -i "swoole-cli-builder-image.tar" - From 10a11bdd9153c8b2ce9564bb7364e7f39572ac97 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 22:43:35 +0800 Subject: [PATCH 136/226] update --- build-musl-enviroment-example.sh | 164 ------------------------------- 1 file changed, 164 deletions(-) delete mode 100644 build-musl-enviroment-example.sh diff --git a/build-musl-enviroment-example.sh b/build-musl-enviroment-example.sh deleted file mode 100644 index 122dec1ab9..0000000000 --- a/build-musl-enviroment-example.sh +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/bash - - -__DIR__=$( - cd "$(dirname "$0")" - pwd -) -__PROJECT__=${__DIR__} - -if [ ! -f ${__DIR__}/prepare.php ] ; then - echo 'no found prepare.php' - exit 0 -fi - -cd ${__PROJECT__} - - -set -x - -# shellcheck disable=SC2034 -OS=$(uname -s) -# shellcheck disable=SC2034 -ARCH=$(uname -m) - -case $OS in -'Linux') - OS="linux" - ;; -'Darwin') - OS="macos" - ;; -*) - echo '暂未配置的 OS ' - exit 0 - ;; - -esac - - -IN_DOCKER=0 -WITH_PHP_COMPOSER=1 - -# 配置系统仓库 china mirror -MIRROR='china' - - - -OPTIONS='' - -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},127.0.0.1,localhost" - NO_PROXY="${NO_PROXY},.aliyuncs.com,.aliyun.com" - NO_PROXY="${NO_PROXY},.tsinghua.edu.cn,.ustc.edu.cn" - NO_PROXY="${NO_PROXY},.tencent.com" - NO_PROXY="${NO_PROXY},.sourceforge.net" - export NO_PROXY="${NO_PROXY},.npmmirror.com" - - OPTIONS="${OPTIONS} --with-http-proxy=${HTTP_PROXY} " - ;; - --debug) - set -x - OPTIONS="${OPTIONS} --with-build-type=debug " - ;; - --*) - echo "Illegal option $1" - ;; - esac - shift $(($# > 0 ? 1 : 0)) -done - -if [ "$OS" = 'linux' ] ; then - if [ -f /.dockerenv ]; then - IN_DOCKER=1 - number=$(which flex | wc -l) - if test $number -eq 0 ;then - { - if [ "$MIRROR" = 'china' ] ; then - sh sapi/quickstart/linux/debian-init.sh --mirror china - else - sh sapi/quickstart/linux/debian-init.sh - fi - } - fi - git config --global --add safe.directory ${__PROJECT__} - else - # docker inspect -f {{.State.Running}} download-box-web-server - if [ "`docker inspect -f {{.State.Running}} swoole-cli-builder`" = "true" ]; then - echo " build container is running " - else - echo " build container no running " - fi - OPTIONS="${OPTIONS} --without-docker=1 " - fi -fi - -if [ "$OS" = 'macos' ] ; then - number=$(which flex | wc -l) - if test $number -eq 0 ; then - { - if [ "$MIRROR" = 'china' ] ; then - bash sapi/quickstart/macos/macos-init.sh --mirror china - else - bash sapi/quickstart/macos/macos-init.sh - fi - } - fi -fi - -bash sapi/quickstart/clean-folder.sh - -php -v - - -if [ ${WITH_PHP_COMPOSER} -eq 1 ] ; then - export COMPOSER_ALLOW_SUPERUSER=1 - if [ "$MIRROR" = 'china' ]; then - composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/ - # composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ - else - composer config -g repos.packagist composer https://packagist.org - fi - # composer suggests --all - # composer dump-autoload - - # composer update --optimize-autoloader - composer config -g --unset repos.packagist -fi - - -# 定制构建选项 -OPTIONS=' --with-override-default-enabled-ext=1 ' -OPTIONS="${OPTIONS} +musl_cross_make" -OPTIONS="${OPTIONS} --with-http-proxy=http://127.0.0.1:8010" -OPTIONS="${OPTIONS} --with-c-compiler=gcc " - - -if [ ${IN_DOCKER} -eq 1 ] ; then -{ -# 容器中 - php prepare.php ${OPTIONS} - -} else { -# 容器外 - php prepare.php --without-docker=1 ${OPTIONS} - -} -fi - - -if [ "$OS" = 'linux' ]; then - bash make-install-deps.sh - bash make.sh musl_cross_make - - exit 0 -fi - From 8b2127f754958bde8bbd4e1ebe4d096c78d0a2df Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 15 Jul 2024 23:05:30 +0800 Subject: [PATCH 137/226] update --- sapi/quickstart/swoole-install/FAQ.md | 38 ---- sapi/quickstart/swoole-install/README.md | 29 --- .../swoole-install/alpine-init-for-swoole.sh | 2 - .../swoole-install/debian-init-for-swoole.sh | 3 - sapi/quickstart/swoole-install/install.sh | 191 ------------------ .../swoole-install/macos-init-for-swoole.sh | 6 - .../swoole-install/rhel-init-for-swoole.sh | 4 - 7 files changed, 273 deletions(-) delete mode 100644 sapi/quickstart/swoole-install/FAQ.md delete mode 100644 sapi/quickstart/swoole-install/README.md delete mode 100644 sapi/quickstart/swoole-install/alpine-init-for-swoole.sh delete mode 100644 sapi/quickstart/swoole-install/debian-init-for-swoole.sh delete mode 100644 sapi/quickstart/swoole-install/install.sh delete mode 100644 sapi/quickstart/swoole-install/macos-init-for-swoole.sh delete mode 100644 sapi/quickstart/swoole-install/rhel-init-for-swoole.sh diff --git a/sapi/quickstart/swoole-install/FAQ.md b/sapi/quickstart/swoole-install/FAQ.md deleted file mode 100644 index 3cbfd65819..0000000000 --- a/sapi/quickstart/swoole-install/FAQ.md +++ /dev/null @@ -1,38 +0,0 @@ -## 查看扩展加载顺序 - -```bash - -ls -lh `php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs` - -``` - -## php.ini 配置文件 curl、sockets、mysqld 扩展应该在 swoole 扩展之前加载 - https://github.com/swoole/swoole-src/issues/4085 - - 编译php 时 扫描目录配置 --with-config-file-scan-dir - - -```bash - -# 查看配置所在目录 -php --ini | grep ".ini files" - -# 配置 90-swoole.ini -PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) - -if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then - SUDO='' - if [ ! -w "${PHP_INI_SCAN_DIR}" ] ; then - SUDO='sudo' - fi - ${SUDO} tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF -extension=swoole.so -swoole.use_shortname=Off -EOF - -fi - -php --ri swoole - -``` - diff --git a/sapi/quickstart/swoole-install/README.md b/sapi/quickstart/swoole-install/README.md deleted file mode 100644 index 9437f5345c..0000000000 --- a/sapi/quickstart/swoole-install/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# 快速安装 swoole - - -## 安装 -1. linux -2. maoc - -### linux -#### debian -1. debian -1. ubuntu - -### rhel -1. rockylinux -1. almalinux -1. redhat -1. -### other - - -### -```bash - -curl -fSL https://gitee.com/jingjingxyk/swoole-cli/raw/new_dev/sapi/quickstart/swoole-install/install.sh | bash -s -- --mirror china --latest - -curl -fSL https://github.com/jingjingxyk/swoole-cli/blob/new_dev/sapi/quickstart/swoole-install/install.sh?raw=true | bash -s -- --mirror china --latest - - -``` diff --git a/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh b/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh deleted file mode 100644 index dbbcff1165..0000000000 --- a/sapi/quickstart/swoole-install/alpine-init-for-swoole.sh +++ /dev/null @@ -1,2 +0,0 @@ -apk add autoconf automake make libtool cmake bison re2c gcc g++ -apk add curl-dev c-ares-dev postgresql-dev sqlite-dev unixodbc-dev liburing-dev linux-headers diff --git a/sapi/quickstart/swoole-install/debian-init-for-swoole.sh b/sapi/quickstart/swoole-install/debian-init-for-swoole.sh deleted file mode 100644 index 4e15348050..0000000000 --- a/sapi/quickstart/swoole-install/debian-init-for-swoole.sh +++ /dev/null @@ -1,3 +0,0 @@ -apt-get install -y libc-ares-dev libcurl4-openssl-dev -apt-get install -y libpcre3 libpcre3-dev libpq-dev libsqlite3-dev unixodbc-dev -apt-get install -y libbrotli-dev liburing-dev diff --git a/sapi/quickstart/swoole-install/install.sh b/sapi/quickstart/swoole-install/install.sh deleted file mode 100644 index f1717970fa..0000000000 --- a/sapi/quickstart/swoole-install/install.sh +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env bash - -__DIR__=$(cd "$(dirname "$0")";pwd) -set -x - -PHP=$(which php) -PHPIZE=$(which phpize) -PHP_CONFIG=$(which php-config) - - -if test -x "${PHP}" -a -x "${PHPIZE}" -a -x "${PHP_CONFIG}" ; then - ${PHP} -v - ${PHPIZE} --help - ${PHP_CONFIG} --help -else - echo 'no found PHP ' - exit 0 -fi - - - -mkdir -p /tmp/build - -# shellcheck disable=SC2164 -cd /tmp/build/ - - -MIRROR='' -DEBUG=0 -ENABLE_TEST=0 -VERSION_LATEST=0 - -while [ $# -gt 0 ]; do - case "$1" in - --mirror) - MIRROR="$2" - ;; - --debug) - DEBUG=1 - ;; - --latest) - VERSION_LATEST=1 - ;; - --test) - ENABLE_TEST=1 - ;; - --*) - echo "no found mirror option $1" - ;; - esac - shift $(($# > 0 ? 1 : 0)) -done - -# 保持源码最新 -test $VERSION_LATEST -eq 1 && test -d swoole-src && rm -rf swoole-src - - -case "$MIRROR" in -china ) - test -d swoole-src || git clone -b master --single-branch --depth=1 https://gitee.com/swoole/swoole.git swoole-src - ;; -*) - test -d swoole-src || git clone -b master --single-branch --depth=1 https://github.com/swoole/swoole-src.git - ;; -esac - - -SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/usr" -SWOOLE_IO_URING='' -SWOOLE_DEBUG_OPTIONS=''; -SWOOLE_THREAD_OPTION=''; - -if [ $DEBUG -eq 1 ] ;then - SWOOLE_DEBUG_OPTIONS=' --enable-debug --enable-debug-log --enable-trace-log ' -fi - -# shellcheck disable=SC2046 -if [ $(php -r "echo PHP_ZTS;") -eq 1 ] ; then - SWOOLE_THREAD_OPTION="--enable-swoole-thread" -fi - -CPU_LOGICAL_PROCESSORS=4 -OS=$(uname -s) -ARCH=$(uname -m) -case "$OS" in -Darwin) - CPU_LOGICAL_PROCESSORS=$(sysctl -n hw.ncpu) - case "$ARCH" in - x86_64) - export PKG_CONFIG_PATH=/usr/local/opt/libpq/lib/pkgconfig/:/usr/local/opt/unixodbc/lib/pkgconfig/ - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/usr/local/opt/unixodbc/" - ;; - arm64) - export PKG_CONFIG_PATH=/opt/homebrew/opt/libpq/lib/pkgconfig/:/opt/homebrew/opt/unixodbc/lib/pkgconfig/ - SWOOLE_ODBC_OPTIONS="--with-swoole-odbc=unixODBC,/opt/homebrew/opt/unixodbc/" - ;; - esac - ;; -Linux) - CPU_LOGICAL_PROCESSORS=$(grep "processor" /proc/cpuinfo | sort -u | wc -l) - OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') - case "$OS_RELEASE" in - 'rocky' | 'almalinux' ) # | 'rhel' | 'centos' | 'fedora' # 未测试 - SWOOLE_ODBC_OPTIONS="" # 缺少 unixODBC-devel - ;; - 'debian' | 'ubuntu' ) # | 'alpine' # 构建报错 - SWOOLE_IO_URING=' --enable-iouring ' - ;; - esac - ;; -*) - ;; -esac - - - -cd swoole-src - -test -f ext-src/.libs/php_swoole.o && make clean - -phpize - -./configure \ -${SWOOLE_DEBUG_OPTIONS} \ ---enable-openssl \ ---enable-sockets \ ---enable-mysqlnd \ ---enable-cares \ ---enable-swoole-curl \ ---enable-swoole-pgsql \ ---enable-swoole-sqlite \ -${SWOOLE_ODBC_OPTIONS} \ -${SWOOLE_IO_URING} \ -${SWOOLE_THREAD_OPTION} \ - -if [ $? -ne 0 ] ; then - echo $? - exit 0 -fi - -# --with-php-config=/usr/bin/php-config -# --enable-swoole-thread \ -# --enable-iouring - - -make -j ${CPU_LOGICAL_PROCESSORS} - -if [ $? -ne 0 ] ; then - echo $? - exit 0 -fi - -if test $ENABLE_TEST -eq 1 ; then - cd /tmp/build/swoole-src/tests/include/lib/ - composer install - cd /tmp/build/swoole-src/ - make test -fi - -make install -if [ $? -ne 0 ] ; then - echo $? - exit 0 -fi - - -# 创建 swoole.ini - -PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs) -if [ $? -ne 0 ] ; then - echo $? - exit 0 -fi - -if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then - SUDO='' - if [ ! -w "${PHP_INI_SCAN_DIR}" ] ; then - SUDO='sudo' - fi - - ${SUDO} tee ${PHP_INI_SCAN_DIR}/90-swoole.ini << EOF -extension=swoole.so -swoole.use_shortname=On -EOF - -fi - -php -v -php --ini -php --ini | grep ".ini files" -php --ri swoole diff --git a/sapi/quickstart/swoole-install/macos-init-for-swoole.sh b/sapi/quickstart/swoole-install/macos-init-for-swoole.sh deleted file mode 100644 index 7bfa5b8e52..0000000000 --- a/sapi/quickstart/swoole-install/macos-init-for-swoole.sh +++ /dev/null @@ -1,6 +0,0 @@ - -export HOMEBREW_NO_ANALYTICS=1 -export HOMEBREW_NO_AUTO_UPDATE=1 -export HOMEBREW_INSTALL_FROM_API=1 - -brew install c-ares libpq unixodbc brotli curl diff --git a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh b/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh deleted file mode 100644 index 51f100e171..0000000000 --- a/sapi/quickstart/swoole-install/rhel-init-for-swoole.sh +++ /dev/null @@ -1,4 +0,0 @@ -yum install -y glibc-headers -yum install -y gcc-c++ - -yum install -y c-ares-devel libcurl-devel pcre-devel postgresql-devel unixODBC brotli-devel sqlite-devel From 1def89c9017ccca4950f5261acab077af14cd49b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 16 Jul 2024 12:04:03 +0800 Subject: [PATCH 138/226] add liburing io_uring library --- sapi/src/builder/library/liburing.php | 34 +++++++++++++++++++++++++++ sapi/src/constants.php | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 sapi/src/builder/library/liburing.php diff --git a/sapi/src/builder/library/liburing.php b/sapi/src/builder/library/liburing.php new file mode 100644 index 0000000000..b04207fb50 --- /dev/null +++ b/sapi/src/builder/library/liburing.php @@ -0,0 +1,34 @@ +addLibrary( + (new Library('liburing')) # io_uring iouring + ->withHomePage('https://github.com/axboe/liburing.git') + ->withLicense('https://github.com/axboe/liburing/blob/master/COPYING', Library::LICENSE_LGPL) + ->withManual('hhttps://github.com/axboe/liburing') + ->withUrl('https://github.com/axboe/liburing/archive/refs/tags/liburing-2.6.tar.gz') + ->withPrefix($liburing_prefix) + ->withConfigure( + <<withScriptAfterInstall( + <<withBinPath($liburing_prefix . '/bin/') + ->withPkgName('liburing') + ); +}; diff --git a/sapi/src/constants.php b/sapi/src/constants.php index ca465042e1..77052b7dfd 100644 --- a/sapi/src/constants.php +++ b/sapi/src/constants.php @@ -54,3 +54,5 @@ define("LIBUUID_PREFIX", $p->getGlobalPrefix() . '/libuuid'); define("LIBINTL_PREFIX", $p->getGlobalPrefix() . '/libintl'); define("LIBUNISTRING_PREFIX", $p->getGlobalPrefix() . '/libunistring'); + +define("LIBURING_PREFIX", $p->getGlobalPrefix() . '/liburing'); From ef2f1546e714e8ebad4fc6918e213f930439e144 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 16 Jul 2024 22:59:59 +0800 Subject: [PATCH 139/226] update --- .../linux/SDN/NET-TOOLS/netfilter.md | 143 ++++++++++++++++++ sapi/quickstart/linux/SDN/other.md | 1 + sapi/quickstart/linux/SDN/wireguard/start.sh | 2 + sapi/src/builder/library/libmongoc.php | 4 +- 4 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md create mode 100644 sapi/quickstart/linux/SDN/other.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md b/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md new file mode 100644 index 0000000000..80ee2d26f6 --- /dev/null +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md @@ -0,0 +1,143 @@ +# iptables详解(1):iptables概念 + + + https://www.cnblogs.com/jingjingxyk/p/16866170.html + + https://www.cnblogs.com/cheyunhua/p/15188835.html + https://www.zsythink.net/archives/1199 + + firewalld 、nftables 和、iptables 都是 netfilter 管理工具 + + 四表五链 (链相当于关卡、表相当于系统功能的规则集合) + + 放行(accept)、拒绝(reject)和丢弃(drop) + + 关卡在iptables中不被称为”关卡”,而被称为”链” + + “路由前”、”转发”、”路由后”,他们的英文名是 + + PREROUTING、FORWARD、POSTROUTING + + 如果报文需要转发,那么报文则不会经过input链发往用户空间,而是直接在内核空间中经过forward链和postrouting链转发出去 + +## 常用场景中,报文的流向 + + 到本机某进程的报文:PREROUTING –> INPUT + + 由本机转发的报文:PREROUTING –> FORWARD –> POSTROUTING + + 由本机的某进程发出报文(通常为响应报文):OUTPUT –> POSTROUTING + +## iptables为我们提供了如下”表” + +我们对每个”链”上都放置了一串规则,但是这些规则有些很相似 ,我们把具有相同功能的规则的集合叫做”表”,所以说,不同功能的规则,我们可以放置在不同的表中进行管理 + + filter表:负责过滤功能,防火墙;内核模块:iptables_filter + + nat表:network address translation,网络地址转换功能;内核模块:iptable_nat + + mangle表:拆解报文,做出修改,并重新封装 的功能;iptable_mangle + + raw表:关闭nat表上启用的连接追踪机制;iptable_raw + +## 每个”链”中的规则都存在于哪些”表”中 + + PREROUTING 的规则可以存在于:raw表,mangle表,nat表。 + + INPUT 的规则可以存在于:mangle表,filter表 + + FORWARD 的规则可以存在于:mangle表,filter表。 + + OUTPUT 的规则可以存在于:raw表mangle表,nat表,filter表。 + + POSTROUTING 的规则可以存在于:mangle表,nat表。 + +## 往往是通过”表”作为操作入口,对规则进行定义的 + + raw 表中的规则可以被哪些链使用:PREROUTING,OUTPUT + + mangle 表中的规则可以被哪些链使用:PREROUTING,INPUT,FORWARD,OUTPUT,POSTROUTING + + nat 表中的规则可以被哪些链使用:PREROUTING,OUTPUT,POSTROUTING + + filter 表中的规则可以被哪些链使用:INPUT,FORWARD,OUTPUT + +## iptables为我们定义了4张”表”,当他们处于同一条”链”时,执行的优先级如下 + 优先级次序(由高而低): + + raw –> mangle –> nat –> filter + + +## 链的规则存放于哪些表中(从链到表的对应关系): + + PREROUTING 的规则可以存在于:raw表,mangle表,nat表。 + + INPUT 的规则可以存在于:mangle表,filter表,(centos7中还有nat表,centos6中没有)。 + + FORWARD 的规则可以存在于:mangle表,filter表。 + + OUTPUT 的规则可以存在于:raw表mangle表,nat表,filter表。 + + POSTROUTING 的规则可以存在于:mangle表,nat表。 + +## ”匹配条件”与”动作”组成了规则 + 匹配条件分为基本匹配条件与扩展匹配条件 + + 基本匹配条件: 源地址Source IP,目标地址 Destination IP + + + + +## 处理动作 + + 处理动作在iptables中被称为target + + ACCEPT:允许数据包通过。 + + DROP:直接丢弃数据包,不给任何回应信息,这时候客户端会感觉自己的请求泥牛入海了,过了超时时间才会有反应。 + + REJECT:拒绝数据包通过,必要时会给数据发送端一个响应的信息,客户端刚请求就会收到拒绝的信息。 + + SNAT:源地址转换,解决内网用户用同一个公网地址上网的问题。 + + MASQUERADE:是SNAT的一种特殊形式,适用于动态的、临时会变的ip上。 伪装 + + DNAT:目标地址转换。 + + REDIRECT:在本机做端口映射。 + + LOG:在/var/log/messages文件中记录日志信息,然后将数据包传递给下一条规则,也就是说除了记录以外不对数据包做任何其他操作,仍然让下一条规则去匹配。 + +## nftables 和 iptables 都是 netfilter 管理工具 + +## 实操 + 当没有使用-t选项指定表时,默认为操作filter表 + + iptables -t filter -L + iptables -t nat -L + iptables -t mangle -L + iptables -t raw -L + + iptables -t filter -L INPUT + iptables -v -t filter -L DOCKER (DOCKER 是自定义链) + + iptables -nvL (n 不执行IP反查域名) + iptables --line-numbers -nvL (n 不执行IP反查域名)显示序号 + iptables --line-numbers -nvL INPUT + + iptables -t 表名 -L 链名 + + +## 主机防火墙 和 网络防火墙 + 当iptables作为”网络防火墙”时,在配置规则时,往往需要考虑”双向性” + + state可以译为状态 实现”连接追踪”机制 + 报文状态可以为NEW、ESTABLISHED、RELATED、INVALID、UNTRACKED + + 连接追踪 对应的内核模块 nf_conntrack + + iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT + + TCP Flags: SYN,ACK,FIN,RST,URG,PSH + + conntrack -L diff --git a/sapi/quickstart/linux/SDN/other.md b/sapi/quickstart/linux/SDN/other.md new file mode 100644 index 0000000000..bfdfe3328a --- /dev/null +++ b/sapi/quickstart/linux/SDN/other.md @@ -0,0 +1 @@ +## 编辑器主题的 Monokai diff --git a/sapi/quickstart/linux/SDN/wireguard/start.sh b/sapi/quickstart/linux/SDN/wireguard/start.sh index 94c4d5c6fd..acec90e093 100644 --- a/sapi/quickstart/linux/SDN/wireguard/start.sh +++ b/sapi/quickstart/linux/SDN/wireguard/start.sh @@ -14,6 +14,8 @@ ip address add 10.192.99.1/24 dev wg0 wg setconf wg0 configuration.conf ip link set up dev wg0 { + sysctl -w net.ipv4.ip_forward=1 + iptables -t filter -A FORWARD -i wg0 -j ACCEPT } || { echo $? diff --git a/sapi/src/builder/library/libmongoc.php b/sapi/src/builder/library/libmongoc.php index 7d6ea27edb..fd8b956662 100644 --- a/sapi/src/builder/library/libmongoc.php +++ b/sapi/src/builder/library/libmongoc.php @@ -93,8 +93,8 @@ 'zlib', 'libzstd', 'icu', - // 'libsasl', - 'snappy' + // 'libsasl', + 'snappy' ) //'libbson' ); }; From 83c1f4ac9f70e6f66408c92040e9bd70a196969a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 17 Jul 2024 00:29:42 +0800 Subject: [PATCH 140/226] update --- build-release-example.sh | 65 ++++----------------------- sapi/src/builder/extension/common.php | 1 + 2 files changed, 9 insertions(+), 57 deletions(-) diff --git a/build-release-example.sh b/build-release-example.sh index b7e18f137f..e83570a4ae 100644 --- a/build-release-example.sh +++ b/build-release-example.sh @@ -98,23 +98,12 @@ while [ $# -gt 0 ]; do shift $(($# > 0 ? 1 : 0)) done -<<<<<<< HEAD -if [ "$OS" = 'linux' ] ; then - if [ ! "$BASH_VERSION" ] ; then - echo "Please use bash to run this script ($0) " 1>&2 - echo "fix : " 1>&2 - echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-minimal.sh " 1>&2 - exit 1 - # reconfigure # - # dpkg-reconfigure dash -======= if [ "$OS" = 'linux' ]; then if [ ! "$BASH_VERSION" ]; then echo "Please use bash to run this script ($0) " 1>&2 echo "fix : " 1>&2 echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-minimal.sh " 1>&2 exit 1 ->>>>>>> build_native_php fi fi @@ -129,43 +118,9 @@ for cmd in "${CMDS[@]}"; do fi done -<<<<<<< HEAD -if [ "$OS" = 'linux' ] ; then - OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"') - - if [ -f /.dockerenv ]; then - IN_DOCKER=1 - if test $CMDS_LEN -ne $CMDS_NUMS ;then - { - if [ "$MIRROR" = 'china' ] ; then - if [ "$OS_RELEASE" = 'alpine' ]; then - sh sapi/quickstart/linux/alpine-init.sh --mirror china - elif [ "$OS_RELEASE" = 'debian' ] || [ "$OS_RELEASE" = 'ubuntu' ] ; then - bash sapi/quickstart/linux/debian-init.sh --mirror china - else - echo 'no support OS' - exit 0 - fi - else - if [ "$OS_RELEASE" = 'alpine' ]; then - sh sapi/quickstart/linux/alpine-init.sh - elif [ "$OS_RELEASE" = 'debian' ] || [ "$OS_RELEASE" = 'ubuntu' ] ; then - bash sapi/quickstart/linux/debian-init.sh - else - echo 'no support OS' - exit 0 - fi - fi - } - fi - git config --global --add safe.directory ${__PROJECT__} - else - # docker inspect -f {{.State.Running}} download-box-web-server - if [ "`docker inspect -f {{.State.Running}} swoole-cli-builder`" = "true" ]; then - echo " build container is running " -======= if [ "$OS" = 'linux' ]; then OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '\n' | tr -d '\"') + if [ -f /.dockerenv ]; then IN_DOCKER=1 if test $CMDS_LEN -ne $CMDS_NUMS; then @@ -173,7 +128,7 @@ if [ "$OS" = 'linux' ]; then if [ "$MIRROR" = 'china' ]; then if [ "$OS_RELEASE" = 'alpine' ]; then sh sapi/quickstart/linux/alpine-init.sh --mirror china - elif [ "$OS_RELEASE" = 'debian' ]; then + elif [ "$OS_RELEASE" = 'debian' ] || [ "$OS_RELEASE" = 'ubuntu' ]; then bash sapi/quickstart/linux/debian-init.sh --mirror china else echo 'no support OS' @@ -182,9 +137,8 @@ if [ "$OS" = 'linux' ]; then else if [ "$OS_RELEASE" = 'alpine' ]; then sh sapi/quickstart/linux/alpine-init.sh - elif [ "$OS_RELEASE" = 'debian' ]; then + elif [ "$OS_RELEASE" = 'debian' ] || [ "$OS_RELEASE" = 'ubuntu' ]; then bash sapi/quickstart/linux/debian-init.sh ->>>>>>> build_native_php else echo 'no support OS' exit 0 @@ -192,8 +146,10 @@ if [ "$OS" = 'linux' ]; then fi } fi - git config --global --add safe.directory ${__PROJECT__} else + + git config --global --add safe.directory ${__PROJECT__} + # docker inspect -f {{.State.Running}} download-box-web-server if [ "$(docker inspect -f {{.State.Running}} swoole-cli-builder)" = "true" ]; then echo " build container is running " @@ -260,14 +216,9 @@ if [ ${WITH_PHP_COMPOSER} -eq 1 ]; then # composer update --no-interaction --optimize-autoloader # composer install --no-interaction --optimize-autoloader -<<<<<<< HEAD - # composer update --optimize-autoloader - # composer update --optimize-autoloader --no-dev - # composer update --profile --prefer-dist --no-dev --optimize-autoloader -======= - # composer update --optimize-autoloader + # composer update --profile --prefer-dist --no-dev --optimize-autoloader + composer install --no-interaction --no-autoloader --no-scripts --profile # --no-dev ->>>>>>> build_native_php composer dump-autoload --optimize --profile diff --git a/sapi/src/builder/extension/common.php b/sapi/src/builder/extension/common.php index 6bbb31aa0f..d78983b596 100644 --- a/sapi/src/builder/extension/common.php +++ b/sapi/src/builder/extension/common.php @@ -196,6 +196,7 @@ $depends = ['prometheus_client_c'] ; $depends = ['liboauth2'] ; $depends = ['depot_tools','libyuv'] ; + $depends = ['libmongoc'] ; $ext = (new Extension('common')) From 63d033a9c718ba27a8972102a21ce6369c5bb94e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 17 Jul 2024 10:38:50 +0800 Subject: [PATCH 141/226] update libmongoc --- sapi/src/builder/library/libmongoc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sapi/src/builder/library/libmongoc.php b/sapi/src/builder/library/libmongoc.php index fd8b956662..32fb973249 100644 --- a/sapi/src/builder/library/libmongoc.php +++ b/sapi/src/builder/library/libmongoc.php @@ -27,26 +27,26 @@ 'mongo-c-driver', <<withPrefix($libmongoc_prefix) - //->withAutoUpdateFile() - ->withBuildCached(false) - ->withInstallCached(false) + ->withAutoUpdateFile() + ->withBuildCached() + ->withInstallCached() ->withBuildScript( << Date: Wed, 17 Jul 2024 13:17:25 +0800 Subject: [PATCH 142/226] update libmongoc --- sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh | 4 ++-- sapi/src/builder/library/coturn.php | 2 +- sapi/src/library_builder/NexusRepositoryManager.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh b/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh index 679a3241fb..24193add86 100644 --- a/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh @@ -15,10 +15,10 @@ ssh-keygen -t rsa -f id_rsa -N "" -C 'Gernerate SSH Key ' # vi /etc/ssh/sshd_config # PubkeyAuthentication yes:启用公钥身份验证; -# PasswordAuthentication no:禁用密码身份验证(可选,但建议); +# PasswordAuthentication no:禁用密码身份验证; # test link # ssh -vT git@github.com -# ssh -T git@gitee.com \ No newline at end of file +# ssh -T git@gitee.com diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index 58b0c6dd97..1437a80741 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -141,7 +141,7 @@ export CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES) -I{$snappy_prefix}/include" export LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) -L{$snappy_prefix}/lib/ {$ldflags} " export LIBS="$(pkg-config --libs-only-l --static \$PACKAGES) {$libcpp} -lm -lsnappy -pthread -lsocket -lrt " - export CFLAGS="-O3 -g -std=gnu11 -Wall {$cflags} -DOPENSSL_THREADS " + export CFLAGS=" -g -std=gnu11 -Wall {$cflags} -DOPENSSL_THREADS " export DBCFLAGS="$(pkg-config --cflags --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" export DBLIBS="$(pkg-config --libs --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" diff --git a/sapi/src/library_builder/NexusRepositoryManager.md b/sapi/src/library_builder/NexusRepositoryManager.md index 199b104394..9866ce049d 100644 --- a/sapi/src/library_builder/NexusRepositoryManager.md +++ b/sapi/src/library_builder/NexusRepositoryManager.md @@ -1,2 +1,2 @@ - +# npm docker 私有仓库搭建 https://www.sonatype.com/products/sonatype-nexus-repository From 8425e024294caabe0a7e9870b806d5fbbcc21ece Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 17 Jul 2024 14:29:49 +0800 Subject: [PATCH 143/226] update coturn --- sapi/src/builder/library/coturn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index 1437a80741..d8f2558109 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -141,7 +141,7 @@ export CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES) -I{$snappy_prefix}/include" export LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) -L{$snappy_prefix}/lib/ {$ldflags} " export LIBS="$(pkg-config --libs-only-l --static \$PACKAGES) {$libcpp} -lm -lsnappy -pthread -lsocket -lrt " - export CFLAGS=" -g -std=gnu11 -Wall {$cflags} -DOPENSSL_THREADS " + export CFLAGS=" -g -std=gnu11 -Wall {$cflags} " # -DOPENSSL_THREADS export DBCFLAGS="$(pkg-config --cflags --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" export DBLIBS="$(pkg-config --libs --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" From 6b425e5134e0c330417fa0f86d4d30fbcec8fb9b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 17 Jul 2024 21:58:22 +0800 Subject: [PATCH 144/226] update --- sapi/src/library_builder/git.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sapi/src/library_builder/git.md b/sapi/src/library_builder/git.md index 7e413c9d45..f32c294008 100644 --- a/sapi/src/library_builder/git.md +++ b/sapi/src/library_builder/git.md @@ -101,6 +101,14 @@ git checkout commit_id filename +``` + +## git 恢复被删除的整个文件夹 +```shell + +git log --oneline -- experimental-features/v3/rules/example/ +git checkout commit_id -- experimental-features/v3/rules/example/ + ``` ## git commits 出现累积叠加 解决办法 From 80d298b3020de09c4cadb84e7aeb9d82ee0faefb Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 17 Jul 2024 22:02:52 +0800 Subject: [PATCH 145/226] update --- sapi/src/builder/library/coturn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index d8f2558109..9744808294 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -141,7 +141,7 @@ export CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES) -I{$snappy_prefix}/include" export LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) -L{$snappy_prefix}/lib/ {$ldflags} " export LIBS="$(pkg-config --libs-only-l --static \$PACKAGES) {$libcpp} -lm -lsnappy -pthread -lsocket -lrt " - export CFLAGS=" -g -std=gnu11 -Wall {$cflags} " # -DOPENSSL_THREADS + export CFLAGS=" -g -std=gnu11 -Wall {$cflags} -DOPENSSL_THREADS " # export DBCFLAGS="$(pkg-config --cflags --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" export DBLIBS="$(pkg-config --libs --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" From c375db21bafde96ccdbed77281b0a72477982f48 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 17 Jul 2024 22:46:24 +0800 Subject: [PATCH 146/226] update --- sapi/src/builder/library/coturn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index 9744808294..eccfdf5c65 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -141,7 +141,7 @@ export CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES) -I{$snappy_prefix}/include" export LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) -L{$snappy_prefix}/lib/ {$ldflags} " export LIBS="$(pkg-config --libs-only-l --static \$PACKAGES) {$libcpp} -lm -lsnappy -pthread -lsocket -lrt " - export CFLAGS=" -g -std=gnu11 -Wall {$cflags} -DOPENSSL_THREADS " # + export CFLAGS=" -g -std=gnu11 -Wall {$cflags} " # -DOPENSSL_THREADS export DBCFLAGS="$(pkg-config --cflags --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" export DBLIBS="$(pkg-config --libs --static libpq sqlite3 hiredis libbson-static-1.0 libmongoc-ssl-1.0 libmongoc-static-1.0 )" From 20709b8ab0cc43291b673b0d70e3ef419f9a13e8 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 17 Jul 2024 22:48:24 +0800 Subject: [PATCH 147/226] update --- sapi/src/builder/library/coturn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index eccfdf5c65..368ad5cb06 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -31,10 +31,10 @@ 'coturn', << Date: Wed, 17 Jul 2024 22:49:37 +0800 Subject: [PATCH 148/226] update --- sapi/src/builder/library/coturn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/builder/library/coturn.php b/sapi/src/builder/library/coturn.php index 368ad5cb06..0fb53de0dc 100644 --- a/sapi/src/builder/library/coturn.php +++ b/sapi/src/builder/library/coturn.php @@ -42,7 +42,7 @@ ) ->withAutoUpdateFile() ->withPrefix($coturn_prefix) - //->withAutoUpdateFile() + ->withAutoUpdateFile() ->withBuildCached(false) ->withInstallCached(false) /* From fd163851014413f0eb1e09580f122e40eba206aa Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 20 Jul 2024 15:41:03 +0800 Subject: [PATCH 149/226] update --- sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md b/sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md new file mode 100644 index 0000000000..08a7426fc1 --- /dev/null +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md @@ -0,0 +1,32 @@ +## 分配IPv6 的方式 + +1. 手动配置:直接设置IPv6地址 +1. 基于ICMPv6 NDP 协议的自动配置 SLAAC +1. 基于DHCPv6 协议的自动配置 + +## IPv6 自动配置IP 的过程中支持三种配置方式 + +1. SLAAC Stateless address autoconfiguration,无状态地址自动配置 +1. Stateful DHCPv6 +1. Stateless DHCPv6 + +## 简述原理 + + SLAAC:即无状态自动配置。主机可以通过RA(Router-Advertisement)消息ICMP type134中携带的前缀得到地址的前缀部分,同时通过该接口自动生成接口ID部分,从而得到一个完整的128位的IPV6地址,该消息默认情况下每200S发送一次。当然主机(或路由器)也可以主动发送RS(Router Solicit)消息ICMP Type=133来主动请求该前缀。 + + + Stateful DHCPv6:即有状态DHCP v6地址分配。通过DHCPv6向主机下发相关前缀、地址、DNS等参数。同时在Stateful DHCPv6又可根据RA报文等配置分为 + + + Stateless DHCPv6:Stateless 和 Stateful 并不完全冲突,可以同时部署,协同使用。利用 NDP 下发网关和子网前缀等信息,主机根据子网前缀自动生成 + IPv6 地址。同时,利用 DHCPv6 配置 DNS Server 等其他信息。 + + + IPv6 引入了 ICMPv6 NDP(Neighbor Discovery Protocol,邻居发现协议)来替代 IPv4 ARP(Address Resolution Protocol) + +| | DHCPv6 | NDP | +|-----------|-------------------|------------------------------------| +| SLAAC | | 网关、子网前缀、mtu 主机根据子网前缀自动生成 IPv6 地址 | +| Stateful | 子网前缀、MTU、主机IP、DNS | 子网前缀、网关、主机 | +| Stateless | DNS | 子网前缀、网关、主机 、DNS | + From d80f309e481472eff138cf1885faf609a23e1ac6 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 20 Jul 2024 16:28:55 +0800 Subject: [PATCH 150/226] update docs --- .../NET-TOOLS => src/library_builder}/ipv6.md | 22 +++++++++++++++---- .../library_builder}/netfilter.md | 0 .../library_builder}/reverse-shell.md | 0 .../library_builder}/socat.md | 0 .../library_builder}/ssh-upgrade.md | 0 5 files changed, 18 insertions(+), 4 deletions(-) rename sapi/{quickstart/linux/SDN/NET-TOOLS => src/library_builder}/ipv6.md (75%) rename sapi/{quickstart/linux/SDN/NET-TOOLS => src/library_builder}/netfilter.md (100%) rename sapi/{quickstart/linux/SDN/NET-TOOLS => src/library_builder}/reverse-shell.md (100%) rename sapi/{quickstart/linux/SDN/NET-TOOLS => src/library_builder}/socat.md (100%) rename sapi/{quickstart/linux/SDN/NET-TOOLS => src/library_builder}/ssh-upgrade.md (100%) diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md b/sapi/src/library_builder/ipv6.md similarity index 75% rename from sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md rename to sapi/src/library_builder/ipv6.md index 08a7426fc1..82c9da7216 100644 --- a/sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md +++ b/sapi/src/library_builder/ipv6.md @@ -1,14 +1,14 @@ ## 分配IPv6 的方式 1. 手动配置:直接设置IPv6地址 -1. 基于ICMPv6 NDP 协议的自动配置 SLAAC -1. 基于DHCPv6 协议的自动配置 +2. 基于ICMPv6 NDP 协议的自动配置 +3. 基于DHCPv6 协议的自动配置 ## IPv6 自动配置IP 的过程中支持三种配置方式 1. SLAAC Stateless address autoconfiguration,无状态地址自动配置 -1. Stateful DHCPv6 -1. Stateless DHCPv6 +2. Stateful DHCPv6 +3. Stateless DHCPv6 ## 简述原理 @@ -30,3 +30,17 @@ | Stateful | 子网前缀、MTU、主机IP、DNS | 子网前缀、网关、主机 | | Stateless | DNS | 子网前缀、网关、主机 、DNS | +## 图文详解NDP机制之——地址解析 + + NDP使用ICMPv6的5种相关报文 + + RS(Router Solicitation):路由请求报文,type=133,code=0; + + RA(Router Advertisement):路由通告报文,type=134,code=0; + + NS(Neighbor Solicitation):邻居请求协议,type=135,code=0; + + NA(Neighbor Advertisement):邻居通告协议,type=136,code=0; + + 重定向:type=137,code=0 + diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md b/sapi/src/library_builder/netfilter.md similarity index 100% rename from sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md rename to sapi/src/library_builder/netfilter.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/reverse-shell.md b/sapi/src/library_builder/reverse-shell.md similarity index 100% rename from sapi/quickstart/linux/SDN/NET-TOOLS/reverse-shell.md rename to sapi/src/library_builder/reverse-shell.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/socat.md b/sapi/src/library_builder/socat.md similarity index 100% rename from sapi/quickstart/linux/SDN/NET-TOOLS/socat.md rename to sapi/src/library_builder/socat.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/ssh-upgrade.md b/sapi/src/library_builder/ssh-upgrade.md similarity index 100% rename from sapi/quickstart/linux/SDN/NET-TOOLS/ssh-upgrade.md rename to sapi/src/library_builder/ssh-upgrade.md From 1451b0dc581f873bd9779e468243bc17855d3141 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 20 Jul 2024 16:38:30 +0800 Subject: [PATCH 151/226] update --- sapi/quickstart/clean-folder-for-extra-build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapi/quickstart/clean-folder-for-extra-build.sh b/sapi/quickstart/clean-folder-for-extra-build.sh index 4524025c01..325796ac43 100644 --- a/sapi/quickstart/clean-folder-for-extra-build.sh +++ b/sapi/quickstart/clean-folder-for-extra-build.sh @@ -28,6 +28,9 @@ test -d kubernetes && rm -rf kubernetes test -d qemu && rm -rf qemu test -d SDN && rm -rf SDN +cd ${__PROJECT__}/sapi/ + +test -d tools && rm -rf tools cd ${__PROJECT__}/sapi/src/builder/ From 802c6b63b96bb9677a725dfbcbb6d5134a9222b7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 20 Jul 2024 16:50:59 +0800 Subject: [PATCH 152/226] update setup-coturn-runtime.sh --- setup-coturn-runtime.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-coturn-runtime.sh b/setup-coturn-runtime.sh index af0f8399f2..7e7b649a26 100644 --- a/setup-coturn-runtime.sh +++ b/setup-coturn-runtime.sh @@ -50,7 +50,7 @@ esac APP_VERSION='4.6.2' APP_NAME='coturn' -VERSION='v1.1.2' +VERSION='v1.2.0' mkdir -p bin/runtime mkdir -p var/runtime From 60e4442172c72d70036da7d0774be5e22a8d97f3 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 20 Jul 2024 22:34:27 +0800 Subject: [PATCH 153/226] update --- sapi/src/library_builder/DPR.md | 14 ++++++++++++++ sapi/src/library_builder/NAT.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 sapi/src/library_builder/DPR.md diff --git a/sapi/src/library_builder/DPR.md b/sapi/src/library_builder/DPR.md new file mode 100644 index 0000000000..974841e831 --- /dev/null +++ b/sapi/src/library_builder/DPR.md @@ -0,0 +1,14 @@ +Device Pixel Ratio + +设备像素比 也就是缩放 + +操作系统有缩放 、浏览器也有缩放 + + +图片的尺寸=css尺寸 * DPR + + +不同缩放情况下,保持图片清晰 + + + diff --git a/sapi/src/library_builder/NAT.md b/sapi/src/library_builder/NAT.md index a521065b1c..3c5c8f0c62 100644 --- a/sapi/src/library_builder/NAT.md +++ b/sapi/src/library_builder/NAT.md @@ -85,3 +85,33 @@ Web前端WebRTC 攻略(五) NAT 穿越与 ICE 【译】 NAT 穿透是如何工作的:技术原理及企业级实践 https://arthurchiao.art/blog/how-nat-traversal-works-zh/ + +webrtc 场景一:双方处于同一个内网中 + + 直接通过内网进行连接 + 通过公网后进行连接 + 通过中继服务器进行连接 + +场景二:双方处于不同的两个地方 + + 直接通过P2P进行连接 + 通过中继服务器进行连接 + +candidate的字段解析 + + foundation:用于标志和区分来自同一个stun的不同的候选者,ID标识 + icegroupid:ICE的组ID + type:协议类型 + priority:优先级 + ip:ip地址 + port:端口 + typ:标识后面字段的属性类型是候选类型 + host:本地接口获取到的candidate(本机候选) + srflx:NAT网关在公网侧的IP地址,通过STUN或者TURN收集(server reflexive candidate)(内网主机映射的外网地址端口,对称性NAT) + prflx:可以在ICE的后续阶段中获取到(peer reflexive candidate)(TUN server为客户端分配的中继地址) + relay:TURN服务器的公网转发地址,通过TURN收集(中继服务器的地址) + + + generation:代号,表明当前是第几代的候选 + ufrag: ICE分配的用户名标识 + network-cost : 网卡标识 From 55ebb0454bc50c479ed819e1ff870ffc41b69027 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 20 Jul 2024 22:37:17 +0800 Subject: [PATCH 154/226] update --- setup-coturn-runtime.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-coturn-runtime.sh b/setup-coturn-runtime.sh index 7e7b649a26..01d4ff68f5 100644 --- a/setup-coturn-runtime.sh +++ b/setup-coturn-runtime.sh @@ -115,7 +115,7 @@ else test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} tar -xvf ${APP_RUNTIME}.tar chmod a+x ${APP_NAME}/bin/turnserver - mkdir -p {__PROJECT__}/bin/runtime/${APP_NAME} + mkdir -p ${__PROJECT__}/bin/runtime/${APP_NAME} cp -rf ${__PROJECT__}/var/runtime/${APP_NAME}/* ${__PROJECT__}/bin/runtime/${APP_NAME} fi From baa08759c01160d1b42f2b192de631fc88751b53 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 21 Jul 2024 17:04:21 +0800 Subject: [PATCH 155/226] update build-release-example.sh --- build-release-example.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-release-example.sh b/build-release-example.sh index c8ac644788..b69c8c9772 100644 --- a/build-release-example.sh +++ b/build-release-example.sh @@ -167,7 +167,7 @@ if [ ${WITH_PHP_COMPOSER} -eq 1 ] ; then # composer dump-autoload # composer update --optimize-autoloader - composer install --no-interaction --no-autoloader --no-scripts --profile # --no-dev + composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vvv --profile # --no-dev composer dump-autoload --optimize --profile composer config -g --unset repos.packagist From 016489bf873c6896ad7ae0a82e38b6dfbfc676f3 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 21 Jul 2024 17:32:52 +0800 Subject: [PATCH 156/226] add extension ffi --- sapi/src/builder/extension/ffi.php | 28 ++++++++++++++++++++++++ sapi/src/builder/extension/pgsql.php | 2 +- sapi/src/builder/library/libffi.php | 32 ++++++++++++++++++++++++++++ sapi/src/constants.php | 1 + 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 sapi/src/builder/extension/ffi.php create mode 100644 sapi/src/builder/library/libffi.php diff --git a/sapi/src/builder/extension/ffi.php b/sapi/src/builder/extension/ffi.php new file mode 100644 index 0000000000..8876192d05 --- /dev/null +++ b/sapi/src/builder/extension/ffi.php @@ -0,0 +1,28 @@ +addExtension( + (new Extension('ffi')) + ->withHomePage('https://www.php.net/pgsql') + ->withLicense('https://github.com/php/php-src/blob/master/LICENSE', Extension::LICENSE_PHP) + ->withOptions('--with-ffi=' . $libffi_prefix) + ->withFile('ffi-' . $php_version . '.tgz') + ->withBuildCached(false) + ->withAutoUpdateFile() + ->withDownloadScript( + 'ffi', + <<withDependentLibraries('libffi') + ); +}; diff --git a/sapi/src/builder/extension/pgsql.php b/sapi/src/builder/extension/pgsql.php index 2932f710ed..cdf43e10bc 100644 --- a/sapi/src/builder/extension/pgsql.php +++ b/sapi/src/builder/extension/pgsql.php @@ -15,7 +15,7 @@ 'pgsql', <<withDependentLibraries('pgsql') diff --git a/sapi/src/builder/library/libffi.php b/sapi/src/builder/library/libffi.php new file mode 100644 index 0000000000..72dbef2f9e --- /dev/null +++ b/sapi/src/builder/library/libffi.php @@ -0,0 +1,32 @@ +withHomePage('http://sourceware.org/libffi') + ->withLicense('https://github.com/libffi/libffi/blob/master/LICENSE', Library::LICENSE_SPEC) + ->withManual('https://github.com/libffi/libffi.git') + ->withUrl('https://github.com/libffi/libffi/archive/refs/tags/v3.4.6.tar.gz') + ->withFile('libffi-v3.4.6.tar.gz') + ->withPrefix($libffi_prefix) + ->withConfigure( + <<withPkgName('libffi'); + + $p->addLibrary($lib); +}; diff --git a/sapi/src/constants.php b/sapi/src/constants.php index 242a476737..2ab5529fc6 100644 --- a/sapi/src/constants.php +++ b/sapi/src/constants.php @@ -81,5 +81,6 @@ define("MPDECIMAL_PREFIX", $p->getGlobalPrefix() . '/mpdecimal'); define("LIBB2_PREFIX", $p->getGlobalPrefix() . '/libb2'); +define("LIBFFI_PREFIX", $p->getGlobalPrefix() . '/libffi'); define("EXAMPLE_PREFIX", $p->getGlobalPrefix() . '/example'); From 0b580256cca56280a09deca61f388812679ff4fa Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sun, 21 Jul 2024 18:38:58 +0800 Subject: [PATCH 157/226] update --- build-release-example.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-release-example.sh b/build-release-example.sh index b69c8c9772..870c2d1040 100644 --- a/build-release-example.sh +++ b/build-release-example.sh @@ -167,7 +167,7 @@ if [ ${WITH_PHP_COMPOSER} -eq 1 ] ; then # composer dump-autoload # composer update --optimize-autoloader - composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vvv --profile # --no-dev + composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev composer dump-autoload --optimize --profile composer config -g --unset repos.packagist From 4dc521f93fac2af6e9be1479980f2c88b309208e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 22 Jul 2024 11:16:14 +0800 Subject: [PATCH 158/226] update --- .../linux/SDN/NET-TOOLS}/IPOE.md | 0 .../library_builder => quickstart/linux/SDN/NET-TOOLS}/NAT.md | 0 .../linux/SDN/NET-TOOLS}/VRRP.md | 0 .../linux/SDN/NET-TOOLS}/env-proxy-alias.md | 0 sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh | 3 ++- .../linux/SDN/NET-TOOLS}/ipv6.md | 0 .../linux/SDN/NET-TOOLS}/reverse-shell.md | 0 sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh | 3 ++- .../linux/SDN/NET-TOOLS}/tunnel.md | 0 sapi/quickstart/linux/SDN/coturn/README.md | 4 ++++ sapi/src/library_builder/keepalived.md | 3 +++ 11 files changed, 11 insertions(+), 2 deletions(-) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/IPOE.md (100%) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/NAT.md (100%) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/VRRP.md (100%) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/env-proxy-alias.md (100%) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/ipv6.md (100%) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/reverse-shell.md (100%) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/tunnel.md (100%) diff --git a/sapi/src/library_builder/IPOE.md b/sapi/quickstart/linux/SDN/NET-TOOLS/IPOE.md similarity index 100% rename from sapi/src/library_builder/IPOE.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/IPOE.md diff --git a/sapi/src/library_builder/NAT.md b/sapi/quickstart/linux/SDN/NET-TOOLS/NAT.md similarity index 100% rename from sapi/src/library_builder/NAT.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/NAT.md diff --git a/sapi/src/library_builder/VRRP.md b/sapi/quickstart/linux/SDN/NET-TOOLS/VRRP.md similarity index 100% rename from sapi/src/library_builder/VRRP.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/VRRP.md diff --git a/sapi/src/library_builder/env-proxy-alias.md b/sapi/quickstart/linux/SDN/NET-TOOLS/env-proxy-alias.md similarity index 100% rename from sapi/src/library_builder/env-proxy-alias.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/env-proxy-alias.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh b/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh index 24193add86..c38a0f4ff1 100644 --- a/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/generate-ssh-keygen.sh @@ -21,4 +21,5 @@ ssh-keygen -t rsa -f id_rsa -N "" -C 'Gernerate SSH Key ' # test link # ssh -vT git@github.com -# ssh -T git@gitee.com +# ssh -T git@gitee.com +# ssh -T git@gitlab.com diff --git a/sapi/src/library_builder/ipv6.md b/sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md similarity index 100% rename from sapi/src/library_builder/ipv6.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/ipv6.md diff --git a/sapi/src/library_builder/reverse-shell.md b/sapi/quickstart/linux/SDN/NET-TOOLS/reverse-shell.md similarity index 100% rename from sapi/src/library_builder/reverse-shell.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/reverse-shell.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh b/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh index 59b1bfc7bc..1b14436ed5 100644 --- a/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh @@ -27,7 +27,8 @@ EOF RESULT_CODE=0 while [ $RESULT_CODE -eq 0 ]; do - curl -fSLo /dev/null http://10.1.20.7/all-deps.zip + curl -fSLo all-deps.zip http://10.1.20.7/all-deps.zip + echo '' > all-deps.zip && rm -f all-deps.zip RESULT_CODE=$? sleep 1 # 每隔1秒检查一次 done diff --git a/sapi/src/library_builder/tunnel.md b/sapi/quickstart/linux/SDN/NET-TOOLS/tunnel.md similarity index 100% rename from sapi/src/library_builder/tunnel.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/tunnel.md diff --git a/sapi/quickstart/linux/SDN/coturn/README.md b/sapi/quickstart/linux/SDN/coturn/README.md index e69de29bb2..e1e7f9dcca 100644 --- a/sapi/quickstart/linux/SDN/coturn/README.md +++ b/sapi/quickstart/linux/SDN/coturn/README.md @@ -0,0 +1,4 @@ + + +stun tcp 3478 +stun udp 3478 diff --git a/sapi/src/library_builder/keepalived.md b/sapi/src/library_builder/keepalived.md index f430609119..69b2b981b7 100644 --- a/sapi/src/library_builder/keepalived.md +++ b/sapi/src/library_builder/keepalived.md @@ -1,3 +1,6 @@ LVS ipvsadm ipset + + +VRRP 虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP) From e086c88c3a11318902c699ebc9a627b9ef0f6c80 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 22 Jul 2024 14:58:04 +0800 Subject: [PATCH 159/226] update --- .../linux/SDN/NET-TOOLS}/netfilter.md | 18 ++++++++++------ .../linux/SDN/NET-TOOLS/test-download-file.sh | 3 +++ setup-supervisord.sh | 21 +++++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) rename sapi/{src/library_builder => quickstart/linux/SDN/NET-TOOLS}/netfilter.md (96%) diff --git a/sapi/src/library_builder/netfilter.md b/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md similarity index 96% rename from sapi/src/library_builder/netfilter.md rename to sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md index 80ee2d26f6..16ffc7c2a9 100644 --- a/sapi/src/library_builder/netfilter.md +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md @@ -1,6 +1,5 @@ # iptables详解(1):iptables概念 - https://www.cnblogs.com/jingjingxyk/p/16866170.html https://www.cnblogs.com/cheyunhua/p/15188835.html @@ -63,11 +62,11 @@ filter 表中的规则可以被哪些链使用:INPUT,FORWARD,OUTPUT ## iptables为我们定义了4张”表”,当他们处于同一条”链”时,执行的优先级如下 + 优先级次序(由高而低): raw –> mangle –> nat –> filter - ## 链的规则存放于哪些表中(从链到表的对应关系): PREROUTING 的规则可以存在于:raw表,mangle表,nat表。 @@ -81,13 +80,11 @@ POSTROUTING 的规则可以存在于:mangle表,nat表。 ## ”匹配条件”与”动作”组成了规则 + 匹配条件分为基本匹配条件与扩展匹配条件 基本匹配条件: 源地址Source IP,目标地址 Destination IP - - - ## 处理动作 处理动作在iptables中被称为target @@ -111,6 +108,7 @@ ## nftables 和 iptables 都是 netfilter 管理工具 ## 实操 + 当没有使用-t选项指定表时,默认为操作filter表 iptables -t filter -L @@ -127,8 +125,8 @@ iptables -t 表名 -L 链名 - ## 主机防火墙 和 网络防火墙 + 当iptables作为”网络防火墙”时,在配置规则时,往往需要考虑”双向性” state可以译为状态 实现”连接追踪”机制 @@ -141,3 +139,11 @@ TCP Flags: SYN,ACK,FIN,RST,URG,PSH conntrack -L + +## 共享网络 + + iptables -t nat -A POSTROUTING -s 172.16.1.0/24 -j SNAT MASQUERADE + +## 使用 nftables 代替 iptables + + kubenetes 使用 nftables 代替 iptables (iptable ipvs ipset) diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh b/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh index 1b14436ed5..aa17966f4d 100644 --- a/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/test-download-file.sh @@ -34,4 +34,7 @@ while [ $RESULT_CODE -eq 0 ]; do done +# nohup : 不挂断的运行 脱离tty 脱离控制台 +# & 符号表示将该命令或脚本放入后台运行 + diff --git a/setup-supervisord.sh b/setup-supervisord.sh index 0e301c27f8..dd06dbe505 100644 --- a/setup-supervisord.sh +++ b/setup-supervisord.sh @@ -68,3 +68,24 @@ fi # supervisord configure # http://supervisord.org/configuration.html + + cat > /etc/supervisord.d/user-custom/example.conf.bak <<'EOF' +[program:example] +command=bash /tmp/example.sh +;process_name=%(program_name)s ; process_name expr (default %(program_name)s) +process_name=example ; process_name expr (default %(program_name)s) +numprocs=1 ; number of processes copies to start (def 1) +directory=/ ; directory to cwd to before exec (def no cwd) +autostart=true ; start at supervisord start (default: true) +startsecs=1 ; # of secs prog must stay up to be running (def. 1) +startretries=3 ; max # of serial start failures when starting (default 3) +autorestart=unexpected ; when to restart if exited after running (def: unexpected) +exitcodes=0 ; 'expected' exit codes used with autorestart (default 0) +stopsignal=QUIT ; signal used to kill process (default TERM) +stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) +stdout_logfile=/tmp/supervisord-example.log ; stdout log path, NONE for none; default AUTO +stdout_syslog=false ; send stdout to syslog with process name (default false) +stderr_logfile=/tmp/supervisord-example.log ; stderr log path, NONE for none; default AUTO + + +EOF From 6eda28e5933abd89a3b6f0b7205002f04c1c31cd Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 22 Jul 2024 19:14:49 +0800 Subject: [PATCH 160/226] update --- sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md | 4 ++++ sapi/src/library_builder/nixos.md | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 sapi/src/library_builder/nixos.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md b/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md index 16ffc7c2a9..d9dda79d01 100644 --- a/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/netfilter.md @@ -147,3 +147,7 @@ ## 使用 nftables 代替 iptables kubenetes 使用 nftables 代替 iptables (iptable ipvs ipset) + +## nftables 查看规则 + + nft list rulese diff --git a/sapi/src/library_builder/nixos.md b/sapi/src/library_builder/nixos.md new file mode 100644 index 0000000000..c1fb69bb7e --- /dev/null +++ b/sapi/src/library_builder/nixos.md @@ -0,0 +1,5 @@ + + +## 安装 nixos + + curl -L https://releases.nixos.org/nix/nix-2.23.3/install | bash From 758cfe2a621058440681a9edfe8781f1c5054f6a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 23 Jul 2024 09:37:04 +0800 Subject: [PATCH 161/226] update --- sapi/quickstart/linux/SDN/NET-TOOLS/Fail2Ban.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sapi/quickstart/linux/SDN/NET-TOOLS/Fail2Ban.md diff --git a/sapi/quickstart/linux/SDN/NET-TOOLS/Fail2Ban.md b/sapi/quickstart/linux/SDN/NET-TOOLS/Fail2Ban.md new file mode 100644 index 0000000000..9753a1713d --- /dev/null +++ b/sapi/quickstart/linux/SDN/NET-TOOLS/Fail2Ban.md @@ -0,0 +1,2 @@ + +## 屏蔽ip From 9215808dc39634f1bc9968d5d99d12da48531415 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 23 Jul 2024 12:39:13 +0800 Subject: [PATCH 162/226] add test static compile opcache --- sapi/tools/build-static-php.sh | 42 ++++++++++++++++++++++ sapi/tools/opcache-static-compile-patch.sh | 41 +++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 sapi/tools/build-static-php.sh create mode 100644 sapi/tools/opcache-static-compile-patch.sh diff --git a/sapi/tools/build-static-php.sh b/sapi/tools/build-static-php.sh new file mode 100644 index 0000000000..8d7b8d1510 --- /dev/null +++ b/sapi/tools/build-static-php.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +__DIR__=$( + cd "$(dirname "$0")" + pwd +) + +set -uex + +PHP_VERSION=8.2.21 + +test -f php-${PHP_VERSION}.tar.gz || curl -fSLo php-${PHP_VERSION}.tar.gz https://github.com/php/php-src/archive/refs/tags/php-${PHP_VERSION}.tar.gz +test -d php-src && rm -rf php-src +mkdir -p php-src +tar --strip-components=1 -C php-src -xf php-${PHP_VERSION}.tar.gz + +export CC=clang +export CXX=clang++ +export LD=ld.lld + +cd php-src + +./buildconf --force + +./configure \ + --disable-all \ + --disable-cgi \ + --enable-shared=no \ + --enable-static=yes \ + --enable-cli \ + --enable-zts \ + --disable-phpdbg \ + --without-valgrind \ + --enable-opcache + +make -j $(nproc) + +file sapi/cli/php +readelf -h sapi/cli/php + +sapi/cli/php -m +sapi/cli/php -v diff --git a/sapi/tools/opcache-static-compile-patch.sh b/sapi/tools/opcache-static-compile-patch.sh new file mode 100644 index 0000000000..3dd4c09f33 --- /dev/null +++ b/sapi/tools/opcache-static-compile-patch.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +if [ ! -f ext/opcache/config.m4 ]; then + echo 'php extension opcache folder no found ' + exit 3 +fi + +cat >ext/opcache/php_opcache.h <>sapi/cli/php_cli.c < Date: Tue, 23 Jul 2024 13:02:38 +0800 Subject: [PATCH 163/226] fix script eroor --- sapi/tools/build-static-php.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sapi/tools/build-static-php.sh b/sapi/tools/build-static-php.sh index 8d7b8d1510..3c095ecb45 100644 --- a/sapi/tools/build-static-php.sh +++ b/sapi/tools/build-static-php.sh @@ -20,6 +20,8 @@ export LD=ld.lld cd php-src +bash ${__DIR__}/opcache-static-compile-patch.sh + ./buildconf --force ./configure \ From ff9a762abf15a80d5ce7b8eef17e337a73ce6c66 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 24 Jul 2024 12:55:41 +0800 Subject: [PATCH 164/226] tools script --- sapi/tools/build-static-php.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapi/tools/build-static-php.sh b/sapi/tools/build-static-php.sh index 3c095ecb45..0ae2cf1114 100644 --- a/sapi/tools/build-static-php.sh +++ b/sapi/tools/build-static-php.sh @@ -35,6 +35,9 @@ bash ${__DIR__}/opcache-static-compile-patch.sh --without-valgrind \ --enable-opcache +export LDFLAGS=" -static -all-static " +sed -i.backup 's/-export-dynamic/-all-static/g' Makefile + make -j $(nproc) file sapi/cli/php From c7e6e951ce45c0fb28a82906377b2ad4149bb428 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 30 Jul 2024 12:18:38 +0800 Subject: [PATCH 165/226] swow upgrade to v1.5.3 --- sapi/quickstart/linux/SDN/theme.md | 1 + sapi/src/builder/extension/swow.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 sapi/quickstart/linux/SDN/theme.md diff --git a/sapi/quickstart/linux/SDN/theme.md b/sapi/quickstart/linux/SDN/theme.md new file mode 100644 index 0000000000..bfdfe3328a --- /dev/null +++ b/sapi/quickstart/linux/SDN/theme.md @@ -0,0 +1 @@ +## 编辑器主题的 Monokai diff --git a/sapi/src/builder/extension/swow.php b/sapi/src/builder/extension/swow.php index fd1724b356..5f8ba1895d 100644 --- a/sapi/src/builder/extension/swow.php +++ b/sapi/src/builder/extension/swow.php @@ -20,11 +20,11 @@ ->withHomePage('https://github.com/swow/swow') ->withLicense('https://github.com/swow/swow/blob/develop/LICENSE', Extension::LICENSE_APACHE2) ->withManual('https://docs.toast.run/swow/en/install.html') - ->withFile('swow-v1.5.2.tar.gz') + ->withFile('swow-v1.5.3.tar.gz') ->withDownloadScript( "swow", << Date: Tue, 30 Jul 2024 12:19:42 +0800 Subject: [PATCH 166/226] update --- sapi/quickstart/linux/SDN/theme.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 sapi/quickstart/linux/SDN/theme.md diff --git a/sapi/quickstart/linux/SDN/theme.md b/sapi/quickstart/linux/SDN/theme.md deleted file mode 100644 index bfdfe3328a..0000000000 --- a/sapi/quickstart/linux/SDN/theme.md +++ /dev/null @@ -1 +0,0 @@ -## 编辑器主题的 Monokai From 9c8fedf0d31f580c6ff4eacc1a8e3011b69b996c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 30 Jul 2024 12:36:46 +0800 Subject: [PATCH 167/226] update --- sapi/src/library_builder/font-theme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 sapi/src/library_builder/font-theme.md diff --git a/sapi/src/library_builder/font-theme.md b/sapi/src/library_builder/font-theme.md new file mode 100644 index 0000000000..bfdfe3328a --- /dev/null +++ b/sapi/src/library_builder/font-theme.md @@ -0,0 +1 @@ +## 编辑器主题的 Monokai From 1d4f59fa9d70cf4b99639bf4b01f939e82572cd2 Mon Sep 17 00:00:00 2001 From: liuqinglin Date: Tue, 30 Jul 2024 19:53:43 +0800 Subject: [PATCH 168/226] update prepare.php & macos-init.sh --- prepare.php | 7 ++++++- sapi/quickstart/macos/macos-init.sh | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/prepare.php b/prepare.php index e377caaf4d..fdd8dc6a6d 100755 --- a/prepare.php +++ b/prepare.php @@ -93,7 +93,12 @@ if (is_file('/usr/local/opt/llvm/bin/ld64.lld')) { $p->withBinPath('/usr/local/opt/llvm/bin')->setLinker('ld64.lld'); } elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) { //兼容 github action - $p->withBinPath('/opt/homebrew/opt/llvm/bin/')->setLinker('ld64.lld'); + $p->withBinPath('/opt/homebrew/opt/llvm/bin/') + ->withBinPath('/opt/homebrew/opt/flex/bin') + ->withBinPath('/opt/homebrew/opt/bison/bin') + ->withBinPath('/opt/homebrew/opt/libtool/bin') + ->withBinPath('/opt/homebrew/opt/m4/bin') + ->setLinker('ld64.lld'); } else { $p->setLinker('lld'); } diff --git a/sapi/quickstart/macos/macos-init.sh b/sapi/quickstart/macos/macos-init.sh index b74d4f929b..36a24bf670 100644 --- a/sapi/quickstart/macos/macos-init.sh +++ b/sapi/quickstart/macos/macos-init.sh @@ -76,13 +76,13 @@ fi -# brew install wget curl libtool automake re2c llvm flex bison +# brew install wget curl libtool automake re2c llvm flex bison m4 # 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 # 已安装的包 跳过安装 -PACKAGES_1=(wget curl libtool automake re2c llvm flex bison) +PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4) PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake) PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}") From a0abe5d66389030786880646c4c4f7d3c69badb1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Tue, 30 Jul 2024 21:38:32 +0800 Subject: [PATCH 169/226] update macos-init.sh --- sapi/quickstart/macos/macos-init.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sapi/quickstart/macos/macos-init.sh b/sapi/quickstart/macos/macos-init.sh index 36a24bf670..c53986d189 100644 --- a/sapi/quickstart/macos/macos-init.sh +++ b/sapi/quickstart/macos/macos-init.sh @@ -76,13 +76,13 @@ fi -# brew install wget curl libtool automake re2c llvm flex bison m4 +# brew install wget curl libtool automake re2c llvm flex bison m4 autoconf # 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 # 已安装的包 跳过安装 -PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4) +PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4 autoconf) PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake) PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}") @@ -90,7 +90,6 @@ for PACKAGE in "${PACKAGES[@]}"; do brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE" done - which glibtool From bff1f890b3a20ffe5425a6a2d372f46f087a146c Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 31 Jul 2024 09:59:17 +0800 Subject: [PATCH 170/226] fix macos build environment error --- prepare.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/prepare.php b/prepare.php index 35b9c5c769..ec08f5c99c 100755 --- a/prepare.php +++ b/prepare.php @@ -160,13 +160,20 @@ if ($p->isMacos()) { $p->setExtraLdflags('-undefined dynamic_lookup'); if (is_file('/usr/local/opt/llvm/bin/ld64.lld')) { - $p->withBinPath('/usr/local/opt/llvm/bin')->setLinker('ld64.lld'); - } elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) { //兼容 github action + $p->withBinPath('/usr/local/opt/llvm/bin') + ->withBinPath('/usr/local/opt/flex/bin') + ->withBinPath('/usr/local/opt/bison/bin') + ->withBinPath('/usr/local/opt/libtool/bin') + ->withBinPath('/usr/local/opt/m4/bin') + ->withBinPath('/usr/local/opt/automake/bin/') + ->setLinker('ld64.lld'); + } elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) { //兼容 macos arm64 $p->withBinPath('/opt/homebrew/opt/llvm/bin/') ->withBinPath('/opt/homebrew/opt/flex/bin') ->withBinPath('/opt/homebrew/opt/bison/bin') ->withBinPath('/opt/homebrew/opt/libtool/bin') ->withBinPath('/opt/homebrew/opt/m4/bin') + ->withBinPath('/opt/homebrew/opt/automake/bin/') ->setLinker('ld64.lld'); } else { $p->setLinker('lld'); From c41df6b0aeb2446aa578037a0adf8028c0831f80 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 31 Jul 2024 10:00:49 +0800 Subject: [PATCH 171/226] fix macos build environment error --- prepare.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prepare.php b/prepare.php index ec08f5c99c..67004199c9 100755 --- a/prepare.php +++ b/prepare.php @@ -166,6 +166,7 @@ ->withBinPath('/usr/local/opt/libtool/bin') ->withBinPath('/usr/local/opt/m4/bin') ->withBinPath('/usr/local/opt/automake/bin/') + ->withBinPath('/usr/local/opt/autoconf/bin/') ->setLinker('ld64.lld'); } elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) { //兼容 macos arm64 $p->withBinPath('/opt/homebrew/opt/llvm/bin/') @@ -174,6 +175,7 @@ ->withBinPath('/opt/homebrew/opt/libtool/bin') ->withBinPath('/opt/homebrew/opt/m4/bin') ->withBinPath('/opt/homebrew/opt/automake/bin/') + ->withBinPath('/opt/homebrew/opt/autoconf/bin/') ->setLinker('ld64.lld'); } else { $p->setLinker('lld'); From f270d3918633974a3a07afa237185617acebce11 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 31 Jul 2024 10:14:26 +0800 Subject: [PATCH 172/226] fix macos build environment error --- sapi/quickstart/macos/macos-init.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sapi/quickstart/macos/macos-init.sh b/sapi/quickstart/macos/macos-init.sh index c53986d189..78f3b2724e 100644 --- a/sapi/quickstart/macos/macos-init.sh +++ b/sapi/quickstart/macos/macos-init.sh @@ -76,19 +76,19 @@ fi -# brew install wget curl libtool automake re2c llvm flex bison m4 autoconf -# brew install libtool gettext coreutils libunistring pkg-config cmake +brew install wget curl libtool automake re2c llvm flex bison m4 autoconf +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 # 已安装的包 跳过安装 -PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4 autoconf) -PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake) +# PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4 autoconf) +# PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake) -PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}") -for PACKAGE in "${PACKAGES[@]}"; do - brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE" -done +# PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}") +# for PACKAGE in "${PACKAGES[@]}"; do +# brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE" +# done which glibtool From b55d9c7799d699c93f5c5ef327f71f774b14ff0a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 31 Jul 2024 13:12:56 +0800 Subject: [PATCH 173/226] fix macos build environment deps --- .github/workflows/macos-aarch64.yml | 10 ---------- .github/workflows/macos-x86_64.yml | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/.github/workflows/macos-aarch64.yml b/.github/workflows/macos-aarch64.yml index a4cf4bd504..6520d9291f 100644 --- a/.github/workflows/macos-aarch64.yml +++ b/.github/workflows/macos-aarch64.yml @@ -61,13 +61,7 @@ jobs: echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV - export PATH="/opt/homebrew/opt/llvm/bin:$PATH" - export PATH="/opt/homebrew/opt/flex/bin:$PATH" - export PATH="/opt/homebrew/opt/bison/bin:$PATH" export PATH="/opt/homebrew/opt/libtool/bin:$PATH" - - ln -sf /opt/homebrew/opt/libtool/bin/glibtool /opt/homebrew/opt/libtool/bin/libtool - ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /opt/homebrew/opt/libtool/bin/libtoolize ls -lha /opt/homebrew/opt/libtool/bin/ libtoolize --version libtool --help-all @@ -135,10 +129,6 @@ jobs: - name: Build run: | export PATH=${{ github.workspace }}/bin/runtime:$PATH - export PATH="/opt/homebrew/opt/llvm/bin:$PATH" - export PATH="/opt/homebrew/opt/flex/bin:$PATH" - export PATH="/opt/homebrew/opt/bison/bin:$PATH" - export PATH="/opt/homebrew/opt/libtool/bin:$PATH" bash make-install-deps.sh diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml index 5422130128..d89e6560b5 100644 --- a/.github/workflows/macos-x86_64.yml +++ b/.github/workflows/macos-x86_64.yml @@ -62,13 +62,7 @@ jobs: echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV - export PATH=/usr/local/opt/llvm/bin:$PATH - export PATH=/usr/local/opt/flex/bin:$PATH - export PATH=/usr/local/opt/bison/bin:$PATH export PATH=/usr/local/opt/libtool/bin:$PATH - - ln -sf /usr/local/opt/libtool/bin/glibtool /usr/local/opt/libtool/bin/libtool - ln -sf /usr/local/opt/libtool/bin/glibtoolize /usr/local/opt/libtool/bin/libtoolize ls -lha /usr/local/opt/libtool/bin/ libtoolize --version @@ -136,10 +130,6 @@ jobs: - name: Build run: | export PATH=${{ github.workspace }}/bin/runtime:$PATH - export PATH=/usr/local/opt/llvm/bin:$PATH - export PATH=/usr/local/opt/flex/bin:$PATH - export PATH=/usr/local/opt/bison/bin:$PATH - export PATH=/usr/local/opt/libtool/bin:$PATH bash make-install-deps.sh From 9d1e171dcaf564d96a670e1b11aa88b51b8c8bb6 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 00:41:46 +0800 Subject: [PATCH 174/226] fix unixodbc build error --- sapi/src/builder/library/unix_odbc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sapi/src/builder/library/unix_odbc.php b/sapi/src/builder/library/unix_odbc.php index e0255c776e..16f51aaa0b 100644 --- a/sapi/src/builder/library/unix_odbc.php +++ b/sapi/src/builder/library/unix_odbc.php @@ -15,7 +15,10 @@ ->withPrefix($unix_odbc_prefix) ->withconfigure( << Date: Thu, 1 Aug 2024 00:52:27 +0800 Subject: [PATCH 175/226] update build steps --- .github/workflows/macos-aarch64.yml | 9 -- .github/workflows/macos-x86_64.yml | 9 -- prepare.php | 13 ++- sapi/quickstart/macos/macos-init.sh | 105 ++++++++++-------------- sapi/src/builder/extension/pdo_odbc.php | 3 +- 5 files changed, 56 insertions(+), 83 deletions(-) diff --git a/.github/workflows/macos-aarch64.yml b/.github/workflows/macos-aarch64.yml index 2da8d0b982..ae48e9f8e5 100644 --- a/.github/workflows/macos-aarch64.yml +++ b/.github/workflows/macos-aarch64.yml @@ -49,13 +49,8 @@ jobs: echo "X_IPV6=${IPV6}" >> $GITHUB_ENV echo "X_IPV4=${IPV4}" >> $GITHUB_ENV - export PATH="/opt/homebrew/opt/llvm/bin:$PATH" - export PATH="/opt/homebrew/opt/flex/bin:$PATH" - export PATH="/opt/homebrew/opt/bison/bin:$PATH" export PATH="/opt/homebrew/opt/libtool/bin:$PATH" - ln -sf /opt/homebrew/opt/libtool/bin/glibtool /opt/homebrew/opt/libtool/bin/libtool - ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /opt/homebrew/opt/libtool/bin/libtoolize ls -lha /opt/homebrew/opt/libtool/bin/ libtoolize --version libtool --help-all @@ -123,10 +118,6 @@ jobs: - name: Build run: | export PATH=${{ github.workspace }}/bin/runtime:$PATH - export PATH="/opt/homebrew/opt/llvm/bin:$PATH" - export PATH="/opt/homebrew/opt/flex/bin:$PATH" - export PATH="/opt/homebrew/opt/bison/bin:$PATH" - export PATH="/opt/homebrew/opt/libtool/bin:$PATH" bash make-install-deps.sh diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml index dce0c305f1..4ec5d73be9 100644 --- a/.github/workflows/macos-x86_64.yml +++ b/.github/workflows/macos-x86_64.yml @@ -48,13 +48,8 @@ jobs: echo "X_IPV6=${IPV6}" >> $GITHUB_ENV echo "X_IPV4=${IPV4}" >> $GITHUB_ENV - export PATH=/usr/local/opt/llvm/bin:$PATH - export PATH=/usr/local/opt/flex/bin:$PATH - export PATH=/usr/local/opt/bison/bin:$PATH export PATH=/usr/local/opt/libtool/bin:$PATH - ln -sf /usr/local/opt/libtool/bin/glibtool /usr/local/opt/libtool/bin/libtool - ln -sf /usr/local/opt/libtool/bin/glibtoolize /usr/local/opt/libtool/bin/libtoolize ls -lha /usr/local/opt/libtool/bin/ libtoolize --version @@ -122,10 +117,6 @@ jobs: - name: Build run: | export PATH=${{ github.workspace }}/bin/runtime:$PATH - export PATH=/usr/local/opt/llvm/bin:$PATH - export PATH=/usr/local/opt/flex/bin:$PATH - export PATH=/usr/local/opt/bison/bin:$PATH - export PATH=/usr/local/opt/libtool/bin:$PATH bash make-install-deps.sh diff --git a/prepare.php b/prepare.php index fdd8dc6a6d..09684a3aa8 100755 --- a/prepare.php +++ b/prepare.php @@ -91,13 +91,22 @@ if ($p->isMacos()) { $p->setExtraLdflags('-undefined dynamic_lookup'); if (is_file('/usr/local/opt/llvm/bin/ld64.lld')) { - $p->withBinPath('/usr/local/opt/llvm/bin')->setLinker('ld64.lld'); - } elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) { //兼容 github action + $p->withBinPath('/usr/local/opt/llvm/bin') + ->withBinPath('/usr/local/opt/flex/bin') + ->withBinPath('/usr/local/opt/bison/bin') + ->withBinPath('/usr/local/opt/libtool/bin') + ->withBinPath('/usr/local/opt/m4/bin') + ->withBinPath('/usr/local/opt/automake/bin/') + ->withBinPath('/usr/local/opt/autoconf/bin/') + ->setLinker('ld64.lld'); + } elseif (is_file('/opt/homebrew/opt/llvm/bin/ld64.lld')) { $p->withBinPath('/opt/homebrew/opt/llvm/bin/') ->withBinPath('/opt/homebrew/opt/flex/bin') ->withBinPath('/opt/homebrew/opt/bison/bin') ->withBinPath('/opt/homebrew/opt/libtool/bin') ->withBinPath('/opt/homebrew/opt/m4/bin') + ->withBinPath('/opt/homebrew/opt/automake/bin/') + ->withBinPath('/opt/homebrew/opt/autoconf/bin/') ->setLinker('ld64.lld'); } else { $p->setLinker('lld'); diff --git a/sapi/quickstart/macos/macos-init.sh b/sapi/quickstart/macos/macos-init.sh index 36a24bf670..b57254c379 100644 --- a/sapi/quickstart/macos/macos-init.sh +++ b/sapi/quickstart/macos/macos-init.sh @@ -29,23 +29,22 @@ while [ $# -gt 0 ]; do shift $(($# > 0 ? 1 : 0)) done - case "$MIRROR" in - china|ustc) - export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api" +china | ustc) + export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api" - export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" - export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" - export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles" + export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" + export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" + export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles" - export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" - export PIPENV_PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" + export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" + export PIPENV_PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" - # pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple - # pip3 config set global.index-url https://pypi.python.org/simple + # pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple + # pip3 config set global.index-url https://pypi.python.org/simple - # 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/ - ;; + # 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/ + ;; esac @@ -53,19 +52,19 @@ export HOMEBREW_NO_ANALYTICS=1 export HOMEBREW_NO_AUTO_UPDATE=1 export HOMEBREW_INSTALL_FROM_API=1 -if [ ${WITH_UPDATE} -eq 1 ] ; then +if [ ${WITH_UPDATE} -eq 1 ]; then case "$MIRROR" in - china|ustc) - brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.ustc.edu.cn/homebrew-cask.git - brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.ustc.edu.cn/homebrew-cask-versions.git - brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git - - # 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/ - # reset - # brew tap --custom-remote --force-auto-update homebrew/cask https://github.com/Homebrew/homebrew-cask - # brew tap --custom-remote --force-auto-update homebrew/cask-versions https://github.com/Homebrew/homebrew-cask-versions - # brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git - ;; + china | ustc) + brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.ustc.edu.cn/homebrew-cask.git + brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.ustc.edu.cn/homebrew-cask-versions.git + brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git + + # 参考文档: https://help.mirrors.cernet.edu.cn/homebrew/ + # reset + # brew tap --custom-remote --force-auto-update homebrew/cask https://github.com/Homebrew/homebrew-cask + # brew tap --custom-remote --force-auto-update homebrew/cask-versions https://github.com/Homebrew/homebrew-cask-versions + # brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git + ;; esac brew update @@ -74,47 +73,37 @@ if [ ${WITH_UPDATE} -eq 1 ] ; then fi - - -# brew install wget curl libtool automake re2c llvm flex bison m4 -# brew install libtool gettext coreutils libunistring pkg-config cmake +brew install wget curl libtool automake re2c llvm flex bison m4 autoconf +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 # 已安装的包 跳过安装 -PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4) -PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake) - -PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}") -for PACKAGE in "${PACKAGES[@]}"; do - brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE" -done +# PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4 autoconf) +# PACKAGES_2=(libtool gettext coreutils libunistring pkg-config cmake) +# PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}") +# for PACKAGE in "${PACKAGES[@]}"; do +# brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE" +# done which glibtool - # maocs intel # HOMEBREW_PREFIX: /usr/local -if [ -d /usr/local/opt/libtool/bin/ ] ; then +if [ -d /usr/local/opt/libtool/bin/ ]; then ln -sf /usr/local/opt/libtool/bin/glibtool /usr/local/opt/libtool/bin/libtool ln -sf /usr/local/opt/libtool/bin/glibtoolize /usr/local/opt/libtool/bin/libtoolize export PATH=/usr/local/opt/libtool/bin/:$PATH - ln -sf /usr/local/bin/glibtool /usr/local/bin/libtool - ln -sf /usr/local/bin/glibtoolize /usr/local/bin/libtoolize - fi # macos M1 # HOMEBREW_PREFIX=/opt/homebrew # HOMEBREW_REPOSITORY=/opt/homebrew -if [ -d /opt/homebrew/opt/libtool/bin ] ; then - ln -sf /opt/homebrew/opt/libtool/bin/glibtool /opt/homebrew/opt/libtool/bin/libtool - ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /opt/homebrew/opt/libtool/bin/libtoolize - export PATH=/opt/homebrew/opt/libtool/bin/:$PATH - ln -sf /opt/homebrew/opt/libtool/bin/glibtool /usr/local/bin/libtool - ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /usr/local/bin/libtoolize - +if [ -d /opt/homebrew/opt/libtool/bin ]; then + ln -sf /opt/homebrew/opt/libtool/bin/glibtool /opt/homebrew/opt/libtool/bin/libtool + ln -sf /opt/homebrew/opt/libtool/bin/glibtoolize /opt/homebrew/opt/libtool/bin/libtoolize + export PATH=/opt/homebrew/opt/libtool/bin/:$PATH fi libtoolize --version @@ -126,18 +115,14 @@ which libtool brew uninstall --ignore-dependencies --force snappy brew uninstall --ignore-dependencies --force capstone +brew install xz zip unzip gzip bzip2 7zip p7zip +brew install git ca-certificates - - -brew install xz zip unzip gzip bzip2 7zip p7zip -brew install git ca-certificates - -brew install yasm nasm -brew install ninja python3 -brew install diffutils -brew install netcat socat -brew install mercurial - +brew install yasm nasm +brew install ninja python3 +brew install diffutils +brew install netcat socat +brew install mercurial case "$MIRROR" in china | tuna | ustc) @@ -147,12 +132,10 @@ china | tuna | ustc) tencentyun | huaweicloud) test "$MIRROR" = "tencentyun" && pip3 config set global.index-url https://mirrors.tencentyun.com/pypi/simple/ test "$MIRROR" = "huaweicloud" && pip3 config set global.index-url https://repo.huaweicloud.com/pypi/simple/ + ;; esac pip3 install meson - brew uninstall --ignore-dependencies --force snappy brew uninstall --ignore-dependencies --force capstone - - diff --git a/sapi/src/builder/extension/pdo_odbc.php b/sapi/src/builder/extension/pdo_odbc.php index 108115b320..e3d7ef22d3 100644 --- a/sapi/src/builder/extension/pdo_odbc.php +++ b/sapi/src/builder/extension/pdo_odbc.php @@ -10,7 +10,6 @@ (new Extension('pdo_odbc')) ->withHomePage('https://www.php.net/manual/zh/ref.pdo-odbc.php') ->withLicense('https://github.com/php/php-src/blob/master/LICENSE', Extension::LICENSE_PHP) - ->withUrl('https://github.com/php/php-src.git ') ->withFile('pdo_odbc-' . $php_version . '.tgz') ->withDownloadScript( 'pdo_odbc', @@ -20,7 +19,7 @@ EOF ) ->withOptions('--with-pdo-odbc=unixODBC,' . $unixODBC_prefix) - ->withDependentLibraries('unixODBC') + ->withDependentLibraries('unix_odbc') ->withDependentExtensions('pdo') ); }; From 030f1f3a68cd4d010313f6e3458b80dea20133b4 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 01:06:30 +0800 Subject: [PATCH 176/226] fix macos-init.sh error --- sapi/quickstart/macos/macos-init.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sapi/quickstart/macos/macos-init.sh b/sapi/quickstart/macos/macos-init.sh index d309a39feb..b57254c379 100644 --- a/sapi/quickstart/macos/macos-init.sh +++ b/sapi/quickstart/macos/macos-init.sh @@ -73,11 +73,6 @@ if [ ${WITH_UPDATE} -eq 1 ]; then fi -<<<<<<< HEAD - - -======= ->>>>>>> experiment brew install wget curl libtool automake re2c llvm flex bison m4 autoconf brew install libtool gettext coreutils libunistring pkg-config cmake # macos 环境下 Homebrew packages : coreutils binutils 不兼容 @@ -89,11 +84,7 @@ brew install libtool gettext coreutils libunistring pkg-config cmake # PACKAGES=("${PACKAGES_1[@]}" "${PACKAGES_2[@]}") # for PACKAGE in "${PACKAGES[@]}"; do -<<<<<<< HEAD -# brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE" -======= # brew list "$PACKAGE" &>/dev/null || brew install "$PACKAGE" ->>>>>>> experiment # done which glibtool From 0e29c44430df26a26d5208b6262ed08ae41fefab Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 08:01:58 +0800 Subject: [PATCH 177/226] enable opcache extension --- sapi/src/Preprocessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index bdf880f4f8..72600f1335 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -104,7 +104,7 @@ class Preprocessor * @var array|string[] */ protected array $extEnabled = [ - //'opcache', //需要修改源码才能实现 + 'opcache', //需要修改源码才能实现 'curl', 'iconv', 'bz2', From 8473dd494ca73a6aec812f36a3ad3d7790fa664b Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 14:04:25 +0800 Subject: [PATCH 178/226] cygwin download extension with curl --- ext/swoole | 1 - sapi/scripts/cygwin/cygwin-config-ext.sh | 43 ++++++++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) delete mode 160000 ext/swoole diff --git a/ext/swoole b/ext/swoole deleted file mode 160000 index 8e8db8b45f..0000000000 --- a/ext/swoole +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e8db8b45fdf81513363054a3cfce8bc5c50906d diff --git a/sapi/scripts/cygwin/cygwin-config-ext.sh b/sapi/scripts/cygwin/cygwin-config-ext.sh index 967c1de5d6..be1db15a00 100644 --- a/sapi/scripts/cygwin/cygwin-config-ext.sh +++ b/sapi/scripts/cygwin/cygwin-config-ext.sh @@ -19,42 +19,41 @@ YAML_VERSION=2.2.2 IMAGICK_VERSION=3.7.0 if [ ! -d pool/ext ]; then - mkdir -p pool/ext + mkdir -p pool/ext fi cd pool/ext if [ ! -d $ROOT/ext/redis ]; then - if [ ! -f redis-${REDIS_VERSION}.tgz ]; then - wget https://pecl.php.net/get/redis-${REDIS_VERSION}.tgz - fi - tar xvf redis-${REDIS_VERSION}.tgz - mv redis-${REDIS_VERSION} $ROOT/ext/redis + if [ ! -f redis-${REDIS_VERSION}.tgz ]; then + curl -fSLo redis-${REDIS_VERSION}.tgz https://pecl.php.net/get/redis-${REDIS_VERSION}.tgz + fi + tar xvf redis-${REDIS_VERSION}.tgz + mv redis-${REDIS_VERSION} $ROOT/ext/redis fi if [ ! -d $ROOT/ext/mongodb ]; then - if [ ! -f mongodb-${MONGODB_VERSION}.tgz ]; then - wget https://pecl.php.net/get/mongodb-${MONGODB_VERSION}.tgz - fi - tar xvf mongodb-${MONGODB_VERSION}.tgz - mv mongodb-${MONGODB_VERSION} $ROOT/ext/mongodb + if [ ! -f mongodb-${MONGODB_VERSION}.tgz ]; then + curl -fSLo mongodb-${MONGODB_VERSION}.tgz https://pecl.php.net/get/mongodb-${MONGODB_VERSION}.tgz + fi + tar xvf mongodb-${MONGODB_VERSION}.tgz + mv mongodb-${MONGODB_VERSION} $ROOT/ext/mongodb fi if [ ! -d $ROOT/ext/yaml ]; then - if [ ! -f yaml-${YAML_VERSION}.tgz ]; then - wget https://pecl.php.net/get/yaml-${YAML_VERSION}.tgz - fi - tar xvf yaml-${YAML_VERSION}.tgz - mv yaml-${YAML_VERSION} $ROOT/ext/yaml + if [ ! -f yaml-${YAML_VERSION}.tgz ]; then + curl -fSLo yaml-${YAML_VERSION}.tgz https://pecl.php.net/get/yaml-${YAML_VERSION}.tgz + fi + tar xvf yaml-${YAML_VERSION}.tgz + mv yaml-${YAML_VERSION} $ROOT/ext/yaml fi if [ ! -d $ROOT/ext/imagick ]; then - if [ ! -f imagick-${IMAGICK_VERSION}.tgz ]; then - wget https://pecl.php.net/get/imagick-${IMAGICK_VERSION}.tgz - fi - tar xvf imagick-${IMAGICK_VERSION}.tgz - mv imagick-${IMAGICK_VERSION} $ROOT/ext/imagick + if [ ! -f imagick-${IMAGICK_VERSION}.tgz ]; then + curl -fSLo imagick-${IMAGICK_VERSION}.tgz https://pecl.php.net/get/imagick-${IMAGICK_VERSION}.tgz + fi + tar xvf imagick-${IMAGICK_VERSION}.tgz + mv imagick-${IMAGICK_VERSION} $ROOT/ext/imagick fi cd $ROOT - From 9d40cd41390e797c1c934fe81c29cb62a228d675 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 15:00:17 +0800 Subject: [PATCH 179/226] update cygwin build --- sapi/scripts/cygwin/cygwin-config-ext.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapi/scripts/cygwin/cygwin-config-ext.sh b/sapi/scripts/cygwin/cygwin-config-ext.sh index ad7cdc36c0..2d2e5c9d7e 100644 --- a/sapi/scripts/cygwin/cygwin-config-ext.sh +++ b/sapi/scripts/cygwin/cygwin-config-ext.sh @@ -13,6 +13,8 @@ cd ${__PROJECT__} ROOT=${__PROJECT__} +SWOOLE_VERSION=v5.1.3 + while [ $# -gt 0 ]; do case "$1" in --swoole-version) @@ -26,7 +28,6 @@ while [ $# -gt 0 ]; do done PHP_VERSION=$(cat ${__PROJECT__}/sapi/PHP-VERSION.conf) -SWOOLE_VERSION=v5.1.2 REDIS_VERSION=5.3.7 MONGODB_VERSION=1.14.2 YAML_VERSION=2.2.2 From f739635855351339ecad6621d9fce84b34910bcf Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 15:31:11 +0800 Subject: [PATCH 180/226] update cygwin --- sapi/scripts/cygwin/cygwin-config-ext.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/scripts/cygwin/cygwin-config-ext.sh b/sapi/scripts/cygwin/cygwin-config-ext.sh index 2d2e5c9d7e..51bbe44879 100644 --- a/sapi/scripts/cygwin/cygwin-config-ext.sh +++ b/sapi/scripts/cygwin/cygwin-config-ext.sh @@ -71,7 +71,7 @@ if [ ! -d $ROOT/ext/imagick ]; then mv imagick-${IMAGICK_VERSION} $ROOT/ext/imagick fi -if [ ! -d $ROOT/ext/swoole ]; then +if [ ! -f $ROOT/ext/swoole/config.m4 ]; then if [ ! -f swoole-${SWOOLE_VERSION}.tgz ]; then test -d /tmp/swoole && rm -rf /tmp/swoole git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git /tmp/swoole From 47554b6fabac907f7da513343c9412878c3d6f44 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 16:20:31 +0800 Subject: [PATCH 181/226] github action linux show environment info --- .github/workflows/linux-aarch64.yml | 4 +++- .github/workflows/linux-x86_64.yml | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-aarch64.yml b/.github/workflows/linux-aarch64.yml index 6299352826..d269c8abea 100644 --- a/.github/workflows/linux-aarch64.yml +++ b/.github/workflows/linux-aarch64.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Prepare Source Code + - name: show build environment info run: | lscpu echo $PATH @@ -29,6 +29,8 @@ jobs: echo "X_IPV6=${IPV6}" >> $GITHUB_ENV echo "X_IPV4=${IPV4}" >> $GITHUB_ENV + - name: Prepare Build Environment + run: | git submodule update --init sudo mkdir -p /usr/local/swoole-cli diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index c404a17688..08afb2043a 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Prepare Source Code + - name: show build environment info run: | echo $PATH env @@ -35,9 +35,12 @@ jobs: echo "X_IPV6=${IPV6}" >> $GITHUB_ENV echo "X_IPV4=${IPV4}" >> $GITHUB_ENV + - name: Prepare Build Environment + run: | git submodule update --init # 准备数据库容器 + docker-compose version bash sapi/src/UnitTest/scripts/database/start.sh sudo mkdir -p /usr/local/swoole-cli From cb9ed3364d1ba241bd1195fda94a437a433588e1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 16:21:51 +0800 Subject: [PATCH 182/226] github action linux show environment info --- .github/workflows/linux-aarch64.yml | 2 +- .github/workflows/linux-x86_64.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-aarch64.yml b/.github/workflows/linux-aarch64.yml index d269c8abea..d3e557a9db 100644 --- a/.github/workflows/linux-aarch64.yml +++ b/.github/workflows/linux-aarch64.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: show build environment info + - name: Show Environment Info run: | lscpu echo $PATH diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml index 08afb2043a..206ac59a92 100644 --- a/.github/workflows/linux-x86_64.yml +++ b/.github/workflows/linux-x86_64.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: show build environment info + - name: Show Environment Info run: | echo $PATH env From bac080a1d4295aa8af05df2f4a82b296da6c7975 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 18:46:03 +0800 Subject: [PATCH 183/226] update cygwin-config-ext.sh --- sapi/scripts/cygwin/cygwin-config-ext.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/scripts/cygwin/cygwin-config-ext.sh b/sapi/scripts/cygwin/cygwin-config-ext.sh index 51bbe44879..c176025a00 100644 --- a/sapi/scripts/cygwin/cygwin-config-ext.sh +++ b/sapi/scripts/cygwin/cygwin-config-ext.sh @@ -81,6 +81,7 @@ if [ ! -f $ROOT/ext/swoole/config.m4 ]; then fi mkdir -p swoole-${SWOOLE_VERSION} tar --strip-components=1 -C swoole-${SWOOLE_VERSION} -xf swoole-${SWOOLE_VERSION}.tgz + test -d $ROOT/ext/swoole && rm -rf $ROOT/ext/swoole mv swoole-${SWOOLE_VERSION} $ROOT/ext/swoole fi From 3a09f9f66a568846943081eb8fb5d4cb855caa75 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 18:49:19 +0800 Subject: [PATCH 184/226] update --- .gitmodules | 0 sapi/scripts/cygwin/cygwin-config-ext.sh | 22 ++++++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sapi/scripts/cygwin/cygwin-config-ext.sh b/sapi/scripts/cygwin/cygwin-config-ext.sh index c176025a00..a306c13c44 100644 --- a/sapi/scripts/cygwin/cygwin-config-ext.sh +++ b/sapi/scripts/cygwin/cygwin-config-ext.sh @@ -71,19 +71,17 @@ if [ ! -d $ROOT/ext/imagick ]; then mv imagick-${IMAGICK_VERSION} $ROOT/ext/imagick fi -if [ ! -f $ROOT/ext/swoole/config.m4 ]; then - if [ ! -f swoole-${SWOOLE_VERSION}.tgz ]; then - test -d /tmp/swoole && rm -rf /tmp/swoole - git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git /tmp/swoole - cd /tmp/swoole - tar -czvf $ROOT/pool/ext/swoole-${SWOOLE_VERSION}.tgz . - cd $ROOT/pool/ext/ - fi - mkdir -p swoole-${SWOOLE_VERSION} - tar --strip-components=1 -C swoole-${SWOOLE_VERSION} -xf swoole-${SWOOLE_VERSION}.tgz - test -d $ROOT/ext/swoole && rm -rf $ROOT/ext/swoole - mv swoole-${SWOOLE_VERSION} $ROOT/ext/swoole +if [ ! -f swoole-${SWOOLE_VERSION}.tgz ]; then + test -d /tmp/swoole && rm -rf /tmp/swoole + git clone -b ${SWOOLE_VERSION} https://github.com/swoole/swoole-src.git /tmp/swoole + cd /tmp/swoole + tar -czvf $ROOT/pool/ext/swoole-${SWOOLE_VERSION}.tgz . + cd $ROOT/pool/ext/ fi +mkdir -p swoole-${SWOOLE_VERSION} +tar --strip-components=1 -C swoole-${SWOOLE_VERSION} -xf swoole-${SWOOLE_VERSION}.tgz +test -d $ROOT/ext/swoole && rm -rf $ROOT/ext/swoole +mv swoole-${SWOOLE_VERSION} $ROOT/ext/swoole cd $ROOT # downgload php-src source code From b97ac31eec05d851a98adfb03a986c9d78f66d1e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 19:55:53 +0800 Subject: [PATCH 185/226] update --- setup-swoole-cli-pre-runtime.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/setup-swoole-cli-pre-runtime.sh b/setup-swoole-cli-pre-runtime.sh index b3e0c5d13f..3944bc1c58 100644 --- a/setup-swoole-cli-pre-runtime.sh +++ b/setup-swoole-cli-pre-runtime.sh @@ -21,7 +21,7 @@ case $OS in ;; *) case $OS in - 'MSYS_NT'* | 'CYGWIN_NT'* ) + 'MSYS_NT'* | 'CYGWIN_NT'*) OS="windows" ;; 'MINGW64_NT'*) @@ -39,7 +39,7 @@ case $ARCH in 'x86_64') ARCH="x64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -50,19 +50,19 @@ esac APP_VERSION='v6.0.0-dev' APP_NAME='swoole-cli' -VERSION='swoole-cli-v0.0.6' +VERSION='swoole-cli-v0.0.7' 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" +APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-zts-${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" + APP_DOWNLOAD_URL="https://github.com/jingjingxyk/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-zts-cygwin-${ARCH}.zip" fi MIRROR='' @@ -70,7 +70,7 @@ while [ $# -gt 0 ]; do case "$1" in --mirror) MIRROR="$2" - # dev beta alpha + # dev beta alpha 不支持 镜像 MIRROR="" ;; --proxy) @@ -92,10 +92,10 @@ done case "$MIRROR" in china) - APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" + APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-zts-${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" + APP_DOWNLOAD_URL="https://wenda-1252906962.file.myqcloud.com/dist/${APP_NAME}-${APP_VERSION}-zts-cygwin-${ARCH}.zip" fi ;; @@ -106,11 +106,11 @@ chmod a+x composer.phar test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} -APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" +APP_RUNTIME="${APP_NAME}-${APP_VERSION}-zts-${OS}-${ARCH}" if [ $OS = 'windows' ]; then { - APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" + APP_RUNTIME="${APP_NAME}-${APP_VERSION}-zts-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" From 188a6562a3167c8df1a009b066303dbd1b400f1a Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 1 Aug 2024 22:11:03 +0800 Subject: [PATCH 186/226] add download swoole-cli script --- setup-swoole-cli-runtime.sh | 166 ++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 setup-swoole-cli-runtime.sh diff --git a/setup-swoole-cli-runtime.sh b/setup-swoole-cli-runtime.sh new file mode 100644 index 0000000000..1649b27db3 --- /dev/null +++ b/setup-swoole-cli-runtime.sh @@ -0,0 +1,166 @@ +#!/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 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: Thu, 1 Aug 2024 22:16:23 +0800 Subject: [PATCH 187/226] merge code --- setup-php-cli-runtime.sh | 13 +++ setup-php-fpm-runtime.sh | 8 +- setup-swoole-cli-runtime.sh | 166 ------------------------------------ 3 files changed, 20 insertions(+), 167 deletions(-) delete mode 100644 setup-swoole-cli-runtime.sh diff --git a/setup-php-cli-runtime.sh b/setup-php-cli-runtime.sh index 9c69779c3b..af40cb54b4 100644 --- a/setup-php-cli-runtime.sh +++ b/setup-php-cli-runtime.sh @@ -132,6 +132,19 @@ cat >${__PROJECT__}/bin/runtime/php.ini < 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 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: Fri, 2 Aug 2024 21:02:11 +0800 Subject: [PATCH 188/226] update --- setup-nodejs-runtime.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/setup-nodejs-runtime.sh b/setup-nodejs-runtime.sh index baa078afd4..e9097c5ffa 100644 --- a/setup-nodejs-runtime.sh +++ b/setup-nodejs-runtime.sh @@ -1,11 +1,14 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( cd "$(dirname "$0")" pwd ) -__PROJECT__=${__DIR__} +__PROJECT__=$( + cd "${__DIR__}/../" + pwd +) cd ${__PROJECT__} @@ -39,7 +42,7 @@ case $ARCH in 'x86_64') ARCH="x64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -57,13 +60,14 @@ mkdir -p var/runtime cd ${__PROJECT__}/var/runtime -:<<'EOF' +: <<'EOF' https://nodejs.org/dist/v20.15.1/node-v20.15.1-darwin-x64.tar.gz https://nodejs.org/dist/v20.15.1/node-v20.15.1-darwin-arm64.tar.gz https://nodejs.org/dist/v20.15.1/node-v20.15.1-linux-arm64.tar.xz https://nodejs.org/dist/v20.15.1/node-v20.15.1-linux-arm64.tar.xz https://nodejs.org/dist/v20.15.1/node-v20.15.1-win-arm64.zip https://nodejs.org/dist/v20.15.1/node-v20.15.1-win-x64.zip +https://registry.npmmirror.com/-/binary/node/v20.15.1/node-v20.15.1-win-x64.zip EOF APP_DOWNLOAD_URL="https://nodejs.org/dist/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" @@ -77,7 +81,6 @@ while [ $# -gt 0 ]; do case "$1" in --mirror) MIRROR="$2" - MIRROR="" ;; --proxy) export HTTP_PROXY="$2" @@ -85,8 +88,6 @@ while [ $# -gt 0 ]; do 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" ;; --*) @@ -98,9 +99,9 @@ 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://registry.npmmirror.com/-/binary/node/${APP_VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" if [ $OS = 'windows' ]; then - APP_DOWNLOAD_URL="https://swoole-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.zip" + APP_DOWNLOAD_URL="https://registry.npmmirror.com/-/binary/node/${APP_VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.zip" fi ;; esac @@ -108,27 +109,26 @@ esac APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" if [ $OS = 'win' ]; then { - test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.zip || curl -fSLo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} unzip "${APP_RUNTIME}.zip" exit 0 } else if [ $OS = "darwin" ]; then - 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 -f ${APP_RUNTIME}.tar.gz || curl -fSLo ${APP_RUNTIME}.tar.gz ${APP_DOWNLOAD_URL} + test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} + tar -xvf ${APP_RUNTIME}.tar.gz 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 -d ${APP_RUNTIME} || tar -xvf ${APP_RUNTIME}.tar + test -f ${APP_RUNTIME}.tar.xz || curl -fSLo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz + test -d ${APP_RUNTIME} || tar -xvf ${APP_RUNTIME}.tar fi test -d ${__PROJECT__}/bin/runtime/node && rm -rf ${__PROJECT__}/bin/runtime/node mv ${APP_RUNTIME} ${__PROJECT__}/bin/runtime/node fi - cd ${__PROJECT__}/ set +x From a1591ad39ddc6b30a1e2dca0a960b898dc5ac375 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Sat, 3 Aug 2024 15:07:38 +0800 Subject: [PATCH 189/226] 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 190/226] =?UTF-8?q?=E8=B0=83=E6=95=B4=20linux=20workflow?= =?UTF-8?q?=20config?= 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 191/226] 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 192/226] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20github=20action=20?= =?UTF-8?q?linux=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 193/226] 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 194/226] 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 195/226] 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 196/226] 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 197/226] 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 198/226] =?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 199/226] 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 200/226] =?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 201/226] 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 202/226] 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 203/226] 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 204/226] 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 205/226] 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 206/226] 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 207/226] 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 208/226] 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 209/226] 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 210/226] 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 211/226] 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 212/226] 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 213/226] 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 214/226] 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 215/226] 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 216/226] 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 217/226] 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 218/226] 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 219/226] 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 220/226] 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 221/226] 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 222/226] 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 223/226] 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 224/226] 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 225/226] 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 226/226] 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