Skip to content

Commit 41fb29e

Browse files
authored
Feat/pie (#936)
2 parents 6a153f9 + dd752cd commit 41fb29e

File tree

14 files changed

+880
-470
lines changed

14 files changed

+880
-470
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ docker/source/
2222
# default package root directory
2323
/pkgroot/**
2424

25+
# Windows PHP SDK binary tools
26+
/php-sdk-binary-tools/**
27+
2528
# default pack:lib and release directory
2629
/dist/**
2730
packlib_files.txt

composer.lock

Lines changed: 196 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/ext.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@
454454
"type": "external",
455455
"source": "msgpack",
456456
"arg-type-unix": "with",
457-
"arg-type-win": "enable",
457+
"arg-type-windows": "enable",
458458
"ext-depends": [
459459
"session"
460460
]
@@ -889,36 +889,38 @@
889889
"mysqli"
890890
]
891891
},
892-
"swoole-hook-pgsql": {
892+
"swoole-hook-odbc": {
893893
"support": {
894894
"Windows": "no",
895-
"BSD": "wip",
896-
"Darwin": "partial"
895+
"BSD": "wip"
897896
},
898897
"notes": true,
899898
"type": "addon",
900899
"arg-type": "none",
901900
"ext-depends": [
902-
"pgsql",
903901
"pdo",
904902
"swoole"
903+
],
904+
"lib-depends": [
905+
"unixodbc"
905906
]
906907
},
907-
"swoole-hook-sqlite": {
908+
"swoole-hook-pgsql": {
908909
"support": {
909910
"Windows": "no",
910-
"BSD": "wip"
911+
"BSD": "wip",
912+
"Darwin": "partial"
911913
},
912914
"notes": true,
913915
"type": "addon",
914916
"arg-type": "none",
915917
"ext-depends": [
916-
"sqlite3",
918+
"pgsql",
917919
"pdo",
918920
"swoole"
919921
]
920922
},
921-
"swoole-hook-odbc": {
923+
"swoole-hook-sqlite": {
922924
"support": {
923925
"Windows": "no",
924926
"BSD": "wip"
@@ -927,11 +929,9 @@
927929
"type": "addon",
928930
"arg-type": "none",
929931
"ext-depends": [
932+
"sqlite3",
930933
"pdo",
931934
"swoole"
932-
],
933-
"lib-depends": [
934-
"unixodbc"
935935
]
936936
},
937937
"swow": {

config/lib.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@
203203
"libcares"
204204
],
205205
"cpp-library": true,
206-
"provide-pre-built": true,
207206
"frameworks": [
208207
"CoreFoundation"
209208
]
@@ -560,6 +559,21 @@
560559
"zstd"
561560
]
562561
},
562+
"liburing": {
563+
"source": "liburing",
564+
"pkg-configs": [
565+
"liburing",
566+
"liburing-ffi"
567+
],
568+
"static-libs-linux": [
569+
"liburing.a",
570+
"liburing-ffi.a"
571+
],
572+
"headers-linux": [
573+
"liburing/",
574+
"liburing.h"
575+
]
576+
},
563577
"libuuid": {
564578
"source": "libuuid",
565579
"static-libs-unix": [
@@ -940,20 +954,5 @@
940954
"zstd.h",
941955
"zstd_errors.h"
942956
]
943-
},
944-
"liburing": {
945-
"source": "liburing",
946-
"pkg-configs": [
947-
"liburing",
948-
"liburing-ffi"
949-
],
950-
"static-libs-linux": [
951-
"liburing.a",
952-
"liburing-ffi.a"
953-
],
954-
"headers-linux": [
955-
"liburing/",
956-
"liburing.h"
957-
]
958957
}
959958
}

config/pkg.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"type": "url",
2424
"url": "https://dl.static-php.dev/static-php-cli/deps/nasm/nasm-2.16.01-win64.zip",
2525
"extract-files": {
26-
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
27-
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
26+
"nasm.exe": "{php_sdk_path}/bin/nasm.exe",
27+
"ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
2828
}
2929
},
3030
"pkg-config-aarch64-linux": {
@@ -84,7 +84,7 @@
8484
"repo": "upx/upx",
8585
"match": "upx.+-win64\\.zip",
8686
"extract-files": {
87-
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
87+
"upx.exe": "{pkg_root_path}/bin/upx.exe"
8888
}
8989
},
9090
"zig-aarch64-linux": {

config/source.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,15 @@
669669
"path": "LICENSE.md"
670670
}
671671
},
672+
"liburing": {
673+
"type": "ghtar",
674+
"repo": "axboe/liburing",
675+
"prefer-stable": true,
676+
"license": {
677+
"type": "file",
678+
"path": "COPYING"
679+
}
680+
},
672681
"libuuid": {
673682
"type": "git",
674683
"url": "https://github.com/static-php/libuuid.git",
@@ -990,7 +999,6 @@
990999
},
9911000
"snappy": {
9921001
"type": "git",
993-
"repo": "google/snappy",
9941002
"rev": "main",
9951003
"url": "https://github.com/google/snappy",
9961004
"license": {
@@ -999,9 +1007,8 @@
9991007
}
10001008
},
10011009
"spx": {
1002-
"type": "git",
1003-
"rev": "master",
1004-
"url": "https://github.com/NoiseByNorthwest/php-spx.git",
1010+
"type": "pie",
1011+
"repo": "noisebynorthwest/php-spx",
10051012
"path": "php-src/ext/spx",
10061013
"license": {
10071014
"type": "file",
@@ -1155,14 +1162,5 @@
11551162
"type": "file",
11561163
"path": "LICENSE"
11571164
}
1158-
},
1159-
"liburing": {
1160-
"type": "ghtar",
1161-
"repo": "axboe/liburing",
1162-
"prefer-stable": true,
1163-
"license": {
1164-
"type": "file",
1165-
"path": "COPYING"
1166-
}
11671165
}
11681166
}

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)