mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge pull request #56 from jingjingxyk/feature_ext_mongodb
mongodb 添加参数
This commit is contained in:
commit
fdf8834163
@ -165,7 +165,11 @@
|
|||||||
"mongodb": {
|
"mongodb": {
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "mongodb",
|
"source": "mongodb",
|
||||||
"arg-type": "custom"
|
"arg-type": "custom",
|
||||||
|
"lib-suggests": [
|
||||||
|
"icu",
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"mysqli": {
|
"mysqli": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
|
|||||||
@ -8,13 +8,13 @@
|
|||||||
```bash
|
```bash
|
||||||
|
|
||||||
# 启动 debian 11 容器环境
|
# 启动 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
|
```bash
|
||||||
|
|
||||||
# 启动 alpine 容器环境
|
# 启动 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
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -36,3 +36,5 @@ esac
|
|||||||
apk update
|
apk update
|
||||||
|
|
||||||
apk add vim alpine-sdk xz autoconf automake linux-headers clang-dev clang lld libtool cmake bison re2c gettext coreutils
|
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
|
||||||
@ -36,7 +36,6 @@ esac
|
|||||||
apt update -y
|
apt update -y
|
||||||
apt install -y git curl wget ca-certificates
|
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 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 musl-tools g++
|
||||||
apt install -y clang
|
apt install -y clang
|
||||||
|
|
||||||
@ -6,7 +6,7 @@ __DIR__=$(
|
|||||||
pwd
|
pwd
|
||||||
)
|
)
|
||||||
__PROJECT__=$(
|
__PROJECT__=$(
|
||||||
cd ${__DIR__}/../../../
|
cd ${__DIR__}/../../
|
||||||
pwd
|
pwd
|
||||||
)
|
)
|
||||||
cd ${__DIR__}
|
cd ${__DIR__}
|
||||||
@ -6,7 +6,7 @@ __DIR__=$(
|
|||||||
pwd
|
pwd
|
||||||
)
|
)
|
||||||
__PROJECT__=$(
|
__PROJECT__=$(
|
||||||
cd ${__DIR__}/../../../
|
cd ${__DIR__}/../../
|
||||||
pwd
|
pwd
|
||||||
)
|
)
|
||||||
cd ${__DIR__}
|
cd ${__DIR__}
|
||||||
@ -1,25 +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
|
|
||||||
|
|
||||||
|
|
||||||
#./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo,pdo_sqlite,ftp,curl" --cc=gcc --cxx=g++ --debug
|
|
||||||
|
|
||||||
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo,pdo_sqlite,ftp,curl" --cc=clang --cxx=clang++ --debug
|
|
||||||
@ -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
|
|
||||||
52
quickstart/prepare.sh
Normal file
52
quickstart/prepare.sh
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -exu
|
||||||
|
__DIR__=$(
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
pwd
|
||||||
|
)
|
||||||
|
__PROJECT__=$(
|
||||||
|
cd ${__DIR__}/../
|
||||||
|
pwd
|
||||||
|
)
|
||||||
|
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
|
||||||
|
|
||||||
|
./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"
|
||||||
|
# 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
|
||||||
@ -12,6 +12,17 @@ class mongodb extends Extension
|
|||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(): string
|
||||||
{
|
{
|
||||||
return '--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-ssl=openssl';
|
||||||
|
}
|
||||||
|
if ($this->builder->getLib('icu')) {
|
||||||
|
$arg .= ' --with-mongodb-icu=yes ';
|
||||||
|
} else {
|
||||||
|
$arg .= ' --with-mongodb-icu=no ';
|
||||||
|
}
|
||||||
|
return $arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user