mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
Compare commits
4 Commits
b852471596
...
4872ff58bb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4872ff58bb | ||
|
|
755246cb6a | ||
|
|
9806422279 | ||
|
|
d5aea9f7d6 |
@ -8,7 +8,7 @@
|
||||
},
|
||||
"apcu": {
|
||||
"type": "url",
|
||||
"url": "http://pecl.php.net/get/APCu",
|
||||
"url": "https://pecl.php.net/get/APCu",
|
||||
"path": "php-src/ext/apcu",
|
||||
"filename": "apcu.tgz",
|
||||
"license": {
|
||||
@ -63,7 +63,7 @@
|
||||
},
|
||||
"ext-ssh2": {
|
||||
"type": "url",
|
||||
"url": "http://pecl.php.net/get/ssh2",
|
||||
"url": "https://pecl.php.net/get/ssh2",
|
||||
"path": "php-src/ext/ssh2",
|
||||
"filename": "ssh2.tgz",
|
||||
"license": {
|
||||
@ -117,7 +117,7 @@
|
||||
},
|
||||
"inotify": {
|
||||
"type": "url",
|
||||
"url": "http://pecl.php.net/get/inotify",
|
||||
"url": "https://pecl.php.net/get/inotify",
|
||||
"path": "php-src/ext/inotify",
|
||||
"filename": "inotify.tgz",
|
||||
"license": {
|
||||
@ -327,7 +327,7 @@
|
||||
},
|
||||
"protobuf": {
|
||||
"type": "url",
|
||||
"url": "http://pecl.php.net/get/protobuf",
|
||||
"url": "https://pecl.php.net/get/protobuf",
|
||||
"path": "php-src/ext/protobuf",
|
||||
"filename": "protobuf.tgz",
|
||||
"license": {
|
||||
@ -393,7 +393,7 @@
|
||||
},
|
||||
"xlswriter": {
|
||||
"type": "url",
|
||||
"url": "http://pecl.php.net/get/xlswriter",
|
||||
"url": "https://pecl.php.net/get/xlswriter",
|
||||
"path": "php-src/ext/xlswriter",
|
||||
"filename": "xlswriter.tgz",
|
||||
"license": {
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
# 快速启动容器环境
|
||||
|
||||
> 提供了 debian 11 构建 和 alpine 构建环境
|
||||
> 任意选一个就可以
|
||||
|
||||
## debian 11 构建环境
|
||||
|
||||
```bash
|
||||
|
||||
# 启动 debian 11 容器环境
|
||||
sh quickstart/linux/run-debian-11-container.sh
|
||||
|
||||
# 进入容器
|
||||
sh quickstart/linux/connection-static-php-cli.sh
|
||||
|
||||
# 准备构建基础软件
|
||||
sh quickstart/linux/debian-11-init.sh
|
||||
|
||||
```
|
||||
|
||||
## aline 构建环境
|
||||
|
||||
```bash
|
||||
|
||||
# 启动 alpine 容器环境
|
||||
sh quickstart/linux/run-alpine-3.16-container.sh
|
||||
|
||||
# 进入容器
|
||||
sh sh quickstart/linux/connection-static-php-cli.sh
|
||||
|
||||
# 准备构建基础软件
|
||||
sh quickstart/linux/alpine-3.16-init.sh
|
||||
|
||||
```
|
||||
@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -exu
|
||||
__DIR__=$(
|
||||
cd "$(dirname "$0")"
|
||||
pwd
|
||||
)
|
||||
cd ${__DIR__}
|
||||
|
||||
|
||||
# use china mirror
|
||||
# bash quickstart/linux/x86_64/alpine-3.16-init.sh --mirror china
|
||||
mirror=''
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--mirror)
|
||||
mirror="$2"
|
||||
shift
|
||||
;;
|
||||
--*)
|
||||
echo "Illegal option $1"
|
||||
;;
|
||||
esac
|
||||
shift $(( $# > 0 ? 1 : 0 ))
|
||||
done
|
||||
|
||||
case "$mirror" in
|
||||
china)
|
||||
test -f /etc/apk/repositories.save || cp /etc/apk/repositories /etc/apk/repositories.save
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
|
||||
;;
|
||||
|
||||
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
|
||||
@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -exu
|
||||
__DIR__=$(
|
||||
cd "$(dirname "$0")"
|
||||
pwd
|
||||
)
|
||||
|
||||
cd ${__DIR__}
|
||||
|
||||
docker exec -it static-php-cli-dev-1 sh
|
||||
@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -exu
|
||||
__DIR__=$(
|
||||
cd "$(dirname "$0")"
|
||||
pwd
|
||||
)
|
||||
cd ${__DIR__}
|
||||
|
||||
# use china mirror
|
||||
# bash quickstart/linux/x86_64/debian-11-init.sh --mirror china
|
||||
mirror=''
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--mirror)
|
||||
mirror="$2"
|
||||
shift
|
||||
;;
|
||||
--*)
|
||||
echo "Illegal option $1"
|
||||
;;
|
||||
esac
|
||||
shift $(( $# > 0 ? 1 : 0 ))
|
||||
done
|
||||
|
||||
case "$mirror" in
|
||||
china)
|
||||
test -f /etc/apt/sources.list.save || cp /etc/apt/sources.list /etc/apt/sources.list.save
|
||||
sed -i "s@deb.debian.org@mirrors.ustc.edu.cn@g" /etc/apt/sources.list && \
|
||||
sed -i "s@security.debian.org@mirrors.ustc.edu.cn@g" /etc/apt/sources.list
|
||||
;;
|
||||
|
||||
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 p7zip
|
||||
apt install -y musl-tools g++
|
||||
apt install -y clang
|
||||
@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -exu
|
||||
__DIR__=$(
|
||||
cd "$(dirname "$0")"
|
||||
pwd
|
||||
)
|
||||
__PROJECT__=$(
|
||||
cd ${__DIR__}/../../
|
||||
pwd
|
||||
)
|
||||
cd ${__DIR__}
|
||||
|
||||
|
||||
{
|
||||
docker stop static-php-cli-dev-1
|
||||
} || {
|
||||
echo $?
|
||||
}
|
||||
cd ${__DIR__}
|
||||
IMAGE=alpine:3.16
|
||||
|
||||
cd ${__DIR__}
|
||||
docker run --rm --name static-php-cli-dev-1 -d -v ${__PROJECT__}:/work -w /work $IMAGE tail -f /dev/null
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -exu
|
||||
__DIR__=$(
|
||||
cd "$(dirname "$0")"
|
||||
pwd
|
||||
)
|
||||
__PROJECT__=$(
|
||||
cd ${__DIR__}/../../
|
||||
pwd
|
||||
)
|
||||
cd ${__DIR__}
|
||||
|
||||
|
||||
{
|
||||
docker stop static-php-cli-dev-1
|
||||
} || {
|
||||
echo $?
|
||||
}
|
||||
cd ${__DIR__}
|
||||
IMAGE=debian:11
|
||||
|
||||
cd ${__DIR__}
|
||||
docker run --rm --name static-php-cli-dev-1 -d -v ${__PROJECT__}:/work -w /work $IMAGE tail -f /dev/null
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
#!/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
|
||||
Loading…
x
Reference in New Issue
Block a user