From 2767ac524fb81ce7b62ec47257c1ea0ebdfcb6cf Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Mon, 8 May 2023 11:44:44 +0800 Subject: [PATCH 01/24] =?UTF-8?q?mongodb=20=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/ext.json | 6 +++++- src/SPC/builder/extension/mongodb.php | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/config/ext.json b/config/ext.json index 7e4718e9..fab1d737 100644 --- a/config/ext.json +++ b/config/ext.json @@ -157,7 +157,11 @@ "mongodb": { "type": "external", "source": "mongodb", - "arg-type": "custom" + "arg-type": "custom", + "lib-suggests": [ + "icu", + "openssl" + ] }, "mysqli": { "type": "builtin", diff --git a/src/SPC/builder/extension/mongodb.php b/src/SPC/builder/extension/mongodb.php index 843ee39b..6214720d 100644 --- a/src/SPC/builder/extension/mongodb.php +++ b/src/SPC/builder/extension/mongodb.php @@ -12,6 +12,19 @@ class mongodb extends Extension { public function getUnixConfigureArg(): string { - return '--enable-mongodb --without-mongodb-sasl'; + $arg = '--enable-mongodb --without-mongodb-sasl'; + if ($this->builder->getLib('openssl')) { + $arg .= '--with-mongodb-system-libs=no --with-mongodb-ssl=openssl'; + } else { + // 禁用,否则链接的是系统库 + $arg .= ''; + } + if ($this->builder->getLib('icu')) { + $arg .= '--with-mongodb-system-libs=no --with-mongodb-ssl=openssl'; + } else { + // 禁用,否则链接的是系统库 + $arg .= ''; + } + return $arg; } } From 41aa129b97a56b7d7c0f0468e10d0a1c3508a1f6 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 24 May 2023 03:48:40 +0800 Subject: [PATCH 02/24] update --- src/SPC/builder/extension/mongodb.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/SPC/builder/extension/mongodb.php b/src/SPC/builder/extension/mongodb.php index 6214720d..f05b096a 100644 --- a/src/SPC/builder/extension/mongodb.php +++ b/src/SPC/builder/extension/mongodb.php @@ -12,18 +12,14 @@ class mongodb extends Extension { public function getUnixConfigureArg(): string { - $arg = '--enable-mongodb --without-mongodb-sasl'; + $arg = ' --enable-mongodb '; + $arg .= ' --with-mongodb-system-libs=no '; + $arg .= ' --with-mongodb-sasl=no '; if ($this->builder->getLib('openssl')) { - $arg .= '--with-mongodb-system-libs=no --with-mongodb-ssl=openssl'; - } else { - // 禁用,否则链接的是系统库 - $arg .= ''; + $arg .= '--with-mongodb-ssl=openssl'; } if ($this->builder->getLib('icu')) { - $arg .= '--with-mongodb-system-libs=no --with-mongodb-ssl=openssl'; - } else { - // 禁用,否则链接的是系统库 - $arg .= ''; + $arg .= ' --with-mongodb-icu=yes '; } return $arg; } From 1cca826e8a5928bdde5c80f5f6629720e3de4ecb Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 24 May 2023 12:29:57 +0800 Subject: [PATCH 03/24] update mongodb extension config --- src/SPC/builder/extension/mongodb.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SPC/builder/extension/mongodb.php b/src/SPC/builder/extension/mongodb.php index f05b096a..a33b1b9e 100644 --- a/src/SPC/builder/extension/mongodb.php +++ b/src/SPC/builder/extension/mongodb.php @@ -20,6 +20,8 @@ class mongodb extends Extension } if ($this->builder->getLib('icu')) { $arg .= ' --with-mongodb-icu=yes '; + } else { + $arg .= ' --with-mongodb-icu=no '; } return $arg; } From f831b4d61df106a1ffd9a4972e63cbb46794a3ff Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 24 May 2023 13:20:56 +0800 Subject: [PATCH 04/24] =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickstart/linux/x86_64/alpine-3.16-init.sh | 2 ++ quickstart/linux/x86_64/debian-11-init.sh | 3 +-- quickstart/linux/x86_64/prepare.sh | 23 +++++++++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/quickstart/linux/x86_64/alpine-3.16-init.sh b/quickstart/linux/x86_64/alpine-3.16-init.sh index 2ad2d6e6..8aed86b6 100644 --- a/quickstart/linux/x86_64/alpine-3.16-init.sh +++ b/quickstart/linux/x86_64/alpine-3.16-init.sh @@ -36,3 +36,5 @@ esac apk update apk add vim alpine-sdk xz autoconf automake linux-headers clang-dev clang lld libtool cmake bison re2c gettext coreutils +apk add bash p7zip zip unzip flex pkgconf ca-certificates +apk add wget git curl \ No newline at end of file diff --git a/quickstart/linux/x86_64/debian-11-init.sh b/quickstart/linux/x86_64/debian-11-init.sh index 1ff044a9..dbd8478c 100644 --- a/quickstart/linux/x86_64/debian-11-init.sh +++ b/quickstart/linux/x86_64/debian-11-init.sh @@ -36,7 +36,6 @@ esac apt update -y apt install -y git curl wget ca-certificates apt install -y xz-utils autoconf automake lld libtool cmake bison re2c gettext coreutils lzip zip unzip -apt install -y pkg-config bzip2 flex +apt install -y pkg-config bzip2 flex p7zip apt install -y musl-tools g++ apt install -y clang - diff --git a/quickstart/linux/x86_64/prepare.sh b/quickstart/linux/x86_64/prepare.sh index bd278330..ef7c2f32 100644 --- a/quickstart/linux/x86_64/prepare.sh +++ b/quickstart/linux/x86_64/prepare.sh @@ -20,6 +20,25 @@ chmod +x bin/spc ./bin/spc list-ext -#./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo,pdo_sqlite,ftp,curl" --cc=gcc --cxx=g++ --debug +EXTENSION="calendar,ctype,exif,fileinfo,filter,ftp" +EXTENSION="${EXTENSION},session,tokenizer" +EXTENSION="${EXTENSION},phar,posix" +EXTENSION="${EXTENSION},iconv" +EXTENSION="${EXTENSION},xml,dom,simplexml,xmlwriter,xmlreader" +EXTENSION="${EXTENSION},phar,posix" +EXTENSION="${EXTENSION},soap" +EXTENSION="${EXTENSION},mbstring,mbregex" +EXTENSION="${EXTENSION},openssl" +EXTENSION="${EXTENSION},sockets,gmp,bcmath" +EXTENSION="${EXTENSION},pcntl" +EXTENSION="${EXTENSION},curl" +EXTENSION="${EXTENSION},zlib,zip,bz2" +EXTENSION="${EXTENSION},gd" +EXTENSION="${EXTENSION},redis" +EXTENSION="${EXTENSION},pdo,pdo_mysql,pdo_sqlite," +EXTENSION="${EXTENSION},mysqlnd,sqlite3" +EXTENSION="${EXTENSION},mongodb" -./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo,pdo_sqlite,ftp,curl" --cc=clang --cxx=clang++ --debug + +./bin/spc build "${EXTENSION}" --build-cli --cc=clang --cxx=clang++ --debug +# ./bin/spc build "${EXTENSION}" --build-cli --cc=gcc --cxx=g++ --debug From 7fb3d05b2ccd1f10117973703a052154fda0b5bd Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 24 May 2023 13:30:22 +0800 Subject: [PATCH 05/24] =?UTF-8?q?=E8=B0=83=E6=95=B4quickstart=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickstart/linux/{x86_64 => }/README.md | 12 ++--- .../linux/{x86_64 => }/alpine-3.16-init.sh | 0 .../{x86_64 => }/connection-static-php-cli.sh | 0 .../linux/{x86_64 => }/debian-11-init.sh | 0 .../{x86_64 => }/run-alpine-3.16-container.sh | 2 +- .../{x86_64 => }/run-debian-11-container.sh | 2 +- quickstart/linux/x86_64/prepare.sh | 44 ------------------- quickstart/macOS/x86_64/prepare.sh | 24 ---------- quickstart/prepare.sh | 44 +++++++++++++++++++ 9 files changed, 52 insertions(+), 76 deletions(-) rename quickstart/linux/{x86_64 => }/README.md (51%) rename quickstart/linux/{x86_64 => }/alpine-3.16-init.sh (100%) rename quickstart/linux/{x86_64 => }/connection-static-php-cli.sh (100%) rename quickstart/linux/{x86_64 => }/debian-11-init.sh (100%) rename quickstart/linux/{x86_64 => }/run-alpine-3.16-container.sh (92%) rename quickstart/linux/{x86_64 => }/run-debian-11-container.sh (92%) delete mode 100644 quickstart/linux/x86_64/prepare.sh delete mode 100644 quickstart/macOS/x86_64/prepare.sh create mode 100644 quickstart/prepare.sh diff --git a/quickstart/linux/x86_64/README.md b/quickstart/linux/README.md similarity index 51% rename from quickstart/linux/x86_64/README.md rename to quickstart/linux/README.md index deb80a2b..c6090a30 100644 --- a/quickstart/linux/x86_64/README.md +++ b/quickstart/linux/README.md @@ -8,13 +8,13 @@ ```bash # 启动 debian 11 容器环境 -sh quickstart/linux/x86_64/run-debian-11-container.sh +sh quickstart/linux/run-debian-11-container.sh # 进入容器 -sh quickstart/linux/x86_64/connection-static-php-cli.sh +sh quickstart/linux/connection-static-php-cli.sh # 准备构建基础软件 -sh quickstart/linux/x86_64/debian-11-init.sh +sh quickstart/linux/debian-11-init.sh ``` @@ -23,12 +23,12 @@ sh quickstart/linux/x86_64/debian-11-init.sh ```bash # 启动 alpine 容器环境 -sh quickstart/linux/x86_64/run-alpine-3.16-container.sh +sh quickstart/linux/run-alpine-3.16-container.sh # 进入容器 -sh sh quickstart/linux/x86_64/connection-static-php-cli.sh +sh sh quickstart/linux/connection-static-php-cli.sh # 准备构建基础软件 -sh quickstart/linux/x86_64/alpine-3.16-init.sh +sh quickstart/linux/alpine-3.16-init.sh ``` \ No newline at end of file diff --git a/quickstart/linux/x86_64/alpine-3.16-init.sh b/quickstart/linux/alpine-3.16-init.sh similarity index 100% rename from quickstart/linux/x86_64/alpine-3.16-init.sh rename to quickstart/linux/alpine-3.16-init.sh diff --git a/quickstart/linux/x86_64/connection-static-php-cli.sh b/quickstart/linux/connection-static-php-cli.sh similarity index 100% rename from quickstart/linux/x86_64/connection-static-php-cli.sh rename to quickstart/linux/connection-static-php-cli.sh diff --git a/quickstart/linux/x86_64/debian-11-init.sh b/quickstart/linux/debian-11-init.sh similarity index 100% rename from quickstart/linux/x86_64/debian-11-init.sh rename to quickstart/linux/debian-11-init.sh diff --git a/quickstart/linux/x86_64/run-alpine-3.16-container.sh b/quickstart/linux/run-alpine-3.16-container.sh similarity index 92% rename from quickstart/linux/x86_64/run-alpine-3.16-container.sh rename to quickstart/linux/run-alpine-3.16-container.sh index b53d9cd4..fa3ea0e5 100644 --- a/quickstart/linux/x86_64/run-alpine-3.16-container.sh +++ b/quickstart/linux/run-alpine-3.16-container.sh @@ -6,7 +6,7 @@ __DIR__=$( pwd ) __PROJECT__=$( - cd ${__DIR__}/../../../ + cd ${__DIR__}/../../ pwd ) cd ${__DIR__} diff --git a/quickstart/linux/x86_64/run-debian-11-container.sh b/quickstart/linux/run-debian-11-container.sh similarity index 92% rename from quickstart/linux/x86_64/run-debian-11-container.sh rename to quickstart/linux/run-debian-11-container.sh index a9239727..c00ae1a6 100644 --- a/quickstart/linux/x86_64/run-debian-11-container.sh +++ b/quickstart/linux/run-debian-11-container.sh @@ -6,7 +6,7 @@ __DIR__=$( pwd ) __PROJECT__=$( - cd ${__DIR__}/../../../ + cd ${__DIR__}/../../ pwd ) cd ${__DIR__} diff --git a/quickstart/linux/x86_64/prepare.sh b/quickstart/linux/x86_64/prepare.sh deleted file mode 100644 index ef7c2f32..00000000 --- a/quickstart/linux/x86_64/prepare.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -exu -__DIR__=$( - cd "$(dirname "$0")" - pwd -) -__PROJECT__=$( - cd ${__DIR__}/../../../ - pwd -) -cd ${__PROJECT__} - -composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ - -chmod +x bin/spc - -./bin/spc fetch --all --debug - -./bin/spc list-ext - - -EXTENSION="calendar,ctype,exif,fileinfo,filter,ftp" -EXTENSION="${EXTENSION},session,tokenizer" -EXTENSION="${EXTENSION},phar,posix" -EXTENSION="${EXTENSION},iconv" -EXTENSION="${EXTENSION},xml,dom,simplexml,xmlwriter,xmlreader" -EXTENSION="${EXTENSION},phar,posix" -EXTENSION="${EXTENSION},soap" -EXTENSION="${EXTENSION},mbstring,mbregex" -EXTENSION="${EXTENSION},openssl" -EXTENSION="${EXTENSION},sockets,gmp,bcmath" -EXTENSION="${EXTENSION},pcntl" -EXTENSION="${EXTENSION},curl" -EXTENSION="${EXTENSION},zlib,zip,bz2" -EXTENSION="${EXTENSION},gd" -EXTENSION="${EXTENSION},redis" -EXTENSION="${EXTENSION},pdo,pdo_mysql,pdo_sqlite," -EXTENSION="${EXTENSION},mysqlnd,sqlite3" -EXTENSION="${EXTENSION},mongodb" - - -./bin/spc build "${EXTENSION}" --build-cli --cc=clang --cxx=clang++ --debug -# ./bin/spc build "${EXTENSION}" --build-cli --cc=gcc --cxx=g++ --debug diff --git a/quickstart/macOS/x86_64/prepare.sh b/quickstart/macOS/x86_64/prepare.sh deleted file mode 100644 index 93b83560..00000000 --- a/quickstart/macOS/x86_64/prepare.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -exu -__DIR__=$( - cd "$(dirname "$0")" - pwd -) -__PROJECT__=$( - cd ${__DIR__}/../../../ - pwd -) -cd ${__PROJECT__} - -export PATH=${__PROJECT__}/bin/runtime:$PATH - -composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ - -chmod +x bin/spc - -./bin/spc fetch --all --debug - -./bin/spc list-ext - -./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo,pdo_sqlite,ftp,curl" --cc=clang --cxx=clang++ --debug diff --git a/quickstart/prepare.sh b/quickstart/prepare.sh new file mode 100644 index 00000000..3cb98d5e --- /dev/null +++ b/quickstart/prepare.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../ + pwd +) +cd ${__PROJECT__} + +composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ + +chmod +x bin/spc + +./bin/spc fetch --all --debug + +./bin/spc list-ext + + +EXTENSIONS="calendar,ctype,exif,fileinfo,filter,ftp" +EXTENSIONS="${EXTENSIONS},session,tokenizer" +EXTENSIONS="${EXTENSIONS},phar,posix" +EXTENSIONS="${EXTENSIONS},iconv" +EXTENSIONS="${EXTENSIONS},xml,dom,simplexml,xmlwriter,xmlreader" +EXTENSIONS="${EXTENSIONS},phar,posix" +EXTENSIONS="${EXTENSIONS},soap" +EXTENSIONS="${EXTENSIONS},mbstring,mbregex" +EXTENSIONS="${EXTENSIONS},openssl" +EXTENSIONS="${EXTENSIONS},sockets,gmp,bcmath" +EXTENSIONS="${EXTENSIONS},pcntl" +EXTENSIONS="${EXTENSIONS},curl" +EXTENSIONS="${EXTENSIONS},zlib,zip,bz2" +EXTENSIONS="${EXTENSIONS},gd" +EXTENSIONS="${EXTENSIONS},redis" +EXTENSIONS="${EXTENSIONS},pdo,pdo_mysql,pdo_sqlite" +EXTENSIONS="${EXTENSIONS},mysqlnd,sqlite3" +EXTENSIONS="${EXTENSIONS},mongodb" + + +./bin/spc build "${EXTENSIONS}" --build-cli --cc=clang --cxx=clang++ --debug +# ./bin/spc build "${EXTENSIONS}" --build-cli --cc=gcc --cxx=g++ --debug From 7c3826f4a42fc1b98ac45814439df071cd0313a9 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 24 May 2023 13:50:23 +0800 Subject: [PATCH 06/24] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickstart/prepare.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/quickstart/prepare.sh b/quickstart/prepare.sh index 3cb98d5e..47c7d676 100644 --- a/quickstart/prepare.sh +++ b/quickstart/prepare.sh @@ -11,6 +11,14 @@ __PROJECT__=$( ) cd ${__PROJECT__} +OS=$(uname -s) +ARCH=$(uname -m) + +if [[ $OS = "Linux" && -f /etc/os-release ]]; then + OS_NAME=$(cat /etc/os-release | grep '^ID=' | awk -F '=' '{print $2}') + # debian ubuntu alpine +fi + composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ chmod +x bin/spc @@ -19,7 +27,6 @@ chmod +x bin/spc ./bin/spc list-ext - EXTENSIONS="calendar,ctype,exif,fileinfo,filter,ftp" EXTENSIONS="${EXTENSIONS},session,tokenizer" EXTENSIONS="${EXTENSIONS},phar,posix" @@ -38,7 +45,7 @@ EXTENSIONS="${EXTENSIONS},redis" EXTENSIONS="${EXTENSIONS},pdo,pdo_mysql,pdo_sqlite" EXTENSIONS="${EXTENSIONS},mysqlnd,sqlite3" EXTENSIONS="${EXTENSIONS},mongodb" +EXTENSIONS="${EXTENSIONS},swoole" - -./bin/spc build "${EXTENSIONS}" --build-cli --cc=clang --cxx=clang++ --debug +./bin/spc build "${EXTENSIONS}" --build-cli --cc=clang --cxx=clang++ --debug # ./bin/spc build "${EXTENSIONS}" --build-cli --cc=gcc --cxx=g++ --debug From 1fd70c9a9972c61776bb7e3459c7e6e75e1de71e Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 24 May 2023 14:40:09 +0800 Subject: [PATCH 07/24] =?UTF-8?q?=E9=AA=8C=E8=AF=81=20swow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickstart/prepare.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstart/prepare.sh b/quickstart/prepare.sh index 47c7d676..9f4669d1 100644 --- a/quickstart/prepare.sh +++ b/quickstart/prepare.sh @@ -45,7 +45,8 @@ EXTENSIONS="${EXTENSIONS},redis" EXTENSIONS="${EXTENSIONS},pdo,pdo_mysql,pdo_sqlite" EXTENSIONS="${EXTENSIONS},mysqlnd,sqlite3" EXTENSIONS="${EXTENSIONS},mongodb" -EXTENSIONS="${EXTENSIONS},swoole" +# EXTENSIONS="${EXTENSIONS},swoole" +EXTENSIONS="${EXTENSIONS},swow" ./bin/spc build "${EXTENSIONS}" --build-cli --cc=clang --cxx=clang++ --debug # ./bin/spc build "${EXTENSIONS}" --build-cli --cc=gcc --cxx=g++ --debug From 71e4ea166c7e7bff04801f32378a7c9709c39383 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 26 May 2023 12:25:53 +0800 Subject: [PATCH 08/24] Update ext.json --- config/ext.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/ext.json b/config/ext.json index 2a78acb1..7a7b3b0f 100644 --- a/config/ext.json +++ b/config/ext.json @@ -166,6 +166,9 @@ "type": "external", "source": "mongodb", "arg-type": "custom", + "lib-depends": [ + "zstd" + ], "lib-suggests": [ "icu", "openssl" @@ -425,4 +428,4 @@ "zstd" ] } -} \ No newline at end of file +} From fb06cc1e1a082519272dafdaa7707d82a51a92d1 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Mon, 29 May 2023 21:57:58 +0800 Subject: [PATCH 09/24] Create FUNDING.yml --- .github/FUNDING.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..988dd37f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +custom: ['https://www.buymeacoffee.com/crazywhalecc']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From c5b24ab136b8686f0329ca74deb438f843c80870 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Mon, 29 May 2023 22:12:34 +0800 Subject: [PATCH 10/24] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 988dd37f..972bbfac 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: ['https://www.buymeacoffee.com/crazywhalecc']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: ['https://www.buymeacoffee.com/crazywhalecc', 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 0fe432dd8ee2db12eb785594cf4bdc143d272272 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Mon, 29 May 2023 22:16:06 +0800 Subject: [PATCH 11/24] Update FUNDING.yml --- .github/FUNDING.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 972bbfac..e5e57e35 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,6 @@ # These are supported funding model platforms -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +github: [crazywhalecc] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username @@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: ['https://www.buymeacoffee.com/crazywhalecc', 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: ['buymeacoffee.com/crazywhalecc', 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From e19bd39feac8cf1e6004a78298d006dc2765c78f Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Mon, 29 May 2023 22:16:46 +0800 Subject: [PATCH 12/24] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e5e57e35..f1b742f5 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,6 @@ # These are supported funding model platforms -github: [crazywhalecc] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username From 030ac531a6481220b93624c80773eea7427f253a Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Mon, 29 May 2023 23:49:55 +0800 Subject: [PATCH 13/24] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 84e93f0f..53e9407e 100755 --- a/README.md +++ b/README.md @@ -200,6 +200,10 @@ cat micro.sfx code.php > single-app && chmod +x single-app 另外,添加新扩展的贡献方式,可以参考下方 `进阶`。 +## 赞助本项目 + +你可以在 [我的个人赞助页](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md) 支持我和我的项目。 + ## 开源协议 本项目依据旧版本惯例采用 MIT License 开源,自身的部分代码引用或修改自以下项目: From 34cd9d7cc145b362ecfaa175eebb334c5d78153a Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Mon, 29 May 2023 23:53:26 +0800 Subject: [PATCH 14/24] Update README-en.md --- README-en.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README-en.md b/README-en.md index 4bd3120a..faa2021c 100755 --- a/README-en.md +++ b/README-en.md @@ -215,6 +215,10 @@ The basic principles for contributing are as follows: camelCase and underscore formats should be followed, and mixing within the same module is prohibited. - When compiling external libraries and creating patches, compatibility with different operating systems should be considered. +## Sponsor this project + +You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md). + ## Open-Source License This project is based on the tradition of using the MIT License for old versions, From 37556c9e02854dcbdb120ddaabc2ae2dc8a8f8d7 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Mon, 29 May 2023 23:53:50 +0800 Subject: [PATCH 15/24] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index f1b742f5..36b494a8 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: ['buymeacoffee.com/crazywhalecc', 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md' # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 3f6e659c6a33080f786a5638c6ff954acb8d0e1a Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 2 Jun 2023 09:52:34 +0800 Subject: [PATCH 16/24] Update ext-support.md --- ext-support.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext-support.md b/ext-support.md index 9af15a0d..5889ff1e 100644 --- a/ext-support.md +++ b/ext-support.md @@ -29,6 +29,7 @@ | iconv | yes | yes | | | imagick | yes | yes | | | inotify | yes | yes | | +| intl | | | | | mbstring | yes | yes | | | mbregex | yes | yes | | | mcrypt | | [no](https://github.com/crazywhalecc/static-php-cli/issues/32) | | @@ -36,6 +37,7 @@ | mysqli | yes | yes | | | mysqlnd | yes | yes | | | openssl | yes | yes | | +| password-argon2 | | | | | pcntl | yes | yes | | | pdo | yes | yes | | | pdo_mysql | yes | yes | | @@ -57,6 +59,7 @@ | swow | yes | yes | | | swoole | [partial](https://github.com/crazywhalecc/static-php-cli/issues/51) | yes | | | tokenizer | yes | yes | | +| xlswriter | | | | | xml | yes | yes | | | xmlreader | yes, untested | yes, untested | | | xmlwriter | yes, untested | yes, untested | | @@ -79,7 +82,7 @@ Here are some extension list example for different use. - For static-php-cli self (with dev dependencies): `"posix,pcntl,phar,tokenizer,iconv,zlib,xml,dom,xmlwriter,xmlreader,fileinfo"` - Minimum, with no extension: `""` -Compile with all supported extensions (exclude `swow`, `swoole` due to c++ extension): +Compile with all supported extensions (exclude `swow`, `swoole`, because these will change the default behavior of php): ```bash bin/spc build --build-all bcmath,bz2,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,mbregex,mbstring,mongodb,mysqli,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,protobuf,redis,session,shmop,simplexml,soap,sockets,sqlite3,tokenizer,xml,xmlreader,xmlwriter,yaml,zip,zlib,zstd --with-libs=libjpeg,freetype,libwebp,libavif --debug From c9692d502c4af4388f71e89d9dacd46a1189d46b Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 2 Jun 2023 09:55:13 +0800 Subject: [PATCH 17/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53e9407e..d4f436ff 100755 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ cat micro.sfx code.php > single-app && chmod +x single-app - [swoole/swoole-cli](https://github.com/swoole/swoole-cli)(Apache 2.0 LICENSE、SWOOLE-CLI LICENSE) 因本项目的特殊性,使用项目编译过程中会使用很多其他开源项目,例如 curl、protobuf 等,它们都有各自的开源协议。 -请在编译完成后,使用命令 `dump-license`(TODO) 导出项目使用项目的开源协议,并遵守对应项目的 LICENSE。 +请在编译完成后,使用命令 `bin/spc dump-license` 导出项目使用项目的开源协议,并遵守对应项目的 LICENSE。 ## 进阶 From b99378ea38f683d672240262bb29ad225aed37c3 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 2 Jun 2023 09:55:33 +0800 Subject: [PATCH 18/24] Update README-en.md --- README-en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-en.md b/README-en.md index faa2021c..d0d30253 100755 --- a/README-en.md +++ b/README-en.md @@ -231,7 +231,7 @@ Due to the special nature of this project, many other open source projects such as curl and protobuf will be used during the project compilation process, and they all have their own open source licenses. -Please use the `dump-license`(TODO) command to export the open source licenses used in the project after compilation, +Please use the `bin/spc dump-license` command to export the open source licenses used in the project after compilation, and comply with the corresponding project's LICENSE. ## Advanced From ee1b03b0607efc646c800fea03152474e53967dc Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 2 Jun 2023 09:59:47 +0800 Subject: [PATCH 19/24] Update README-en.md --- README-en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-en.md b/README-en.md index d0d30253..6627e9d9 100755 --- a/README-en.md +++ b/README-en.md @@ -154,7 +154,7 @@ cd buildroot/bin/ ### micro.sfx Usage -> phpmicro is a Self-Extracted Executable SAPI module, +> phpmicro is a SelF-extracted eXecutable SAPI module, > provided by [dixyes/phpmicro](https://github.com/dixyes/phpmicro). > It can put php runtime and your source code together. From 1158931d918fbfcd357bd2085e3c38ccf0f17ef2 Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Fri, 2 Jun 2023 11:47:11 +0200 Subject: [PATCH 20/24] Add intl/ICU support --- config/lib.json | 13 +++++++++++++ config/source.json | 8 ++++++++ src/SPC/builder/linux/LinuxBuilder.php | 2 +- src/SPC/builder/linux/library/icu.php | 20 ++++++++++++++++++++ src/SPC/builder/macos/MacOSBuilder.php | 2 +- src/SPC/builder/macos/library/icu.php | 20 ++++++++++++++++++++ src/globals/tests/intl.php | 5 +++++ 7 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 src/SPC/builder/linux/library/icu.php create mode 100644 src/SPC/builder/macos/library/icu.php create mode 100644 src/globals/tests/intl.php diff --git a/config/lib.json b/config/lib.json index bfe6ec6c..16ea45c8 100644 --- a/config/lib.json +++ b/config/lib.json @@ -460,5 +460,18 @@ "static-libs-unix": [ "libsodium.a" ] + }, + "icu": { + "source": "icu", + "static-libs-unix": [ + "libicudata.a", + "libicui18n.a", + "libicuio.a", + "libicutu.a", + "libicuuc.a" + ], + "headers": [ + + ] } } \ No newline at end of file diff --git a/config/source.json b/config/source.json index d74fd496..89238e39 100644 --- a/config/source.json +++ b/config/source.json @@ -419,5 +419,13 @@ "type": "file", "path": "LICENSE" } + }, + "icu": { + "type": "url", + "url": "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz", + "license": { + "type": "file", + "path": "LICENSE" + } } } \ No newline at end of file diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index b8d8757d..8aee51ce 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -139,7 +139,7 @@ class LinuxBuilder extends BuilderBase ) ); } - if ($this->getExt('swoole')) { + if ($this->getExt('swoole') || $this->getExt('intl')) { $extra_libs .= ' -lstdc++'; } if ($this->getExt('imagick')) { diff --git a/src/SPC/builder/linux/library/icu.php b/src/SPC/builder/linux/library/icu.php new file mode 100644 index 00000000..4e061dfc --- /dev/null +++ b/src/SPC/builder/linux/library/icu.php @@ -0,0 +1,20 @@ +cd($this->source_dir . '/source') + ->exec("{$this->builder->configure_env} ./runConfigureICU Linux --enable-static --disable-shared --prefix={$root}") + ->exec('make clean') + ->exec("make -j{$this->builder->concurrency}") + ->exec('make install'); + } +} diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index cb7f9f56..65b1a7f6 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -123,7 +123,7 @@ class MacOSBuilder extends BuilderBase */ public function buildPHP(int $build_target = BUILD_TARGET_NONE, bool $bloat = false): void { - $extra_libs = $this->getFrameworks(true) . ' ' . ($this->getExt('swoole') ? '-lc++ ' : ''); + $extra_libs = $this->getFrameworks(true) . ' ' . ($this->getExt('swoole') || $this->getExt('intl') ? '-lc++ ' : ''); if (!$bloat) { $extra_libs .= implode(' ', $this->getAllStaticLibFiles()); } else { diff --git a/src/SPC/builder/macos/library/icu.php b/src/SPC/builder/macos/library/icu.php new file mode 100644 index 00000000..dd7967a1 --- /dev/null +++ b/src/SPC/builder/macos/library/icu.php @@ -0,0 +1,20 @@ +cd($this->source_dir . '/source') + ->exec("{$this->builder->configure_env} ./runConfigureICU MacOSX --enable-static --disable-shared --prefix={$root}") + ->exec('make clean') + ->exec("make -j{$this->builder->concurrency}") + ->exec('make install'); + } +} diff --git a/src/globals/tests/intl.php b/src/globals/tests/intl.php new file mode 100644 index 00000000..32ccd568 --- /dev/null +++ b/src/globals/tests/intl.php @@ -0,0 +1,5 @@ + Date: Fri, 2 Jun 2023 11:52:27 +0200 Subject: [PATCH 21/24] Remove empty headers array --- config/lib.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/lib.json b/config/lib.json index 16ea45c8..b69d53bd 100644 --- a/config/lib.json +++ b/config/lib.json @@ -469,9 +469,6 @@ "libicuio.a", "libicutu.a", "libicuuc.a" - ], - "headers": [ - ] } } \ No newline at end of file From 1398086c38c717fc55f96738c733a00eeac86c02 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 2 Jun 2023 20:26:19 +0800 Subject: [PATCH 22/24] add icu configure options for linux --- src/SPC/builder/linux/library/icu.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/linux/library/icu.php b/src/SPC/builder/linux/library/icu.php index 4e061dfc..c6ef6c37 100644 --- a/src/SPC/builder/linux/library/icu.php +++ b/src/SPC/builder/linux/library/icu.php @@ -11,8 +11,22 @@ class icu extends LinuxLibraryBase protected function build() { $root = BUILD_ROOT_PATH; + $cppflag = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1"'; shell()->cd($this->source_dir . '/source') - ->exec("{$this->builder->configure_env} ./runConfigureICU Linux --enable-static --disable-shared --prefix={$root}") + ->exec( + "{$this->builder->configure_env} {$cppflag} ./runConfigureICU Linux " . + '--enable-static ' . + '--disable-shared ' . + '--with-data-packaging=static ' . + '--enable-release=yes ' . + '--enable-extras=yes ' . + '--enable-icuio=yes ' . + '--enable-dyload=no ' . + '--enable-tools=yes ' . + '--enable-tests=no ' . + '--enable-samples=no ' . + "--prefix={$root}" + ) ->exec('make clean') ->exec("make -j{$this->builder->concurrency}") ->exec('make install'); From 874e104570f966d04401ca62c96b15cd70b3605d Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 2 Jun 2023 20:27:25 +0800 Subject: [PATCH 23/24] sort config and change icu libs order --- config/lib.json | 31 +++++++++++++++---------------- config/source.json | 32 ++++++++++++++++---------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/config/lib.json b/config/lib.json index b69d53bd..18f71244 100644 --- a/config/lib.json +++ b/config/lib.json @@ -96,6 +96,15 @@ "gmp.h" ] }, + "icu": { + "source": "icu", + "static-libs-unix": [ + "libicui18n.a", + "libicuio.a", + "libicuuc.a", + "libicudata.a" + ] + }, "imagemagick": { "source": "imagemagick", "static-libs-unix": [ @@ -200,6 +209,12 @@ "zlib" ] }, + "libsodium": { + "source": "libsodium", + "static-libs-unix": [ + "libsodium.a" + ] + }, "libssh2": { "source": "libssh2", "static-libs-unix": [ @@ -454,21 +469,5 @@ "zstd.h", "zstd_errors.h" ] - }, - "libsodium": { - "source": "libsodium", - "static-libs-unix": [ - "libsodium.a" - ] - }, - "icu": { - "source": "icu", - "static-libs-unix": [ - "libicudata.a", - "libicui18n.a", - "libicuio.a", - "libicutu.a", - "libicuuc.a" - ] } } \ No newline at end of file diff --git a/config/source.json b/config/source.json index 89238e39..a5ede620 100644 --- a/config/source.json +++ b/config/source.json @@ -99,6 +99,14 @@ "text": "Since version 6, GMP is distributed under the dual licenses, GNU LGPL v3 and GNU GPL v2. These licenses make the library free to use, share, and improve, and allow you to pass on the result. The GNU licenses give freedoms, but also set firm restrictions on the use with non-free programs." } }, + "icu": { + "type": "url", + "url": "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz", + "license": { + "type": "file", + "path": "LICENSE" + } + }, "imagemagick": { "type": "ghtar", "repo": "ImageMagick/ImageMagick", @@ -186,6 +194,14 @@ "path": "COPYING" } }, + "libsodium": { + "type": "url", + "url": "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz", + "license": { + "type": "file", + "path": "LICENSE" + } + }, "libssh2": { "type": "ghrel", "repo": "libssh2/libssh2", @@ -411,21 +427,5 @@ "type": "file", "path": "LICENSE" } - }, - "libsodium": { - "type": "url", - "url": "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz", - "license": { - "type": "file", - "path": "LICENSE" - } - }, - "icu": { - "type": "url", - "url": "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz", - "license": { - "type": "file", - "path": "LICENSE" - } } } \ No newline at end of file From 9e71a98edaa874975e7286f752889a1f30998ab5 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 2 Jun 2023 21:19:17 +0800 Subject: [PATCH 24/24] fix enable-zts option error on build:libs command --- src/SPC/builder/BuilderProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/BuilderProvider.php b/src/SPC/builder/BuilderProvider.php index 879153f8..a4e54032 100644 --- a/src/SPC/builder/BuilderProvider.php +++ b/src/SPC/builder/BuilderProvider.php @@ -31,13 +31,13 @@ class BuilderProvider cc: $input->getOption('cc'), cxx: $input->getOption('cxx'), arch: $input->getOption('arch'), - zts: $input->getOption('enable-zts'), + zts: $input->hasOption('enable-zts') ? $input->getOption('enable-zts') : false, ), 'Linux' => new LinuxBuilder( cc: $input->getOption('cc'), cxx: $input->getOption('cxx'), arch: $input->getOption('arch'), - zts: $input->getOption('enable-zts'), + zts: $input->hasOption('enable-zts') ? $input->getOption('enable-zts') : false, ), default => throw new WrongUsageException('Current OS "' . PHP_OS_FAMILY . '" is not supported yet'), };