mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 06:45:39 +08:00
Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b05bdcd83d | ||
|
|
6a4ad34324 | ||
|
|
f1d1d4fe10 | ||
|
|
fa6fa1c425 | ||
|
|
f8c8300c9c | ||
|
|
09198b431f | ||
|
|
f426ced789 | ||
|
|
bab330b64e | ||
|
|
b59a06face | ||
|
|
bb44e88c3b | ||
|
|
5476385553 | ||
|
|
56bac35768 | ||
|
|
4cdc6a07ae | ||
|
|
c30b34ae5c | ||
|
|
da5c6fd084 | ||
|
|
a4b6499530 | ||
|
|
eb4445ea59 | ||
|
|
be51bcfdfc | ||
|
|
7bc4131c02 | ||
|
|
da8debdade | ||
|
|
ef5e664981 | ||
|
|
8e50af3a7e | ||
|
|
8e96c64918 | ||
|
|
8a9c8a279d | ||
|
|
72ca0cecd1 | ||
|
|
3564f6d0a7 | ||
|
|
d3e2b4b5b2 | ||
|
|
c6de6e7056 | ||
|
|
55322a282c | ||
|
|
6789ea81ff | ||
|
|
ac8a9af89c | ||
|
|
553b817b2a | ||
|
|
96592bce3e | ||
|
|
4e393886aa | ||
|
|
2e13be2a7a | ||
|
|
41fb29eba4 | ||
|
|
b519291fa2 | ||
|
|
dd752cd5be | ||
|
|
6a153f9aa0 | ||
|
|
bba390dbcc | ||
|
|
32efeb970c | ||
|
|
310335813f | ||
|
|
487980c9a8 | ||
|
|
f8801e224f | ||
|
|
5e229a0b01 | ||
|
|
49cfcbe92d | ||
|
|
4e4ce282db | ||
|
|
e2fd3e18d6 | ||
|
|
605c06f85c | ||
|
|
4cdefeab81 | ||
|
|
8ab09898f0 | ||
|
|
9c8b4d627c | ||
|
|
8923077120 | ||
|
|
29c31d90e5 | ||
|
|
e281d26a3a | ||
|
|
8ed68f481a | ||
|
|
b1abff61a5 | ||
|
|
15638cea4c | ||
|
|
9ed77c10e0 | ||
|
|
ccf262d202 | ||
|
|
4be894bc10 | ||
|
|
6440863ce4 | ||
|
|
25d7c72b6e | ||
|
|
dc4dd6ffa4 | ||
|
|
bf79134405 | ||
|
|
4f8b9d0f81 | ||
|
|
70bda268e5 | ||
|
|
e559dce9d5 | ||
|
|
6a98a6bf5e | ||
|
|
9b53133ba4 | ||
|
|
5b319b0df1 | ||
|
|
572bf919aa | ||
|
|
1d960a9084 | ||
|
|
4b28d1c2df | ||
|
|
9c8fd4d45d | ||
|
|
b62f029da7 | ||
|
|
c711a3666e | ||
|
|
487c6da4ac | ||
|
|
e942b13d73 | ||
|
|
26ccaa4449 | ||
|
|
f8d77b9b50 | ||
|
|
6594811536 | ||
|
|
cc7eb7cd84 | ||
|
|
330c3486af | ||
|
|
b9dfb5afe3 | ||
|
|
565ac87b65 | ||
|
|
f0c39c1770 | ||
|
|
896cf889e4 | ||
|
|
6b91570054 | ||
|
|
31906b36e5 | ||
|
|
4e2d4f3f05 | ||
|
|
ffdc2dc85a | ||
|
|
911bc74bf4 |
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@@ -1,13 +1,9 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'src/globals/test-extensions.php'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
types: [ opened, synchronize, reopened ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'config/**'
|
||||
@@ -179,7 +175,7 @@ jobs:
|
||||
key: php-dependencies-${{ matrix.os }}
|
||||
|
||||
- name: "Install Dependencies"
|
||||
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||
run: composer update -vvv --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-plugins
|
||||
|
||||
- name: "Run Build Tests (doctor)"
|
||||
run: php src/globals/test-extensions.php doctor_cmd ${{ matrix.os }} ${{ matrix.php }}
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -22,6 +22,9 @@ docker/source/
|
||||
# default package root directory
|
||||
/pkgroot/**
|
||||
|
||||
# Windows PHP SDK binary tools
|
||||
/php-sdk-binary-tools/**
|
||||
|
||||
# default pack:lib and release directory
|
||||
/dist/**
|
||||
packlib_files.txt
|
||||
|
||||
@@ -150,6 +150,7 @@ MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/log:/app/log"
|
||||
if [ -f "$(pwd)/craft.yml" ]; then
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
|
||||
fi
|
||||
|
||||
@@ -158,6 +158,7 @@ MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/log:/app/log"
|
||||
if [ -f "$(pwd)/craft.yml" ]; then
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
|
||||
fi
|
||||
|
||||
289
composer.lock
generated
289
composer.lock
generated
@@ -8,7 +8,7 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "illuminate/collections",
|
||||
"version": "v11.45.3",
|
||||
"version": "v11.46.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/collections.git",
|
||||
@@ -64,7 +64,7 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate/conditionable",
|
||||
"version": "v11.45.3",
|
||||
"version": "v11.46.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/conditionable.git",
|
||||
@@ -110,7 +110,7 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate/contracts",
|
||||
"version": "v11.45.3",
|
||||
"version": "v11.46.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/contracts.git",
|
||||
@@ -158,7 +158,7 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate/macroable",
|
||||
"version": "v11.45.3",
|
||||
"version": "v11.46.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/macroable.git",
|
||||
@@ -416,16 +416,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v7.3.3",
|
||||
"version": "v7.3.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7"
|
||||
"reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7",
|
||||
"reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/2b9c5fafbac0399a20a2e82429e2bd735dcfb7db",
|
||||
"reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -490,7 +490,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v7.3.3"
|
||||
"source": "https://github.com/symfony/console/tree/v7.3.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -510,7 +510,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-25T06:35:40+00:00"
|
||||
"time": "2025-09-22T15:31:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
@@ -916,16 +916,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v7.3.3",
|
||||
"version": "v7.3.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "32241012d521e2e8a9d713adb0812bb773b907f1"
|
||||
"reference": "f24f8f316367b30810810d4eb30c543d7003ff3b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/32241012d521e2e8a9d713adb0812bb773b907f1",
|
||||
"reference": "32241012d521e2e8a9d713adb0812bb773b907f1",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b",
|
||||
"reference": "f24f8f316367b30810810d4eb30c543d7003ff3b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -957,7 +957,7 @@
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v7.3.3"
|
||||
"source": "https://github.com/symfony/process/tree/v7.3.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -977,7 +977,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-18T09:42:54+00:00"
|
||||
"time": "2025-09-11T10:12:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
@@ -1064,16 +1064,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
"version": "v7.3.3",
|
||||
"version": "v7.3.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c"
|
||||
"reference": "f96476035142921000338bad71e5247fbc138872"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/17a426cce5fd1f0901fefa9b2a490d0038fd3c9c",
|
||||
"reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872",
|
||||
"reference": "f96476035142921000338bad71e5247fbc138872",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1088,7 +1088,6 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/emoji": "^7.1",
|
||||
"symfony/error-handler": "^6.4|^7.0",
|
||||
"symfony/http-client": "^6.4|^7.0",
|
||||
"symfony/intl": "^6.4|^7.0",
|
||||
"symfony/translation-contracts": "^2.5|^3.0",
|
||||
@@ -1131,7 +1130,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v7.3.3"
|
||||
"source": "https://github.com/symfony/string/tree/v7.3.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1151,7 +1150,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-25T06:35:40+00:00"
|
||||
"time": "2025-09-11T14:36:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
@@ -2861,16 +2860,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.87.1",
|
||||
"version": "v3.89.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "2f5170365e2a422d0c5421f9c8818b2c078105f6"
|
||||
"reference": "4dd6768cb7558440d27d18f54909eee417317ce9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2f5170365e2a422d0c5421f9c8818b2c078105f6",
|
||||
"reference": "2f5170365e2a422d0c5421f9c8818b2c078105f6",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/4dd6768cb7558440d27d18f54909eee417317ce9",
|
||||
"reference": "4dd6768cb7558440d27d18f54909eee417317ce9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2885,7 +2884,6 @@
|
||||
"php": "^7.4 || ^8.0",
|
||||
"react/child-process": "^0.6.6",
|
||||
"react/event-loop": "^1.5",
|
||||
"react/promise": "^3.3",
|
||||
"react/socket": "^1.16",
|
||||
"react/stream": "^1.4",
|
||||
"sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0",
|
||||
@@ -2897,12 +2895,13 @@
|
||||
"symfony/polyfill-mbstring": "^1.33",
|
||||
"symfony/polyfill-php80": "^1.33",
|
||||
"symfony/polyfill-php81": "^1.33",
|
||||
"symfony/polyfill-php84": "^1.33",
|
||||
"symfony/process": "^5.4.47 || ^6.4.24 || ^7.2",
|
||||
"symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.7",
|
||||
"infection/infection": "^0.29.14",
|
||||
"infection/infection": "^0.31.0",
|
||||
"justinrainbow/json-schema": "^6.5",
|
||||
"keradus/cli-executor": "^2.2",
|
||||
"mikey179/vfsstream": "^1.6.12",
|
||||
@@ -2910,7 +2909,6 @@
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6",
|
||||
"phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34",
|
||||
"symfony/polyfill-php84": "^1.33",
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2"
|
||||
},
|
||||
@@ -2953,7 +2951,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.87.1"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.89.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2961,20 +2959,20 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-02T15:27:36+00:00"
|
||||
"time": "2025-10-18T19:30:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "humbug/box",
|
||||
"version": "4.6.6",
|
||||
"version": "4.6.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/box-project/box.git",
|
||||
"reference": "09646041cb2e0963ab6ca109e1b366337617a0f2"
|
||||
"reference": "05d205d99ddb72f3729658a0115db02cfc08912e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/box-project/box/zipball/09646041cb2e0963ab6ca109e1b366337617a0f2",
|
||||
"reference": "09646041cb2e0963ab6ca109e1b366337617a0f2",
|
||||
"url": "https://api.github.com/repos/box-project/box/zipball/05d205d99ddb72f3729658a0115db02cfc08912e",
|
||||
"reference": "05d205d99ddb72f3729658a0115db02cfc08912e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2988,13 +2986,13 @@
|
||||
"fidry/console": "^0.6.0",
|
||||
"fidry/filesystem": "^1.2.1",
|
||||
"humbug/php-scoper": "^0.18.14",
|
||||
"justinrainbow/json-schema": "^5.2.12",
|
||||
"justinrainbow/json-schema": "^6.2.0",
|
||||
"nikic/iter": "^2.2",
|
||||
"php": "^8.2",
|
||||
"phpdocumentor/reflection-docblock": "^5.4",
|
||||
"phpdocumentor/type-resolver": "^1.7",
|
||||
"psr/log": "^3.0",
|
||||
"sebastian/diff": "^5.0",
|
||||
"sebastian/diff": "^5.0 || ^6.0 || ^7.0",
|
||||
"seld/jsonlint": "^1.10.2",
|
||||
"seld/phar-utils": "^1.2",
|
||||
"symfony/finder": "^6.4.0 || ^7.0.0",
|
||||
@@ -3005,6 +3003,9 @@
|
||||
"thecodingmachine/safe": "^2.5 || ^3.0",
|
||||
"webmozart/assert": "^1.11"
|
||||
},
|
||||
"conflict": {
|
||||
"marc-mabe/php-enum": "<4.4"
|
||||
},
|
||||
"replace": {
|
||||
"symfony/polyfill-php80": "*",
|
||||
"symfony/polyfill-php81": "*",
|
||||
@@ -3070,22 +3071,22 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/box-project/box/issues",
|
||||
"source": "https://github.com/box-project/box/tree/4.6.6"
|
||||
"source": "https://github.com/box-project/box/tree/4.6.8"
|
||||
},
|
||||
"time": "2025-03-02T18:20:45+00:00"
|
||||
"time": "2025-10-13T17:13:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "humbug/php-scoper",
|
||||
"version": "0.18.17",
|
||||
"version": "0.18.18",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/humbug/php-scoper.git",
|
||||
"reference": "0a2556c7c23776a61cf22689e2f24298ba00e33a"
|
||||
"reference": "dd55d01a937602c9473cfbe0ecab9521cb9740aa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/humbug/php-scoper/zipball/0a2556c7c23776a61cf22689e2f24298ba00e33a",
|
||||
"reference": "0a2556c7c23776a61cf22689e2f24298ba00e33a",
|
||||
"url": "https://api.github.com/repos/humbug/php-scoper/zipball/dd55d01a937602c9473cfbe0ecab9521cb9740aa",
|
||||
"reference": "dd55d01a937602c9473cfbe0ecab9521cb9740aa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3154,9 +3155,9 @@
|
||||
"description": "Prefixes all PHP namespaces in a file or directory.",
|
||||
"support": {
|
||||
"issues": "https://github.com/humbug/php-scoper/issues",
|
||||
"source": "https://github.com/humbug/php-scoper/tree/0.18.17"
|
||||
"source": "https://github.com/humbug/php-scoper/tree/0.18.18"
|
||||
},
|
||||
"time": "2025-02-19T22:50:39+00:00"
|
||||
"time": "2025-10-15T15:29:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jetbrains/phpstorm-stubs",
|
||||
@@ -3207,30 +3208,40 @@
|
||||
},
|
||||
{
|
||||
"name": "justinrainbow/json-schema",
|
||||
"version": "5.3.0",
|
||||
"version": "6.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jsonrainbow/json-schema.git",
|
||||
"reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8"
|
||||
"reference": "68ba7677532803cc0c5900dd5a4d730537f2b2f3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8",
|
||||
"reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8",
|
||||
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/68ba7677532803cc0c5900dd5a4d730537f2b2f3",
|
||||
"reference": "68ba7677532803cc0c5900dd5a4d730537f2b2f3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
"ext-json": "*",
|
||||
"marc-mabe/php-enum": "^4.0",
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1",
|
||||
"json-schema/json-schema-test-suite": "1.2.0",
|
||||
"phpunit/phpunit": "^4.8.35"
|
||||
"friendsofphp/php-cs-fixer": "3.3.0",
|
||||
"json-schema/json-schema-test-suite": "^23.2",
|
||||
"marc-mabe/php-enum-phpstan": "^2.0",
|
||||
"phpspec/prophecy": "^1.19",
|
||||
"phpstan/phpstan": "^1.12",
|
||||
"phpunit/phpunit": "^8.5"
|
||||
},
|
||||
"bin": [
|
||||
"bin/validate-json"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"JsonSchema\\": "src/JsonSchema/"
|
||||
@@ -3259,16 +3270,16 @@
|
||||
}
|
||||
],
|
||||
"description": "A library to validate a json schema.",
|
||||
"homepage": "https://github.com/justinrainbow/json-schema",
|
||||
"homepage": "https://github.com/jsonrainbow/json-schema",
|
||||
"keywords": [
|
||||
"json",
|
||||
"schema"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/jsonrainbow/json-schema/issues",
|
||||
"source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0"
|
||||
"source": "https://github.com/jsonrainbow/json-schema/tree/6.6.0"
|
||||
},
|
||||
"time": "2024-07-06T21:00:26+00:00"
|
||||
"time": "2025-10-10T11:34:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "kelunik/certificate",
|
||||
@@ -3502,6 +3513,79 @@
|
||||
],
|
||||
"time": "2024-12-08T08:18:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "marc-mabe/php-enum",
|
||||
"version": "v4.7.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/marc-mabe/php-enum.git",
|
||||
"reference": "bb426fcdd65c60fb3638ef741e8782508fda7eef"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/marc-mabe/php-enum/zipball/bb426fcdd65c60fb3638ef741e8782508fda7eef",
|
||||
"reference": "bb426fcdd65c60fb3638ef741e8782508fda7eef",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-reflection": "*",
|
||||
"php": "^7.1 | ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpbench/phpbench": "^0.16.10 || ^1.0.4",
|
||||
"phpstan/phpstan": "^1.3.1",
|
||||
"phpunit/phpunit": "^7.5.20 | ^8.5.22 | ^9.5.11",
|
||||
"vimeo/psalm": "^4.17.0 | ^5.26.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-3.x": "3.2-dev",
|
||||
"dev-master": "4.7-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"MabeEnum\\": "src/"
|
||||
},
|
||||
"classmap": [
|
||||
"stubs/Stringable.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Marc Bennewitz",
|
||||
"email": "dev@mabe.berlin",
|
||||
"homepage": "https://mabe.berlin/",
|
||||
"role": "Lead"
|
||||
}
|
||||
],
|
||||
"description": "Simple and fast implementation of enumerations with native PHP",
|
||||
"homepage": "https://github.com/marc-mabe/php-enum",
|
||||
"keywords": [
|
||||
"enum",
|
||||
"enum-map",
|
||||
"enum-set",
|
||||
"enumeration",
|
||||
"enumerator",
|
||||
"enummap",
|
||||
"enumset",
|
||||
"map",
|
||||
"set",
|
||||
"type",
|
||||
"type-hint",
|
||||
"typehint"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/marc-mabe/php-enum/issues",
|
||||
"source": "https://github.com/marc-mabe/php-enum/tree/v4.7.2"
|
||||
},
|
||||
"time": "2025-09-14T11:18:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.13.4",
|
||||
@@ -4228,16 +4312,11 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.12.28",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "fcf8b71aeab4e1a1131d1783cef97b23a51b87a9"
|
||||
},
|
||||
"version": "1.12.32",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/fcf8b71aeab4e1a1131d1783cef97b23a51b87a9",
|
||||
"reference": "fcf8b71aeab4e1a1131d1783cef97b23a51b87a9",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8",
|
||||
"reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4282,7 +4361,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-07-17T17:15:39+00:00"
|
||||
"time": "2025-09-30T10:16:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@@ -4607,16 +4686,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "10.5.53",
|
||||
"version": "10.5.58",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "32768472ebfb6969e6c7399f1c7b09009723f653"
|
||||
"reference": "e24fb46da450d8e6a5788670513c1af1424f16ca"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/32768472ebfb6969e6c7399f1c7b09009723f653",
|
||||
"reference": "32768472ebfb6969e6c7399f1c7b09009723f653",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e24fb46da450d8e6a5788670513c1af1424f16ca",
|
||||
"reference": "e24fb46da450d8e6a5788670513c1af1424f16ca",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4637,10 +4716,10 @@
|
||||
"phpunit/php-timer": "^6.0.0",
|
||||
"sebastian/cli-parser": "^2.0.1",
|
||||
"sebastian/code-unit": "^2.0.0",
|
||||
"sebastian/comparator": "^5.0.3",
|
||||
"sebastian/comparator": "^5.0.4",
|
||||
"sebastian/diff": "^5.1.1",
|
||||
"sebastian/environment": "^6.1.0",
|
||||
"sebastian/exporter": "^5.1.2",
|
||||
"sebastian/exporter": "^5.1.4",
|
||||
"sebastian/global-state": "^6.0.2",
|
||||
"sebastian/object-enumerator": "^5.0.0",
|
||||
"sebastian/recursion-context": "^5.0.1",
|
||||
@@ -4688,7 +4767,7 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.53"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.58"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -4712,7 +4791,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-20T14:40:06+00:00"
|
||||
"time": "2025-09-28T12:04:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/event-dispatcher",
|
||||
@@ -5640,16 +5719,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/comparator",
|
||||
"version": "5.0.3",
|
||||
"version": "5.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/comparator.git",
|
||||
"reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e"
|
||||
"reference": "e8e53097718d2b53cfb2aa859b06a41abf58c62e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e",
|
||||
"reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e8e53097718d2b53cfb2aa859b06a41abf58c62e",
|
||||
"reference": "e8e53097718d2b53cfb2aa859b06a41abf58c62e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5705,15 +5784,27 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/comparator/issues",
|
||||
"security": "https://github.com/sebastianbergmann/comparator/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3"
|
||||
"source": "https://github.com/sebastianbergmann/comparator/tree/5.0.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/sebastianbergmann",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://liberapay.com/sebastianbergmann",
|
||||
"type": "liberapay"
|
||||
},
|
||||
{
|
||||
"url": "https://thanks.dev/u/gh/sebastianbergmann",
|
||||
"type": "thanks_dev"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/sebastian/comparator",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-10-18T14:56:07+00:00"
|
||||
"time": "2025-09-07T05:25:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/complexity",
|
||||
@@ -5906,16 +5997,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/exporter",
|
||||
"version": "5.1.2",
|
||||
"version": "5.1.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/exporter.git",
|
||||
"reference": "955288482d97c19a372d3f31006ab3f37da47adf"
|
||||
"reference": "0735b90f4da94969541dac1da743446e276defa6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf",
|
||||
"reference": "955288482d97c19a372d3f31006ab3f37da47adf",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6",
|
||||
"reference": "0735b90f4da94969541dac1da743446e276defa6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5924,7 +6015,7 @@
|
||||
"sebastian/recursion-context": "^5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^10.0"
|
||||
"phpunit/phpunit": "^10.5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -5972,15 +6063,27 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/exporter/issues",
|
||||
"security": "https://github.com/sebastianbergmann/exporter/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2"
|
||||
"source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/sebastianbergmann",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://liberapay.com/sebastianbergmann",
|
||||
"type": "liberapay"
|
||||
},
|
||||
{
|
||||
"url": "https://thanks.dev/u/gh/sebastianbergmann",
|
||||
"type": "thanks_dev"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/sebastian/exporter",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-03-02T07:17:12+00:00"
|
||||
"time": "2025-09-24T06:09:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/global-state",
|
||||
@@ -7108,16 +7211,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v7.3.3",
|
||||
"version": "v7.3.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "34d8d4c4b9597347306d1ec8eb4e1319b1e6986f"
|
||||
"reference": "b8abe7daf2730d07dfd4b2ee1cecbf0dd2fbdabb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/34d8d4c4b9597347306d1ec8eb4e1319b1e6986f",
|
||||
"reference": "34d8d4c4b9597347306d1ec8eb4e1319b1e6986f",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/b8abe7daf2730d07dfd4b2ee1cecbf0dd2fbdabb",
|
||||
"reference": "b8abe7daf2730d07dfd4b2ee1cecbf0dd2fbdabb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -7171,7 +7274,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v7.3.3"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v7.3.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7191,7 +7294,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-13T11:49:31+00:00"
|
||||
"time": "2025-09-11T10:12:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "thecodingmachine/safe",
|
||||
|
||||
@@ -65,7 +65,7 @@ PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
|
||||
; upx executable path
|
||||
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
|
||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
||||
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static
|
||||
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static,win32_api
|
||||
|
||||
[linux]
|
||||
; Linux can use different build toolchains.
|
||||
@@ -105,8 +105,6 @@ SPC_MICRO_PATCHES=cli_checks,disable_huge_page
|
||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
||||
; configure command
|
||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-phpdbg --with-pic"
|
||||
; make command
|
||||
SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
||||
|
||||
; *** default build vars for building php ***
|
||||
; embed type for php, static (libphp.a) or shared (libphp.so)
|
||||
@@ -139,8 +137,6 @@ SPC_MICRO_PATCHES=cli_checks,macos_iconv
|
||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
||||
; configure command
|
||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-phpdbg"
|
||||
; make command
|
||||
SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
||||
|
||||
; *** default build vars for building php ***
|
||||
; embed type for php, static (libphp.a) or shared (libphp.dylib)
|
||||
|
||||
@@ -341,6 +341,7 @@
|
||||
"ext-depends": [
|
||||
"xml"
|
||||
],
|
||||
"build-with-php": true,
|
||||
"target": [
|
||||
"static"
|
||||
]
|
||||
@@ -453,7 +454,7 @@
|
||||
"type": "external",
|
||||
"source": "msgpack",
|
||||
"arg-type-unix": "with",
|
||||
"arg-type-win": "enable",
|
||||
"arg-type-windows": "enable",
|
||||
"ext-depends": [
|
||||
"session"
|
||||
]
|
||||
@@ -461,6 +462,7 @@
|
||||
"mysqli": {
|
||||
"type": "builtin",
|
||||
"arg-type": "with",
|
||||
"build-with-php": true,
|
||||
"ext-depends": [
|
||||
"mysqlnd"
|
||||
]
|
||||
@@ -468,6 +470,7 @@
|
||||
"mysqlnd": {
|
||||
"type": "builtin",
|
||||
"arg-type-windows": "with",
|
||||
"build-with-php": true,
|
||||
"lib-depends": [
|
||||
"zlib"
|
||||
]
|
||||
@@ -687,7 +690,7 @@
|
||||
"type": "builtin",
|
||||
"arg-type": "with-path",
|
||||
"lib-depends": [
|
||||
"readline"
|
||||
"libedit"
|
||||
],
|
||||
"target": [
|
||||
"static"
|
||||
@@ -753,6 +756,18 @@
|
||||
"apcu"
|
||||
]
|
||||
},
|
||||
"snmp": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "builtin",
|
||||
"arg-type-unix": "with",
|
||||
"arg-type-windows": "with",
|
||||
"lib-depends": [
|
||||
"net-snmp"
|
||||
]
|
||||
},
|
||||
"soap": {
|
||||
"support": {
|
||||
"BSD": "wip"
|
||||
@@ -797,6 +812,7 @@
|
||||
"type": "builtin",
|
||||
"arg-type": "with-path",
|
||||
"arg-type-windows": "with",
|
||||
"build-with-php": true,
|
||||
"lib-depends": [
|
||||
"sqlite"
|
||||
]
|
||||
@@ -885,6 +901,22 @@
|
||||
"mysqli"
|
||||
]
|
||||
},
|
||||
"swoole-hook-odbc": {
|
||||
"support": {
|
||||
"Windows": "no",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"notes": true,
|
||||
"type": "addon",
|
||||
"arg-type": "none",
|
||||
"ext-depends": [
|
||||
"pdo",
|
||||
"swoole"
|
||||
],
|
||||
"lib-depends": [
|
||||
"unixodbc"
|
||||
]
|
||||
},
|
||||
"swoole-hook-pgsql": {
|
||||
"support": {
|
||||
"Windows": "no",
|
||||
@@ -914,22 +946,6 @@
|
||||
"swoole"
|
||||
]
|
||||
},
|
||||
"swoole-hook-odbc": {
|
||||
"support": {
|
||||
"Windows": "no",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"notes": true,
|
||||
"type": "addon",
|
||||
"arg-type": "none",
|
||||
"ext-depends": [
|
||||
"pdo",
|
||||
"swoole"
|
||||
],
|
||||
"lib-depends": [
|
||||
"unixodbc"
|
||||
]
|
||||
},
|
||||
"swow": {
|
||||
"support": {
|
||||
"BSD": "wip"
|
||||
@@ -984,6 +1000,14 @@
|
||||
"type": "builtin",
|
||||
"build-with-php": true
|
||||
},
|
||||
"trader": {
|
||||
"support": {
|
||||
"BSD": "wip",
|
||||
"Windows": "wip"
|
||||
},
|
||||
"type": "external",
|
||||
"source": "ext-trader"
|
||||
},
|
||||
"uuid": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
@@ -1177,6 +1201,7 @@
|
||||
"lib-depends": [
|
||||
"zlib"
|
||||
],
|
||||
"build-with-php": true,
|
||||
"target": [
|
||||
"static"
|
||||
]
|
||||
|
||||
@@ -203,7 +203,6 @@
|
||||
"libcares"
|
||||
],
|
||||
"cpp-library": true,
|
||||
"provide-pre-built": true,
|
||||
"frameworks": [
|
||||
"CoreFoundation"
|
||||
]
|
||||
@@ -345,6 +344,15 @@
|
||||
],
|
||||
"cpp-library": true
|
||||
},
|
||||
"libedit": {
|
||||
"source": "libedit",
|
||||
"static-libs-unix": [
|
||||
"libedit.a"
|
||||
],
|
||||
"lib-depends": [
|
||||
"ncurses"
|
||||
]
|
||||
},
|
||||
"libevent": {
|
||||
"source": "libevent",
|
||||
"static-libs-unix": [
|
||||
@@ -551,6 +559,21 @@
|
||||
"zstd"
|
||||
]
|
||||
},
|
||||
"liburing": {
|
||||
"source": "liburing",
|
||||
"pkg-configs": [
|
||||
"liburing",
|
||||
"liburing-ffi"
|
||||
],
|
||||
"static-libs-linux": [
|
||||
"liburing.a",
|
||||
"liburing-ffi.a"
|
||||
],
|
||||
"headers-linux": [
|
||||
"liburing/",
|
||||
"liburing.h"
|
||||
]
|
||||
},
|
||||
"libuuid": {
|
||||
"source": "libuuid",
|
||||
"static-libs-unix": [
|
||||
@@ -674,6 +697,17 @@
|
||||
"libncurses.a"
|
||||
]
|
||||
},
|
||||
"net-snmp": {
|
||||
"source": "net-snmp",
|
||||
"pkg-configs": [
|
||||
"netsnmp",
|
||||
"netsnmp-agent"
|
||||
],
|
||||
"lib-depends": [
|
||||
"openssl",
|
||||
"zlib"
|
||||
]
|
||||
},
|
||||
"nghttp2": {
|
||||
"source": "nghttp2",
|
||||
"static-libs-unix": [
|
||||
@@ -772,7 +806,7 @@
|
||||
"libxml2",
|
||||
"openssl",
|
||||
"zlib",
|
||||
"readline"
|
||||
"libedit"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"icu",
|
||||
@@ -931,20 +965,5 @@
|
||||
"zstd.h",
|
||||
"zstd_errors.h"
|
||||
]
|
||||
},
|
||||
"liburing": {
|
||||
"source": "liburing",
|
||||
"pkg-configs": [
|
||||
"liburing",
|
||||
"liburing-ffi"
|
||||
],
|
||||
"static-libs-linux": [
|
||||
"liburing.a",
|
||||
"liburing-ffi.a"
|
||||
],
|
||||
"headers-linux": [
|
||||
"liburing/",
|
||||
"liburing.h"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
"type": "url",
|
||||
"url": "https://dl.static-php.dev/static-php-cli/deps/nasm/nasm-2.16.01-win64.zip",
|
||||
"extract-files": {
|
||||
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
||||
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
||||
"nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
||||
"ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
||||
}
|
||||
},
|
||||
"pkg-config-aarch64-linux": {
|
||||
@@ -84,7 +84,7 @@
|
||||
"repo": "upx/upx",
|
||||
"match": "upx.+-win64\\.zip",
|
||||
"extract-files": {
|
||||
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
|
||||
"upx.exe": "{pkg_root_path}/bin/upx.exe"
|
||||
}
|
||||
},
|
||||
"zig-aarch64-linux": {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"provide-pre-built": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "doc/COPYING"
|
||||
"path": "doc/COPYING.LGPL"
|
||||
}
|
||||
},
|
||||
"brotli": {
|
||||
@@ -233,6 +233,16 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-trader": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/trader",
|
||||
"path": "php-src/ext/trader",
|
||||
"filename": "trader.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-uuid": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/uuid",
|
||||
@@ -306,16 +316,17 @@
|
||||
"regex": "/href=\"(?<file>gettext-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
"path": "gettext-runtime/intl/COPYING.LIB"
|
||||
}
|
||||
},
|
||||
"gmp": {
|
||||
"type": "url",
|
||||
"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz",
|
||||
"type": "filelist",
|
||||
"url": "https://gmplib.org/download/gmp/",
|
||||
"regex": "/href=\"(?<file>gmp-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||
"provide-pre-built": true,
|
||||
"alt": {
|
||||
"type": "ghtagtar",
|
||||
"repo": "alisw/GMP"
|
||||
"type": "url",
|
||||
"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz"
|
||||
},
|
||||
"license": {
|
||||
"type": "text",
|
||||
@@ -439,7 +450,7 @@
|
||||
"provide-pre-built": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "doc/COPYING"
|
||||
"path": "doc/COPYING.LGPL"
|
||||
}
|
||||
},
|
||||
"libaom": {
|
||||
@@ -498,6 +509,16 @@
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"libedit": {
|
||||
"type": "filelist",
|
||||
"url": "https://thrysoee.dk/editline/",
|
||||
"regex": "/href=\"(?<file>libedit-(?<version>[^\"]+)\\.tar\\.gz)\"/",
|
||||
"provide-pre-built": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"libevent": {
|
||||
"type": "ghrel",
|
||||
"repo": "libevent/libevent",
|
||||
@@ -546,7 +567,7 @@
|
||||
"provide-pre-built": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
"path": "COPYING.LIB"
|
||||
}
|
||||
},
|
||||
"libiconv-win": {
|
||||
@@ -659,6 +680,15 @@
|
||||
"path": "LICENSE.md"
|
||||
}
|
||||
},
|
||||
"liburing": {
|
||||
"type": "ghtar",
|
||||
"repo": "axboe/liburing",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"libuuid": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/static-php/libuuid.git",
|
||||
@@ -742,7 +772,7 @@
|
||||
"micro": {
|
||||
"type": "git",
|
||||
"path": "php-src/sapi/micro",
|
||||
"rev": "php-85-win",
|
||||
"rev": "master",
|
||||
"url": "https://github.com/static-php/phpmicro",
|
||||
"license": {
|
||||
"type": "file",
|
||||
@@ -790,6 +820,14 @@
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"net-snmp": {
|
||||
"type": "ghtagtar",
|
||||
"repo": "net-snmp/net-snmp",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"nghttp2": {
|
||||
"type": "ghrel",
|
||||
"repo": "nghttp2/nghttp2",
|
||||
@@ -980,7 +1018,6 @@
|
||||
},
|
||||
"snappy": {
|
||||
"type": "git",
|
||||
"repo": "google/snappy",
|
||||
"rev": "main",
|
||||
"url": "https://github.com/google/snappy",
|
||||
"license": {
|
||||
@@ -989,9 +1026,8 @@
|
||||
}
|
||||
},
|
||||
"spx": {
|
||||
"type": "git",
|
||||
"rev": "master",
|
||||
"url": "https://github.com/static-php/php-spx.git",
|
||||
"type": "pie",
|
||||
"repo": "noisebynorthwest/php-spx",
|
||||
"path": "php-src/ext/spx",
|
||||
"license": {
|
||||
"type": "file",
|
||||
@@ -1145,14 +1181,5 @@
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"liburing": {
|
||||
"type": "ghtar",
|
||||
"repo": "axboe/liburing",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -744,10 +744,26 @@ h2 {
|
||||
}
|
||||
|
||||
select {
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
padding: 0 4px;
|
||||
padding: 8px 12px;
|
||||
width: 300px;
|
||||
background-color: var(--vp-c-bg-soft);
|
||||
color: var(--vp-c-text-1);
|
||||
font-size: 14px;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
select:hover {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-bg);
|
||||
}
|
||||
|
||||
select:focus {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
box-shadow: 0 0 0 3px var(--vp-c-brand-soft);
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
@@ -781,17 +797,160 @@ select {
|
||||
|
||||
.textarea {
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
border-radius: 4px;
|
||||
width: calc(100% - 12px);
|
||||
padding: 4px 8px;
|
||||
border-radius: 8px;
|
||||
width: calc(100% - 24px);
|
||||
padding: 12px;
|
||||
background-color: var(--vp-c-bg-soft);
|
||||
color: var(--vp-c-text-1);
|
||||
font-size: 14px;
|
||||
font-family: var(--vp-font-family-mono);
|
||||
line-height: 1.5;
|
||||
transition: all 0.2s ease;
|
||||
outline: none;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.textarea:hover {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-bg);
|
||||
}
|
||||
|
||||
.textarea:focus {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
box-shadow: 0 0 0 3px var(--vp-c-brand-soft);
|
||||
}
|
||||
|
||||
.input {
|
||||
display: block;
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
width: 100%;
|
||||
padding: 4px 8px;
|
||||
padding: 10px 12px;
|
||||
background-color: var(--vp-c-bg-soft);
|
||||
color: var(--vp-c-text-1);
|
||||
font-size: 14px;
|
||||
transition: all 0.2s ease;
|
||||
outline: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.input:hover {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-bg);
|
||||
}
|
||||
|
||||
.input:focus {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
box-shadow: 0 0 0 3px var(--vp-c-brand-soft);
|
||||
}
|
||||
|
||||
/* Radio button styles */
|
||||
input[type="radio"] {
|
||||
appearance: none;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border: 2px solid var(--vp-c-border);
|
||||
border-radius: 50%;
|
||||
background-color: var(--vp-c-bg);
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
margin-right: 6px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
input[type="radio"]:hover {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-bg-soft);
|
||||
}
|
||||
|
||||
input[type="radio"]:checked {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
input[type="radio"]:checked::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--vp-c-bg);
|
||||
}
|
||||
|
||||
input[type="radio"]:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Checkbox styles */
|
||||
input[type="checkbox"] {
|
||||
appearance: none;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border: 2px solid var(--vp-c-border);
|
||||
border-radius: 4px;
|
||||
background-color: var(--vp-c-bg);
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
margin-right: 6px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:hover {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-bg-soft);
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
background-color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 5px;
|
||||
width: 4px;
|
||||
height: 8px;
|
||||
border: solid var(--vp-c-bg);
|
||||
border-width: 0 2px 2px 0;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
input[type="checkbox"]:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Label styles */
|
||||
label {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
color: var(--vp-c-text-1);
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
label:hover {
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
input[type="radio"]:disabled + label,
|
||||
input[type="checkbox"]:disabled + label {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
input[type="radio"]:disabled + label:hover,
|
||||
input[type="checkbox"]:disabled + label:hover {
|
||||
color: var(--vp-c-text-1);
|
||||
}
|
||||
|
||||
.command-container {
|
||||
|
||||
219
docs/.vitepress/components/Contributors.vue
Normal file
219
docs/.vitepress/components/Contributors.vue
Normal file
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<div class="contributors-container">
|
||||
<div class="contributors-header">
|
||||
<h2>Contributors</h2>
|
||||
<p class="contributors-description">
|
||||
Thanks to all the amazing people who have contributed to this project!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div v-if="loading" class="loading-state">
|
||||
<div class="spinner"></div>
|
||||
<p>Loading contributors...</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="error" class="error-state">
|
||||
<p>{{ error }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="contributors-grid">
|
||||
<a
|
||||
v-for="contributor in contributors"
|
||||
:key="contributor.id"
|
||||
:href="contributor.html_url"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="contributor-card"
|
||||
:title="contributor.login"
|
||||
>
|
||||
<img
|
||||
:src="contributor.avatar_url"
|
||||
:alt="contributor.login"
|
||||
class="contributor-avatar"
|
||||
loading="lazy"
|
||||
/>
|
||||
<div class="contributor-name">{{ contributor.login }}</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
|
||||
interface Contributor {
|
||||
id: number;
|
||||
login: string;
|
||||
avatar_url: string;
|
||||
html_url: string;
|
||||
contributions: number;
|
||||
}
|
||||
|
||||
const contributors = ref<Contributor[]>([]);
|
||||
const loading = ref(true);
|
||||
const error = ref('');
|
||||
|
||||
const fetchContributors = async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
|
||||
const response = await fetch(
|
||||
'https://api.github.com/repos/crazywhalecc/static-php-cli/contributors?per_page=24'
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch contributors');
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
contributors.value = data;
|
||||
} catch (err) {
|
||||
error.value = 'Failed to load contributors. Please try again later.';
|
||||
console.error('Error fetching contributors:', err);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchContributors();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.contributors-container {
|
||||
margin: 48px auto;
|
||||
padding: 32px 24px;
|
||||
max-width: 1152px;
|
||||
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.contributors-header {
|
||||
text-align: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.contributors-header h2 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 8px 0;
|
||||
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.contributors-description {
|
||||
font-size: 0.95rem;
|
||||
color: var(--vp-c-text-2);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.loading-state,
|
||||
.error-state {
|
||||
text-align: center;
|
||||
padding: 40px 20px;
|
||||
color: var(--vp-c-text-2);
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0 auto 16px;
|
||||
border: 4px solid var(--vp-c-divider);
|
||||
border-top-color: var(--vp-c-brand-1);
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.contributors-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.contributor-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
background: var(--vp-c-bg);
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
transition: all 0.3s ease;
|
||||
text-decoration: none;
|
||||
color: var(--vp-c-text-1);
|
||||
}
|
||||
|
||||
.contributor-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
border-color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
.contributor-avatar {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--vp-c-divider);
|
||||
transition: all 0.3s ease;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.contributor-card:hover .contributor-avatar {
|
||||
border-color: var(--vp-c-brand-1);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.contributor-name {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
word-break: break-word;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.contributors-container {
|
||||
margin: 32px 16px;
|
||||
padding: 24px 16px;
|
||||
}
|
||||
|
||||
.contributors-header h2 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.contributors-description {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.contributors-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.contributor-card {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.contributor-avatar {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.contributor-name {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,7 @@ import sidebarZh from "./sidebar.zh";
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default {
|
||||
title: "static-php-cli",
|
||||
title: "Static PHP",
|
||||
description: "Build single static PHP binary, with PHP project together, with popular extensions included.",
|
||||
locales: {
|
||||
en: {
|
||||
@@ -44,6 +44,7 @@ export default {
|
||||
},
|
||||
themeConfig: {
|
||||
// https://vitepress.dev/reference/default-theme-config
|
||||
logo: '/images/static-php_nobg.png',
|
||||
nav: [],
|
||||
socialLinks: [
|
||||
{icon: 'github', link: 'https://github.com/crazywhalecc/static-php-cli'}
|
||||
|
||||
@@ -4,3 +4,21 @@
|
||||
max-width: 1000px !important;
|
||||
}
|
||||
|
||||
|
||||
.vp-doc .contributors-header h2 {
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.vp-doc .sponsors-header h2 {
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.dark .VPImage.logo {
|
||||
filter: contrast(0.7);
|
||||
}
|
||||
|
||||
.dark .VPImage.image-src {
|
||||
filter: contrast(0.7);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ The following is the source download configuration corresponding to the `libeven
|
||||
The most important field here is `type`. Currently, the types it supports are:
|
||||
|
||||
- `url`: Directly use URL to download, for example: `https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz`.
|
||||
- `pie`: Download PHP extensions from Packagist using the PIE (PHP Installer for Extensions) standard.
|
||||
- `ghrel`: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.
|
||||
- `ghtar`: Use the GitHub Release API to download.
|
||||
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
|
||||
}
|
||||
```
|
||||
|
||||
## Download type - pie
|
||||
|
||||
PIE (PHP Installer for Extensions) type sources refer to downloading PHP extensions from Packagist that follow the PIE standard.
|
||||
This method automatically fetches extension information from the Packagist repository and downloads the appropriate distribution file.
|
||||
|
||||
The parameters included are:
|
||||
|
||||
- `repo`: The Packagist vendor/package name, such as `vendor/package-name`
|
||||
|
||||
Example (download a PHP extension from Packagist using PIE):
|
||||
|
||||
```json
|
||||
{
|
||||
"ext-example": {
|
||||
"type": "pie",
|
||||
"repo": "vendor/example-extension",
|
||||
"path": "php-src/ext/example",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
The PIE download type will automatically detect the extension information from Packagist metadata,
|
||||
including the download URL, version, and distribution type.
|
||||
The extension must be marked as `type: php-ext` or contain `php-ext` metadata in its Packagist package definition.
|
||||
:::
|
||||
|
||||
## Download type - ghrel
|
||||
|
||||
ghrel will download files from Assets uploaded in GitHub Release.
|
||||
|
||||
@@ -44,6 +44,11 @@ So on macOS, you can **directly** use SPC to build statically compiled PHP binar
|
||||
2. You will get `buildroot/modules/xdebug.so` and `buildroot/bin/php`.
|
||||
3. The `xdebug.so` file could be used for php that version and thread-safe are the same.
|
||||
|
||||
For the Windows platform, since officially built extensions (such as `php_yaml.dll`) force the use of the `php8.dll` dynamic library as a link, and statically built PHP does not include any dynamic libraries other than system libraries,
|
||||
php.exe built by static-php cannot load officially built dynamic extensions. Since static-php-cli does not yet support building dynamic extensions, there is currently no way to load dynamic extensions with static-php.
|
||||
|
||||
However, Windows can normally use the `FFI` extension to load other dll files and call them.
|
||||
|
||||
## Can it support Oracle database extension?
|
||||
|
||||
Some extensions that rely on closed source libraries, such as `oci8`, `sourceguardian`, etc.,
|
||||
|
||||
125
docs/en/index.md
125
docs/en/index.md
@@ -3,11 +3,14 @@
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "static-php-cli"
|
||||
name: "Static PHP"
|
||||
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
|
||||
image:
|
||||
src: /images/static-php_nobg.png
|
||||
alt: Static PHP CLI Logo
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Guide
|
||||
text: Get Started
|
||||
link: ./guide/
|
||||
|
||||
features:
|
||||
@@ -19,3 +22,121 @@ features:
|
||||
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import {VPSponsors} from "vitepress/theme";
|
||||
import Contributors from '../.vitepress/components/Contributors.vue';
|
||||
|
||||
const sponsors = [
|
||||
{ name: 'Beyond Code', img: '/images/beyondcode-seeklogo.png', url: 'https://beyondco.de/' },
|
||||
{ name: 'NativePHP', img: '/images/nativephp-logo.svg', url: 'https://nativephp.com/' },
|
||||
];
|
||||
</script>
|
||||
|
||||
<div class="sponsors-section">
|
||||
<div class="sponsors-header">
|
||||
<h2>Special Sponsors</h2>
|
||||
<p class="sponsors-description">
|
||||
Thank you to our amazing sponsors for supporting this project!
|
||||
</p>
|
||||
</div>
|
||||
<VPSponsors :data="sponsors"/>
|
||||
</div>
|
||||
|
||||
<style scoped>
|
||||
.sponsors-section {
|
||||
margin: 48px auto;
|
||||
padding: 32px 24px;
|
||||
max-width: 1152px;
|
||||
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.sponsors-section:hover {
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.sponsors-header {
|
||||
text-align: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.sponsors-header h2 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 8px 0;
|
||||
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.sponsors-description {
|
||||
font-size: 0.95rem;
|
||||
color: var(--vp-c-text-2);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.sponsors-section {
|
||||
margin: 32px 16px;
|
||||
padding: 24px 16px;
|
||||
}
|
||||
|
||||
.sponsors-header h2 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.sponsors-description {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hero logo styling */
|
||||
:deep(.VPImage.image-src) {
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-default-soft) 100%);
|
||||
padding: 40px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
:deep(.VPImage.image-src:hover) {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
/* Dark mode adjustments for logo */
|
||||
.dark :deep(.VPImage.image-src) {
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.dark :deep(.VPImage.image-src:hover) {
|
||||
opacity: 1;
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
/* Additional styling for the logo image itself */
|
||||
:deep(.VPImage.image-src img) {
|
||||
max-height: 280px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
:deep(.VPImage.image-src) {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
:deep(.VPImage.image-src img) {
|
||||
max-height: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<Contributors />
|
||||
|
||||
117
docs/index.md
117
docs/index.md
@@ -3,8 +3,11 @@
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "static-php-cli"
|
||||
name: "Static PHP"
|
||||
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
|
||||
image:
|
||||
src: /images/static-php_nobg.png
|
||||
alt: Static PHP CLI Logo
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Get Started
|
||||
@@ -24,13 +27,121 @@ features:
|
||||
|
||||
<script setup>
|
||||
import {VPSponsors} from "vitepress/theme";
|
||||
import Contributors from './.vitepress/components/Contributors.vue';
|
||||
|
||||
const sponsors = [
|
||||
{ name: 'Beyond Code', img: '/images/beyondcode-seeklogo.png', url: 'https://beyondco.de/' },
|
||||
{ name: 'NativePHP', img: '/images/nativephp-logo.svg', url: 'https://nativephp.com/' },
|
||||
];
|
||||
</script>
|
||||
|
||||
## Special Sponsors
|
||||
<div class="sponsors-section">
|
||||
<div class="sponsors-header">
|
||||
<h2>Special Sponsors</h2>
|
||||
<p class="sponsors-description">
|
||||
Thank you to our amazing sponsors for supporting this project!
|
||||
</p>
|
||||
</div>
|
||||
<VPSponsors :data="sponsors"/>
|
||||
</div>
|
||||
|
||||
<VPSponsors :data="sponsors"/>
|
||||
<style scoped>
|
||||
.sponsors-section {
|
||||
margin: 48px auto;
|
||||
padding: 32px 24px;
|
||||
max-width: 1152px;
|
||||
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.sponsors-section:hover {
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.sponsors-header {
|
||||
text-align: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.sponsors-header h2 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 8px 0;
|
||||
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.sponsors-description {
|
||||
font-size: 0.95rem;
|
||||
color: var(--vp-c-text-2);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.sponsors-section {
|
||||
margin: 32px 16px;
|
||||
padding: 24px 16px;
|
||||
}
|
||||
|
||||
.sponsors-header h2 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.sponsors-description {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hero logo styling */
|
||||
:deep(.VPImage.image-src) {
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-default-soft) 100%);
|
||||
padding: 40px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
:deep(.VPImage.image-src:hover) {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
/* Dark mode adjustments for logo */
|
||||
.dark :deep(.VPImage.image-src) {
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.dark :deep(.VPImage.image-src:hover) {
|
||||
opacity: 1;
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
/* Additional styling for the logo image itself */
|
||||
:deep(.VPImage.image-src img) {
|
||||
max-height: 280px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
:deep(.VPImage.image-src) {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
:deep(.VPImage.image-src img) {
|
||||
max-height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<Contributors />
|
||||
|
||||
|
||||
BIN
docs/public/images/static-php_nobg.png
Normal file
BIN
docs/public/images/static-php_nobg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 965 KiB |
@@ -30,6 +30,7 @@ static-php-cli 的下载资源模块是一个主要的功能,它包含了所
|
||||
这里最主要的字段是 `type`,目前它支持的类型有:
|
||||
|
||||
- `url`: 直接使用 URL 下载,例如:`https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz`。
|
||||
- `pie`: 使用 PIE(PHP Installer for Extensions)标准从 Packagist 下载 PHP 扩展。
|
||||
- `ghrel`: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。
|
||||
- `ghtar`: 使用 GitHub Release API 下载,与 `ghrel` 不同的是,`ghtar` 是从项目的最新 Release 中找 `source code (tar.gz)` 下载的。
|
||||
- `ghtagtar`: 使用 GitHub Release API 下载,与 `ghtar` 相比,`ghtagtar` 可以从 `tags` 列表找最新的,并下载 `tar.gz` 格式的源码(因为有些项目只使用了 `tag` 发布版本)。
|
||||
@@ -77,6 +78,36 @@ url 类型的资源指的是从 URL 直接下载文件。
|
||||
}
|
||||
```
|
||||
|
||||
## 下载类型 - pie
|
||||
|
||||
PIE(PHP Installer for Extensions)类型的资源是从 Packagist 下载遵循 PIE 标准的 PHP 扩展。
|
||||
该方法会自动从 Packagist 仓库获取扩展信息,并下载相应的分发文件。
|
||||
|
||||
包含的参数有:
|
||||
|
||||
- `repo`: Packagist 的 vendor/package 名称,如 `vendor/package-name`
|
||||
|
||||
例子(使用 PIE 从 Packagist 下载 PHP 扩展):
|
||||
|
||||
```json
|
||||
{
|
||||
"ext-example": {
|
||||
"type": "pie",
|
||||
"repo": "vendor/example-extension",
|
||||
"path": "php-src/ext/example",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
PIE 下载类型会自动从 Packagist 元数据中检测扩展信息,包括下载 URL、版本和分发类型。
|
||||
扩展必须在其 Packagist 包定义中标记为 `type: php-ext` 或包含 `php-ext` 元数据。
|
||||
:::
|
||||
|
||||
## 下载类型 - ghrel
|
||||
|
||||
ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。
|
||||
|
||||
@@ -41,6 +41,11 @@ buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" -
|
||||
2. 你将获得 `buildroot/modules/xdebug.so` 和 `buildroot/bin/php`。
|
||||
3. `xdebug.so` 文件可用于版本和线程安全相同的 php。
|
||||
|
||||
对于 Windows 平台,由于官方构建的扩展(如 `php_yaml.dll`)强制使用了 `php8.dll` 动态库作为链接,静态构建的 PHP 不包含任何系统库以外的动态库,
|
||||
所以 Windows 下无法加载官方构建的动态扩展。 由于 static-php-cli 还暂未支持构建动态扩展,所以目前还没有让 static-php 加载动态扩展的方法。
|
||||
|
||||
不过,Windows 可以正常使用 `FFI` 扩展加载其他的 dll 文件并调用。
|
||||
|
||||
## 可以支持 Oracle 数据库扩展吗?
|
||||
|
||||
部分依赖库闭源的扩展,如 `oci8`、`sourceguardian` 等,它们没有提供纯静态编译的依赖库文件(`.a`),仅提供了动态依赖库文件(`.so`),
|
||||
|
||||
138
docs/zh/index.md
138
docs/zh/index.md
@@ -3,18 +3,140 @@
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "static-php-cli"
|
||||
name: "Static PHP"
|
||||
tagline: "在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。"
|
||||
image:
|
||||
src: /images/static-php_nobg.png
|
||||
alt: Static PHP CLI Logo
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 指南
|
||||
text: 开始使用
|
||||
link: ./guide/
|
||||
|
||||
features:
|
||||
- title: 静态二进制
|
||||
details: 您可以轻松地编译一个独立的 PHP 二进制文件以供嵌入程序使用。包括 cli、fpm、micro。
|
||||
- title: phpmicro 自执行二进制
|
||||
details: 您可以使用 micro SAPI 编译一个自解压的可执行文件,并将 PHP 代码与二进制文件打包为一个文件。
|
||||
- title: 依赖管理
|
||||
details: static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展和不同的依赖库。
|
||||
- title: 静态 CLI 二进制
|
||||
details: 您可以轻松地编译一个独立的 PHP 二进制文件以供通用使用,包括 CLI、FPM SAPI。
|
||||
- title: Micro 自解压可执行文件
|
||||
details: 您可以编译一个自解压的可执行文件,并将 PHP 源代码与二进制文件打包在一起。
|
||||
- title: 依赖管理
|
||||
details: static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展。
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import {VPSponsors} from "vitepress/theme";
|
||||
import Contributors from '../.vitepress/components/Contributors.vue';
|
||||
|
||||
const sponsors = [
|
||||
{ name: 'Beyond Code', img: '/images/beyondcode-seeklogo.png', url: 'https://beyondco.de/' },
|
||||
{ name: 'NativePHP', img: '/images/nativephp-logo.svg', url: 'https://nativephp.com/' },
|
||||
];
|
||||
</script>
|
||||
|
||||
<div class="sponsors-section">
|
||||
<div class="sponsors-header">
|
||||
<h2>特别赞助商</h2>
|
||||
<p class="sponsors-description">
|
||||
感谢我们出色的赞助商对本项目的支持!
|
||||
</p>
|
||||
</div>
|
||||
<VPSponsors :data="sponsors"/>
|
||||
</div>
|
||||
|
||||
<style scoped>
|
||||
.sponsors-section {
|
||||
margin: 48px auto;
|
||||
padding: 32px 24px;
|
||||
max-width: 1152px;
|
||||
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--vp-c-divider);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.sponsors-section:hover {
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.sponsors-header {
|
||||
text-align: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.sponsors-header h2 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 8px 0;
|
||||
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.sponsors-description {
|
||||
font-size: 0.95rem;
|
||||
color: var(--vp-c-text-2);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.sponsors-section {
|
||||
margin: 32px 16px;
|
||||
padding: 24px 16px;
|
||||
}
|
||||
|
||||
.sponsors-header h2 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.sponsors-description {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hero logo styling */
|
||||
:deep(.VPImage.image-src) {
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-default-soft) 100%);
|
||||
padding: 40px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
:deep(.VPImage.image-src:hover) {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
/* Dark mode adjustments for logo */
|
||||
.dark :deep(.VPImage.image-src) {
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.dark :deep(.VPImage.image-src:hover) {
|
||||
opacity: 1;
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
/* Additional styling for the logo image itself */
|
||||
:deep(.VPImage.image-src img) {
|
||||
max-height: 280px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
:deep(.VPImage.image-src) {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
:deep(.VPImage.image-src img) {
|
||||
max-height: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<Contributors />
|
||||
|
||||
@@ -34,7 +34,7 @@ use Symfony\Component\Console\Application;
|
||||
*/
|
||||
final class ConsoleApplication extends Application
|
||||
{
|
||||
public const string VERSION = '2.7.5';
|
||||
public const string VERSION = '2.7.6';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -305,7 +305,7 @@ class Extension
|
||||
// Run compile check if build target is cli
|
||||
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
if ($ret !== 0) {
|
||||
throw new ValidationException(
|
||||
"extension {$this->getName()} failed compile check: php-cli returned {$ret}",
|
||||
@@ -335,7 +335,7 @@ class Extension
|
||||
{
|
||||
// Run compile check if build target is cli
|
||||
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
||||
[$ret] = cmd()->execWithResult(BUILD_ROOT_PATH . '/bin/php.exe -n --ri "' . $this->getDistName() . '"', false);
|
||||
[$ret] = cmd()->execWithResult(BUILD_BIN_PATH . '/php.exe -n --ri "' . $this->getDistName() . '"', false);
|
||||
if ($ret !== 0) {
|
||||
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: "Extension {$this->getName()} sanity check");
|
||||
}
|
||||
|
||||
@@ -15,7 +15,11 @@ class gettext extends Extension
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
if ($this->builder instanceof MacOSBuilder) {
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/gettext/config.m4', 'AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB', 'AC_CHECK_LIB(intl');
|
||||
FileSystem::replaceFileStr(
|
||||
SOURCE_PATH . '/php-src/ext/gettext/config.m4',
|
||||
['AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB', 'AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB'],
|
||||
['AC_CHECK_LIB(intl', 'AC_CHECK_LIB([intl'] // new php versions use a bracket
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\ValidationException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
@@ -23,12 +24,7 @@ class readline extends Extension
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$enable = '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
|
||||
if ($this->builder->getPHPVersionID() < 84000) {
|
||||
// the check uses `char rl_pending_input()` instead of `extern int rl_pending_input`, which makes LTO fail
|
||||
$enable .= ' ac_cv_lib_readline_rl_pending_input=yes';
|
||||
}
|
||||
return $enable;
|
||||
return '--with-libedit --without-readline';
|
||||
}
|
||||
|
||||
public function buildUnixShared(): void
|
||||
@@ -39,4 +35,13 @@ class readline extends Extension
|
||||
}
|
||||
parent::buildUnixShared();
|
||||
}
|
||||
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
parent::runCliCheckUnix();
|
||||
[$ret, $out] = shell()->execWithResult('printf "exit\n" | ' . BUILD_BIN_PATH . '/php -a');
|
||||
if ($ret !== 0 || !str_contains(implode("\n", $out), 'Interactive shell')) {
|
||||
throw new ValidationException("readline extension failed sanity check. Code: {$ret}, output: " . implode("\n", $out));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
src/SPC/builder/extension/snmp.php
Normal file
29
src/SPC/builder/extension/snmp.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
use SPC\util\PkgConfigUtil;
|
||||
|
||||
#[CustomExt('snmp')]
|
||||
class snmp extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
// Overwrite m4 config using newer PHP version
|
||||
if ($this->builder->getPHPVersionID() < 80400) {
|
||||
FileSystem::copy(ROOT_DIR . '/src/globals/extra/snmp-ext-config-old.m4', "{$this->source_dir}/config.m4");
|
||||
}
|
||||
$libs = implode(' ', PkgConfigUtil::getLibsArray('netsnmp'));
|
||||
FileSystem::replaceFileStr(
|
||||
"{$this->source_dir}/config.m4",
|
||||
'PHP_EVAL_LIBLINE([$SNMP_LIBS], [SNMP_SHARED_LIBADD])',
|
||||
"SNMP_LIBS=\"{$libs}\"\nPHP_EVAL_LIBLINE([\$SNMP_LIBS], [SNMP_SHARED_LIBADD])"
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ class spx extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-spx' . ($shared ? '=shared' : '');
|
||||
$arg = '--enable-SPX' . ($shared ? '=shared' : '');
|
||||
if ($this->builder->getLib('zlib') !== null) {
|
||||
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
@@ -29,4 +29,20 @@ class spx extends Extension
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/config.m4',
|
||||
'CFLAGS="$CFLAGS -Werror -Wall -O3 -pthread -std=gnu90"',
|
||||
'CFLAGS="$CFLAGS -pthread"'
|
||||
);
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/src/php_spx.h',
|
||||
"extern zend_module_entry spx_module_entry;\n",
|
||||
"extern zend_module_entry spx_module_entry;;\n#define phpext_spx_ptr &spx_module_entry\n"
|
||||
);
|
||||
FileSystem::copy($this->source_dir . '/src/php_spx.h', $this->source_dir . '/php_spx.h');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,12 +69,15 @@ class swoole extends Extension
|
||||
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
|
||||
$arg .= $this->builder->getExt('swoole-hook-mysql') ? ' --enable-mysqlnd' : ' --disable-mysqlnd';
|
||||
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? ' --enable-swoole-sqlite' : ' --disable-swoole-sqlite';
|
||||
|
||||
if ($this->builder->getExt('swoole-hook-odbc')) {
|
||||
$config = (new SPCConfigUtil($this->builder, ['libs_only_deps' => true]))->config([], ['unixodbc']);
|
||||
$arg .= ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"';
|
||||
}
|
||||
|
||||
if ($this->getExtVersion() >= '6.1.0') {
|
||||
$arg .= ' --enable-swoole-stdext';
|
||||
}
|
||||
|
||||
if (SPCTarget::getTargetOS() === 'Darwin') {
|
||||
$arg .= ' ac_cv_lib_pthread_pthread_barrier_init=no';
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace SPC\builder\linux;
|
||||
use SPC\builder\unix\UnixBuilderBase;
|
||||
use SPC\exception\PatchException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\Config;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\store\SourcePatcher;
|
||||
use SPC\util\GlobalEnvManager;
|
||||
@@ -107,19 +108,19 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
|
||||
$this->seekPhpSrcLogFileOnException(fn () => shell()->cd(SOURCE_PATH . '/php-src')->exec(
|
||||
$php_configure_env . ' ' .
|
||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
||||
($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
|
||||
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
|
||||
($enableCgi ? '--enable-cgi ' : '--disable-cgi ') .
|
||||
$config_file_path .
|
||||
$config_file_scan_dir .
|
||||
$json_74 .
|
||||
$zts .
|
||||
$maxExecutionTimers .
|
||||
"{$phpvars} " .
|
||||
$this->makeStaticExtensionArgs() . ' '
|
||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
||||
($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
|
||||
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
|
||||
($enableCgi ? '--enable-cgi ' : '--disable-cgi ') .
|
||||
$config_file_path .
|
||||
$config_file_scan_dir .
|
||||
$json_74 .
|
||||
$zts .
|
||||
$maxExecutionTimers .
|
||||
$phpvars . ' ' .
|
||||
$this->makeStaticExtensionArgs() . ' '
|
||||
));
|
||||
|
||||
$this->emitPatchPoint('before-php-make');
|
||||
@@ -179,16 +180,17 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
*/
|
||||
protected function buildCli(): void
|
||||
{
|
||||
if ($this->getExt('readline')) {
|
||||
if ($this->getExt('readline') && SPCTarget::isStatic()) {
|
||||
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src');
|
||||
}
|
||||
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cli");
|
||||
->exec("make {$concurrency} {$vars} cli");
|
||||
|
||||
if ($this->getExt('readline')) {
|
||||
if ($this->getExt('readline') && SPCTarget::isStatic()) {
|
||||
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src', true);
|
||||
}
|
||||
|
||||
@@ -206,10 +208,10 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
protected function buildCgi(): void
|
||||
{
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cgi");
|
||||
->exec("make {$concurrency} {$vars} cgi");
|
||||
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/cgi')->exec('strip --strip-unneeded php-cgi');
|
||||
@@ -241,11 +243,11 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
// patch fake cli for micro
|
||||
$vars['EXTRA_CFLAGS'] .= $enable_fake_cli;
|
||||
$vars = SystemUtil::makeEnvVarString($vars);
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} micro");
|
||||
->exec("make {$concurrency} {$vars} micro");
|
||||
|
||||
$this->processMicroUPX();
|
||||
|
||||
@@ -262,10 +264,10 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
protected function buildFpm(): void
|
||||
{
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} fpm");
|
||||
->exec("make {$concurrency} {$vars} fpm");
|
||||
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/fpm')->exec('strip --strip-unneeded php-fpm');
|
||||
@@ -282,12 +284,17 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
*/
|
||||
protected function buildEmbed(): void
|
||||
{
|
||||
$sharedExts = array_filter($this->exts, static fn ($ext) => $ext->isBuildShared());
|
||||
$sharedExts = array_filter($sharedExts, static function ($ext) {
|
||||
return Config::getExt($ext->getName(), 'build-with-php') === true;
|
||||
});
|
||||
$install_modules = $sharedExts ? 'install-modules' : '';
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec('sed -i "s|^EXTENSION_DIR = .*|EXTENSION_DIR = /' . basename(BUILD_MODULES_PATH) . '|" Makefile')
|
||||
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
|
||||
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install-sapi {$install_modules} install-build install-headers install-programs");
|
||||
|
||||
$ldflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS') ?: '';
|
||||
$libDir = BUILD_LIB_PATH;
|
||||
@@ -376,12 +383,12 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
$config = (new SPCConfigUtil($this, ['libs_only_deps' => true, 'absolute_libs' => true]))->config($this->ext_list, $this->lib_list, $this->getOption('with-suggested-exts'), $this->getOption('with-suggested-libs'));
|
||||
$static = SPCTarget::isStatic() ? '-all-static' : '';
|
||||
$lib = BUILD_LIB_PATH;
|
||||
return [
|
||||
return array_filter([
|
||||
'EXTRA_CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
|
||||
'EXTRA_LIBS' => $config['libs'],
|
||||
'EXTRA_LDFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'),
|
||||
'EXTRA_LDFLAGS_PROGRAM' => "-L{$lib} {$static} -pie",
|
||||
];
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
12
src/SPC/builder/linux/library/libedit.php
Normal file
12
src/SPC/builder/linux/library/libedit.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class libedit extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libedit;
|
||||
|
||||
public const NAME = 'libedit';
|
||||
}
|
||||
12
src/SPC/builder/linux/library/net_snmp.php
Normal file
12
src/SPC/builder/linux/library/net_snmp.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class net_snmp extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\net_snmp;
|
||||
|
||||
public const NAME = 'net-snmp';
|
||||
}
|
||||
@@ -78,7 +78,7 @@ class openssl extends LinuxLibraryBase
|
||||
if (!str_contains($file = FileSystem::readFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc'), 'prefix=')) {
|
||||
FileSystem::writeFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', 'prefix=' . BUILD_ROOT_PATH . "\n" . $file);
|
||||
}
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Requires.private: zlib');
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class readline extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\readline;
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace SPC\builder\macos;
|
||||
use SPC\builder\macos\library\MacOSLibraryBase;
|
||||
use SPC\builder\unix\UnixBuilderBase;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\Config;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\store\SourcePatcher;
|
||||
use SPC\util\GlobalEnvManager;
|
||||
@@ -186,8 +187,8 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
|
||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
$shell->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cli");
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
$shell->exec("make {$concurrency} {$vars} cli");
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
$shell->exec('dsymutil -f sapi/cli/php')->exec('strip -S sapi/cli/php');
|
||||
}
|
||||
@@ -199,8 +200,8 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
|
||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
$shell->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cgi");
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
$shell->exec("make {$concurrency} {$vars} cgi");
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
$shell->exec('dsymutil -f sapi/cgi/php-cgi')->exec('strip -S sapi/cgi/php-cgi');
|
||||
}
|
||||
@@ -229,7 +230,8 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
|
||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||
// build
|
||||
$shell->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . " {$vars} micro");
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
$shell->exec("make {$concurrency} {$vars} micro");
|
||||
// strip
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
$shell->exec('dsymutil -f sapi/micro/micro.sfx')->exec('strip -S sapi/micro/micro.sfx');
|
||||
@@ -250,7 +252,8 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
|
||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||
$shell->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . " {$vars} fpm");
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
$shell->exec("make {$concurrency} {$vars} fpm");
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
$shell->exec('dsymutil -f sapi/fpm/php-fpm')->exec('strip -S sapi/fpm/php-fpm');
|
||||
}
|
||||
@@ -262,10 +265,15 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
*/
|
||||
protected function buildEmbed(): void
|
||||
{
|
||||
$sharedExts = array_filter($this->exts, static fn ($ext) => $ext->isBuildShared());
|
||||
$sharedExts = array_filter($sharedExts, static function ($ext) {
|
||||
return Config::getExt($ext->getName(), 'build-with-php') === true;
|
||||
});
|
||||
$install_modules = $sharedExts ? 'install-modules' : '';
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
|
||||
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
|
||||
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install-sapi {$install_modules} install-build install-headers install-programs");
|
||||
|
||||
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
|
||||
$AR = getenv('AR') ?: 'ar';
|
||||
@@ -279,10 +287,10 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
private function getMakeExtraVars(): array
|
||||
{
|
||||
$config = (new SPCConfigUtil($this, ['libs_only_deps' => true]))->config($this->ext_list, $this->lib_list, $this->getOption('with-suggested-exts'), $this->getOption('with-suggested-libs'));
|
||||
return [
|
||||
return array_filter([
|
||||
'EXTRA_CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
|
||||
'EXTRA_LDFLAGS_PROGRAM' => '-L' . BUILD_LIB_PATH,
|
||||
'EXTRA_LIBS' => $config['libs'],
|
||||
];
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
12
src/SPC/builder/macos/library/libedit.php
Normal file
12
src/SPC/builder/macos/library/libedit.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class libedit extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libedit;
|
||||
|
||||
public const NAME = 'libedit';
|
||||
}
|
||||
12
src/SPC/builder/macos/library/net_snmp.php
Normal file
12
src/SPC/builder/macos/library/net_snmp.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class net_snmp extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\net_snmp;
|
||||
|
||||
public const NAME = 'net-snmp';
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class openssl extends MacOSLibraryBase
|
||||
if (!str_contains($file = FileSystem::readFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc'), 'prefix=')) {
|
||||
FileSystem::writeFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', 'prefix=' . BUILD_ROOT_PATH . "\n" . $file);
|
||||
}
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Requires.private: zlib');
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class readline extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\readline;
|
||||
|
||||
@@ -17,7 +17,7 @@ trait attr
|
||||
->exec('libtoolize --force --copy')
|
||||
->exec('./autogen.sh || autoreconf -if')
|
||||
->configure('--disable-nls')
|
||||
->make();
|
||||
->make('install-attributes_h install-data install-libattr_h install-libLTLIBRARIES install-pkgincludeHEADERS install-pkgconfDATA', with_install: false);
|
||||
$this->patchPkgconfPrefix(['libattr.pc'], PKGCONF_PATCH_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ trait gettext
|
||||
$autoconf->addConfigureArgs('--disable-threads');
|
||||
}
|
||||
|
||||
$autoconf->configure()->make();
|
||||
$autoconf->configure()->make(dir: $this->getSourceDir() . '/gettext-runtime/intl');
|
||||
$this->patchLaDependencyPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ trait libacl
|
||||
->exec('libtoolize --force --copy')
|
||||
->exec('./autogen.sh || autoreconf -if')
|
||||
->configure('--disable-nls', '--disable-tests')
|
||||
->make();
|
||||
->make('install-acl_h install-libacl_h install-data install-libLTLIBRARIES install-pkgincludeHEADERS install-sysincludeHEADERS install-pkgconfDATA', with_install: false);
|
||||
$this->patchPkgconfPrefix(['libacl.pc'], PKGCONF_PATCH_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
30
src/SPC/builder/unix/library/libedit.php
Normal file
30
src/SPC/builder/unix/library/libedit.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
trait libedit
|
||||
{
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/src/sys.h',
|
||||
'|//#define\s+strl|',
|
||||
'#define strl'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
|
||||
->configure()
|
||||
->make();
|
||||
$this->patchPkgconfPrefix(['libedit.pc']);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,13 @@ trait libiconv
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($this)->configure('--enable-extra-encodings')->make();
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->configure(
|
||||
'--enable-extra-encodings',
|
||||
'--enable-year2038',
|
||||
)
|
||||
->make('install-lib', with_install: false)
|
||||
->make('install-lib', with_install: false, dir: $this->getSourceDir() . '/libcharset');
|
||||
$this->patchLaDependencyPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ trait libzip
|
||||
'-DBUILD_EXAMPLES=OFF',
|
||||
'-DBUILD_REGRESS=OFF',
|
||||
'-DBUILD_TOOLS=OFF',
|
||||
'-DBUILD_OSSFUZZ=OFF',
|
||||
)
|
||||
->build();
|
||||
$this->patchPkgconfPrefix(['libzip.pc'], PKGCONF_PATCH_PREFIX);
|
||||
|
||||
49
src/SPC/builder/unix/library/net_snmp.php
Normal file
49
src/SPC/builder/unix/library/net_snmp.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
trait net_snmp
|
||||
{
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY === 'Linux') {
|
||||
FileSystem::replaceFileStr("{$this->source_dir}/configure", 'LIBS="-lssl ${OPENSSL_LIBS}"', 'LIBS="-lssl ${OPENSSL_LIBS} -lpthread -ldl"');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
// use --static for PKG_CONFIG
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->setEnv(['PKG_CONFIG' => getenv('PKG_CONFIG') . ' --static'])
|
||||
->configure(
|
||||
'--disable-mibs',
|
||||
'--without-nl',
|
||||
'--disable-agent',
|
||||
'--disable-applications',
|
||||
'--disable-manuals',
|
||||
'--disable-scripts',
|
||||
'--disable-embedded-perl',
|
||||
'--without-perl-modules',
|
||||
'--with-out-mib-modules="if-mib host disman/event-mib ucd-snmp/diskio mibII"',
|
||||
'--with-out-transports="Unix"',
|
||||
'--with-mib-modules=""',
|
||||
'--enable-mini-agent',
|
||||
'--with-default-snmp-version="3"',
|
||||
'--with-sys-contact="@@no.where"',
|
||||
'--with-sys-location="Unknown"',
|
||||
'--with-logfile="/var/log/snmpd.log"',
|
||||
'--with-persistent-directory="/var/lib/net-snmp"',
|
||||
'--with-openssl=' . BUILD_ROOT_PATH,
|
||||
'--with-zlib=' . BUILD_ROOT_PATH,
|
||||
)->make(with_install: 'installheaders installlibs install_pkgconfig');
|
||||
$this->patchPkgconfPrefix();
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,7 @@ class WindowsBuilder extends BuilderBase
|
||||
$enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
|
||||
$enableMicro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
|
||||
$enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
|
||||
$enableCgi = ($build_target & BUILD_TARGET_CGI) === BUILD_TARGET_CGI;
|
||||
|
||||
SourcePatcher::patchBeforeBuildconf($this);
|
||||
|
||||
@@ -102,13 +103,13 @@ class WindowsBuilder extends BuilderBase
|
||||
->exec(
|
||||
"{$this->sdk_prefix} configure.bat --task-args \"" .
|
||||
'--disable-all ' .
|
||||
'--disable-cgi ' .
|
||||
'--with-php-build=' . BUILD_ROOT_PATH . ' ' .
|
||||
'--with-extra-includes=' . BUILD_INCLUDE_PATH . ' ' .
|
||||
'--with-extra-libs=' . BUILD_LIB_PATH . ' ' .
|
||||
($enableCli ? '--enable-cli=yes ' : '--enable-cli=no ') .
|
||||
($enableMicro ? ('--enable-micro=yes ' . $micro_logo . $micro_w32) : '--enable-micro=no ') .
|
||||
($enableEmbed ? '--enable-embed=yes ' : '--enable-embed=no ') .
|
||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enableMicro ? ('--enable-micro ' . $micro_logo . $micro_w32) : '--disable-micro ') .
|
||||
($enableEmbed ? '--enable-embed ' : '--disable-embed ') .
|
||||
($enableCgi ? '--enable-cgi ' : '--disable-cgi ') .
|
||||
$config_file_scan_dir .
|
||||
$opcache_jit_arg .
|
||||
"{$this->makeStaticExtensionArgs()} " .
|
||||
@@ -127,6 +128,10 @@ class WindowsBuilder extends BuilderBase
|
||||
if ($enableFpm) {
|
||||
logger()->warning('Windows does not support fpm SAPI, I will skip it.');
|
||||
}
|
||||
if ($enableCgi) {
|
||||
logger()->info('building cgi');
|
||||
$this->buildCgi();
|
||||
}
|
||||
if ($enableMicro) {
|
||||
logger()->info('building micro');
|
||||
$this->buildMicro();
|
||||
@@ -159,6 +164,20 @@ class WindowsBuilder extends BuilderBase
|
||||
$this->deployBinary(BUILD_TARGET_CLI);
|
||||
}
|
||||
|
||||
public function buildCgi(): void
|
||||
{
|
||||
SourcePatcher::patchWindowsCGITarget();
|
||||
|
||||
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
|
||||
|
||||
// add nmake wrapper
|
||||
FileSystem::writeFile(SOURCE_PATH . '\php-src\nmake_cgi_wrapper.bat', "nmake /nologo LIBS_CGI=\"ws2_32.lib kernel32.lib advapi32.lib {$extra_libs}\" EXTRA_LD_FLAGS_PROGRAM= %*");
|
||||
|
||||
cmd()->cd(SOURCE_PATH . '\php-src')->exec("{$this->sdk_prefix} nmake_cgi_wrapper.bat --task-args php-cgi.exe");
|
||||
|
||||
$this->deployBinary(BUILD_TARGET_CGI);
|
||||
}
|
||||
|
||||
public function buildEmbed(): void
|
||||
{
|
||||
// TODO: add embed support for windows
|
||||
@@ -265,7 +284,7 @@ class WindowsBuilder extends BuilderBase
|
||||
// sanity check for php-cli
|
||||
if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) {
|
||||
logger()->info('running cli sanity check');
|
||||
[$ret, $output] = cmd()->execWithResult(BUILD_ROOT_PATH . '\bin\php.exe -n -r "echo \"hello\";"');
|
||||
[$ret, $output] = cmd()->execWithResult(BUILD_BIN_PATH . '\php.exe -n -r "echo \"hello\";"');
|
||||
if ($ret !== 0 || trim(implode('', $output)) !== 'hello') {
|
||||
throw new ValidationException('cli failed sanity check', validation_module: 'php-cli function check');
|
||||
}
|
||||
@@ -284,7 +303,7 @@ class WindowsBuilder extends BuilderBase
|
||||
if (file_exists($test_file)) {
|
||||
@unlink($test_file);
|
||||
}
|
||||
file_put_contents($test_file, file_get_contents(BUILD_ROOT_PATH . '\bin\micro.sfx') . $task['content']);
|
||||
file_put_contents($test_file, file_get_contents(BUILD_BIN_PATH . '\micro.sfx') . $task['content']);
|
||||
chmod($test_file, 0755);
|
||||
[$ret, $out] = cmd()->execWithResult($test_file);
|
||||
foreach ($task['conditions'] as $condition => $closure) {
|
||||
@@ -298,6 +317,17 @@ class WindowsBuilder extends BuilderBase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sanity check for php-cgi
|
||||
if (($build_target & BUILD_TARGET_CGI) === BUILD_TARGET_CGI) {
|
||||
logger()->info('running cgi sanity check');
|
||||
FileSystem::writeFile(SOURCE_PATH . '\php-cgi-test.php', '<?php echo "<h1>Hello, World!</h1>"; ?>');
|
||||
[$ret, $output] = cmd()->execWithResult(BUILD_BIN_PATH . '\php-cgi.exe -n -f ' . SOURCE_PATH . '\php-cgi-test.php');
|
||||
$raw_output = implode("\n", $output);
|
||||
if ($ret !== 0 || !str_contains($raw_output, 'Hello, World!')) {
|
||||
throw new ValidationException("cgi failed sanity check. code: {$ret}, output: {$raw_output}", validation_module: 'php-cgi sanity check');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,20 +341,21 @@ class WindowsBuilder extends BuilderBase
|
||||
$src = match ($type) {
|
||||
BUILD_TARGET_CLI => SOURCE_PATH . "\\php-src\\x64\\Release{$ts}\\php.exe",
|
||||
BUILD_TARGET_MICRO => SOURCE_PATH . "\\php-src\\x64\\Release{$ts}\\micro.sfx",
|
||||
BUILD_TARGET_CGI => SOURCE_PATH . "\\php-src\\x64\\Release{$ts}\\php-cgi.exe",
|
||||
default => throw new SPCInternalException("Deployment does not accept type {$type}"),
|
||||
};
|
||||
|
||||
// with-upx-pack for cli and micro
|
||||
if ($this->getOption('with-upx-pack', false)) {
|
||||
if ($type === BUILD_TARGET_CLI || ($type === BUILD_TARGET_MICRO && version_compare($this->getMicroVersion(), '0.2.0') >= 0)) {
|
||||
if ($type === BUILD_TARGET_CLI || $type === BUILD_TARGET_CGI || ($type === BUILD_TARGET_MICRO && version_compare($this->getMicroVersion(), '0.2.0') >= 0)) {
|
||||
cmd()->exec(getenv('UPX_EXEC') . ' --best ' . escapeshellarg($src));
|
||||
}
|
||||
}
|
||||
|
||||
logger()->info('Deploying ' . $this->getBuildTypeName($type) . ' file');
|
||||
FileSystem::createDir(BUILD_ROOT_PATH . '\bin');
|
||||
FileSystem::createDir(BUILD_BIN_PATH);
|
||||
|
||||
cmd()->exec('copy ' . escapeshellarg($src) . ' ' . escapeshellarg(BUILD_ROOT_PATH . '\bin\\'));
|
||||
cmd()->exec('copy ' . escapeshellarg($src) . ' ' . escapeshellarg(BUILD_BIN_PATH . '\\'));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class BuildPHPCommand extends BuildCommand
|
||||
$this->addOption('build-fpm', null, null, 'Build fpm SAPI (not available on Windows)');
|
||||
$this->addOption('build-embed', null, null, 'Build embed SAPI (not available on Windows)');
|
||||
$this->addOption('build-frankenphp', null, null, 'Build FrankenPHP SAPI (not available on Windows)');
|
||||
$this->addOption('build-cgi', null, null, 'Build cgi SAPI (not available on Windows)');
|
||||
$this->addOption('build-cgi', null, null, 'Build cgi SAPI');
|
||||
$this->addOption('build-all', null, null, 'Build all SAPI');
|
||||
$this->addOption('no-strip', null, null, 'build without strip, keep symbols to debug');
|
||||
$this->addOption('disable-opcache-jit', null, null, 'disable opcache jit');
|
||||
@@ -222,11 +222,9 @@ class BuildPHPCommand extends BuildCommand
|
||||
|
||||
// ---------- When using bin/spc-alpine-docker, the build root path is different from the host system ----------
|
||||
$build_root_path = BUILD_ROOT_PATH;
|
||||
$cwd = getcwd();
|
||||
$fixed = '';
|
||||
$build_root_path = get_display_path($build_root_path);
|
||||
if (!empty(getenv('SPC_FIX_DEPLOY_ROOT'))) {
|
||||
str_replace($cwd, '', $build_root_path);
|
||||
$build_root_path = getenv('SPC_FIX_DEPLOY_ROOT') . '/' . basename($build_root_path);
|
||||
$fixed = ' (host system)';
|
||||
}
|
||||
if (($rule & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) {
|
||||
|
||||
@@ -40,7 +40,7 @@ class LinuxToolCheckList
|
||||
'tar', 'unzip', 'gzip', 'gcc', 'g++',
|
||||
'bzip2', 'cmake', 'patch', 'which',
|
||||
'xz', 'libtool', 'gettext-devel',
|
||||
'patchelf',
|
||||
'patchelf', 'file',
|
||||
];
|
||||
|
||||
public const TOOLS_ARCH = [
|
||||
@@ -82,14 +82,14 @@ class LinuxToolCheckList
|
||||
return CheckResult::ok();
|
||||
}
|
||||
|
||||
#[AsCheckItem('if cmake version >= 3.18', limit_os: 'Linux')]
|
||||
#[AsCheckItem('if cmake version >= 3.22', limit_os: 'Linux')]
|
||||
public function checkCMakeVersion(): ?CheckResult
|
||||
{
|
||||
$ver = get_cmake_version();
|
||||
if ($ver === null) {
|
||||
return CheckResult::fail('Failed to get cmake version');
|
||||
}
|
||||
if (version_compare($ver, '3.18.0') < 0) {
|
||||
if (version_compare($ver, '3.22.0') < 0) {
|
||||
return CheckResult::fail('cmake version is too low (' . $ver . '), please update it manually!');
|
||||
}
|
||||
return CheckResult::ok($ver);
|
||||
|
||||
@@ -137,13 +137,18 @@ class ExceptionHandler
|
||||
|
||||
self::logError("\n----------------------------------------\n");
|
||||
|
||||
self::logError('⚠ The ' . ConsoleColor::cyan('console output log') . ConsoleColor::red(' is saved in ') . ConsoleColor::none(SPC_OUTPUT_LOG));
|
||||
// convert log file path if in docker
|
||||
$spc_log_convert = get_display_path(SPC_OUTPUT_LOG);
|
||||
$shell_log_convert = get_display_path(SPC_SHELL_LOG);
|
||||
$spc_logs_dir_convert = get_display_path(SPC_LOGS_DIR);
|
||||
|
||||
self::logError('⚠ The ' . ConsoleColor::cyan('console output log') . ConsoleColor::red(' is saved in ') . ConsoleColor::none($spc_log_convert));
|
||||
if (file_exists(SPC_SHELL_LOG)) {
|
||||
self::logError('⚠ The ' . ConsoleColor::cyan('shell output log') . ConsoleColor::red(' is saved in ') . ConsoleColor::none(SPC_SHELL_LOG));
|
||||
self::logError('⚠ The ' . ConsoleColor::cyan('shell output log') . ConsoleColor::red(' is saved in ') . ConsoleColor::none($shell_log_convert));
|
||||
}
|
||||
if ($e->getExtraLogFiles() !== []) {
|
||||
foreach ($e->getExtraLogFiles() as $key => $file) {
|
||||
self::logError("⚠ Log file [{$key}] is saved in: " . ConsoleColor::none(SPC_LOGS_DIR . "/{$file}"));
|
||||
self::logError("⚠ Log file [{$key}] is saved in: " . ConsoleColor::none("{$spc_logs_dir_convert}/{$file}"));
|
||||
}
|
||||
}
|
||||
if (!defined('DEBUG_MODE')) {
|
||||
|
||||
@@ -16,6 +16,42 @@ use SPC\util\SPCTarget;
|
||||
*/
|
||||
class Downloader
|
||||
{
|
||||
/**
|
||||
* Get latest version from PIE config (Packagist)
|
||||
*
|
||||
* @param string $name Source name
|
||||
* @param array $source Source meta info: [repo]
|
||||
* @return array<int, string> [url, filename]
|
||||
*/
|
||||
public static function getPIEInfo(string $name, array $source): array
|
||||
{
|
||||
$packagist_url = "https://repo.packagist.org/p2/{$source['repo']}.json";
|
||||
logger()->debug("Fetching {$name} source from packagist index: {$packagist_url}");
|
||||
$data = json_decode(self::curlExec(
|
||||
url: $packagist_url,
|
||||
retries: self::getRetryAttempts()
|
||||
), true);
|
||||
if (!isset($data['packages'][$source['repo']]) || !is_array($data['packages'][$source['repo']])) {
|
||||
throw new DownloaderException("failed to find {$name} repo info from packagist");
|
||||
}
|
||||
// get the first version
|
||||
$first = $data['packages'][$source['repo']][0] ?? [];
|
||||
// check 'type' => 'php-ext' or contains 'php-ext' key
|
||||
if (!isset($first['php-ext'])) {
|
||||
throw new DownloaderException("failed to find {$name} php-ext info from packagist, maybe not a php extension package");
|
||||
}
|
||||
// get download link from dist
|
||||
$dist_url = $first['dist']['url'] ?? null;
|
||||
$dist_type = $first['dist']['type'] ?? null;
|
||||
if (!$dist_url || !$dist_type) {
|
||||
throw new DownloaderException("failed to find {$name} dist info from packagist");
|
||||
}
|
||||
$name = str_replace('/', '_', $source['repo']);
|
||||
$version = $first['version'] ?? 'unknown';
|
||||
// file name use: $name-$version.$dist_type
|
||||
return [$dist_url, "{$name}-{$version}.{$dist_type}"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get latest version from BitBucket tag
|
||||
*
|
||||
@@ -317,84 +353,7 @@ class Downloader
|
||||
if (self::isAlreadyDownloaded($name, $force, SPC_DOWNLOAD_PACKAGE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
switch ($pkg['type']) {
|
||||
case 'bitbuckettag': // BitBucket Tag
|
||||
[$url, $filename] = self::getLatestBitbucketTag($name, $pkg);
|
||||
self::downloadFile($name, $url, $filename, $pkg['extract'] ?? null, SPC_DOWNLOAD_PACKAGE);
|
||||
break;
|
||||
case 'ghtar': // GitHub Release (tar)
|
||||
[$url, $filename] = self::getLatestGithubTarball($name, $pkg);
|
||||
self::downloadFile($name, $url, $filename, $pkg['extract'] ?? null, SPC_DOWNLOAD_PACKAGE, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'ghtagtar': // GitHub Tag (tar)
|
||||
[$url, $filename] = self::getLatestGithubTarball($name, $pkg, 'tags');
|
||||
self::downloadFile($name, $url, $filename, $pkg['extract'] ?? null, SPC_DOWNLOAD_PACKAGE, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'ghrel': // GitHub Release (uploaded)
|
||||
[$url, $filename] = self::getLatestGithubRelease($name, $pkg);
|
||||
self::downloadFile($name, $url, $filename, $pkg['extract'] ?? null, SPC_DOWNLOAD_PACKAGE, ['Accept: application/octet-stream'], [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'filelist': // Basic File List (regex based crawler)
|
||||
[$url, $filename] = self::getFromFileList($name, $pkg);
|
||||
self::downloadFile($name, $url, $filename, $pkg['extract'] ?? null, SPC_DOWNLOAD_PACKAGE);
|
||||
break;
|
||||
case 'url': // Direct download URL
|
||||
$url = $pkg['url'];
|
||||
$filename = $pkg['filename'] ?? basename($pkg['url']);
|
||||
self::downloadFile($name, $url, $filename, $pkg['extract'] ?? null, SPC_DOWNLOAD_PACKAGE);
|
||||
break;
|
||||
case 'git': // Git repo
|
||||
self::downloadGit(
|
||||
$name,
|
||||
$pkg['url'],
|
||||
$pkg['rev'],
|
||||
$pkg['submodules'] ?? null,
|
||||
$pkg['extract'] ?? null,
|
||||
self::getRetryAttempts(),
|
||||
SPC_DOWNLOAD_PRE_BUILT
|
||||
);
|
||||
break;
|
||||
case 'local':
|
||||
// Local directory, do nothing, just lock it
|
||||
logger()->debug("Locking local source {$name}");
|
||||
LockFile::lockSource($name, [
|
||||
'source_type' => SPC_SOURCE_LOCAL,
|
||||
'dirname' => $pkg['dirname'],
|
||||
'move_path' => $pkg['extract'] ?? null,
|
||||
'lock_as' => SPC_DOWNLOAD_PACKAGE,
|
||||
]);
|
||||
break;
|
||||
case 'custom': // Custom download method, like API-based download or other
|
||||
$classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/pkg', 'SPC\store\pkg');
|
||||
if (isset($pkg['func']) && is_callable($pkg['func'])) {
|
||||
$pkg['name'] = $name;
|
||||
$pkg['func']($force, $pkg, SPC_DOWNLOAD_PACKAGE);
|
||||
break;
|
||||
}
|
||||
foreach ($classes as $class) {
|
||||
if (is_a($class, CustomPackage::class, true) && $class !== CustomPackage::class) {
|
||||
$cls = new $class();
|
||||
if (in_array($name, $cls->getSupportName())) {
|
||||
(new $class())->fetch($name, $force, $pkg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new DownloaderException('unknown source type: ' . $pkg['type']);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Because sometimes files downloaded through the command line are not automatically deleted after a failure.
|
||||
// Here we need to manually delete the file if it is detected to exist.
|
||||
if (isset($filename) && file_exists(DOWNLOAD_PATH . '/' . $filename)) {
|
||||
logger()->warning('Deleting download file: ' . $filename);
|
||||
unlink(DOWNLOAD_PATH . '/' . $filename);
|
||||
}
|
||||
throw new DownloaderException('Download failed! ' . $e->getMessage());
|
||||
}
|
||||
self::downloadByType($pkg['type'], $name, $pkg, $force, SPC_DOWNLOAD_PACKAGE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,80 +398,7 @@ class Downloader
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
switch ($source['type']) {
|
||||
case 'bitbuckettag': // BitBucket Tag
|
||||
[$url, $filename] = self::getLatestBitbucketTag($name, $source);
|
||||
self::downloadFile($name, $url, $filename, $source['path'] ?? null, $download_as);
|
||||
break;
|
||||
case 'ghtar': // GitHub Release (tar)
|
||||
[$url, $filename] = self::getLatestGithubTarball($name, $source);
|
||||
self::downloadFile($name, $url, $filename, $source['path'] ?? null, $download_as, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'ghtagtar': // GitHub Tag (tar)
|
||||
[$url, $filename] = self::getLatestGithubTarball($name, $source, 'tags');
|
||||
self::downloadFile($name, $url, $filename, $source['path'] ?? null, $download_as, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'ghrel': // GitHub Release (uploaded)
|
||||
[$url, $filename] = self::getLatestGithubRelease($name, $source);
|
||||
self::downloadFile($name, $url, $filename, $source['path'] ?? null, $download_as, ['Accept: application/octet-stream'], [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'filelist': // Basic File List (regex based crawler)
|
||||
[$url, $filename] = self::getFromFileList($name, $source);
|
||||
self::downloadFile($name, $url, $filename, $source['path'] ?? null, $download_as);
|
||||
break;
|
||||
case 'url': // Direct download URL
|
||||
$url = $source['url'];
|
||||
$filename = $source['filename'] ?? basename($source['url']);
|
||||
self::downloadFile($name, $url, $filename, $source['path'] ?? null, $download_as);
|
||||
break;
|
||||
case 'git': // Git repo
|
||||
self::downloadGit(
|
||||
$name,
|
||||
$source['url'],
|
||||
$source['rev'],
|
||||
$source['submodules'] ?? null,
|
||||
$source['path'] ?? null,
|
||||
self::getRetryAttempts(),
|
||||
$download_as
|
||||
);
|
||||
break;
|
||||
case 'local':
|
||||
// Local directory, do nothing, just lock it
|
||||
logger()->debug("Locking local source {$name}");
|
||||
LockFile::lockSource($name, [
|
||||
'source_type' => SPC_SOURCE_LOCAL,
|
||||
'dirname' => $source['dirname'],
|
||||
'move_path' => $source['extract'] ?? null,
|
||||
'lock_as' => $download_as,
|
||||
]);
|
||||
break;
|
||||
case 'custom': // Custom download method, like API-based download or other
|
||||
if (isset($source['func']) && is_callable($source['func'])) {
|
||||
$source['name'] = $name;
|
||||
$source['func']($force, $source, $download_as);
|
||||
break;
|
||||
}
|
||||
$classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/source', 'SPC\store\source');
|
||||
foreach ($classes as $class) {
|
||||
if (is_a($class, CustomSourceBase::class, true) && $class::NAME === $name) {
|
||||
(new $class())->fetch($force, $source, $download_as);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new DownloaderException('unknown source type: ' . $source['type']);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Because sometimes files downloaded through the command line are not automatically deleted after a failure.
|
||||
// Here we need to manually delete the file if it is detected to exist.
|
||||
if (isset($filename) && file_exists(DOWNLOAD_PATH . '/' . $filename)) {
|
||||
logger()->warning('Deleting download file: ' . $filename);
|
||||
unlink(DOWNLOAD_PATH . '/' . $filename);
|
||||
}
|
||||
throw new DownloaderException('Download failed! ' . $e->getMessage());
|
||||
}
|
||||
self::downloadByType($source['type'], $name, $source, $force, $download_as);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -713,4 +599,109 @@ class Downloader
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Download by type.
|
||||
*
|
||||
* @param string $type Types
|
||||
* @param string $name Download item name
|
||||
* @param array{
|
||||
* url?: string,
|
||||
* repo?: string,
|
||||
* rev?: string,
|
||||
* path?: string,
|
||||
* filename?: string,
|
||||
* dirname?: string,
|
||||
* match?: string,
|
||||
* prefer-stable?: bool,
|
||||
* extract?: string,
|
||||
* submodules?: array<string>,
|
||||
* provide-pre-built?: bool,
|
||||
* func?: ?callable,
|
||||
* license?: array
|
||||
* } $conf Download item config
|
||||
* @param bool $force Force download
|
||||
* @param int $download_as Lock source type
|
||||
*/
|
||||
private static function downloadByType(string $type, string $name, array $conf, bool $force, int $download_as): void
|
||||
{
|
||||
try {
|
||||
switch ($type) {
|
||||
case 'pie': // Packagist
|
||||
[$url, $filename] = self::getPIEInfo($name, $conf);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'bitbuckettag': // BitBucket Tag
|
||||
[$url, $filename] = self::getLatestBitbucketTag($name, $conf);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as);
|
||||
break;
|
||||
case 'ghtar': // GitHub Release (tar)
|
||||
[$url, $filename] = self::getLatestGithubTarball($name, $conf);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'ghtagtar': // GitHub Tag (tar)
|
||||
[$url, $filename] = self::getLatestGithubTarball($name, $conf, 'tags');
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'ghrel': // GitHub Release (uploaded)
|
||||
[$url, $filename] = self::getLatestGithubRelease($name, $conf);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as, ['Accept: application/octet-stream'], [[CurlHook::class, 'setupGithubToken']]);
|
||||
break;
|
||||
case 'filelist': // Basic File List (regex based crawler)
|
||||
[$url, $filename] = self::getFromFileList($name, $conf);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as);
|
||||
break;
|
||||
case 'url': // Direct download URL
|
||||
$url = $conf['url'];
|
||||
$filename = $conf['filename'] ?? basename($conf['url']);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as);
|
||||
break;
|
||||
case 'git': // Git repo
|
||||
self::downloadGit($name, $conf['url'], $conf['rev'], $conf['submodules'] ?? null, $conf['path'] ?? $conf['extract'] ?? null, self::getRetryAttempts(), $download_as);
|
||||
break;
|
||||
case 'local': // Local directory, do nothing, just lock it
|
||||
LockFile::lockSource($name, [
|
||||
'source_type' => SPC_SOURCE_LOCAL,
|
||||
'dirname' => $conf['dirname'],
|
||||
'move_path' => $conf['path'] ?? $conf['extract'] ?? null,
|
||||
'lock_as' => $download_as,
|
||||
]);
|
||||
break;
|
||||
case 'custom': // Custom download method, like API-based download or other
|
||||
if (isset($conf['func'])) {
|
||||
$conf['name'] = $name;
|
||||
$conf['func']($force, $conf, $download_as);
|
||||
break;
|
||||
}
|
||||
$classes = [
|
||||
...FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/source', 'SPC\store\source'),
|
||||
...FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/pkg', 'SPC\store\pkg'),
|
||||
];
|
||||
foreach ($classes as $class) {
|
||||
if (is_a($class, CustomSourceBase::class, true) && $class::NAME === $name) {
|
||||
(new $class())->fetch($force, $conf, $download_as);
|
||||
break;
|
||||
}
|
||||
if (is_a($class, CustomPackage::class, true) && $class !== CustomPackage::class) {
|
||||
$cls = new $class();
|
||||
if (in_array($name, $cls->getSupportName())) {
|
||||
(new $class())->fetch($name, $force, $conf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new DownloaderException("Unknown download type: {$type}");
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Because sometimes files downloaded through the command line are not automatically deleted after a failure.
|
||||
// Here we need to manually delete the file if it is detected to exist.
|
||||
if (isset($filename) && file_exists(DOWNLOAD_PATH . '/' . $filename)) {
|
||||
logger()->warning("Deleting download file: {$filename}");
|
||||
unlink(DOWNLOAD_PATH . '/' . $filename);
|
||||
}
|
||||
throw new DownloaderException("Download failed: {$e->getMessage()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ class FileSystem
|
||||
'tar', 'xz', 'txz' => f_passthru("tar -xf {$filename} -C {$target} --strip-components 1"),
|
||||
'tgz', 'gz' => f_passthru("tar -xzf {$filename} -C {$target} --strip-components 1"),
|
||||
'bz2' => f_passthru("tar -xjf {$filename} -C {$target} --strip-components 1"),
|
||||
'zip' => f_passthru("unzip {$filename} -d {$target}"),
|
||||
'zip' => self::unzipWithStrip($filename, $target),
|
||||
default => throw new FileSystemException('unknown archive format: ' . $filename),
|
||||
};
|
||||
} elseif (PHP_OS_FAMILY === 'Windows') {
|
||||
@@ -599,7 +599,7 @@ class FileSystem
|
||||
match (self::extname($filename)) {
|
||||
'tar' => f_passthru("tar -xf {$filename} -C {$target} --strip-components 1"),
|
||||
'xz', 'txz', 'gz', 'tgz', 'bz2' => cmd()->execWithResult("\"{$_7z}\" x -so {$filename} | tar -f - -x -C \"{$target}\" --strip-components 1"),
|
||||
'zip' => f_passthru("\"{$_7z}\" x {$filename} -o{$target} -y"),
|
||||
'zip' => self::unzipWithStrip($filename, $target),
|
||||
default => throw new FileSystemException("unknown archive format: {$filename}"),
|
||||
};
|
||||
}
|
||||
@@ -635,7 +635,7 @@ class FileSystem
|
||||
|
||||
private static function extractWithType(string $source_type, string $filename, string $extract_path): void
|
||||
{
|
||||
logger()->debug('Extracting source [' . $source_type . ']: ' . $filename);
|
||||
logger()->debug("Extracting source [{$source_type}]: {$filename}");
|
||||
/* @phpstan-ignore-next-line */
|
||||
match ($source_type) {
|
||||
SPC_SOURCE_ARCHIVE => self::extractArchive($filename, $extract_path),
|
||||
@@ -644,4 +644,107 @@ class FileSystem
|
||||
SPC_SOURCE_LOCAL => symlink(self::convertPath($filename), $extract_path),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Move file or directory, handling cross-device scenarios
|
||||
* Uses rename() if possible, falls back to copy+delete for cross-device moves
|
||||
*
|
||||
* @param string $source Source path
|
||||
* @param string $dest Destination path
|
||||
*/
|
||||
private static function moveFileOrDir(string $source, string $dest): void
|
||||
{
|
||||
$source = self::convertPath($source);
|
||||
$dest = self::convertPath($dest);
|
||||
|
||||
// Try rename first (fast, atomic)
|
||||
if (@rename($source, $dest)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_dir($source)) {
|
||||
self::copyDir($source, $dest);
|
||||
self::removeDir($source);
|
||||
} else {
|
||||
if (!copy($source, $dest)) {
|
||||
throw new FileSystemException("Failed to copy file from {$source} to {$dest}");
|
||||
}
|
||||
if (!unlink($source)) {
|
||||
throw new FileSystemException("Failed to remove source file: {$source}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unzip file with stripping top-level directory
|
||||
*/
|
||||
private static function unzipWithStrip(string $zip_file, string $extract_path): void
|
||||
{
|
||||
$temp_dir = self::convertPath(sys_get_temp_dir() . '/spc_unzip_' . bin2hex(random_bytes(16)));
|
||||
$zip_file = self::convertPath($zip_file);
|
||||
$extract_path = self::convertPath($extract_path);
|
||||
|
||||
// extract to temp dir
|
||||
self::createDir($temp_dir);
|
||||
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
$mute = defined('DEBUG_MODE') ? '' : ' > NUL';
|
||||
// use php-sdk-binary-tools/bin/7za.exe
|
||||
$_7z = self::convertPath(getenv('PHP_SDK_PATH') . '/bin/7za.exe');
|
||||
f_passthru("\"{$_7z}\" x {$zip_file} -o{$temp_dir} -y{$mute}");
|
||||
} else {
|
||||
$mute = defined('DEBUG_MODE') ? '' : ' > /dev/null';
|
||||
f_passthru("unzip \"{$zip_file}\" -d \"{$temp_dir}\"{$mute}");
|
||||
}
|
||||
// scan first level dirs (relative, not recursive, include dirs)
|
||||
$contents = self::scanDirFiles($temp_dir, false, true, true);
|
||||
if ($contents === false) {
|
||||
throw new FileSystemException('Cannot scan unzip temp dir: ' . $temp_dir);
|
||||
}
|
||||
// if extract path already exists, remove it
|
||||
if (is_dir($extract_path)) {
|
||||
self::removeDir($extract_path);
|
||||
}
|
||||
// if only one dir, move its contents to extract_path
|
||||
$subdir = self::convertPath("{$temp_dir}/{$contents[0]}");
|
||||
if (count($contents) === 1 && is_dir($subdir)) {
|
||||
self::moveFileOrDir($subdir, $extract_path);
|
||||
} else {
|
||||
// else, if it contains only one dir, strip dir and copy other files
|
||||
$dircount = 0;
|
||||
$dir = [];
|
||||
$top_files = [];
|
||||
foreach ($contents as $item) {
|
||||
if (is_dir(self::convertPath("{$temp_dir}/{$item}"))) {
|
||||
++$dircount;
|
||||
$dir[] = $item;
|
||||
} else {
|
||||
$top_files[] = $item;
|
||||
}
|
||||
}
|
||||
// extract dir contents to extract_path
|
||||
self::createDir($extract_path);
|
||||
// extract move dir
|
||||
if ($dircount === 1) {
|
||||
$sub_contents = self::scanDirFiles("{$temp_dir}/{$dir[0]}", false, true, true);
|
||||
if ($sub_contents === false) {
|
||||
throw new FileSystemException("Cannot scan unzip temp sub-dir: {$dir[0]}");
|
||||
}
|
||||
foreach ($sub_contents as $sub_item) {
|
||||
self::moveFileOrDir(self::convertPath("{$temp_dir}/{$dir[0]}/{$sub_item}"), self::convertPath("{$extract_path}/{$sub_item}"));
|
||||
}
|
||||
} else {
|
||||
foreach ($dir as $item) {
|
||||
self::moveFileOrDir(self::convertPath("{$temp_dir}/{$item}"), self::convertPath("{$extract_path}/{$item}"));
|
||||
}
|
||||
}
|
||||
// move top-level files to extract_path
|
||||
foreach ($top_files as $top_file) {
|
||||
self::moveFileOrDir(self::convertPath("{$temp_dir}/{$top_file}"), self::convertPath("{$extract_path}/{$top_file}"));
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up temp directory
|
||||
self::removeDir($temp_dir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,8 +155,8 @@ class LockFile
|
||||
* @param string $name Source name
|
||||
* @param array{
|
||||
* source_type: string,
|
||||
* dirname: ?string,
|
||||
* filename: ?string,
|
||||
* dirname?: ?string,
|
||||
* filename?: ?string,
|
||||
* move_path: ?string,
|
||||
* lock_as: int
|
||||
* } $data Source data
|
||||
|
||||
@@ -44,7 +44,7 @@ class SourcePatcher
|
||||
}
|
||||
foreach ($builder->getLibs() as $lib) {
|
||||
if ($lib->patchBeforeBuildconf() === true) {
|
||||
logger()->info("Library [{$lib->getName()}]patched before buildconf");
|
||||
logger()->info("Library [{$lib->getName()}] patched before buildconf");
|
||||
}
|
||||
}
|
||||
// patch windows php 8.1 bug
|
||||
@@ -549,6 +549,39 @@ class SourcePatcher
|
||||
FileSystem::writeFile(SOURCE_PATH . '/php-src/Makefile', implode("\r\n", $lines));
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch cgi SAPI Makefile for Windows.
|
||||
*/
|
||||
public static function patchWindowsCGITarget(): void
|
||||
{
|
||||
// search Makefile code line contains "$(BUILD_DIR)\php-cgi.exe:"
|
||||
$content = FileSystem::readFile(SOURCE_PATH . '/php-src/Makefile');
|
||||
$lines = explode("\r\n", $content);
|
||||
$line_num = 0;
|
||||
$found = false;
|
||||
foreach ($lines as $v) {
|
||||
if (str_contains($v, '$(BUILD_DIR)\php-cgi.exe:')) {
|
||||
$found = $line_num;
|
||||
break;
|
||||
}
|
||||
++$line_num;
|
||||
}
|
||||
if ($found === false) {
|
||||
throw new PatchException('Windows Makefile patching for php-cgi.exe target', 'Cannot patch windows CGI Makefile, Makefile does not contain "$(BUILD_DIR)\php-cgi.exe:" line');
|
||||
}
|
||||
// cli: $(BUILD_DIR)\php.exe: $(DEPS_CLI) $(CLI_GLOBAL_OBJS) $(BUILD_DIR)\$(PHPLIB) $(BUILD_DIR)\php.exe.res $(BUILD_DIR)\php.exe.manifest
|
||||
// $lines[$line_num] = '$(BUILD_DIR)\php.exe: generated_files $(DEPS_CLI) $(CLI_GLOBAL_OBJS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(ASM_OBJS) $(BUILD_DIR)\php.exe.res $(BUILD_DIR)\php.exe.manifest';
|
||||
// cgi: $(BUILD_DIR)\php-cgi.exe: $(DEPS_CGI) $(CGI_GLOBAL_OBJS) $(BUILD_DIR)\$(PHPLIB) $(BUILD_DIR)\php-cgi.exe.res $(BUILD_DIR)\php-cgi.exe.manifest
|
||||
$lines[$line_num] = '$(BUILD_DIR)\php-cgi.exe: $(DEPS_CGI) $(CGI_GLOBAL_OBJS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(ASM_OBJS) $(BUILD_DIR)\php-cgi.exe.res $(BUILD_DIR)\php-cgi.exe.manifest';
|
||||
|
||||
// cli: @"$(LINK)" /nologo $(CGI_GLOBAL_OBJS_RESP) $(BUILD_DIR)\$(PHPLIB) $(LIBS_CGI) $(BUILD_DIR)\php-cgi.exe.res /out:$(BUILD_DIR)\php-cgi.exe $(LDFLAGS) $(LDFLAGS_CGI)
|
||||
$lines[$line_num + 1] = "\t" . '@"$(LINK)" /nologo $(PHP_GLOBAL_OBJS_RESP) $(CGI_GLOBAL_OBJS_RESP) $(STATIC_EXT_OBJS_RESP) $(STATIC_EXT_LIBS) $(ASM_OBJS) $(LIBS) $(LIBS_CGI) $(BUILD_DIR)\php-cgi.exe.res /out:$(BUILD_DIR)\php-cgi.exe $(LDFLAGS) $(LDFLAGS_CGI) /ltcg /nodefaultlib:msvcrt /nodefaultlib:msvcrtd /ignore:4286';
|
||||
FileSystem::writeFile(SOURCE_PATH . '/php-src/Makefile', implode("\r\n", $lines));
|
||||
|
||||
// Patch cgi-static, comment ZEND_TSRMLS_CACHE_DEFINE()
|
||||
FileSystem::replaceFileRegex(SOURCE_PATH . '\php-src\sapi\cgi\cgi_main.c', '/^ZEND_TSRMLS_CACHE_DEFINE\(\)/m', '// ZEND_TSRMLS_CACHE_DEFINE()');
|
||||
}
|
||||
|
||||
public static function patchPhpLibxml212(): bool
|
||||
{
|
||||
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
|
||||
|
||||
@@ -16,7 +16,7 @@ class PhpSource extends CustomSourceBase
|
||||
{
|
||||
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4';
|
||||
if ($major === '8.5') {
|
||||
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://github.com/php/php-src/archive/refs/tags/php-8.5.0RC2.tar.gz'], $force);
|
||||
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://downloads.php.net/~daniels/php-8.5.0RC3.tar.xz'], $force);
|
||||
} elseif ($major === 'git') {
|
||||
Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force);
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,150 @@ use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class ConfigValidator
|
||||
{
|
||||
/**
|
||||
* Global field type definitions
|
||||
* Maps field names to their expected types and validation rules
|
||||
* Note: This only includes fields used in config files (source.json, lib.json, ext.json, pkg.json, pre-built.json)
|
||||
*/
|
||||
private const array FIELD_TYPES = [
|
||||
// String fields
|
||||
'url' => 'string', // url
|
||||
'regex' => 'string', // regex pattern
|
||||
'rev' => 'string', // revision/branch
|
||||
'repo' => 'string', // repository name
|
||||
'match' => 'string', // match pattern (aaa*bbb)
|
||||
'filename' => 'string', // filename
|
||||
'path' => 'string', // copy path
|
||||
'extract' => 'string', // copy path (alias of path)
|
||||
'dirname' => 'string', // directory name for local source
|
||||
'source' => 'string', // the source name that this item uses
|
||||
'match-pattern-linux' => 'string', // pre-built match pattern for linux
|
||||
'match-pattern-macos' => 'string', // pre-built match pattern for macos
|
||||
'match-pattern-windows' => 'string', // pre-built match pattern for windows
|
||||
|
||||
// Boolean fields
|
||||
'prefer-stable' => 'bool', // prefer stable releases
|
||||
'provide-pre-built' => 'bool', // provide pre-built binaries
|
||||
'notes' => 'bool', // whether to show notes in docs
|
||||
'cpp-library' => 'bool', // whether this is a C++ library
|
||||
'cpp-extension' => 'bool', // whether this is a C++ extension
|
||||
'build-with-php' => 'bool', // whether if this extension can be built to shared with PHP source together
|
||||
'zend-extension' => 'bool', // whether this is a zend extension
|
||||
'unix-only' => 'bool', // whether this extension is only for unix-like systems
|
||||
|
||||
// Array fields
|
||||
'submodules' => 'array', // git submodules list (for git source type)
|
||||
'lib-depends' => 'list',
|
||||
'lib-suggests' => 'list',
|
||||
'ext-depends' => 'list',
|
||||
'ext-suggests' => 'list',
|
||||
'static-libs' => 'list',
|
||||
'pkg-configs' => 'list', // required pkg-config files without suffix (e.g. [libwebp])
|
||||
'headers' => 'list', // required header files
|
||||
'bin' => 'list', // required binary files
|
||||
'frameworks' => 'list', // shared library frameworks (macOS)
|
||||
|
||||
// Object/assoc array fields
|
||||
'support' => 'object', // extension OS support docs
|
||||
'extract-files' => 'object', // pkg.json extract files mapping with match pattern
|
||||
'alt' => 'object|bool', // alternative source/package
|
||||
'license' => 'object|array', // license information
|
||||
'target' => 'array', // extension build targets (default: [static], alternate: [shared] or both)
|
||||
|
||||
// Special/mixed fields
|
||||
'func' => 'callable', // custom download function for custom source/package type
|
||||
'type' => 'string', // type field (validated separately)
|
||||
];
|
||||
|
||||
/**
|
||||
* Source/Package download type validation rules
|
||||
* Maps type names to [required_props, optional_props]
|
||||
*/
|
||||
private const array SOURCE_TYPE_FIELDS = [
|
||||
'filelist' => [['url', 'regex'], []],
|
||||
'git' => [['url', 'rev'], ['path', 'extract', 'submodules']],
|
||||
'ghtagtar' => [['repo'], ['path', 'extract', 'prefer-stable', 'match']],
|
||||
'ghtar' => [['repo'], ['path', 'extract', 'prefer-stable', 'match']],
|
||||
'ghrel' => [['repo', 'match'], ['path', 'extract', 'prefer-stable']],
|
||||
'url' => [['url'], ['filename', 'path', 'extract']],
|
||||
'bitbuckettag' => [['repo'], ['path', 'extract']],
|
||||
'local' => [['dirname'], ['path', 'extract']],
|
||||
'pie' => [['repo'], ['path']],
|
||||
'custom' => [[], ['func']],
|
||||
];
|
||||
|
||||
/**
|
||||
* Source.json specific fields [field_name => required]
|
||||
* Note: 'type' is validated separately in validateSourceTypeConfig
|
||||
* Field types are defined in FIELD_TYPES constant
|
||||
*/
|
||||
private const array SOURCE_FIELDS = [
|
||||
'type' => true, // source type (must be SOURCE_TYPE_FIELDS key)
|
||||
'provide-pre-built' => false, // whether to provide pre-built binaries
|
||||
'alt' => false, // alternative source configuration
|
||||
'license' => false, // license information for source
|
||||
// ... other fields are validated based on source type
|
||||
];
|
||||
|
||||
/**
|
||||
* Lib.json specific fields [field_name => required]
|
||||
* Field types are defined in FIELD_TYPES constant
|
||||
*/
|
||||
private const array LIB_FIELDS = [
|
||||
'type' => false, // lib type (lib/package/target/root)
|
||||
'source' => false, // the source name that this lib uses
|
||||
'lib-depends' => false, // required libraries
|
||||
'lib-suggests' => false, // suggested libraries
|
||||
'static-libs' => false, // Generated static libraries
|
||||
'pkg-configs' => false, // Generated pkg-config files
|
||||
'cpp-library' => false, // whether this is a C++ library
|
||||
'headers' => false, // Generated header files
|
||||
'bin' => false, // Generated binary files
|
||||
'frameworks' => false, // Used shared library frameworks (macOS)
|
||||
];
|
||||
|
||||
/**
|
||||
* Ext.json specific fields [field_name => required]
|
||||
* Field types are defined in FIELD_TYPES constant
|
||||
*/
|
||||
private const array EXT_FIELDS = [
|
||||
'type' => true, // extension type (builtin/external/addon/wip)
|
||||
'source' => false, // the source name that this extension uses
|
||||
'support' => false, // extension OS support docs
|
||||
'notes' => false, // whether to show notes in docs
|
||||
'cpp-extension' => false, // whether this is a C++ extension
|
||||
'build-with-php' => false, // whether if this extension can be built to shared with PHP source together
|
||||
'target' => false, // extension build targets (default: [static], alternate: [shared] or both)
|
||||
'lib-depends' => false,
|
||||
'lib-suggests' => false,
|
||||
'ext-depends' => false,
|
||||
'ext-suggests' => false,
|
||||
'frameworks' => false,
|
||||
'zend-extension' => false, // whether this is a zend extension
|
||||
'unix-only' => false, // whether this extension is only for unix-like systems
|
||||
];
|
||||
|
||||
/**
|
||||
* Pkg.json specific fields [field_name => required]
|
||||
* Field types are defined in FIELD_TYPES constant
|
||||
*/
|
||||
private const array PKG_FIELDS = [
|
||||
'type' => true, // package type (same as source type)
|
||||
'extract-files' => false, // files to extract mapping (source pattern => target path)
|
||||
];
|
||||
|
||||
/**
|
||||
* Pre-built.json specific fields [field_name => required]
|
||||
* Field types are defined in FIELD_TYPES constant
|
||||
*/
|
||||
private const array PRE_BUILT_FIELDS = [
|
||||
'repo' => true, // repository name for pre-built binaries
|
||||
'prefer-stable' => false, // prefer stable releases
|
||||
'match-pattern-linux' => false, // pre-built match pattern for linux
|
||||
'match-pattern-macos' => false, // pre-built match pattern for macos
|
||||
'match-pattern-windows' => false, // pre-built match pattern for windows
|
||||
];
|
||||
|
||||
/**
|
||||
* Validate source.json
|
||||
*
|
||||
@@ -22,33 +166,20 @@ class ConfigValidator
|
||||
// Validate basic source type configuration
|
||||
self::validateSourceTypeConfig($src, $name, 'source');
|
||||
|
||||
// Check source-specific fields
|
||||
// Validate all source-specific fields using unified method
|
||||
self::validateConfigFields($src, $name, 'source', self::SOURCE_FIELDS);
|
||||
|
||||
// Check for unknown fields
|
||||
self::validateAllowedFields($src, $name, 'source', self::SOURCE_FIELDS);
|
||||
|
||||
// check if alt is valid
|
||||
if (isset($src['alt'])) {
|
||||
if (!is_assoc_array($src['alt']) && !is_bool($src['alt'])) {
|
||||
throw new ValidationException("source {$name} alt must be object or boolean");
|
||||
}
|
||||
if (is_assoc_array($src['alt'])) {
|
||||
// validate alt source recursively
|
||||
self::validateSource([$name . '_alt' => $src['alt']]);
|
||||
}
|
||||
}
|
||||
|
||||
// check if provide-pre-built is boolean
|
||||
if (isset($src['provide-pre-built']) && !is_bool($src['provide-pre-built'])) {
|
||||
throw new ValidationException("source {$name} provide-pre-built must be boolean");
|
||||
}
|
||||
|
||||
// check if prefer-stable is boolean
|
||||
if (isset($src['prefer-stable']) && !is_bool($src['prefer-stable'])) {
|
||||
throw new ValidationException("source {$name} prefer-stable must be boolean");
|
||||
if (isset($src['alt']) && is_assoc_array($src['alt'])) {
|
||||
// validate alt source recursively
|
||||
self::validateSource([$name . '_alt' => $src['alt']]);
|
||||
}
|
||||
|
||||
// check if license is valid
|
||||
if (isset($src['license'])) {
|
||||
if (!is_array($src['license'])) {
|
||||
throw new ValidationException("source {$name} license must be an object or array");
|
||||
}
|
||||
if (is_assoc_array($src['license'])) {
|
||||
self::checkSingleLicense($src['license'], $name);
|
||||
} elseif (is_list_array($src['license'])) {
|
||||
@@ -58,8 +189,6 @@ class ConfigValidator
|
||||
}
|
||||
self::checkSingleLicense($license, $name);
|
||||
}
|
||||
} else {
|
||||
throw new ValidationException("source {$name} license must be an object or array");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,9 +200,8 @@ class ConfigValidator
|
||||
if (!is_array($data)) {
|
||||
throw new ValidationException('lib.json is broken');
|
||||
}
|
||||
// check each lib
|
||||
|
||||
foreach ($data as $name => $lib) {
|
||||
// check if lib is an assoc array
|
||||
if (!is_assoc_array($lib)) {
|
||||
throw new ValidationException("lib {$name} is not an object");
|
||||
}
|
||||
@@ -89,36 +217,22 @@ class ConfigValidator
|
||||
if (isset($lib['source']) && !empty($source_data) && !isset($source_data[$lib['source']])) {
|
||||
throw new ValidationException("lib {$name} assigns an invalid source: {$lib['source']}");
|
||||
}
|
||||
// check if source is string
|
||||
if (isset($lib['source']) && !is_string($lib['source'])) {
|
||||
throw new ValidationException("lib {$name} source must be string");
|
||||
}
|
||||
// check if [lib-depends|lib-suggests|static-libs|headers|bin][-windows|-unix|-macos|-linux] are valid list array
|
||||
|
||||
// Validate basic fields using unified method
|
||||
self::validateConfigFields($lib, $name, 'lib', self::LIB_FIELDS);
|
||||
|
||||
// Validate list array fields with suffixes
|
||||
$suffixes = ['', '-windows', '-unix', '-macos', '-linux'];
|
||||
foreach ($suffixes as $suffix) {
|
||||
if (isset($lib['lib-depends' . $suffix]) && !is_list_array($lib['lib-depends' . $suffix])) {
|
||||
throw new ValidationException("lib {$name} lib-depends must be a list");
|
||||
}
|
||||
if (isset($lib['lib-suggests' . $suffix]) && !is_list_array($lib['lib-suggests' . $suffix])) {
|
||||
throw new ValidationException("lib {$name} lib-suggests must be a list");
|
||||
}
|
||||
if (isset($lib['static-libs' . $suffix]) && !is_list_array($lib['static-libs' . $suffix])) {
|
||||
throw new ValidationException("lib {$name} static-libs must be a list");
|
||||
}
|
||||
if (isset($lib['pkg-configs' . $suffix]) && !is_list_array($lib['pkg-configs' . $suffix])) {
|
||||
throw new ValidationException("lib {$name} pkg-configs must be a list");
|
||||
}
|
||||
if (isset($lib['headers' . $suffix]) && !is_list_array($lib['headers' . $suffix])) {
|
||||
throw new ValidationException("lib {$name} headers must be a list");
|
||||
}
|
||||
if (isset($lib['bin' . $suffix]) && !is_list_array($lib['bin' . $suffix])) {
|
||||
throw new ValidationException("lib {$name} bin must be a list");
|
||||
}
|
||||
}
|
||||
// check if frameworks is a list array
|
||||
if (isset($lib['frameworks']) && !is_list_array($lib['frameworks'])) {
|
||||
throw new ValidationException("lib {$name} frameworks must be a list");
|
||||
$fields = ['lib-depends', 'lib-suggests', 'static-libs', 'pkg-configs', 'headers', 'bin'];
|
||||
self::validateListArrayFields($lib, $name, 'lib', $fields, $suffixes);
|
||||
|
||||
// Validate frameworks (special case without suffix)
|
||||
if (isset($lib['frameworks'])) {
|
||||
self::validateFieldType('frameworks', $lib['frameworks'], $name, 'lib');
|
||||
}
|
||||
|
||||
// Check for unknown fields
|
||||
self::validateAllowedFields($lib, $name, 'lib', self::LIB_FIELDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,61 +241,34 @@ class ConfigValidator
|
||||
if (!is_array($data)) {
|
||||
throw new ValidationException('ext.json is broken');
|
||||
}
|
||||
// check each extension
|
||||
|
||||
foreach ($data as $name => $ext) {
|
||||
// check if ext is an assoc array
|
||||
if (!is_assoc_array($ext)) {
|
||||
throw new ValidationException("ext {$name} is not an object");
|
||||
}
|
||||
// check if ext has valid type
|
||||
|
||||
if (!in_array($ext['type'] ?? '', ['builtin', 'external', 'addon', 'wip'])) {
|
||||
throw new ValidationException("ext {$name} type is invalid");
|
||||
}
|
||||
// check if external ext has source
|
||||
|
||||
// Check source field requirement
|
||||
if (($ext['type'] ?? '') === 'external' && !isset($ext['source'])) {
|
||||
throw new ValidationException("ext {$name} does not assign any source");
|
||||
}
|
||||
// check if source is string
|
||||
if (isset($ext['source']) && !is_string($ext['source'])) {
|
||||
throw new ValidationException("ext {$name} source must be string");
|
||||
}
|
||||
// check if support is valid
|
||||
if (isset($ext['support']) && !is_assoc_array($ext['support'])) {
|
||||
throw new ValidationException("ext {$name} support must be an object");
|
||||
}
|
||||
// check if notes is boolean
|
||||
if (isset($ext['notes']) && !is_bool($ext['notes'])) {
|
||||
throw new ValidationException("ext {$name} notes must be boolean");
|
||||
}
|
||||
// check if [lib-depends|lib-suggests|ext-depends][-windows|-unix|-macos|-linux] are valid list array
|
||||
|
||||
// Validate basic fields using unified method
|
||||
self::validateConfigFields($ext, $name, 'ext', self::EXT_FIELDS);
|
||||
|
||||
// Validate list array fields with suffixes
|
||||
$suffixes = ['', '-windows', '-unix', '-macos', '-linux'];
|
||||
foreach ($suffixes as $suffix) {
|
||||
if (isset($ext['lib-depends' . $suffix]) && !is_list_array($ext['lib-depends' . $suffix])) {
|
||||
throw new ValidationException("ext {$name} lib-depends must be a list");
|
||||
}
|
||||
if (isset($ext['lib-suggests' . $suffix]) && !is_list_array($ext['lib-suggests' . $suffix])) {
|
||||
throw new ValidationException("ext {$name} lib-suggests must be a list");
|
||||
}
|
||||
if (isset($ext['ext-depends' . $suffix]) && !is_list_array($ext['ext-depends' . $suffix])) {
|
||||
throw new ValidationException("ext {$name} ext-depends must be a list");
|
||||
}
|
||||
}
|
||||
// check if arg-type is valid
|
||||
if (isset($ext['arg-type'])) {
|
||||
$valid_arg_types = ['enable', 'with', 'with-path', 'custom', 'none', 'enable-path'];
|
||||
if (!in_array($ext['arg-type'], $valid_arg_types)) {
|
||||
throw new ValidationException("ext {$name} arg-type is invalid");
|
||||
}
|
||||
}
|
||||
// check if arg-type with suffix is valid
|
||||
foreach ($suffixes as $suffix) {
|
||||
if (isset($ext['arg-type' . $suffix])) {
|
||||
$valid_arg_types = ['enable', 'with', 'with-path', 'custom', 'none', 'enable-path'];
|
||||
if (!in_array($ext['arg-type' . $suffix], $valid_arg_types)) {
|
||||
throw new ValidationException("ext {$name} arg-type{$suffix} is invalid");
|
||||
}
|
||||
}
|
||||
}
|
||||
$fields = ['lib-depends', 'lib-suggests', 'ext-depends', 'ext-suggests'];
|
||||
self::validateListArrayFields($ext, $name, 'ext', $fields, $suffixes);
|
||||
|
||||
// Validate arg-type fields
|
||||
self::validateArgTypeFields($ext, $name, $suffixes);
|
||||
|
||||
// Check for unknown fields
|
||||
self::validateAllowedFields($ext, $name, 'ext', self::EXT_FIELDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,12 +287,11 @@ class ConfigValidator
|
||||
// Validate basic source type configuration (reuse from source validation)
|
||||
self::validateSourceTypeConfig($pkg, $name, 'pkg');
|
||||
|
||||
// Check pkg-specific fields
|
||||
// check if extract-files is valid
|
||||
// Validate all pkg-specific fields using unified method
|
||||
self::validateConfigFields($pkg, $name, 'pkg', self::PKG_FIELDS);
|
||||
|
||||
// Validate extract-files content (object validation is done by validateFieldType)
|
||||
if (isset($pkg['extract-files'])) {
|
||||
if (!is_assoc_array($pkg['extract-files'])) {
|
||||
throw new ValidationException("pkg {$name} extract-files must be an object");
|
||||
}
|
||||
// check each extract file mapping
|
||||
foreach ($pkg['extract-files'] as $source => $target) {
|
||||
if (!is_string($source) || !is_string($target)) {
|
||||
@@ -213,6 +299,9 @@ class ConfigValidator
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for unknown fields
|
||||
self::validateAllowedFields($pkg, $name, 'pkg', self::PKG_FIELDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,18 +316,11 @@ class ConfigValidator
|
||||
throw new ValidationException('pre-built.json is broken');
|
||||
}
|
||||
|
||||
// Check required fields
|
||||
if (!isset($data['repo'])) {
|
||||
throw new ValidationException('pre-built.json must have [repo] field');
|
||||
}
|
||||
if (!is_string($data['repo'])) {
|
||||
throw new ValidationException('pre-built.json [repo] must be string');
|
||||
}
|
||||
// Validate all fields using unified method
|
||||
self::validateConfigFields($data, 'pre-built', 'pre-built', self::PRE_BUILT_FIELDS);
|
||||
|
||||
// Check optional prefer-stable field
|
||||
if (isset($data['prefer-stable']) && !is_bool($data['prefer-stable'])) {
|
||||
throw new ValidationException('pre-built.json [prefer-stable] must be boolean');
|
||||
}
|
||||
// Check for unknown fields
|
||||
self::validateAllowedFields($data, 'pre-built', 'pre-built', self::PRE_BUILT_FIELDS);
|
||||
|
||||
// Check match pattern fields (at least one must exist)
|
||||
$pattern_fields = ['match-pattern-linux', 'match-pattern-macos', 'match-pattern-windows'];
|
||||
@@ -247,9 +329,6 @@ class ConfigValidator
|
||||
foreach ($pattern_fields as $field) {
|
||||
if (isset($data[$field])) {
|
||||
$has_pattern = true;
|
||||
if (!is_string($data[$field])) {
|
||||
throw new ValidationException("pre-built.json [{$field}] must be string");
|
||||
}
|
||||
// Validate pattern contains required placeholders
|
||||
if (!str_contains($data[$field], '{name}')) {
|
||||
throw new ValidationException("pre-built.json [{$field}] must contain {name} placeholder");
|
||||
@@ -403,6 +482,52 @@ class ConfigValidator
|
||||
return $craft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a field based on its global type definition
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param mixed $value Field value
|
||||
* @param string $name Item name (for error messages)
|
||||
* @param string $type Item type (for error messages)
|
||||
* @return bool Returns true if validation passes
|
||||
*/
|
||||
private static function validateFieldType(string $field, mixed $value, string $name, string $type): bool
|
||||
{
|
||||
// Check if field exists in FIELD_TYPES
|
||||
if (!isset(self::FIELD_TYPES[$field])) {
|
||||
// Try to strip suffix and check base field name
|
||||
$suffixes = ['-windows', '-unix', '-macos', '-linux'];
|
||||
$base_field = $field;
|
||||
foreach ($suffixes as $suffix) {
|
||||
if (str_ends_with($field, $suffix)) {
|
||||
$base_field = substr($field, 0, -strlen($suffix));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset(self::FIELD_TYPES[$base_field])) {
|
||||
// Unknown field is not allowed - strict validation
|
||||
throw new ValidationException("{$type} {$name} has unknown field [{$field}]");
|
||||
}
|
||||
|
||||
// Use base field type for validation
|
||||
$expected_type = self::FIELD_TYPES[$base_field];
|
||||
} else {
|
||||
$expected_type = self::FIELD_TYPES[$field];
|
||||
}
|
||||
|
||||
return match ($expected_type) {
|
||||
'string' => is_string($value) ?: throw new ValidationException("{$type} {$name} [{$field}] must be string"),
|
||||
'bool' => is_bool($value) ?: throw new ValidationException("{$type} {$name} [{$field}] must be boolean"),
|
||||
'array' => is_array($value) ?: throw new ValidationException("{$type} {$name} [{$field}] must be array"),
|
||||
'list' => is_list_array($value) ?: throw new ValidationException("{$type} {$name} [{$field}] must be a list"),
|
||||
'object' => is_assoc_array($value) ?: throw new ValidationException("{$type} {$name} [{$field}] must be an object"),
|
||||
'object|bool' => (is_assoc_array($value) || is_bool($value)) ?: throw new ValidationException("{$type} {$name} [{$field}] must be object or boolean"),
|
||||
'object|array' => is_array($value) ?: throw new ValidationException("{$type} {$name} [{$field}] must be an object or array"),
|
||||
'callable' => true, // Skip validation for callable
|
||||
};
|
||||
}
|
||||
|
||||
private static function checkSingleLicense(array $license, string $name): void
|
||||
{
|
||||
if (!is_assoc_array($license)) {
|
||||
@@ -414,9 +539,6 @@ class ConfigValidator
|
||||
if (!in_array($license['type'], ['file', 'text'])) {
|
||||
throw new ValidationException("source {$name} license type is invalid");
|
||||
}
|
||||
if (!in_array($license['type'], ['file', 'text'])) {
|
||||
throw new ValidationException("source {$name} license type is invalid");
|
||||
}
|
||||
if ($license['type'] === 'file' && !isset($license['path'])) {
|
||||
throw new ValidationException("source {$name} license file must have path");
|
||||
}
|
||||
@@ -440,68 +562,127 @@ class ConfigValidator
|
||||
if (!is_string($item['type'])) {
|
||||
throw new ValidationException("{$config_type} {$name} type prop must be string");
|
||||
}
|
||||
if (!in_array($item['type'], ['filelist', 'git', 'ghtagtar', 'ghtar', 'ghrel', 'url', 'custom'])) {
|
||||
|
||||
if (!isset(self::SOURCE_TYPE_FIELDS[$item['type']])) {
|
||||
throw new ValidationException("{$config_type} {$name} type [{$item['type']}] is invalid");
|
||||
}
|
||||
|
||||
// Validate type-specific requirements
|
||||
switch ($item['type']) {
|
||||
case 'filelist':
|
||||
if (!isset($item['url'], $item['regex'])) {
|
||||
throw new ValidationException("{$config_type} {$name} needs [url] and [regex] props");
|
||||
[$required, $optional] = self::SOURCE_TYPE_FIELDS[$item['type']];
|
||||
|
||||
// Check required fields exist
|
||||
foreach ($required as $prop) {
|
||||
if (!isset($item[$prop])) {
|
||||
$props = implode('] and [', $required);
|
||||
throw new ValidationException("{$config_type} {$name} needs [{$props}] props");
|
||||
}
|
||||
}
|
||||
|
||||
// Validate field types using global field type definitions
|
||||
foreach (array_merge($required, $optional) as $prop) {
|
||||
if (isset($item[$prop])) {
|
||||
self::validateFieldType($prop, $item[$prop], $name, $config_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that fields with suffixes are list arrays
|
||||
*/
|
||||
private static function validateListArrayFields(array $item, string $name, string $type, array $fields, array $suffixes): void
|
||||
{
|
||||
foreach ($fields as $field) {
|
||||
foreach ($suffixes as $suffix) {
|
||||
$key = $field . $suffix;
|
||||
if (isset($item[$key])) {
|
||||
self::validateFieldType($key, $item[$key], $name, $type);
|
||||
}
|
||||
if (!is_string($item['url']) || !is_string($item['regex'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [url] and [regex] must be string");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate arg-type fields with suffixes
|
||||
*/
|
||||
private static function validateArgTypeFields(array $item, string $name, array $suffixes): void
|
||||
{
|
||||
$valid_arg_types = ['enable', 'with', 'with-path', 'custom', 'none', 'enable-path'];
|
||||
|
||||
foreach (array_merge([''], $suffixes) as $suffix) {
|
||||
$key = 'arg-type' . $suffix;
|
||||
if (isset($item[$key]) && !in_array($item[$key], $valid_arg_types)) {
|
||||
throw new ValidationException("ext {$name} {$key} is invalid");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unified method to validate config fields based on field definitions
|
||||
*
|
||||
* @param array $item Item data to validate
|
||||
* @param string $name Item name for error messages
|
||||
* @param string $type Config type (source, lib, ext, pkg, pre-built)
|
||||
* @param array $field_definitions Field definitions [field_name => required (bool)]
|
||||
*/
|
||||
private static function validateConfigFields(array $item, string $name, string $type, array $field_definitions): void
|
||||
{
|
||||
foreach ($field_definitions as $field => $required) {
|
||||
if ($required && !isset($item[$field])) {
|
||||
throw new ValidationException("{$type} {$name} must have [{$field}] field");
|
||||
}
|
||||
|
||||
if (isset($item[$field])) {
|
||||
self::validateFieldType($field, $item[$field], $name, $type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that item only contains allowed fields
|
||||
* This method checks for unknown fields based on the config type
|
||||
*
|
||||
* @param array $item Item data to validate
|
||||
* @param string $name Item name for error messages
|
||||
* @param string $type Config type (source, lib, ext, pkg, pre-built)
|
||||
* @param array $field_definitions Field definitions [field_name => required (bool)]
|
||||
*/
|
||||
private static function validateAllowedFields(array $item, string $name, string $type, array $field_definitions): void
|
||||
{
|
||||
// For source and pkg types, we need to check SOURCE_TYPE_FIELDS as well
|
||||
$allowed_fields = array_keys($field_definitions);
|
||||
|
||||
// For source/pkg, add allowed fields from SOURCE_TYPE_FIELDS based on the type
|
||||
if (in_array($type, ['source', 'pkg']) && isset($item['type'], self::SOURCE_TYPE_FIELDS[$item['type']])) {
|
||||
[$required, $optional] = self::SOURCE_TYPE_FIELDS[$item['type']];
|
||||
$allowed_fields = array_merge($allowed_fields, $required, $optional);
|
||||
}
|
||||
|
||||
// For lib and ext types, add fields with suffixes
|
||||
if (in_array($type, ['lib', 'ext'])) {
|
||||
$suffixes = ['-windows', '-unix', '-macos', '-linux'];
|
||||
$base_fields = ['lib-depends', 'lib-suggests', 'static-libs', 'pkg-configs', 'headers', 'bin'];
|
||||
if ($type === 'ext') {
|
||||
$base_fields = ['lib-depends', 'lib-suggests', 'ext-depends', 'ext-suggests'];
|
||||
// Add arg-type fields
|
||||
foreach (array_merge([''], $suffixes) as $suffix) {
|
||||
$allowed_fields[] = 'arg-type' . $suffix;
|
||||
}
|
||||
break;
|
||||
case 'git':
|
||||
if (!isset($item['url'], $item['rev'])) {
|
||||
throw new ValidationException("{$config_type} {$name} needs [url] and [rev] props");
|
||||
}
|
||||
foreach ($base_fields as $field) {
|
||||
foreach ($suffixes as $suffix) {
|
||||
$allowed_fields[] = $field . $suffix;
|
||||
}
|
||||
if (!is_string($item['url']) || !is_string($item['rev'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [url] and [rev] must be string");
|
||||
}
|
||||
if (isset($item['path']) && !is_string($item['path'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [path] must be string");
|
||||
}
|
||||
break;
|
||||
case 'ghtagtar':
|
||||
case 'ghtar':
|
||||
if (!isset($item['repo'])) {
|
||||
throw new ValidationException("{$config_type} {$name} needs [repo] prop");
|
||||
}
|
||||
if (!is_string($item['repo'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [repo] must be string");
|
||||
}
|
||||
if (isset($item['path']) && !is_string($item['path'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [path] must be string");
|
||||
}
|
||||
break;
|
||||
case 'ghrel':
|
||||
if (!isset($item['repo'], $item['match'])) {
|
||||
throw new ValidationException("{$config_type} {$name} needs [repo] and [match] props");
|
||||
}
|
||||
if (!is_string($item['repo']) || !is_string($item['match'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [repo] and [match] must be string");
|
||||
}
|
||||
break;
|
||||
case 'url':
|
||||
if (!isset($item['url'])) {
|
||||
throw new ValidationException("{$config_type} {$name} needs [url] prop");
|
||||
}
|
||||
if (!is_string($item['url'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [url] must be string");
|
||||
}
|
||||
if (isset($item['filename']) && !is_string($item['filename'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [filename] must be string");
|
||||
}
|
||||
if (isset($item['path']) && !is_string($item['path'])) {
|
||||
throw new ValidationException("{$config_type} {$name} [path] must be string");
|
||||
}
|
||||
break;
|
||||
case 'custom':
|
||||
// custom type has no specific requirements
|
||||
break;
|
||||
}
|
||||
// frameworks is lib-only
|
||||
if ($type === 'lib') {
|
||||
$allowed_fields[] = 'frameworks';
|
||||
}
|
||||
}
|
||||
|
||||
// Check each field in item
|
||||
foreach (array_keys($item) as $field) {
|
||||
if (!in_array($field, $allowed_fields)) {
|
||||
throw new ValidationException("{$type} {$name} has unknown field [{$field}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,18 +50,22 @@ class UnixAutoconfExecutor extends Executor
|
||||
* @param bool $with_clean Whether to clean before building
|
||||
* @param array $after_env_vars Environment variables postfix
|
||||
*/
|
||||
public function make(string $target = '', false|string $with_install = 'install', bool $with_clean = true, array $after_env_vars = []): static
|
||||
public function make(string $target = '', false|string $with_install = 'install', bool $with_clean = true, array $after_env_vars = [], ?string $dir = null): static
|
||||
{
|
||||
return $this->seekLogFileOnException(function () use ($target, $with_install, $with_clean, $after_env_vars) {
|
||||
return $this->seekLogFileOnException(function () use ($target, $with_install, $with_clean, $after_env_vars, $dir) {
|
||||
$shell = $this->shell;
|
||||
if ($dir) {
|
||||
$shell = $shell->cd($dir);
|
||||
}
|
||||
if ($with_clean) {
|
||||
$this->shell->exec('make clean');
|
||||
$shell->exec('make clean');
|
||||
}
|
||||
$after_env_vars_str = $after_env_vars !== [] ? shell()->setEnv($after_env_vars)->getEnvString() : '';
|
||||
$this->shell->exec("make -j{$this->library->getBuilder()->concurrency} {$target} {$after_env_vars_str}");
|
||||
$shell->exec("make -j{$this->library->getBuilder()->concurrency} {$target} {$after_env_vars_str}");
|
||||
if ($with_install !== false) {
|
||||
$this->shell->exec("make {$with_install}");
|
||||
$shell->exec("make {$with_install}");
|
||||
}
|
||||
return $this->shell;
|
||||
return $shell;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -111,6 +115,12 @@ class UnixAutoconfExecutor extends Executor
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setEnv(array $env): static
|
||||
{
|
||||
$this->shell->setEnv($env);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function appendEnv(array $env): static
|
||||
{
|
||||
$this->shell->appendEnv($env);
|
||||
|
||||
@@ -205,7 +205,7 @@ SET(CMAKE_INSTALL_PREFIX "{$root}")
|
||||
SET(CMAKE_INSTALL_LIBDIR "lib")
|
||||
|
||||
set(PKG_CONFIG_EXECUTABLE "{$pkgConfigExecutable}")
|
||||
list(APPEND PKG_CONFIG_EXECUTABLE "--static")
|
||||
set(PKG_CONFIG_ARGN "--static" CACHE STRING "Extra arguments for pkg-config" FORCE)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
@@ -8,6 +8,7 @@ use SPC\builder\freebsd\library\BSDLibraryBase;
|
||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
||||
use SPC\builder\macos\library\MacOSLibraryBase;
|
||||
use SPC\exception\SPCInternalException;
|
||||
use SPC\util\SPCTarget;
|
||||
use ZM\Logger\ConsoleColor;
|
||||
|
||||
/**
|
||||
@@ -28,6 +29,7 @@ class UnixShell extends Shell
|
||||
|
||||
public function exec(string $cmd): static
|
||||
{
|
||||
$cmd = clean_spaces($cmd);
|
||||
/* @phpstan-ignore-next-line */
|
||||
logger()->info(ConsoleColor::yellow('[EXEC] ') . ConsoleColor::green($cmd));
|
||||
$original_command = $cmd;
|
||||
@@ -48,7 +50,7 @@ class UnixShell extends Shell
|
||||
'CFLAGS' => $library->getLibExtraCFlags(),
|
||||
'CXXFLAGS' => $library->getLibExtraCXXFlags(),
|
||||
'LDFLAGS' => $library->getLibExtraLdFlags(),
|
||||
'LIBS' => $library->getLibExtraLibs(),
|
||||
'LIBS' => $library->getLibExtraLibs() . SPCTarget::getRuntimeLibs(),
|
||||
]);
|
||||
return $this;
|
||||
}
|
||||
|
||||
92
src/globals/extra/snmp-ext-config-old.m4
Normal file
92
src/globals/extra/snmp-ext-config-old.m4
Normal file
@@ -0,0 +1,92 @@
|
||||
PHP_ARG_WITH([snmp],
|
||||
[for SNMP support],
|
||||
[AS_HELP_STRING([[--with-snmp[=DIR]]],
|
||||
[Include SNMP support. Use PKG_CONFIG_PATH (or SNMP_CFLAGS and SNMP_LIBS)
|
||||
environment variables, or alternatively the optional DIR argument to
|
||||
customize where to look for the net-snmp-config utility of the NET-SNMP
|
||||
library.])])
|
||||
|
||||
if test "$PHP_SNMP" != "no"; then
|
||||
snmp_found=no
|
||||
AS_VAR_IF([PHP_SNMP], [yes],
|
||||
[PKG_CHECK_MODULES([SNMP], [netsnmp >= 5.3], [snmp_found=yes], [:])])
|
||||
|
||||
AS_VAR_IF([snmp_found], [no], [
|
||||
AS_VAR_IF([PHP_SNMP], [yes],
|
||||
[AC_PATH_PROG([SNMP_CONFIG], [net-snmp-config],, [/usr/local/bin:$PATH])],
|
||||
[SNMP_CONFIG="$PHP_SNMP/bin/net-snmp-config"])
|
||||
|
||||
AS_IF([test ! -x "$SNMP_CONFIG"],
|
||||
[AC_MSG_ERROR(m4_text_wrap([
|
||||
Could not find net-snmp-config binary. Please check your net-snmp
|
||||
installation.
|
||||
]))])
|
||||
|
||||
snmp_version=$($SNMP_CONFIG --version)
|
||||
AS_VERSION_COMPARE([$snmp_version], [5.3],
|
||||
[AC_MSG_ERROR(m4_text_wrap([
|
||||
Net-SNMP version 5.3 or greater required (detected $snmp_version).
|
||||
]))])
|
||||
|
||||
SNMP_PREFIX=$($SNMP_CONFIG --prefix)
|
||||
SNMP_CFLAGS="-I${SNMP_PREFIX}/include"
|
||||
SNMP_LIBS=$($SNMP_CONFIG --netsnmp-libs)
|
||||
SNMP_LIBS="$SNMP_LIBS $($SNMP_CONFIG --external-libs)"
|
||||
|
||||
AS_IF([test -z "$SNMP_LIBS" || test -z "$SNMP_PREFIX"],
|
||||
[AC_MSG_ERROR(m4_text_wrap([
|
||||
Could not find the required paths. Please check your net-snmp
|
||||
installation.
|
||||
]))])
|
||||
])
|
||||
|
||||
PHP_EVAL_INCLINE([$SNMP_CFLAGS])
|
||||
PHP_EVAL_LIBLINE([$SNMP_LIBS], [SNMP_SHARED_LIBADD])
|
||||
SNMP_LIBNAME=netsnmp
|
||||
|
||||
dnl Test build.
|
||||
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [init_snmp],
|
||||
[AC_DEFINE([HAVE_SNMP], [1],
|
||||
[Define to 1 if the PHP extension 'snmp' is available.])],
|
||||
[AC_MSG_FAILURE([SNMP sanity check failed.])],
|
||||
[$SNMP_SHARED_LIBADD])
|
||||
|
||||
dnl Check whether shutdown_snmp_logging() exists.
|
||||
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [shutdown_snmp_logging],
|
||||
[AC_DEFINE([HAVE_SHUTDOWN_SNMP_LOGGING], [1],
|
||||
[Define to 1 if SNMP library has the 'shutdown_snmp_logging' function.])],
|
||||
[],
|
||||
[$SNMP_SHARED_LIBADD])
|
||||
|
||||
CFLAGS_SAVE=$CFLAGS
|
||||
LIBS_SAVE=$LIBS
|
||||
CFLAGS="$CFLAGS $SNMP_CFLAGS"
|
||||
LIBS="$LIBS $SNMP_LIBS"
|
||||
|
||||
AC_CHECK_DECL([usmHMAC192SHA256AuthProtocol],
|
||||
[AC_DEFINE([HAVE_SNMP_SHA256], [1],
|
||||
[Define to 1 if SNMP library has the 'usmHMAC192SHA256AuthProtocol'
|
||||
array.])],
|
||||
[],
|
||||
[
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
])
|
||||
|
||||
AC_CHECK_DECL([usmHMAC384SHA512AuthProtocol],
|
||||
[AC_DEFINE([HAVE_SNMP_SHA512], [1],
|
||||
[Define to 1 if SNMP library has the 'usmHMAC384SHA512AuthProtocol'
|
||||
array.])],
|
||||
[],
|
||||
[
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
])
|
||||
|
||||
CFLAGS=$CFLAGS_SAVE
|
||||
LIBS=$LIBS_SAVE
|
||||
|
||||
PHP_NEW_EXTENSION([snmp], [snmp.c], [$ext_shared])
|
||||
PHP_ADD_EXTENSION_DEP(snmp, spl)
|
||||
PHP_SUBST([SNMP_SHARED_LIBADD])
|
||||
fi
|
||||
@@ -300,3 +300,20 @@ function strip_ansi_colors(string $text): string
|
||||
// Including color codes, cursor control, clear screen and other control sequences
|
||||
return preg_replace('/\e\[[0-9;]*[a-zA-Z]/', '', $text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to a real path for display purposes, used in docker volumes.
|
||||
*/
|
||||
function get_display_path(string $path): string
|
||||
{
|
||||
$deploy_root = getenv('SPC_FIX_DEPLOY_ROOT');
|
||||
if ($deploy_root === false) {
|
||||
return $path;
|
||||
}
|
||||
$cwd = WORKING_DIR;
|
||||
// replace build root with deploy root, only if path starts with build root
|
||||
if (str_starts_with($path, $cwd)) {
|
||||
return $deploy_root . substr($path, strlen($cwd));
|
||||
}
|
||||
throw new WrongUsageException("Cannot convert path: {$path}");
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ declare(strict_types=1);
|
||||
|
||||
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
||||
$test_php_version = [
|
||||
// '8.1',
|
||||
// '8.2',
|
||||
// '8.3',
|
||||
'8.1',
|
||||
'8.2',
|
||||
'8.3',
|
||||
'8.4',
|
||||
// '8.5',
|
||||
'8.5',
|
||||
// 'git',
|
||||
];
|
||||
|
||||
@@ -25,16 +25,17 @@ $test_php_version = [
|
||||
$test_os = [
|
||||
'macos-15-intel', // bin/spc for x86_64
|
||||
'macos-15', // bin/spc for arm64
|
||||
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||
// 'ubuntu-24.04', // bin/spc for x86_64
|
||||
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||
// 'ubuntu-24.04-arm', // bin/spc for arm64
|
||||
// 'windows-latest', // .\bin\spc.ps1
|
||||
'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||
'ubuntu-24.04', // bin/spc for x86_64
|
||||
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||
'ubuntu-24.04-arm', // bin/spc for arm64
|
||||
// 'windows-2022', // .\bin\spc.ps1
|
||||
// 'windows-2025',
|
||||
];
|
||||
|
||||
// whether enable thread safe
|
||||
$zts = false;
|
||||
$zts = true;
|
||||
|
||||
$no_strip = false;
|
||||
|
||||
@@ -49,8 +50,8 @@ $prefer_pre_built = false;
|
||||
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'pdo_pgsql',
|
||||
'Windows' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip',
|
||||
'Linux', 'Darwin' => 'trader',
|
||||
'Windows' => 'bcmath,bz2,calendar,ctype,curl,dba,dom,exif,ffi,fileinfo,filter,ftp,iconv,libxml,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_sqlite,pdo_sqlsrv,phar,session,shmop,simdjson,simplexml,soap,sockets,sqlite3,sqlsrv,ssh2,sysvshm,tokenizer,xml,xmlreader,xmlwriter,yaml,zip,zlib',
|
||||
};
|
||||
|
||||
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
||||
@@ -61,7 +62,7 @@ $shared_extensions = match (PHP_OS_FAMILY) {
|
||||
};
|
||||
|
||||
// If you want to test lib-suggests for all extensions and libraries, set it to true.
|
||||
$with_suggested_libs = true;
|
||||
$with_suggested_libs = false;
|
||||
|
||||
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
||||
$with_libs = match (PHP_OS_FAMILY) {
|
||||
@@ -208,7 +209,7 @@ switch ($argv[1] ?? null) {
|
||||
passthru($prefix . $down_cmd, $retcode);
|
||||
break;
|
||||
case 'build_cmd':
|
||||
passthru($prefix . $build_cmd . ' --build-cli --build-micro', $retcode);
|
||||
passthru($prefix . $build_cmd . ' --build-cli --build-micro --build-cgi', $retcode);
|
||||
break;
|
||||
case 'build_embed_cmd':
|
||||
if ($frankenphp) {
|
||||
|
||||
@@ -50,7 +50,6 @@ class ConfigValidatorTest extends TestCase
|
||||
'filename' => 'test.tar.gz',
|
||||
'path' => 'test/path',
|
||||
'provide-pre-built' => true,
|
||||
'prefer-stable' => false,
|
||||
'license' => [
|
||||
'type' => 'file',
|
||||
'path' => 'LICENSE',
|
||||
|
||||
@@ -44,6 +44,9 @@ class SPCConfigUtilTest extends TestCase
|
||||
|
||||
public function testConfig(): void
|
||||
{
|
||||
if (PHP_OS_FAMILY !== 'Linux') {
|
||||
$this->markTestSkipped('SPCConfigUtil tests are only applicable on Linux.');
|
||||
}
|
||||
// normal
|
||||
$result = (new SPCConfigUtil())->config(['bcmath']);
|
||||
$this->assertStringContainsString(BUILD_ROOT_PATH . '/include', $result['cflags']);
|
||||
|
||||
Reference in New Issue
Block a user