Compare commits

...

87 Commits

Author SHA1 Message Date
crazywhalecc
ee3be6f374 add pocketmine support 2023-12-21 21:57:03 +08:00
Jerry Ma
a39cd9a238 Update README.md 2023-12-21 12:55:20 +08:00
Jerry Ma
2d437952f2 Update README.md 2023-12-21 12:54:43 +08:00
crazywhalecc
7e5b0d6f43 use bulk combination for setup-runtime 2023-12-21 01:45:54 +08:00
Jerry Ma
cf198e0f0a Merge pull request #64 from mpociot/libargon2-support
Add support for libargon2
2023-12-19 20:49:50 +08:00
crazywhalecc
248918e458 remove ldap test for known reason 2023-12-19 20:04:13 +08:00
crazywhalecc
c4cfc01b88 fix linux build (dont know why linux failed) 2023-12-19 19:37:19 +08:00
crazywhalecc
339c03adb2 fix linux build (dont know why linux failed) 2023-12-19 19:31:56 +08:00
crazywhalecc
48551cc602 add linux support for libargon2 2023-12-19 19:13:19 +08:00
crazywhalecc
e0550b4a45 add argon2 test 2023-12-19 19:04:49 +08:00
crazywhalecc
93a55e87d5 temporarily use pkg-config mirror (freedesktop.org down) 2023-12-19 19:03:16 +08:00
Marcel Pociot
e68f1ce3fe Merge branch 'main' into libargon2-support 2023-12-19 10:05:45 +01:00
crazywhalecc
3573007485 Merge remote-tracking branch 'origin/main' 2023-12-18 00:14:34 +08:00
crazywhalecc
b961c34d9a add ldap test 2023-12-18 00:14:14 +08:00
Jerry Ma
33e1759caa Update README.md 2023-12-17 12:16:54 +08:00
Jerry Ma
d72ee53cb4 Update README.md 2023-12-17 02:02:00 +08:00
crazywhalecc
a5fa46b82d update README 2023-12-17 01:35:28 +08:00
Jerry Ma
bc15de0dfb Update README.md 2023-12-17 01:03:32 +08:00
crazywhalecc
1f7bdb94fb update README 2023-12-17 01:02:02 +08:00
crazywhalecc
ea64e50ce5 fix SourcePatcher::patchFile not working with spc binary 2023-12-16 18:49:38 +08:00
crazywhalecc
ed8b606761 add libtool for macos doctor 2023-12-16 15:07:04 +08:00
Jerry Ma
b722b3edd4 Merge pull request #279 from jingjingxyk/feature_upgrade_libpq
upgrade libpq to v16.1
2023-12-16 12:34:36 +08:00
crazywhalecc
9266a4c504 remove ldap test 2023-12-15 23:36:12 +08:00
crazywhalecc
d8ce5f69f4 fix mongodb support for Linux (mac still broken) 2023-12-15 01:31:01 +08:00
crazywhalecc
0cfac49560 adjust package order 2023-12-15 00:34:22 +08:00
crazywhalecc
3e9ddc8e01 update to rc9 2023-12-10 20:43:52 +08:00
crazywhalecc
83dd1bd5c3 Merge branch 'main' into feature_upgrade_libpq 2023-12-10 19:10:39 +08:00
crazywhalecc
42f448cf17 reformat build log 2023-12-10 19:07:28 +08:00
crazywhalecc
f0319de93e opcache limit php version 2023-12-10 19:07:28 +08:00
crazywhalecc
c7e9294908 fix libtool missing bug for freetype 2023-12-10 19:07:28 +08:00
Jerry Ma
c1758bd754 Update README.md 2023-12-07 16:01:12 +08:00
jingjingxyk
bba2d0dbf7 test remove imap ldap extension 2023-11-30 21:29:57 +08:00
jingjingxyk
00689b951b update ldap depends 2023-11-30 14:19:20 +08:00
jingjingxyk
98b7164de3 test libpq build 2023-11-30 13:09:02 +08:00
jingjingxyk
d3e4470e1f test libpq build 2023-11-30 13:06:36 +08:00
jingjingxyk
433c91b68d test libpq build 2023-11-30 13:01:15 +08:00
jingjingxyk
3185d98b1a test libpq build 2023-11-30 13:00:04 +08:00
jingjingxyk
e603e441e7 test libpq build 2023-11-30 12:56:47 +08:00
jingjingxyk
b1bf8bb848 test libpq build 2023-11-30 12:53:19 +08:00
jingjingxyk
b1958ea0c4 test libpq build 2023-11-30 12:37:20 +08:00
jingjingxyk
930849758c swoole.php and LinuxBuilder.php revert 2023-11-29 22:28:20 +08:00
jingjingxyk
7ee431725c test swoole enable pgsql 2023-11-29 22:22:36 +08:00
jingjingxyk
7c866cb0e3 swoole enable pgsql 2023-11-29 22:19:20 +08:00
jingjingxyk
266108b25f test libpq build config 2023-11-29 22:06:30 +08:00
crazywhalecc
82e3a86f17 bypass error: swoole curl hook is buggy for php 8.0 2023-11-29 20:31:53 +08:00
crazywhalecc
ba18819b41 Merge branch 'main' into feature_upgrade_libpq
# Conflicts:
#	src/globals/test-extensions.php
2023-11-29 19:16:40 +08:00
jingjingxyk
6b23c90bba test build libpq 2023-11-29 16:52:53 +08:00
crazywhalecc
edfd371973 bypass error: unknown warning option '-Wno-logical-op' for macOS 2023-11-29 16:03:30 +08:00
crazywhalecc
8ed95602e2 add tests 2023-11-29 16:03:30 +08:00
crazywhalecc
cee1346bec fix imagemagick linking issue 2023-11-29 16:03:30 +08:00
jingjingxyk
400007c206 test change test-extensions 2023-11-29 15:56:52 +08:00
jingjingxyk
443e615066 Merge remote-tracking branch 'origin/feature_upgrade_libpq' into feature_upgrade_libpq 2023-11-29 15:46:26 +08:00
jingjingxyk
ed22945ae2 test 2023-11-29 15:44:04 +08:00
Jerry Ma
5db084ba0e reduce test extensions 2023-11-29 15:17:21 +08:00
jingjingxyk
c7b3275a72 update libpq build config 2023-11-29 15:06:17 +08:00
Jerry Ma
41cd319d4e Update test-extensions.php 2023-11-29 14:28:39 +08:00
jingjingxyk
1c307d0d59 upgrade libpq to v16.1 2023-11-29 13:30:12 +08:00
Jerry Ma
9dcda873f3 Fix debian libtool bug (#276)
* add libtool installation for debian

* update composer lock

* re-fix libtool check

* re-fix libtool check
2023-11-27 22:35:40 +08:00
crazywhalecc
4400c6271e update composer lock 2023-11-27 21:59:59 +08:00
crazywhalecc
0589690eaa add libtool installation for debian 2023-11-27 21:59:59 +08:00
Jerry Ma
5449e05898 Update README.md 2023-11-24 10:28:35 +08:00
crazywhalecc
93e64e1d5a use php 8.2 to setup php runtime 2023-11-24 01:33:12 +08:00
crazywhalecc
7a2e237069 add php 8.3 support 2023-11-24 01:33:12 +08:00
crazywhalecc
c95da8c150 add tests 2023-11-24 01:23:15 +08:00
crazywhalecc
89afd44344 add tidy support for linux 2023-11-24 01:23:15 +08:00
crazywhalecc
04f100da8b add tidy support 2023-11-24 01:23:15 +08:00
Jerry Ma
2e24976b71 Update README.md 2023-11-22 11:05:57 +08:00
Jerry Ma
36a30cc23b Update README.md 2023-11-21 23:35:34 +08:00
crazywhalecc
869130572f change test 2023-11-21 23:09:20 +08:00
crazywhalecc
2bb08af89b add rar test 2023-11-21 23:09:20 +08:00
crazywhalecc
b3d41ef969 add extension rar 2023-11-21 23:09:20 +08:00
crazywhalecc
9c904409cd use string 2023-11-19 13:47:48 +08:00
crazywhalecc
859182abff remove fail fast 2023-11-19 13:44:12 +08:00
crazywhalecc
c0e88bf4bd prevent setup php from using 8.0 2023-11-19 13:42:40 +08:00
crazywhalecc
79bcd35c0e Add test build things 2023-11-19 13:41:09 +08:00
crazywhalecc
2e637524fc Add test build things 2023-11-19 13:38:55 +08:00
Jerry Ma
a2c687599f Create pull_request_template.md 2023-11-19 13:38:09 +08:00
crazywhalecc
fbf5c958d0 sort configs 2023-11-05 17:55:39 +08:00
crazywhalecc
672a4102cd overwrite password-argon2 cli check 2023-11-05 17:53:48 +08:00
crazywhalecc
52d61365b7 Merge branch 'main' into libargon2-support 2023-11-05 17:50:00 +08:00
crazywhalecc
3604ea6d67 Update lock 2023-11-05 17:32:29 +08:00
crazywhalecc
967292be5c Remove old configure_env 2023-11-05 17:31:17 +08:00
crazywhalecc
4f5335bba4 Merge branch 'main' into libargon2-support
# Conflicts:
#	config/lib.json
#	config/source.json
2023-11-05 17:25:36 +08:00
Marcel Pociot
0569c69634 remove path 2023-06-03 00:04:02 +02:00
Marcel Pociot
1b734073b0 Merge refactor 2023-06-02 22:47:59 +02:00
Marcel Pociot
47d068e6d3 Merge branch 'refactor' into libargon2-support 2023-06-02 22:47:47 +02:00
Marcel Pociot
4537bfb247 Add support for libargon2 2023-05-31 10:03:40 +02:00
40 changed files with 864 additions and 265 deletions

12
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,12 @@
## What does this PR do?
## Checklist before merging
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
> If a modification is not involved, please skip it directly.
- [ ] If it's a extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
- [ ] If you changed the behavior of static-php-cli, add docs in [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs) .
- [ ] If you updated `config/xxxx.json` content, run `bin/spc dev:sort-config xxx`.

View File

@@ -15,6 +15,7 @@ on:
default: '8.2' default: '8.2'
type: choice type: choice
options: options:
- '8.3'
- '8.2' - '8.2'
- '8.1' - '8.1'
- '8.0' - '8.0'

View File

@@ -9,6 +9,7 @@ on:
default: '8.2' default: '8.2'
type: choice type: choice
options: options:
- '8.3'
- '8.2' - '8.2'
- '8.1' - '8.1'
- '8.0' - '8.0'

View File

@@ -9,6 +9,7 @@ on:
default: '8.2' default: '8.2'
type: choice type: choice
options: options:
- '8.3'
- '8.2' - '8.2'
- '8.1' - '8.1'
- '8.0' - '8.0'

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
php-version: [ "8.0", "8.1", "8.2" ] php-version: [ "8.0", "8.1", "8.2", "8.3" ]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@@ -1,98 +1,146 @@
name: Tests name: Tests
on: on:
push: push:
branches: [ "main" ] branches: [ "main" ]
pull_request: pull_request:
branches: [ "main" ] branches: [ "main" ]
permissions: permissions:
contents: read contents: read
jobs: jobs:
php-cs-fixer: php-cs-fixer:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- name: Checkout - name: "Checkout"
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup PHP - name: "Setup PHP"
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '8.1' php-version: '8.1'
extensions: curl, openssl, mbstring extensions: curl, openssl, mbstring
ini-values: memory_limit=-1 ini-values: memory_limit=-1
tools: pecl, composer, php-cs-fixer tools: pecl, composer, php-cs-fixer
- name: Run PHP-CS-Fixer fix - name: Run PHP-CS-Fixer fix
run: php-cs-fixer fix --dry-run --diff --ansi run: php-cs-fixer fix --dry-run --diff --ansi
phpstan: phpstan:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- name: Checkout - name: "Checkout"
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup PHP - name: "Setup PHP"
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '8.1' php-version: '8.1'
extensions: curl, openssl, mbstring extensions: curl, openssl, mbstring
ini-values: memory_limit=-1 ini-values: memory_limit=-1
tools: composer tools: composer
- name: Cache Composer packages - name: "Cache Composer packages"
id: composer-cache id: composer-cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: vendor path: vendor
key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }} key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-phpstan- ${{ runner.os }}-phpstan-
- name: Install Dependencies - name: "Install Dependencies"
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run phpstan - name: "Run phpstan"
run: vendor/bin/phpstan analyse run: vendor/bin/phpstan analyse
phpunit: phpunit:
name: PHPUnit (PHP ${{ matrix.php }}) name: "PHPUnit (PHP ${{ matrix.php }})"
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
strategy: strategy:
matrix: matrix:
include: include:
- php: '8.1' - php: '8.1'
- php: '8.2' - php: '8.2'
fail-fast: false - php: '8.3'
steps: steps:
- name: Checkout - name: "Checkout"
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup PHP - name: "Setup PHP"
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: "${{ matrix.php }}" php-version: "${{ matrix.php }}"
tools: pecl, composer tools: pecl, composer
extensions: curl, openssl, mbstring extensions: curl, openssl, mbstring
ini-values: memory_limit=-1 ini-values: memory_limit=-1
- name: Cache Composer packages - name: "Cache Composer packages"
id: composer-cache id: composer-cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: vendor path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-php- ${{ runner.os }}-php-
- name: Install Dependencies - name: "Install Dependencies"
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run PHPUnit tests - name: "Run PHPUnit Tests"
run: | run: |
vendor/bin/phpunit tests/ --no-coverage vendor/bin/phpunit tests/ --no-coverage
build:
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
php:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
os:
- ubuntu-latest
- macos-latest
fail-fast: false
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: pecl, composer
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
- name: "Cache Composer packages"
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: "Install Dependencies"
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: "Run Build Tests (doctor)"
run: bin/spc doctor --auto-fix
- name: "Run Build Tests (download)"
run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php)" --with-php=${{ matrix.php }} --debug
- name: "Run Build Tests (build)"
run: bin/spc build "$(php src/globals/test-extensions.php)" --build-cli --build-micro --build-fpm --debug

View File

@@ -28,9 +28,11 @@ Build single static PHP binary, with PHP project together, with popular extensio
## 自托管直接下载 ## 自托管直接下载
如果你不想自行编译 PHP可以从本项目现有的示例 Action 下载 Artifact也可以从自托管的服务器下载[进入](https://dl.static-php.dev/static-php-cli/common/) 如果你不想自行编译 PHP可以从本项目现有的示例 Action 下载 Artifact也可以从自托管的服务器下载
> 自托管的服务器默认包含的扩展有:`bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip` - [扩展组合 - common](https://dl.static-php.dev/static-php-cli/common/)common 组合包含了约 [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) 个常用扩展,体积为 22MB 左右。
- [扩展组合 - bulk](https://dl.static-php.dev/static-php-cli/bulk/)bulk 组合包含了 [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) 个扩展,体积为 70MB 左右。
- [扩展组合 - minimal](https://dl.static-php.dev/static-php-cli/minimal/)minimal 组合包含了 [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) 个扩展,体积为 6MB 左右。
## 使用 static-php-cli 构建 PHP ## 使用 static-php-cli 构建 PHP
@@ -130,7 +132,7 @@ chmod +x bin/spc
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro ./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro
``` ```
你也可以使用参数 `--with-php=x.y` 来指定下载的 PHP 版本,目前支持 7.3 ~ 8.2 你也可以使用参数 `--with-php=x.y` 来指定下载的 PHP 版本,目前支持 7.3 ~ 8.3
```bash ```bash
# 优先考虑使用 >= 8.0 的 PHP 版本,因为 phpmicro 不支持在 PHP7 中构建 # 优先考虑使用 >= 8.0 的 PHP 版本,因为 phpmicro 不支持在 PHP7 中构建

View File

@@ -18,22 +18,26 @@ You can also use the micro binary file to combine php binary and php source code
[![Version](https://img.shields.io/badge/Version-2.0--rc8-pink.svg?style=flat-square)]() [![Version](https://img.shields.io/badge/Version-2.0--rc8-pink.svg?style=flat-square)]()
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)]() [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)]()
[![](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/build-linux-x86_64.yml?branch=refactor&label=Linux%20Build&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml) [![](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/tests.yml?branch=main&label=Build%20Test&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
[![](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/build-macos-x86_64.yml?branch=refactor&label=macOS%20Build&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml)
[![](https://img.shields.io/badge/Extension%20Counter-65+-yellow.svg?style=flat-square)]() [![](https://img.shields.io/badge/Extension%20Counter-65+-yellow.svg?style=flat-square)]([https://static-php.dev/](https://static-php.dev/en/guide/extensions.html))
[![](https://img.shields.io/github/search/crazywhalecc/static-php-cli/TODO?label=TODO%20Counter&style=flat-square)]() [![](https://img.shields.io/github/search/crazywhalecc/static-php-cli/TODO?label=TODO%20Counter&style=flat-square)]()
## Docs ## Documentation
The current README contains basic usage. For all the features of static-php-cli, The current README contains basic usage. For all the features of static-php-cli,
see <https://static-php.dev> . see <https://static-php.dev> .
## Direct Download ## Direct Download
If you don't want to compile yourself, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml), or from [self-hosted server](https://dl.static-php.dev/static-php-cli/common/). If you don't want to compile yourself, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml), or from self-hosted server.
> self-hosted server contains extensions: `bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip` Below are several precompiled static-php binaries with different extension combinations,
which can be downloaded directly according to your needs.
- [Extension-Combination - common](https://dl.static-php.dev/static-php-cli/common/): `common` contains about [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) commonly used extensions, and the size is about 22MB.
- [Extension-Combination - bulk](https://dl.static-php.dev/static-php-cli/bulk/): `bulk` contains [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) extensions and is about 70MB in size.
- [Extension-Combination - minimal](https://dl.static-php.dev/static-php-cli/minimal/): `minimal` contains [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) extensions and is about 6MB in size.
## Use static-php-cli to build PHP ## Use static-php-cli to build PHP
@@ -65,6 +69,8 @@ Please first select the extension you want to compile based on the extension lis
> If an extension you need is missing, you can submit an issue. > If an extension you need is missing, you can submit an issue.
Here is the current planned roadmap for extension support: [#152](https://github.com/crazywhalecc/static-php-cli/issues/152) .
### GitHub Actions Build ### GitHub Actions Build
Use GitHub Action to easily build a statically compiled PHP, Use GitHub Action to easily build a statically compiled PHP,
@@ -88,13 +94,12 @@ Currently, the platforms supported by `spc` binary are Linux and macOS.
Here's how to download from GitHub Actions: Here's how to download from GitHub Actions:
1. Enter [GitHub Actions](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml). 1. Enter [GitHub Actions](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml) or [self-hosted nightly builds](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/).
2. Select the latest build task, select `Artifacts`, and download the binary file of the corresponding platform. 2. If you download from GHA, select the latest build task, select `Artifacts`, and download the binary file of the corresponding platform.
3. Unzip the `.zip` file. After decompressing, add execution permissions to it: `chmod +x ./spc`. 3. If you download from GHA, unzip the `.zip` file. After decompressing, add execution permissions to it: `chmod +x ./spc`.
4. If you download from self-hosted server, download `spc-$os-$arch` file and just use it (don't forget `chmod +x`).
You can also download binaries from a self-hosted server: [enter](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/). > SPC single-file binary is built by phpmicro and box, and it doesn't need to install PHP. Just treat `spc` as a standalone executable.
> SPC single-file binary is built by phpmicro and box.
### Manual build (using source code) ### Manual build (using source code)
@@ -134,7 +139,7 @@ Basic usage for building php and micro with some extensions:
> If you are using the packaged `spc` binary, you need to replace `bin/spc` with `./spc` in the following commands. > If you are using the packaged `spc` binary, you need to replace `bin/spc` with `./spc` in the following commands.
```bash ```bash
# Check system tool dependencies, fix them automatically # Check system tool dependencies, fix them if possible
./bin/spc doctor ./bin/spc doctor
# fetch all libraries # fetch all libraries
./bin/spc download --all ./bin/spc download --all
@@ -144,7 +149,7 @@ Basic usage for building php and micro with some extensions:
./bin/spc build bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl --build-cli --build-micro ./bin/spc build bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl --build-cli --build-micro
``` ```
You can also use the parameter `--with-php=x.y` to specify the downloaded PHP version, currently supports 7.4 ~ 8.2: You can also use the parameter `--with-php=x.y` to specify the downloaded PHP version, currently supports 7.4 ~ 8.3:
```bash ```bash
# Using PHP >= 8.0 is recommended, because PHP7 cannot use phpmicro # Using PHP >= 8.0 is recommended, because PHP7 cannot use phpmicro
@@ -166,7 +171,7 @@ If anything goes wrong, use `--debug` option to display full terminal output:
./bin/spc fetch --all --debug ./bin/spc fetch --all --debug
``` ```
In addition, we build NTS by default. If you are going to build ZTS version, just add `--enable-zts` option. In addition, we build NTS (non-thread-safe) by default. If you are going to build ZTS version, just add `--enable-zts` option.
```bash ```bash
./bin/spc build openssl,pcntl --build-all --enable-zts ./bin/spc build openssl,pcntl --build-all --enable-zts
@@ -227,7 +232,7 @@ cat buildroot/bin/micro.sfx my-app.phar > my-app && chmod +x my-app
bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=system" --output my-app-2 bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=system" --output my-app-2
``` ```
> In some cases, PHAR files may not run in a micro environment. > In some cases, PHAR files may not run in a micro environment. Overall, micro is not production ready.
### Use fpm ### Use fpm
@@ -235,7 +240,7 @@ When using the parameter `--build-all` or `--build-fpm`,
the final compilation result will output a file named `./php-fpm`, the final compilation result will output a file named `./php-fpm`,
This file will be located in the path `buildroot/bin/`, simply copy it out for use. This file will be located in the path `buildroot/bin/`, simply copy it out for use.
In normal Linux distributions and macOS systems, the package manager will automatically generate a default fpm configuration file after installing php-fpm. In common Linux distributions and macOS systems, the package manager will automatically generate a default fpm configuration file after installing php-fpm.
Because php-fpm must specify a configuration file before running, the php-fpm compiled by this project will not have any configuration files, so you need to write `php-fpm.conf` and `pool.conf` configuration files yourself. Because php-fpm must specify a configuration file before running, the php-fpm compiled by this project will not have any configuration files, so you need to write `php-fpm.conf` and `pool.conf` configuration files yourself.
Specifying `php-fpm.conf` can use the command parameter `-y`, for example: `./php-fpm -y php-fpm.conf`. Specifying `php-fpm.conf` can use the command parameter `-y`, for example: `./php-fpm -y php-fpm.conf`.
@@ -261,10 +266,6 @@ If you want to contribute documentation, please go to [static-php/static-php-cli
Now there is a [static-php](https://github.com/static-php) organization, which is used to store the repo related to the project. Now there is a [static-php](https://github.com/static-php) organization, which is used to store the repo related to the project.
Part of the English document is written by me, and part is translated by Google,
and there may be inaccurate descriptions, strange or offensive expressions.
If you are a native English speaker, some corrections to the documentation are welcome.
## Sponsor this project ## Sponsor this project
You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md). You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md).
@@ -272,11 +273,13 @@ You can sponsor my project on [this page](https://github.com/crazywhalecc/crazyw
## Open-Source License ## Open-Source License
This project itself is based on MIT License, This project itself is based on MIT License,
some newly added extensions and dependencies may originate from the following projects (including but not limited to), some newly added extensions and dependencies may originate from the the other projects,
and the headers of these code files will also be given additional instructions LICENSE and AUTHOR: and the headers of these code files will also be given additional instructions LICENSE and AUTHOR.
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs) (Mulun Permissive License) These are similar projects:
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli) (Apache 2.0 LICENSE+SWOOLE-CLI LICENSE)
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs)
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli)
Due to the special nature of this project, Due to the special nature of this project,
many other open source projects such as curl and protobuf will be used during the project compilation process, many other open source projects such as curl and protobuf will be used during the project compilation process,
@@ -285,8 +288,3 @@ and they all have their own open source licenses.
Please use the `bin/spc dump-license` command to export the open source licenses used in the project after compilation, Please use the `bin/spc dump-license` command to export the open source licenses used in the project after compilation,
and comply with the corresponding project's LICENSE. and comply with the corresponding project's LICENSE.
## Advanced
The refactoring branch of this project is written modularly.
If you are interested in this project and want to join the development,
you can refer to the [Contribution Guide](https://static-php.dev) of the documentation to contribute code or documentation.

View File

@@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
__PROJECT__=$(cd "${__DIR__}"/../ && pwd) __PROJECT__=$(cd "${__DIR__}"/../ && pwd)
# set download dir # set download dir
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.10-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz" __PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar" __COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
# use china mirror # use china mirror
@@ -46,7 +46,7 @@ done
case "$mirror" in case "$mirror" in
china) china)
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.10-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz" __PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
__COMPOSER_URL__="https://mirrors.aliyun.com/composer/composer.phar" __COMPOSER_URL__="https://mirrors.aliyun.com/composer/composer.phar"
;; ;;

View File

@@ -73,6 +73,7 @@ RUN apk update; \
git \ git \
jq \ jq \
libgcc \ libgcc \
libtool \
libstdc++ \ libstdc++ \
linux-headers \ linux-headers \
m4 \ m4 \

236
composer.lock generated
View File

@@ -8,16 +8,16 @@
"packages": [ "packages": [
{ {
"name": "illuminate/collections", "name": "illuminate/collections",
"version": "v10.29.0", "version": "v10.33.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/collections.git", "url": "https://github.com/illuminate/collections.git",
"reference": "bb8784ce913bd46f944b4bd67cd857f40d9cfe68" "reference": "766a3b6c3e5c8011b037a147266dcf7f93b21223"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/collections/zipball/bb8784ce913bd46f944b4bd67cd857f40d9cfe68", "url": "https://api.github.com/repos/illuminate/collections/zipball/766a3b6c3e5c8011b037a147266dcf7f93b21223",
"reference": "bb8784ce913bd46f944b4bd67cd857f40d9cfe68", "reference": "766a3b6c3e5c8011b037a147266dcf7f93b21223",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -59,11 +59,11 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2023-10-10T12:55:25+00:00" "time": "2023-11-20T15:45:45+00:00"
}, },
{ {
"name": "illuminate/conditionable", "name": "illuminate/conditionable",
"version": "v10.29.0", "version": "v10.33.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/conditionable.git", "url": "https://github.com/illuminate/conditionable.git",
@@ -109,16 +109,16 @@
}, },
{ {
"name": "illuminate/contracts", "name": "illuminate/contracts",
"version": "v10.29.0", "version": "v10.33.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/contracts.git", "url": "https://github.com/illuminate/contracts.git",
"reference": "6c39fba7b2311e28f5c6ac7d729e3d49a2a98406" "reference": "f6bf37a272fda164f6c451407c99f820eb1eb95b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/contracts/zipball/6c39fba7b2311e28f5c6ac7d729e3d49a2a98406", "url": "https://api.github.com/repos/illuminate/contracts/zipball/f6bf37a272fda164f6c451407c99f820eb1eb95b",
"reference": "6c39fba7b2311e28f5c6ac7d729e3d49a2a98406", "reference": "f6bf37a272fda164f6c451407c99f820eb1eb95b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -153,11 +153,11 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2023-09-05T19:07:46+00:00" "time": "2023-10-30T00:59:22+00:00"
}, },
{ {
"name": "illuminate/macroable", "name": "illuminate/macroable",
"version": "v10.29.0", "version": "v10.33.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/macroable.git", "url": "https://github.com/illuminate/macroable.git",
@@ -203,16 +203,16 @@
}, },
{ {
"name": "laravel/prompts", "name": "laravel/prompts",
"version": "v0.1.12", "version": "v0.1.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/prompts.git", "url": "https://github.com/laravel/prompts.git",
"reference": "b35f249028c22016e45e48626e19e5d42fd827ff" "reference": "e1379d8ead15edd6cc4369c22274345982edc95a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/b35f249028c22016e45e48626e19e5d42fd827ff", "url": "https://api.github.com/repos/laravel/prompts/zipball/e1379d8ead15edd6cc4369c22274345982edc95a",
"reference": "b35f249028c22016e45e48626e19e5d42fd827ff", "reference": "e1379d8ead15edd6cc4369c22274345982edc95a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -254,9 +254,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/laravel/prompts/issues", "issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.1.12" "source": "https://github.com/laravel/prompts/tree/v0.1.13"
}, },
"time": "2023-10-18T14:18:57+00:00" "time": "2023-10-27T13:53:59+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",
@@ -414,16 +414,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v6.3.4", "version": "v6.3.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", "url": "https://api.github.com/repos/symfony/console/zipball/0d14a9f6d04d4ac38a8cea1171f4554e325dae92",
"reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -484,7 +484,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v6.3.4" "source": "https://github.com/symfony/console/tree/v6.3.8"
}, },
"funding": [ "funding": [
{ {
@@ -500,11 +500,11 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-08-16T10:10:12+00:00" "time": "2023-10-31T08:09:35+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
"version": "v3.3.0", "version": "v3.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git", "url": "https://github.com/symfony/deprecation-contracts.git",
@@ -551,7 +551,7 @@
"description": "A generic function and convention to trigger deprecation notices", "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
}, },
"funding": [ "funding": [
{ {
@@ -901,16 +901,16 @@
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
"version": "v3.3.0", "version": "v3.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -963,7 +963,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/service-contracts/tree/v3.3.0" "source": "https://github.com/symfony/service-contracts/tree/v3.4.0"
}, },
"funding": [ "funding": [
{ {
@@ -979,20 +979,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-05-23T14:45:45+00:00" "time": "2023-07-30T20:28:31+00:00"
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v6.3.5", "version": "v6.3.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339" "reference": "13880a87790c76ef994c91e87efb96134522577a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339", "url": "https://api.github.com/repos/symfony/string/zipball/13880a87790c76ef994c91e87efb96134522577a",
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339", "reference": "13880a87790c76ef994c91e87efb96134522577a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1049,7 +1049,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v6.3.5" "source": "https://github.com/symfony/string/tree/v6.3.8"
}, },
"funding": [ "funding": [
{ {
@@ -1065,7 +1065,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-09-18T10:38:32+00:00" "time": "2023-11-09T08:28:21+00:00"
}, },
{ {
"name": "zhamao/logger", "name": "zhamao/logger",
@@ -1691,16 +1691,16 @@
}, },
{ {
"name": "captainhook/captainhook", "name": "captainhook/captainhook",
"version": "5.18.2", "version": "5.18.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/captainhookphp/captainhook.git", "url": "https://github.com/captainhookphp/captainhook.git",
"reference": "61c24442f71ea216e9e172861d48d7676439dd18" "reference": "b7bc503a40ccfe80ea9638e4921b4697669d725f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/61c24442f71ea216e9e172861d48d7676439dd18", "url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/b7bc503a40ccfe80ea9638e4921b4697669d725f",
"reference": "61c24442f71ea216e9e172861d48d7676439dd18", "reference": "b7bc503a40ccfe80ea9638e4921b4697669d725f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1762,7 +1762,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/captainhookphp/captainhook/issues", "issues": "https://github.com/captainhookphp/captainhook/issues",
"source": "https://github.com/captainhookphp/captainhook/tree/5.18.2" "source": "https://github.com/captainhookphp/captainhook/tree/5.18.3"
}, },
"funding": [ "funding": [
{ {
@@ -1770,7 +1770,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-10-16T15:13:42+00:00" "time": "2023-11-05T13:56:19+00:00"
}, },
{ {
"name": "captainhook/plugin-composer", "name": "captainhook/plugin-composer",
@@ -2247,16 +2247,16 @@
}, },
{ {
"name": "filp/whoops", "name": "filp/whoops",
"version": "2.15.3", "version": "2.15.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/filp/whoops.git", "url": "https://github.com/filp/whoops.git",
"reference": "c83e88a30524f9360b11f585f71e6b17313b7187" "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/c83e88a30524f9360b11f585f71e6b17313b7187", "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546",
"reference": "c83e88a30524f9360b11f585f71e6b17313b7187", "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2306,7 +2306,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/filp/whoops/issues", "issues": "https://github.com/filp/whoops/issues",
"source": "https://github.com/filp/whoops/tree/2.15.3" "source": "https://github.com/filp/whoops/tree/2.15.4"
}, },
"funding": [ "funding": [
{ {
@@ -2314,54 +2314,54 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-07-13T12:00:00+00:00" "time": "2023-11-03T12:00:00+00:00"
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.37.1", "version": "v3.40.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "c3fe76976081ab871aa654e872da588077e19679" "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/c3fe76976081ab871aa654e872da588077e19679", "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/27d2b3265b5d550ec411b4319967ae7cfddfb2e0",
"reference": "c3fe76976081ab871aa654e872da588077e19679", "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/semver": "^3.3", "composer/semver": "^3.4",
"composer/xdebug-handler": "^3.0.3", "composer/xdebug-handler": "^3.0.3",
"ext-json": "*", "ext-json": "*",
"ext-tokenizer": "*", "ext-tokenizer": "*",
"php": "^7.4 || ^8.0", "php": "^7.4 || ^8.0",
"sebastian/diff": "^4.0 || ^5.0", "sebastian/diff": "^4.0 || ^5.0",
"symfony/console": "^5.4 || ^6.0", "symfony/console": "^5.4 || ^6.0 || ^7.0",
"symfony/event-dispatcher": "^5.4 || ^6.0", "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
"symfony/finder": "^5.4 || ^6.0", "symfony/finder": "^5.4 || ^6.0 || ^7.0",
"symfony/options-resolver": "^5.4 || ^6.0", "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
"symfony/polyfill-mbstring": "^1.27", "symfony/polyfill-mbstring": "^1.28",
"symfony/polyfill-php80": "^1.27", "symfony/polyfill-php80": "^1.28",
"symfony/polyfill-php81": "^1.27", "symfony/polyfill-php81": "^1.28",
"symfony/process": "^5.4 || ^6.0", "symfony/process": "^5.4 || ^6.0 || ^7.0",
"symfony/stopwatch": "^5.4 || ^6.0" "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
}, },
"require-dev": { "require-dev": {
"facile-it/paraunit": "^1.3 || ^2.0", "facile-it/paraunit": "^1.3 || ^2.0",
"justinrainbow/json-schema": "^5.2", "justinrainbow/json-schema": "^5.2",
"keradus/cli-executor": "^2.0", "keradus/cli-executor": "^2.1",
"mikey179/vfsstream": "^1.6.11", "mikey179/vfsstream": "^1.6.11",
"php-coveralls/php-coveralls": "^2.5.3", "php-coveralls/php-coveralls": "^2.7",
"php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/accessible-object": "^1.1",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
"phpspec/prophecy": "^1.16", "phpspec/prophecy": "^1.17",
"phpspec/prophecy-phpunit": "^2.0", "phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.6",
"symfony/phpunit-bridge": "^6.2.3", "symfony/phpunit-bridge": "^6.3.8 || ^7.0",
"symfony/yaml": "^5.4 || ^6.0" "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
}, },
"suggest": { "suggest": {
"ext-dom": "For handling output formats in XML", "ext-dom": "For handling output formats in XML",
@@ -2399,7 +2399,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.37.1" "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.40.0"
}, },
"funding": [ "funding": [
{ {
@@ -2407,7 +2407,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-10-29T20:51:23+00:00" "time": "2023-11-26T09:25:53+00:00"
}, },
{ {
"name": "humbug/box", "name": "humbug/box",
@@ -2521,16 +2521,16 @@
}, },
{ {
"name": "humbug/php-scoper", "name": "humbug/php-scoper",
"version": "0.18.4", "version": "0.18.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/humbug/php-scoper.git", "url": "https://github.com/humbug/php-scoper.git",
"reference": "d79c1486537280c21c907e9a8a610eceb391407f" "reference": "9386a0af946f175d7a1ebfb68851bc2bb8ad7858"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/humbug/php-scoper/zipball/d79c1486537280c21c907e9a8a610eceb391407f", "url": "https://api.github.com/repos/humbug/php-scoper/zipball/9386a0af946f175d7a1ebfb68851bc2bb8ad7858",
"reference": "d79c1486537280c21c907e9a8a610eceb391407f", "reference": "9386a0af946f175d7a1ebfb68851bc2bb8ad7858",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2548,7 +2548,7 @@
"bamarni/composer-bin-plugin": "^1.1", "bamarni/composer-bin-plugin": "^1.1",
"ergebnis/composer-normalize": "^2.28", "ergebnis/composer-normalize": "^2.28",
"fidry/makefile": "^1.0", "fidry/makefile": "^1.0",
"humbug/box": "^4.0", "humbug/box": "^4.5.1",
"phpspec/prophecy-phpunit": "^2.0", "phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.0", "phpunit/phpunit": "^9.0",
"symfony/yaml": "^6.1" "symfony/yaml": "^6.1"
@@ -2598,9 +2598,9 @@
"description": "Prefixes all PHP namespaces in a file or directory.", "description": "Prefixes all PHP namespaces in a file or directory.",
"support": { "support": {
"issues": "https://github.com/humbug/php-scoper/issues", "issues": "https://github.com/humbug/php-scoper/issues",
"source": "https://github.com/humbug/php-scoper/tree/0.18.4" "source": "https://github.com/humbug/php-scoper/tree/0.18.7"
}, },
"time": "2023-10-20T17:14:04+00:00" "time": "2023-11-04T18:01:12+00:00"
}, },
{ {
"name": "jetbrains/phpstorm-stubs", "name": "jetbrains/phpstorm-stubs",
@@ -2722,16 +2722,16 @@
}, },
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
"version": "v1.3.2", "version": "v1.3.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/serializable-closure.git", "url": "https://github.com/laravel/serializable-closure.git",
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c" "reference": "3dbf8a8e914634c48d389c1234552666b3d43754"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c", "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754",
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c", "reference": "3dbf8a8e914634c48d389c1234552666b3d43754",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2778,7 +2778,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues", "issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure" "source": "https://github.com/laravel/serializable-closure"
}, },
"time": "2023-10-17T13:38:16+00:00" "time": "2023-11-08T14:08:06+00:00"
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
@@ -3477,16 +3477,16 @@
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
"version": "1.24.2", "version": "1.24.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git", "url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "bcad8d995980440892759db0c32acae7c8e79442" "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"reference": "bcad8d995980440892759db0c32acae7c8e79442", "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3518,22 +3518,22 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types", "description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": { "support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues", "issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.4"
}, },
"time": "2023-09-26T12:28:12+00:00" "time": "2023-11-26T18:29:22+00:00"
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.10.40", "version": "1.10.44",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d" "reference": "bf84367c53a23f759513985c54ffe0d0c249825b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/93c84b5bf7669920d823631e39904d69b9c7dc5d", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/bf84367c53a23f759513985c54ffe0d0c249825b",
"reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d", "reference": "bf84367c53a23f759513985c54ffe0d0c249825b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3582,20 +3582,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-10-30T14:48:31+00:00" "time": "2023-11-21T16:30:46+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "10.1.7", "version": "10.1.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "355324ca4980b8916c18b9db29f3ef484078f26e" "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/355324ca4980b8916c18b9db29f3ef484078f26e", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735",
"reference": "355324ca4980b8916c18b9db29f3ef484078f26e", "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3652,7 +3652,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.7" "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9"
}, },
"funding": [ "funding": [
{ {
@@ -3660,7 +3660,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-10-04T15:34:17+00:00" "time": "2023-11-23T12:23:20+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@@ -5292,7 +5292,7 @@
}, },
{ {
"name": "symfony/event-dispatcher-contracts", "name": "symfony/event-dispatcher-contracts",
"version": "v3.3.0", "version": "v3.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git", "url": "https://github.com/symfony/event-dispatcher-contracts.git",
@@ -5348,7 +5348,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0"
}, },
"funding": [ "funding": [
{ {
@@ -5685,16 +5685,16 @@
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v6.3.6", "version": "v6.3.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
"reference": "999ede244507c32b8e43aebaa10e9fce20de7c97" "reference": "81acabba9046550e89634876ca64bfcd3c06aa0a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/999ede244507c32b8e43aebaa10e9fce20de7c97", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/81acabba9046550e89634876ca64bfcd3c06aa0a",
"reference": "999ede244507c32b8e43aebaa10e9fce20de7c97", "reference": "81acabba9046550e89634876ca64bfcd3c06aa0a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5749,7 +5749,7 @@
"dump" "dump"
], ],
"support": { "support": {
"source": "https://github.com/symfony/var-dumper/tree/v6.3.6" "source": "https://github.com/symfony/var-dumper/tree/v6.3.8"
}, },
"funding": [ "funding": [
{ {
@@ -5765,7 +5765,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-10-12T18:45:56+00:00" "time": "2023-11-08T10:42:36+00:00"
}, },
{ {
"name": "thecodingmachine/safe", "name": "thecodingmachine/safe",
@@ -5908,16 +5908,16 @@
}, },
{ {
"name": "theseer/tokenizer", "name": "theseer/tokenizer",
"version": "1.2.1", "version": "1.2.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/theseer/tokenizer.git", "url": "https://github.com/theseer/tokenizer.git",
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5946,7 +5946,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": { "support": {
"issues": "https://github.com/theseer/tokenizer/issues", "issues": "https://github.com/theseer/tokenizer/issues",
"source": "https://github.com/theseer/tokenizer/tree/1.2.1" "source": "https://github.com/theseer/tokenizer/tree/1.2.2"
}, },
"funding": [ "funding": [
{ {
@@ -5954,7 +5954,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-07-28T10:34:58+00:00" "time": "2023-11-20T00:12:19+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",

View File

@@ -16,6 +16,14 @@
"calendar": { "calendar": {
"type": "builtin" "type": "builtin"
}, },
"crypto": {
"type": "external",
"arg-type": "with",
"source": "ext-crypto",
"lib-depends": [
"openssl"
]
},
"ctype": { "ctype": {
"type": "builtin" "type": "builtin"
}, },
@@ -122,6 +130,10 @@
"libiconv" "libiconv"
] ]
}, },
"igbinary": {
"type": "external",
"source": "igbinary"
},
"imagick": { "imagick": {
"type": "external", "type": "external",
"source": "ext-imagick", "source": "ext-imagick",
@@ -164,6 +176,14 @@
"openssl" "openssl"
] ]
}, },
"leveldb": {
"type": "external",
"arg-type": "with-prefix",
"source": "pmmp-leveldb",
"lib-depends": [
"leveldb"
]
},
"mbregex": { "mbregex": {
"type": "builtin", "type": "builtin",
"arg-type": "custom", "arg-type": "custom",
@@ -213,6 +233,10 @@
"zlib" "zlib"
] ]
}, },
"morton": {
"type": "external",
"source": "ext-morton"
},
"mysqli": { "mysqli": {
"type": "builtin", "type": "builtin",
"arg-type": "with", "arg-type": "with",
@@ -228,7 +252,8 @@
] ]
}, },
"opcache": { "opcache": {
"type": "builtin" "type": "builtin",
"arg-type": "custom"
}, },
"openssl": { "openssl": {
"type": "builtin", "type": "builtin",
@@ -241,6 +266,13 @@
"zlib" "zlib"
] ]
}, },
"password-argon2": {
"type": "builtin",
"arg-type": "with-prefix",
"lib-depends": [
"libargon2"
]
},
"pcntl": { "pcntl": {
"type": "builtin", "type": "builtin",
"unix-only": true "unix-only": true
@@ -291,6 +323,16 @@
"zlib" "zlib"
] ]
}, },
"pmmp-chunkutils2": {
"type": "external",
"source": "pmmp-chunkutils2",
"arg-type": "custom",
"cpp-extension": true
},
"pmmpthread": {
"type": "external",
"source": "pmmpthread"
},
"posix": { "posix": {
"type": "builtin", "type": "builtin",
"unix-only": true "unix-only": true
@@ -306,6 +348,11 @@
"aspell" "aspell"
] ]
}, },
"rar": {
"type": "external",
"source": "rar",
"cpp-extension": true
},
"readline": { "readline": {
"type": "builtin", "type": "builtin",
"arg-type": "with-prefix", "arg-type": "with-prefix",
@@ -430,7 +477,7 @@
}, },
"tidy": { "tidy": {
"type": "builtin", "type": "builtin",
"arg-type": "with", "arg-type": "with-prefix",
"lib-depends": [ "lib-depends": [
"tidy" "tidy"
] ]

View File

@@ -156,12 +156,26 @@
"liblber.a", "liblber.a",
"libldap.a" "libldap.a"
], ],
"lib-suggests": [ "lib-depends": [
"openssl", "openssl",
"zlib",
"gmp", "gmp",
"libsodium" "libsodium"
] ]
}, },
"leveldb": {
"source": "leveldb",
"static-libs-unix": [
"libleveldb.a"
],
"cpp-library": true
},
"libargon2": {
"source": "libargon2",
"static-libs-unix": [
"libargon2.a"
]
},
"libavif": { "libavif": {
"source": "libavif", "source": "libavif",
"static-libs-unix": [ "static-libs-unix": [
@@ -483,6 +497,12 @@
"sqlite3ext.h" "sqlite3ext.h"
] ]
}, },
"tidy": {
"source": "tidy",
"static-libs-unix": [
"libtidy.a"
]
},
"xz": { "xz": {
"source": "xz", "source": "xz",
"static-libs-unix": [ "static-libs-unix": [

View File

@@ -42,6 +42,16 @@
"path": "COPYING" "path": "COPYING"
} }
}, },
"ext-crypto": {
"type": "git",
"path": "php-src/ext/crypto",
"rev": "master",
"url": "https://github.com/bukka/php-crypto.git",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-event": { "ext-event": {
"type": "url", "type": "url",
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz", "url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
@@ -80,6 +90,16 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"ext-morton": {
"type": "git",
"path": "php-src/ext/morton",
"rev": "master",
"url": "https://github.com/pmmp/ext-morton.git",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-snappy": { "ext-snappy": {
"type": "git", "type": "git",
"path": "php-src/ext/snappy", "path": "php-src/ext/snappy",
@@ -136,6 +156,15 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"igbinary": {
"type": "ghtar",
"path": "php-src/ext/igbinary",
"repo": "igbinary/igbinary",
"license": {
"type": "file",
"path": "COPYING"
}
},
"imagemagick": { "imagemagick": {
"type": "ghtar", "type": "ghtar",
"repo": "ImageMagick/ImageMagick", "repo": "ImageMagick/ImageMagick",
@@ -172,6 +201,24 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"leveldb": {
"type": "git",
"rev": "mojang-compatible",
"url": "https://github.com/pmmp/leveldb.git",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libargon2": {
"type": "git",
"rev": "master",
"url": "https://github.com/mpociot/phc-winner-argon2",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libavif": { "libavif": {
"type": "ghtar", "type": "ghtar",
"repo": "AOMediaCodec/libavif", "repo": "AOMediaCodec/libavif",
@@ -376,17 +423,44 @@
} }
}, },
"pkg-config": { "pkg-config": {
"type": "filelist", "type": "url",
"url": "https://pkgconfig.freedesktop.org/releases/", "url": "https://dl.static-php.dev/static-php-cli/deps/pkg-config/pkg-config-0.29.2.tar.gz",
"regex": "/href=\"(?<file>pkg-config-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"license": { "license": {
"type": "file", "type": "file",
"path": "COPYING" "path": "COPYING"
} }
}, },
"pmmp-chunkutils2": {
"type": "ghtar",
"path": "php-src/ext/chunkutils2",
"repo": "pmmp/ext-chunkutils2",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"pmmp-leveldb": {
"type": "git",
"path": "php-src/ext/leveldb",
"rev": "pmmp-mojang-compatible",
"url": "https://github.com/pmmp/php-leveldb.git",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"pmmpthread": {
"type": "ghtar",
"path": "php-src/ext/pmmpthread",
"repo": "pmmp/ext-pmmpthread",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"postgresql": { "postgresql": {
"type": "url", "type": "url",
"url": "https://ftp.postgresql.org/pub/source/v15.1/postgresql-15.1.tar.gz", "url": "https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.gz",
"license": { "license": {
"type": "file", "type": "file",
"path": "COPYRIGHT" "path": "COPYRIGHT"
@@ -402,6 +476,16 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"rar": {
"type": "git",
"url": "https://github.com/static-php/php-rar.git",
"path": "php-src/ext/rar",
"rev": "issue-php82",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"readline": { "readline": {
"type": "filelist", "type": "filelist",
"url": "https://ftp.gnu.org/pub/gnu/readline/", "url": "https://ftp.gnu.org/pub/gnu/readline/",
@@ -459,6 +543,15 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"tidy": {
"type": "url",
"url": "https://github.com/htacg/tidy-html5/archive/refs/tags/5.8.0.tar.gz",
"filename": "tidy-html5.tgz",
"license": {
"type": "file",
"path": "README/LICENSE.md"
}
},
"xlswriter": { "xlswriter": {
"type": "url", "type": "url",
"url": "https://pecl.php.net/get/xlswriter", "url": "https://pecl.php.net/get/xlswriter",

View File

@@ -23,7 +23,7 @@ use Symfony\Component\Console\Command\ListCommand;
*/ */
final class ConsoleApplication extends Application final class ConsoleApplication extends Application
{ {
public const VERSION = '2.0.0-rc8'; public const VERSION = '2.0.0-rc9';
public function __construct() public function __construct()
{ {

View File

@@ -259,6 +259,19 @@ abstract class BuilderBase
throw new RuntimeException('PHP version file format is malformed, please remove it and download again'); throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
} }
public function getPHPVersion(): string
{
if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) {
throw new WrongUsageException('PHP source files are not available, you need to download them first');
}
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
if (preg_match('/PHP_VERSION "(.*)"/', $file, $match) !== 0) {
return $match[1];
}
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
}
/** /**
* Get build type name string to display. * Get build type name string to display.
* *

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace SPC\builder\extension; namespace SPC\builder\extension;
use SPC\builder\Extension; use SPC\builder\Extension;
use SPC\builder\linux\LinuxBuilder;
use SPC\util\CustomExt; use SPC\util\CustomExt;
#[CustomExt('imagick')] #[CustomExt('imagick')]
@@ -14,7 +15,9 @@ class imagick extends Extension
{ {
// imagick may call omp_pause_all which requires -lgomp // imagick may call omp_pause_all which requires -lgomp
$extra_libs = $this->builder->getOption('extra-libs', ''); $extra_libs = $this->builder->getOption('extra-libs', '');
$extra_libs .= ' -lgomp '; if ($this->builder instanceof LinuxBuilder) {
$extra_libs .= ' -lgomp ';
}
$this->builder->setOption('extra-libs', $extra_libs); $this->builder->setOption('extra-libs', $extra_libs);
return true; return true;
} }

View File

@@ -5,11 +5,20 @@ declare(strict_types=1);
namespace SPC\builder\extension; namespace SPC\builder\extension;
use SPC\builder\Extension; use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt; use SPC\util\CustomExt;
#[CustomExt('mongodb')] #[CustomExt('mongodb')]
class mongodb extends Extension class mongodb extends Extension
{ {
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'if test -z "$PHP_CONFIG"; then', 'if false; then');
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'PHP_MONGODB_PHP_VERSION=`${PHP_CONFIG} --version`', 'PHP_MONGODB_PHP_VERSION=' . $this->builder->getPHPVersion());
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'PHP_MONGODB_PHP_VERSION_ID=`${PHP_CONFIG} --vernum`', 'PHP_MONGODB_PHP_VERSION_ID=' . $this->builder->getPHPVersionID());
return true;
}
public function getUnixConfigureArg(): string public function getUnixConfigureArg(): string
{ {
$arg = ' --enable-mongodb '; $arg = ' --enable-mongodb ';

View File

@@ -5,11 +5,25 @@ declare(strict_types=1);
namespace SPC\builder\extension; namespace SPC\builder\extension;
use SPC\builder\Extension; use SPC\builder\Extension;
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
use SPC\util\CustomExt; use SPC\util\CustomExt;
#[CustomExt('opcache')] #[CustomExt('opcache')]
class opcache extends Extension class opcache extends Extension
{ {
/**
* @throws WrongUsageException
* @throws RuntimeException
*/
public function getUnixConfigureArg(): string
{
if ($this->builder->getPHPVersionID() < 80000) {
throw new WrongUsageException('Statically compiled PHP with Zend Opcache only available for PHP >= 8.0 !');
}
return '--enable-opcache';
}
public function getDistName(): string public function getDistName(): string
{ {
return 'Zend Opcache'; return 'Zend Opcache';

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\exception\RuntimeException;
use SPC\util\CustomExt;
#[CustomExt('password-argon2')]
class password_argon2 extends Extension
{
public function runCliCheck(): void
{
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
if ($ret !== 0) {
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
}
}
}

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('pmmp-chunkutils2')]
class pmmp_chunkutils2 extends Extension
{
public function getDistName(): string
{
return 'chunkutils2';
}
public function getUnixConfigureArg(): string
{
return '--enable-chunkutils2';
}
}

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('sodium')]
class sodium extends Extension
{
public function patchBeforeBuildconf(): bool
{
// bypass error: unknown warning option '-Wno-logical-op' for macOS
return $this->removeLineContainingString();
}
private function removeLineContainingString(): bool
{
$path = SOURCE_PATH . '/php-src/ext/sodium/config.m4';
$search = '-Wno-logical-op';
if (!file_exists($path)) {
return false;
}
$content = file_get_contents($path);
$lines = preg_split('/\r\n|\n/', $content);
$filteredLines = array_filter($lines, function ($line) use ($search) {
return strpos($line, $search) === false;
});
$newContent = implode("\n", $filteredLines);
file_put_contents($path, $newContent);
return true;
}
}

View File

@@ -17,7 +17,8 @@ class swoole extends Extension
$arg .= ' --disable-swoole-pgsql'; $arg .= ' --disable-swoole-pgsql';
$arg .= $this->builder->getLib('openssl') ? ' --enable-openssl' : ' --disable-openssl --without-openssl'; $arg .= $this->builder->getLib('openssl') ? ' --enable-openssl' : ' --disable-openssl --without-openssl';
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ' --disable-brotli'; $arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ' --disable-brotli';
$arg .= $this->builder->getExt('curl') ? ' --enable-swoole-curl' : ' --disable-swoole-curl'; // swoole curl hook is buggy for php 8.0
$arg .= $this->builder->getExt('curl') && $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
return $arg; return $arg;
} }
} }

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class leveldb extends LinuxLibraryBase
{
use \SPC\builder\unix\library\leveldb;
public const NAME = 'leveldb';
}

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
use SPC\exception\WrongUsageException;
use SPC\store\FileSystem;
class libargon2 extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libargon2;
public const NAME = 'libargon2';
public function patchBeforeBuild(): bool
{
// detect libsodium (The libargon2 conflicts with the libsodium library.)
if ($this->builder->getLib('libsodium') !== null) {
throw new WrongUsageException('libargon2 (required by password-argon2) conflicts with the libsodium library !');
}
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'LIBRARY_REL ?= lib/x86_64-linux-gnu', 'LIBRARY_REL ?= lib');
return true;
}
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class tidy extends LinuxLibraryBase
{
use \SPC\builder\unix\library\tidy;
public const NAME = 'tidy';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class leveldb extends MacOSLibraryBase
{
use \SPC\builder\unix\library\leveldb;
public const NAME = 'leveldb';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class libargon2 extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libargon2;
public const NAME = 'libargon2';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class tidy extends MacOSLibraryBase
{
use \SPC\builder\unix\library\tidy;
public const NAME = 'tidy';
}

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace SPC\builder\unix\library; namespace SPC\builder\unix\library;
use SPC\builder\linux\library\LinuxLibraryBase; use SPC\builder\linux\library\LinuxLibraryBase;
use SPC\builder\macos\library\MacOSLibraryBase;
use SPC\exception\FileSystemException; use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException; use SPC\exception\RuntimeException;
use SPC\store\FileSystem; use SPC\store\FileSystem;
@@ -39,8 +40,12 @@ trait imagemagick
} }
$ldflags = $this instanceof LinuxLibraryBase ? ('LDFLAGS="-static" ') : ''; $ldflags = $this instanceof LinuxLibraryBase ? ('LDFLAGS="-static" ') : '';
// libxml iconv patch
$required_libs .= $this instanceof MacOSLibraryBase ? (' -liconv') : '';
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
->exec( ->exec(
'PKG_CONFIG="$PKG_CONFIG --static" ' .
$ldflags . $ldflags .
"LIBS='{$required_libs}' " . "LIBS='{$required_libs}' " .
'./configure ' . './configure ' .

View File

@@ -15,6 +15,8 @@ trait ldap
$alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : ''; $alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : '';
// libsodium support // libsodium support
$alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : ''; $alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '';
f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config');
f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
->exec( ->exec(
$this->builder->makeAutoconfFlags(AUTOCONF_LDFLAGS | AUTOCONF_CPPFLAGS) . $this->builder->makeAutoconfFlags(AUTOCONF_LDFLAGS | AUTOCONF_CPPFLAGS) .

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
trait leveldb
{
/**
* @throws FileSystemException
* @throws RuntimeException
*/
protected function build(): void
{
// CMake needs a clean build directory
FileSystem::resetDir($this->source_dir . '/build');
// Start build
shell()->cd($this->source_dir . '/build')
->exec(
"cmake {$this->builder->makeCmakeArgs()} " .
'-DBUILD_SHARED_LIBS=OFF ' .
'-DLEVELDB_BUILD_TESTS=OFF ' .
'-DLEVELDB_BUILD_BENCHMARKS=OFF ' .
'..'
)
->exec("cmake --build . -j {$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
}
}

View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\store\FileSystem;
trait libargon2
{
protected function build()
{
shell()->cd($this->source_dir)
->exec("make PREFIX='' clean")
->exec("make -j{$this->builder->concurrency} PREFIX=''")
->exec("make install PREFIX='' DESTDIR=" . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['libargon2.pc']);
foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) {
if (str_starts_with($filename, 'libargon2') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {
unlink(BUILD_ROOT_PATH . '/lib/' . $filename);
}
}
}
}

View File

@@ -20,16 +20,22 @@ trait postgresql
{ {
$builddir = BUILD_ROOT_PATH; $builddir = BUILD_ROOT_PATH;
$envs = ''; $envs = '';
$packages = 'openssl zlib readline libxml-2.0 zlib'; $packages = 'zlib openssl readline libxml-2.0';
$optional_packages = [ $optional_packages = [
'zstd' => 'libzstd', 'zstd' => 'libzstd',
'ldap' => 'ldap', // 'ldap' => 'ldap',
'libxslt' => 'libxslt', 'libxslt' => 'libxslt',
'icu' => 'icu-i18n', 'icu' => 'icu-i18n',
]; ];
f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config');
f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
foreach ($optional_packages as $lib => $pkg) { foreach ($optional_packages as $lib => $pkg) {
if ($this->getBuilder()->getLib($lib)) { if ($this->getBuilder()->getLib($lib)) {
$packages .= ' ' . $pkg; $packages .= ' ' . $pkg;
$output = shell()->execWithResult("pkg-config --static {$pkg}");
logger()->info(var_export($output[1], true));
} }
} }
@@ -58,8 +64,8 @@ trait postgresql
# 有静态链接配置 参考文件: src/interfaces/libpq/Makefile # 有静态链接配置 参考文件: src/interfaces/libpq/Makefile
shell()->cd($this->source_dir . '/build') shell()->cd($this->source_dir . '/build')
->exec('sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile') ->exec('sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile')
->exec('sed -i.backup "293 s/^/#$/" ../src/Makefile.shlib') ->exec('sed -i.backup "278 s/^/# /" ../src/Makefile.shlib')
->exec('sed -i.backup "441 s/^/#$/" ../src/Makefile.shlib'); ->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib');
// configure // configure
shell()->cd($this->source_dir . '/build') shell()->cd($this->source_dir . '/build')
@@ -72,7 +78,7 @@ trait postgresql
'--with-readline ' . '--with-readline ' .
'--with-libxml ' . '--with-libxml ' .
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') . ($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') . '--without-ldap ' .
($this->builder->getLib('libxslt') ? '--with-libxslt ' : '--without-libxslt ') . ($this->builder->getLib('libxslt') ? '--with-libxslt ' : '--without-libxslt ') .
($this->builder->getLib('zstd') ? '--with-zstd ' : '--without-zstd ') . ($this->builder->getLib('zstd') ? '--with-zstd ' : '--without-zstd ') .
'--without-lz4 ' . '--without-lz4 ' .
@@ -82,15 +88,14 @@ trait postgresql
'--without-bonjour ' . '--without-bonjour ' .
'--without-tcl ' '--without-tcl '
); );
// ($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
// build // build
shell()->cd($this->source_dir . '/build') shell()->cd($this->source_dir . '/build')
->exec($envs . ' make -C src/bin/pg_config install') ->exec($envs . ' make -C src/bin/pg_config install')
->exec($envs . ' make -C src/include install') ->exec($envs . ' make -C src/include install')
->exec($envs . ' make -C src/common install') ->exec($envs . ' make -C src/common install')
->exec($envs . ' make -C src/backend/port install')
->exec($envs . ' make -C src/port install') ->exec($envs . ' make -C src/port install')
->exec($envs . ' make -C src/backend/libpq install')
->exec($envs . ' make -C src/interfaces/libpq install'); ->exec($envs . ' make -C src/interfaces/libpq install');
// remove dynamic libs // remove dynamic libs

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
trait tidy
{
/**
* @throws RuntimeException
* @throws FileSystemException
*/
protected function build(): void
{
FileSystem::resetDir($this->source_dir . '/build-dir');
shell()->cd($this->source_dir . '/build-dir')
->exec(
'cmake ' .
"{$this->builder->makeCmakeArgs()} " .
'-DBUILD_SHARED_LIB=OFF ' .
'-DSUPPORT_CONSOLE_APP=OFF ' .
'..'
)
->exec("cmake --build . -j {$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['tidy.pc']);
}
}

View File

@@ -16,7 +16,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
use ZM\Logger\ConsoleColor; use ZM\Logger\ConsoleColor;
#[AsCommand('build', 'build CLI binary')] #[AsCommand('build', 'build PHP')]
class BuildCliCommand extends BuildCommand class BuildCliCommand extends BuildCommand
{ {
public function configure(): void public function configure(): void
@@ -33,6 +33,8 @@ class BuildCliCommand extends BuildCommand
$this->addOption('disable-opcache-jit', null, null, 'disable opcache jit'); $this->addOption('disable-opcache-jit', null, null, 'disable opcache jit');
$this->addOption('with-hardcoded-ini', 'I', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Patch PHP source code, inject hardcoded INI'); $this->addOption('with-hardcoded-ini', 'I', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Patch PHP source code, inject hardcoded INI');
$this->addOption('with-micro-fake-cli', null, null, 'Enable phpmicro fake cli'); $this->addOption('with-micro-fake-cli', null, null, 'Enable phpmicro fake cli');
$this->addOption('with-suggested-libs', 'L', null, 'Build with suggested libs for selected exts and libs');
$this->addOption('with-suggested-exts', 'E', null, 'Build with suggested extensions for selected exts');
} }
public function handle(): int public function handle(): int
@@ -42,12 +44,9 @@ class BuildCliCommand extends BuildCommand
// transform string to array // transform string to array
$extensions = array_map('trim', array_filter(explode(',', $this->getArgument('extensions')))); $extensions = array_map('trim', array_filter(explode(',', $this->getArgument('extensions'))));
$rule = BUILD_TARGET_NONE; // parse rule with options
$rule |= ($this->getOption('build-cli') ? BUILD_TARGET_CLI : BUILD_TARGET_NONE); $rule = $this->parseRules();
$rule |= ($this->getOption('build-micro') ? BUILD_TARGET_MICRO : BUILD_TARGET_NONE);
$rule |= ($this->getOption('build-fpm') ? BUILD_TARGET_FPM : BUILD_TARGET_NONE);
$rule |= ($this->getOption('build-embed') ? BUILD_TARGET_EMBED : BUILD_TARGET_NONE);
$rule |= ($this->getOption('build-all') ? BUILD_TARGET_ALL : BUILD_TARGET_NONE);
if ($rule === BUILD_TARGET_NONE) { if ($rule === BUILD_TARGET_NONE) {
$this->output->writeln('<error>Please add at least one build target!</error>'); $this->output->writeln('<error>Please add at least one build target!</error>');
$this->output->writeln("<comment>\t--build-cli\tBuild php-cli SAPI</comment>"); $this->output->writeln("<comment>\t--build-cli\tBuild php-cli SAPI</comment>");
@@ -62,16 +61,27 @@ class BuildCliCommand extends BuildCommand
$builder = BuilderProvider::makeBuilderByInput($this->input); $builder = BuilderProvider::makeBuilderByInput($this->input);
// calculate dependencies // calculate dependencies
[$extensions, $libraries, $not_included] = DependencyUtil::getExtLibsByDeps($extensions, $libraries); [$extensions, $libraries, $not_included] = DependencyUtil::getExtLibsByDeps($extensions, $libraries);
/* @phpstan-ignore-next-line */
logger()->info('Build target: ' . ConsoleColor::yellow($builder->getBuildTypeName($rule))); // print info
/* @phpstan-ignore-next-line */ $indent_texts = [
logger()->info('Enabled extensions: ' . ConsoleColor::yellow(implode(', ', $extensions))); 'Build OS' => PHP_OS_FAMILY . ' (' . php_uname('m') . ')',
/* @phpstan-ignore-next-line */ 'Build SAPI' => $builder->getBuildTypeName($rule),
logger()->info('Required libraries: ' . ConsoleColor::yellow(implode(', ', $libraries))); 'Extensions (' . count($extensions) . ')' => implode(', ', $extensions),
if (!empty($not_included)) { 'Libraries (' . count($libraries) . ')' => implode(', ', $libraries),
logger()->warning('some extensions will be enabled due to dependencies: ' . implode(',', $not_included)); 'Strip Binaries' => $builder->getOption('no-strip') ? 'no' : 'yes',
'Enable ZTS' => $builder->getOption('enable-zts') ? 'yes' : 'no',
];
if (!empty($this->input->getOption('with-hardcoded-ini'))) {
$indent_texts['Hardcoded INI'] = $this->input->getOption('with-hardcoded-ini');
} }
$this->printFormatInfo($indent_texts);
if (!empty($not_included)) {
logger()->warning('Some extensions will be enabled due to dependencies: ' . implode(',', $not_included));
}
logger()->info('Build will start after 2s ...');
sleep(2); sleep(2);
if ($this->input->getOption('with-clean')) { if ($this->input->getOption('with-clean')) {
logger()->info('Cleaning source dir...'); logger()->info('Cleaning source dir...');
FileSystem::removeDir(SOURCE_PATH); FileSystem::removeDir(SOURCE_PATH);
@@ -140,4 +150,41 @@ class BuildCliCommand extends BuildCommand
return static::FAILURE; return static::FAILURE;
} }
} }
/**
* Parse build options to rule int.
*/
private function parseRules(): int
{
$rule = BUILD_TARGET_NONE;
$rule |= ($this->getOption('build-cli') ? BUILD_TARGET_CLI : BUILD_TARGET_NONE);
$rule |= ($this->getOption('build-micro') ? BUILD_TARGET_MICRO : BUILD_TARGET_NONE);
$rule |= ($this->getOption('build-fpm') ? BUILD_TARGET_FPM : BUILD_TARGET_NONE);
$rule |= ($this->getOption('build-embed') ? BUILD_TARGET_EMBED : BUILD_TARGET_NONE);
$rule |= ($this->getOption('build-all') ? BUILD_TARGET_ALL : BUILD_TARGET_NONE);
return $rule;
}
private function printFormatInfo(array $indent_texts): void
{
// calculate space count for every line
$maxlen = 0;
foreach ($indent_texts as $k => $v) {
$maxlen = max(strlen($k), $maxlen);
}
foreach ($indent_texts as $k => $v) {
if (is_string($v)) {
/* @phpstan-ignore-next-line */
logger()->info($k . ': ' . str_pad('', $maxlen - strlen($k)) . ConsoleColor::yellow($v));
} elseif (is_array($v) && !is_assoc_array($v)) {
$first = array_shift($v);
/* @phpstan-ignore-next-line */
logger()->info($k . ': ' . str_pad('', $maxlen - strlen($k)) . ConsoleColor::yellow($first));
foreach ($v as $vs) {
/* @phpstan-ignore-next-line */
logger()->info(str_pad('', $maxlen + 2) . ConsoleColor::yellow($vs));
}
}
}
}
} }

View File

@@ -21,6 +21,7 @@ class LinuxToolCheckList
'tar', 'unzip', 'gzip', 'tar', 'unzip', 'gzip',
'bzip2', 'cmake', 'gcc', 'bzip2', 'cmake', 'gcc',
'g++', 'patch', 'binutils-gold', 'g++', 'patch', 'binutils-gold',
'libtoolize',
]; ];
public const TOOLS_DEBIAN = [ public const TOOLS_DEBIAN = [
@@ -28,7 +29,7 @@ class LinuxToolCheckList
'git', 'autoconf', 'automake', 'git', 'autoconf', 'automake',
'tar', 'unzip', 'gzip', 'tar', 'unzip', 'gzip',
'bzip2', 'cmake', 'patch', 'bzip2', 'cmake', 'patch',
'xz', 'xz', 'libtoolize',
]; ];
public const TOOLS_RHEL = [ public const TOOLS_RHEL = [
@@ -102,6 +103,8 @@ class LinuxToolCheckList
try { try {
$is_debian = in_array($distro['dist'], ['debian', 'ubuntu']); $is_debian = in_array($distro['dist'], ['debian', 'ubuntu']);
$to_install = $is_debian ? str_replace('xz', 'xz-utils', $missing) : $missing; $to_install = $is_debian ? str_replace('xz', 'xz-utils', $missing) : $missing;
// debian, alpine libtool -> libtoolize
$to_install = str_replace('libtoolize', 'libtool', $to_install);
shell(true)->exec($prefix . $install_cmd . ' ' . implode(' ', $to_install)); shell(true)->exec($prefix . $install_cmd . ' ' . implode(' ', $to_install));
} catch (RuntimeException) { } catch (RuntimeException) {
return false; return false;

View File

@@ -25,6 +25,7 @@ class MacOSToolCheckList
'autoconf', 'autoconf',
'automake', 'automake',
'tar', 'tar',
'libtool',
'unzip', 'unzip',
'xz', 'xz',
'gzip', 'gzip',

View File

@@ -134,6 +134,12 @@ class SourcePatcher
$patch_file = ROOT_DIR . "/src/globals/patch/{$patch_name}"; $patch_file = ROOT_DIR . "/src/globals/patch/{$patch_name}";
$patch_str = str_replace('/', DIRECTORY_SEPARATOR, $patch_file); $patch_str = str_replace('/', DIRECTORY_SEPARATOR, $patch_file);
// copy patch from phar
if (\Phar::running() !== '') {
file_put_contents(SOURCE_PATH . '/' . $patch_name, file_get_contents($patch_file));
$patch_str = str_replace('/', DIRECTORY_SEPARATOR, SOURCE_PATH . '/' . $patch_name);
}
f_passthru( f_passthru(
'cd ' . $cwd . ' && ' . 'cd ' . $cwd . ' && ' .
(PHP_OS_FAMILY === 'Windows' ? 'type' : 'cat') . ' ' . $patch_str . ' | patch -p1 ' . ($reverse ? '-R' : '') (PHP_OS_FAMILY === 'Windows' ? 'type' : 'cat') . ' ' . $patch_str . ' | patch -p1 ' . ($reverse ? '-R' : '')

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
# If you want to test new extensions here, just modify it.
$extensions = 'password-argon2,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib';
if (PHP_OS_FAMILY === 'Darwin') {
$extensions .= ',sodium';
}
echo $extensions;