Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 8efc431

Browse files
committed
1 parent 85a12de commit 8efc431

File tree

4 files changed

+63
-15
lines changed

4 files changed

+63
-15
lines changed

docs/en/develop/source-module.md

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ The parameters included are:
9595

9696
- `repo`: GitHub repository name
9797
- `match`: regular expression matching Assets files
98+
- `prefer-stable`: Whether to download stable versions first (default is `false`)
9899

99100
Example (download the libsodium library, matching the libsodium-x.y.tar.gz file in Release):
100101

@@ -120,6 +121,7 @@ Unlike `ghrel`, `ghtar` will download the `source code (tar.gz)` from the latest
120121
The parameters included are:
121122

122123
- `repo`: GitHub repository name
124+
- `prefer-stable`: Whether to download stable versions first (default is `false`)
123125

124126
Example (brotli library):
125127

@@ -145,6 +147,7 @@ Compared with `ghtar`, `ghtagtar` can find the latest one from the `tags` list a
145147
The parameters included are:
146148

147149
- `repo`: GitHub repository name
150+
- `prefer-stable`: Whether to download stable versions first (default is `false`)
148151

149152
Example (gmp library):
150153

docs/en/guide/manual-build.md

+29-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
11
# Build (Linux, macOS, FreeBSD)
22

33
This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows,
4-
please go to [Build on Windows](./build-on-windows).
4+
also need to read [Build on Windows](./build-on-windows).
55

6-
### Build locally (using SPC binary)
6+
### Build locally (using SPC binary) (recommended)
77

88
This project provides a binary file of static-php-cli.
99
You can directly download the binary file of the corresponding platform and then use it to build static PHP.
1010
Currently, the platforms supported by `spc` binary are Linux and macOS.
1111

12-
Here's how to download from GitHub Actions:
12+
Here's how to download from self-hosted server:
1313

14-
1. Enter [GitHub Actions](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml).
15-
2. Select the latest build task, select `Artifacts`, and download the binary file of the corresponding platform.
16-
3. Unzip the `.zip` file. After decompressing, add execution permissions to it: `chmod +x ./spc`.
14+
```bash
15+
# Download from self-hosted nightly builds (sync with main branch)
16+
# For Linux x86_64
17+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
18+
# For Linux aarch64
19+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64
20+
# macOS x86_64 (Intel)
21+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64
22+
# macOS aarch64 (Apple)
23+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64
24+
# Windows (x86_64, win10 build 17063 or later)
25+
curl.exe -o spc.exe https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe
26+
27+
# Add execute perm (Linux and macOS only)
28+
chmod +x ./spc
29+
30+
# Run (Linux and macOS)
31+
./spc --version
32+
# Run (Windows powershell)
33+
.\spc.exe --version
34+
```
1735

18-
You can also download binaries from a self-hosted server: [enter](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/).
36+
> If you are using the packaged `spc` binary, you will need to replace the leading `bin/spc` with `./spc` in all the commands below.
1937
2038
### Build locally (using source code)
2139

40+
If you have problems using the spc binary, or if you need to modify the static-php-cli source code, download static-php-cli from the source code.
41+
2242
Currently, it supports building on macOS and Linux.
2343
macOS supports the latest version of the operating system and two architectures,
2444
while Linux supports Debian and derivative distributions, as well as Alpine Linux.
@@ -366,6 +386,8 @@ when you use static-php-cli to build PHP or modify and enhance the static-php-cl
366386
- `dev:extensions`: output all currently supported extension names, or output the specified extension information
367387
- `dev:php-version`: output the currently compiled PHP version (by reading `php_version.h`)
368388
- `dev:sort-config`: Sort the list of configuration files in the `config/` directory in alphabetical order
389+
- `dev:lib-ver <lib-name>`: Read the version from the source code of the dependency library (only available for specific dependency libraries)
390+
- `dev:ext-ver <ext-name>`: Read the corresponding version from the source code of the extension (only available for specific extensions)
369391

370392
```bash
371393
# output all extensions information

docs/zh/develop/source-module.md

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitH
8383

8484
- `repo`: GitHub 仓库名称
8585
- `match`: 匹配 Assets 文件的正则表达式
86+
- `prefer-stable`: 是否优先下载稳定版本(默认为 `false`
8687

8788
例子(下载 libsodium 库,匹配 Release 中的 libsodium-x.y.tar.gz 文件):
8889

@@ -107,6 +108,7 @@ ghtar 会从 GitHub Release Tag 下载文件,与 `ghrel` 不同的是,`ghtar
107108
包含的参数有:
108109

109110
- `repo`: GitHub 仓库名称
111+
- `prefer-stable`: 是否优先下载稳定版本(默认为 `false`
110112

111113
例子(brotli 库):
112114

@@ -130,6 +132,7 @@ ghtar 会从 GitHub Release Tag 下载文件,与 `ghrel` 不同的是,`ghtar
130132
包含的参数有:
131133

132134
- `repo`: GitHub 仓库名称
135+
- `prefer-stable`: 是否优先下载稳定版本(默认为 `false`
133136

134137
例子(gmp 库):
135138

docs/zh/guide/manual-build.md

+28-8
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,41 @@
22

33
本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 [在 Windows 上构建](./build-on-windows)
44

5-
## 手动构建(使用 SPC 二进制)
5+
## 手动构建(使用 SPC 二进制)(推荐)
66

77
本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 `spc` 二进制支持的平台有 Linux 和 macOS。
88

9-
下面是从 GitHub Action 下载的方法
9+
使用以下命令从自托管服务器下载
1010

11-
1. 进入 [GitHub Action](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml)
12-
2. 选择一个最新的构建任务,进入后选择 `Artifacts`,下载对应平台的二进制文件。
13-
3. 解压 `.zip` 文件。解压后,为其添加执行权限:`chmod +x ./spc`
14-
15-
你也可以从自托管的服务器下载二进制文件:[进入](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/)
11+
```bash
12+
# Download from self-hosted nightly builds (sync with main branch)
13+
# For Linux x86_64
14+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
15+
# For Linux aarch64
16+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64
17+
# macOS x86_64 (Intel)
18+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64
19+
# macOS aarch64 (Apple)
20+
curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64
21+
# Windows (x86_64, win10 build 17063 or later)
22+
curl.exe -o spc.exe https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe
23+
24+
# Add execute perm (Linux and macOS only)
25+
chmod +x ./spc
26+
27+
# Run (Linux and macOS)
28+
./spc --version
29+
# Run (Windows powershell)
30+
.\spc.exe --version
31+
```
1632

1733
> 如果你使用的是打包好的 `spc` 二进制,你需要将下面所有命令中 `bin/spc` 开头替换为 `./spc`
1834
1935
## 手动构建(使用源码)
2036

21-
目前支持在 macOS、Linux 上构建,macOS 支持最新版操作系统和两种架构,Linux 支持 Debian、RHEL 及衍生发行版、Alpine Linux。
37+
如果使用 spc 二进制出现问题,或你有修改 static-php-cli 源码需求,请从源码下载 static-php-cli。
38+
39+
目前支持在 macOS、Linux 上构建,macOS 支持最新版操作系统和两种架构,Linux 支持 Debian、RHEL 及衍生发行版、Alpine Linux 等。
2240

2341
因为本项目本身采用 PHP 开发,所以在编译时也需要系统安装 PHP。本项目本身也提供了适用于本项目的静态二进制 php,可以根据实际情况自行选择使用。
2442

@@ -326,6 +344,8 @@ bin/spc extract php-src,libxml2
326344
- `dev:extensions`: 输出目前所有支持的扩展信息,或者输出指定的扩展信息
327345
- `dev:php-version`: 输出当前编译的 PHP 版本(通过读取 `php_version.h` 实现)
328346
- `dev:sort-config`: 对 `config/` 目录下的配置文件的列表按照字母表排序
347+
- `dev:lib-ver <lib-name>`: 从依赖库的源码中读取版本(仅特定依赖库可用)
348+
- `dev:ext-ver <ext-name>`: 从扩展的源码中读取对应版本(仅特定扩展可用)
329349

330350
```bash
331351
# 输出所有扩展

0 commit comments

Comments
 (0)