mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge branch 'main' into suggest-cmd
# Conflicts: # src/globals/test-extensions.php
This commit is contained in:
commit
158298b96c
14
.github/workflows/tests.yml
vendored
14
.github/workflows/tests.yml
vendored
@ -129,6 +129,13 @@ jobs:
|
|||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
|
|
||||||
|
- name: "Use test token if exists"
|
||||||
|
if: matrix.os != 'windows-latest'
|
||||||
|
run: |
|
||||||
|
if [ "${{ secrets.TEST_GH_TOKEN }}" != "" ]; then
|
||||||
|
echo "GITHUB_TOKEN=${{ secrets.TEST_GH_TOKEN }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: "Cache Composer packages"
|
- name: "Cache Composer packages"
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -152,7 +159,12 @@ jobs:
|
|||||||
run: bin/spc doctor --auto-fix
|
run: bin/spc doctor --auto-fix
|
||||||
|
|
||||||
- name: "Run Build Tests (download)"
|
- name: "Run Build Tests (download)"
|
||||||
run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --with-php=${{ matrix.php }} --debug
|
uses: nick-fields/retry@v3
|
||||||
|
with:
|
||||||
|
timeout_minutes: 10
|
||||||
|
max_attempts: 3
|
||||||
|
retry_on: error
|
||||||
|
command: bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --with-php=${{ matrix.php }} --debug
|
||||||
|
|
||||||
- name: "Run Build Tests (build)"
|
- name: "Run Build Tests (build)"
|
||||||
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php libs_cmd) --build-cli --build-micro --build-fpm --debug
|
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php libs_cmd) --build-cli --build-micro --build-fpm --debug
|
||||||
|
|||||||
14
README-zh.md
14
README-zh.md
@ -1,10 +1,11 @@
|
|||||||
# static-php-cli
|
# static-php-cli
|
||||||
|
|
||||||
[]()
|
[](README.md)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
[](README-zh.md)
|
||||||
[]()
|
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
||||||
[]([https://static-php.dev/](https://static-php.dev/en/guide/extensions.html))
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
[](https://discord.gg/RNpegEYW)
|
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
||||||
|
[](https://static-php.dev/zh/guide/extensions.html)
|
||||||
|
|
||||||
**static-php-cli**是一个用于静态编译、构建 PHP 解释器的工具,支持众多流行扩展。
|
**static-php-cli**是一个用于静态编译、构建 PHP 解释器的工具,支持众多流行扩展。
|
||||||
|
|
||||||
@ -12,9 +13,6 @@
|
|||||||
|
|
||||||
**static-php-cli**也支持将 PHP 代码和 PHP 运行时打包为一个文件并运行。
|
**static-php-cli**也支持将 PHP 代码和 PHP 运行时打包为一个文件并运行。
|
||||||
|
|
||||||
- [README - English](./README.md)
|
|
||||||
- [README - 中文](./README-zh.md)
|
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
static-php-cli(简称 `spc`)有许多特性:
|
static-php-cli(简称 `spc`)有许多特性:
|
||||||
|
|||||||
14
README.md
14
README.md
@ -1,10 +1,11 @@
|
|||||||
# static-php-cli
|
# static-php-cli
|
||||||
|
|
||||||
[]()
|
[](README-zh.md)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
[](README.md)
|
||||||
[]()
|
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
||||||
[]([https://static-php.dev/](https://static-php.dev/en/guide/extensions.html))
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
[](https://discord.gg/RNpegEYW)
|
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
||||||
|
[](https://static-php.dev/en/guide/extensions.html)
|
||||||
|
|
||||||
**static-php-cli** is a powerful tool designed for building static, standalone PHP runtime
|
**static-php-cli** is a powerful tool designed for building static, standalone PHP runtime
|
||||||
with popular extensions.
|
with popular extensions.
|
||||||
@ -14,9 +15,6 @@ Static PHP built by **static-php-cli** supports `cli`, `fpm`, `embed` and `micro
|
|||||||
**static-php-cli** also has the ability to package PHP projects
|
**static-php-cli** also has the ability to package PHP projects
|
||||||
along with the PHP interpreter into one single executable file.
|
along with the PHP interpreter into one single executable file.
|
||||||
|
|
||||||
- [README - English](./README.md)
|
|
||||||
- [README - 中文](./README-zh.md)
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
static-php-cli (you can call it `spc`) has a lot of features:
|
static-php-cli (you can call it `spc`) has a lot of features:
|
||||||
|
|||||||
@ -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\macos\MacOSBuilder;
|
||||||
use SPC\exception\FileSystemException;
|
use SPC\exception\FileSystemException;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
@ -34,4 +35,16 @@ class event extends Extension
|
|||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-levent_openssl/', $this->getLibFilesString());
|
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-levent_openssl/', $this->getLibFilesString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws FileSystemException
|
||||||
|
*/
|
||||||
|
public function patchBeforeMake(): bool
|
||||||
|
{
|
||||||
|
// Prevent event extension compile error on macOS
|
||||||
|
if ($this->builder instanceof MacOSBuilder) {
|
||||||
|
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/main/php_config.h', '/^#define HAVE_OPENPTY 1$/m', '');
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@ class MacOSToolCheckList
|
|||||||
'gzip',
|
'gzip',
|
||||||
'bzip2',
|
'bzip2',
|
||||||
'cmake',
|
'cmake',
|
||||||
|
'glibtoolize',
|
||||||
];
|
];
|
||||||
|
|
||||||
#[AsCheckItem('if homebrew has installed', limit_os: 'Darwin', level: 998)]
|
#[AsCheckItem('if homebrew has installed', limit_os: 'Darwin', level: 998)]
|
||||||
@ -72,8 +73,14 @@ class MacOSToolCheckList
|
|||||||
#[AsFixItem('build-tools')]
|
#[AsFixItem('build-tools')]
|
||||||
public function fixBuildTools(array $missing): bool
|
public function fixBuildTools(array $missing): bool
|
||||||
{
|
{
|
||||||
|
$replacement = [
|
||||||
|
'glibtoolize' => 'libtool',
|
||||||
|
];
|
||||||
foreach ($missing as $cmd) {
|
foreach ($missing as $cmd) {
|
||||||
try {
|
try {
|
||||||
|
if (isset($replacement[$cmd])) {
|
||||||
|
$cmd = $replacement[$cmd];
|
||||||
|
}
|
||||||
shell(true)->exec('brew install --formula ' . escapeshellarg($cmd));
|
shell(true)->exec('brew install --formula ' . escapeshellarg($cmd));
|
||||||
} catch (RuntimeException) {
|
} catch (RuntimeException) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -197,7 +197,6 @@ class SourcePatcher
|
|||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/main/php_config.h', '/^#define HAVE_STRLCAT 1$/m', '');
|
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/main/php_config.h', '/^#define HAVE_STRLCAT 1$/m', '');
|
||||||
}
|
}
|
||||||
if ($builder instanceof UnixBuilderBase) {
|
if ($builder instanceof UnixBuilderBase) {
|
||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/main/php_config.h', '/^#define HAVE_OPENPTY 1$/m', '');
|
|
||||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/Makefile', 'install-micro', '');
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/Makefile', 'install-micro', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user