Skip to content

Commit 49cfcbe

Browse files
committed
Update docs
1 parent 4e4ce28 commit 49cfcbe

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

docs/en/develop/source-module.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The following is the source download configuration corresponding to the `libeven
3636
The most important field here is `type`. Currently, the types it supports are:
3737

3838
- `url`: Directly use URL to download, for example: `https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz`.
39+
- `pie`: Download PHP extensions from Packagist using the PIE (PHP Installer for Extensions) standard.
3940
- `ghrel`: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.
4041
- `ghtar`: Use the GitHub Release API to download.
4142
Different from `ghrel`, `ghtar` is downloaded from the `source code (tar.gz)` in the latest Release of the project.
@@ -89,6 +90,37 @@ Example (download the imagick extension and extract it to the extension storage
8990
}
9091
```
9192

93+
## Download type - pie
94+
95+
PIE (PHP Installer for Extensions) type sources refer to downloading PHP extensions from Packagist that follow the PIE standard.
96+
This method automatically fetches extension information from the Packagist repository and downloads the appropriate distribution file.
97+
98+
The parameters included are:
99+
100+
- `repo`: The Packagist vendor/package name, such as `vendor/package-name`
101+
102+
Example (download a PHP extension from Packagist using PIE):
103+
104+
```json
105+
{
106+
"ext-example": {
107+
"type": "pie",
108+
"repo": "vendor/example-extension",
109+
"path": "php-src/ext/example",
110+
"license": {
111+
"type": "file",
112+
"path": "LICENSE"
113+
}
114+
}
115+
}
116+
```
117+
118+
::: tip
119+
The PIE download type will automatically detect the extension information from Packagist metadata,
120+
including the download URL, version, and distribution type.
121+
The extension must be marked as `type: php-ext` or contain `php-ext` metadata in its Packagist package definition.
122+
:::
123+
92124
## Download type - ghrel
93125

94126
ghrel will download files from Assets uploaded in GitHub Release.

docs/zh/develop/source-module.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static-php-cli 的下载资源模块是一个主要的功能,它包含了所
3030
这里最主要的字段是 `type`,目前它支持的类型有:
3131

3232
- `url`: 直接使用 URL 下载,例如:`https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz`
33+
- `pie`: 使用 PIE(PHP Installer for Extensions)标准从 Packagist 下载 PHP 扩展。
3334
- `ghrel`: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。
3435
- `ghtar`: 使用 GitHub Release API 下载,与 `ghrel` 不同的是,`ghtar` 是从项目的最新 Release 中找 `source code (tar.gz)` 下载的。
3536
- `ghtagtar`: 使用 GitHub Release API 下载,与 `ghtar` 相比,`ghtagtar` 可以从 `tags` 列表找最新的,并下载 `tar.gz` 格式的源码(因为有些项目只使用了 `tag` 发布版本)。
@@ -77,6 +78,36 @@ url 类型的资源指的是从 URL 直接下载文件。
7778
}
7879
```
7980

81+
## 下载类型 - pie
82+
83+
PIE(PHP Installer for Extensions)类型的资源是从 Packagist 下载遵循 PIE 标准的 PHP 扩展。
84+
该方法会自动从 Packagist 仓库获取扩展信息,并下载相应的分发文件。
85+
86+
包含的参数有:
87+
88+
- `repo`: Packagist 的 vendor/package 名称,如 `vendor/package-name`
89+
90+
例子(使用 PIE 从 Packagist 下载 PHP 扩展):
91+
92+
```json
93+
{
94+
"ext-example": {
95+
"type": "pie",
96+
"repo": "vendor/example-extension",
97+
"path": "php-src/ext/example",
98+
"license": {
99+
"type": "file",
100+
"path": "LICENSE"
101+
}
102+
}
103+
}
104+
```
105+
106+
::: tip
107+
PIE 下载类型会自动从 Packagist 元数据中检测扩展信息,包括下载 URL、版本和分发类型。
108+
扩展必须在其 Packagist 包定义中标记为 `type: php-ext` 或包含 `php-ext` 元数据。
109+
:::
110+
80111
## 下载类型 - ghrel
81112

82113
ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。

0 commit comments

Comments
 (0)