mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-19 06:45:35 +08:00
Compare commits
15 Commits
fix/protob
...
23daeeb311
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23daeeb311 | ||
|
|
e9466dca68 | ||
|
|
664a8122ad | ||
|
|
13523bcdbc | ||
|
|
6de66056a5 | ||
|
|
aa457dfe5c | ||
|
|
4a22d2a613 | ||
|
|
3f871fde13 | ||
|
|
e196442387 | ||
|
|
dc57e5e5c4 | ||
|
|
6670b56da5 | ||
|
|
307e984b5d | ||
|
|
0e131f2dba | ||
|
|
6ed25ed740 | ||
|
|
220c4dab42 |
148
.github/workflows/ext-matrix-tests.yml
vendored
Normal file
148
.github/workflows/ext-matrix-tests.yml
vendored
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
name: "Extension matrix tests"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/ext-matrix-tests.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
extension:
|
||||||
|
- amqp
|
||||||
|
- apcu
|
||||||
|
- bcmath
|
||||||
|
- bz2
|
||||||
|
- calendar
|
||||||
|
- ctype
|
||||||
|
- curl
|
||||||
|
- dba
|
||||||
|
- dom
|
||||||
|
- ds
|
||||||
|
- event
|
||||||
|
- exif
|
||||||
|
- filter
|
||||||
|
- fileinfo
|
||||||
|
- ftp
|
||||||
|
- gd
|
||||||
|
- gettext
|
||||||
|
- gmp
|
||||||
|
- iconv
|
||||||
|
- igbinary
|
||||||
|
- imagick
|
||||||
|
- imap
|
||||||
|
- intl
|
||||||
|
- ldap
|
||||||
|
- mbstring,mbregex
|
||||||
|
- memcache
|
||||||
|
- mysqli,mysqlnd,pdo_mysql
|
||||||
|
- opcache
|
||||||
|
- openssl
|
||||||
|
- pcntl
|
||||||
|
- password-argon2
|
||||||
|
- pcntl
|
||||||
|
- pdo
|
||||||
|
- pgsql,pdo_pgsql
|
||||||
|
- phar
|
||||||
|
- posix
|
||||||
|
- rar
|
||||||
|
- protobuf
|
||||||
|
- readline
|
||||||
|
- redis
|
||||||
|
- session
|
||||||
|
- shmop
|
||||||
|
- simdjson
|
||||||
|
- simplexml,xml
|
||||||
|
- snappy
|
||||||
|
- soap
|
||||||
|
- sockets
|
||||||
|
- sodium
|
||||||
|
- sqlite3,pdo_sqlite
|
||||||
|
- sqlsrv
|
||||||
|
- ssh2
|
||||||
|
- swoole
|
||||||
|
- swoole,swoole-hook-pgsql,swoole-hook-mysql,swoole-hook-sqlite
|
||||||
|
- swow
|
||||||
|
- sysvmsg,sysvsem,sysvshm
|
||||||
|
- tidy
|
||||||
|
- tokenizer
|
||||||
|
- uuid
|
||||||
|
- uv
|
||||||
|
- xhprof
|
||||||
|
- xlswriter
|
||||||
|
- xmlwriter,xmlreader
|
||||||
|
- xsl
|
||||||
|
- yac
|
||||||
|
- yaml
|
||||||
|
- zip
|
||||||
|
- zlib
|
||||||
|
- zstd
|
||||||
|
php-version:
|
||||||
|
- "8.4"
|
||||||
|
operating-system:
|
||||||
|
- "ubuntu-latest"
|
||||||
|
#- "macos-13"
|
||||||
|
#- "debian-arm64-self-hosted"
|
||||||
|
- "macos-14"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v4"
|
||||||
|
|
||||||
|
- name: OS type
|
||||||
|
id: os-type
|
||||||
|
run: |
|
||||||
|
OS=""
|
||||||
|
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
|
||||||
|
OS="linux-x86_64"
|
||||||
|
elif [ "${{ matrix.operating-system }}" = "macos-13" ]; then
|
||||||
|
OS="macos-x86_64"
|
||||||
|
elif [ "${{ matrix.operating-system }}" = "debian-arm64-self-hosted" ]; then
|
||||||
|
OS="linux-aarch64"
|
||||||
|
elif [ "${{ matrix.operating-system }}" = "macos-14" ]; then
|
||||||
|
OS="macos-aarch64"
|
||||||
|
fi
|
||||||
|
echo "OS=$OS" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- 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
|
||||||
|
env:
|
||||||
|
phpts: nts
|
||||||
|
|
||||||
|
- name: "Install Dependencies"
|
||||||
|
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
|
||||||
|
- id: cache-download
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: downloads
|
||||||
|
key: php-${{ matrix.php-version }}-dependencies-for-tests
|
||||||
|
|
||||||
|
# If there's no dependencies cache, fetch sources
|
||||||
|
- name: "Download sources"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }}
|
||||||
|
run: ./bin/spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extension }} --debug
|
||||||
|
|
||||||
|
- name: "Build library: ${{ matrix.library }}"
|
||||||
|
run: |
|
||||||
|
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
|
||||||
|
if [ "${{ env.OS }}" = "linux-x86_64" ]; then
|
||||||
|
./bin/spc install-pkg upx
|
||||||
|
UPX=--with-upx-pack
|
||||||
|
elif [ "${{ env.OS }}" = "linux-aarch64" ]; then
|
||||||
|
./bin/spc install-pkg upx
|
||||||
|
UPX=--with-upx-pack
|
||||||
|
fi
|
||||||
|
./bin/spc build --build-cli --build-micro --build-fpm ${{ matrix.extension }} --debug $UPX --with-suggested-libs --with-suggested-exts
|
||||||
22
README-zh.md
22
README-zh.md
@@ -82,16 +82,18 @@ static-php-cli(简称 `spc`)有许多特性:
|
|||||||
>
|
>
|
||||||
> :x: 不支持
|
> :x: 不支持
|
||||||
|
|
||||||
| PHP Version | Status | Comment |
|
| PHP Version | Status | Comment |
|
||||||
|-------------|--------------------|------------------------------|
|
|-------------|--------------------|----------------------------------------------|
|
||||||
| 7.2 | :x: | |
|
| 7.2 | :x: | |
|
||||||
| 7.3 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
||||||
| 7.4 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
||||||
| 8.0 | :heavy_check_mark: | PHP 官方已停止 8.0 的维护 |
|
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
|
||||||
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
|
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
|
||||||
| 8.2 | :heavy_check_mark: | |
|
| 8.2 | :heavy_check_mark: | |
|
||||||
| 8.3 | :heavy_check_mark: | |
|
| 8.3 | :heavy_check_mark: | |
|
||||||
| 8.4 | :x: | WIP |
|
| 8.4 | :heavy_check_mark: | |
|
||||||
|
|
||||||
|
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。
|
||||||
|
|
||||||
### 支持的扩展
|
### 支持的扩展
|
||||||
|
|
||||||
|
|||||||
23
README.md
23
README.md
@@ -89,16 +89,19 @@ Currently supported PHP versions for compilation:
|
|||||||
>
|
>
|
||||||
> :x: not supported
|
> :x: not supported
|
||||||
|
|
||||||
| PHP Version | Status | Comment |
|
| PHP Version | Status | Comment |
|
||||||
|-------------|--------------------|---------------------------------------------------|
|
|-------------|--------------------|----------------------------------------------------------------------------------------------------|
|
||||||
| 7.2 | :x: | |
|
| 7.2 | :x: | |
|
||||||
| 7.3 | :warning: | phpmicro and some extensions not supported on 7.x |
|
| 7.3 | :x: | phpmicro and some extensions not supported on 7.x |
|
||||||
| 7.4 | :warning: | phpmicro and some extensions not supported on 7.x |
|
| 7.4 | :x: | phpmicro and some extensions not supported on 7.x |
|
||||||
| 8.0 | :heavy_check_mark: | PHP official has stopped maintenance of 8.0 |
|
| 8.0 | :warning: | PHP official has stopped maintenance of 8.0, we no longer provide backport support for version 8.0 |
|
||||||
| 8.1 | :heavy_check_mark: | PHP official has security fixes only |
|
| 8.1 | :heavy_check_mark: | PHP official has security fixes only |
|
||||||
| 8.2 | :heavy_check_mark: | |
|
| 8.2 | :heavy_check_mark: | |
|
||||||
| 8.3 | :heavy_check_mark: | |
|
| 8.3 | :heavy_check_mark: | |
|
||||||
| 8.4 | :x: | WIP |
|
| 8.4 | :heavy_check_mark: | |
|
||||||
|
|
||||||
|
> This table shows the support status for static-php-cli in building the corresponding version,
|
||||||
|
> not the official PHP support status for that version.
|
||||||
|
|
||||||
### Supported Extensions
|
### Supported Extensions
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS} -fno-ident
|
|||||||
; EXTRA_LIBS for `make` php
|
; EXTRA_LIBS for `make` php
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS=""
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS=""
|
||||||
; EXTRA_LDFLAGS_PROGRAM for `make` php
|
; EXTRA_LDFLAGS_PROGRAM for `make` php
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static"
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static -Wl,-O1 -pie"
|
||||||
|
|
||||||
[macos]
|
[macos]
|
||||||
; compiler environments
|
; compiler environments
|
||||||
|
|||||||
@@ -242,7 +242,8 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "builtin",
|
"type": "external",
|
||||||
|
"source": "ext-imap",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"imap"
|
"imap"
|
||||||
|
|||||||
@@ -249,6 +249,18 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ext-imap": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/imap",
|
||||||
|
"path": "php-src/ext/imap",
|
||||||
|
"filename": "imap.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": [
|
||||||
|
"LICENSE"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"inotify": {
|
"inotify": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/inotify",
|
"url": "https://pecl.php.net/get/inotify",
|
||||||
@@ -513,7 +525,7 @@
|
|||||||
"micro": {
|
"micro": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"path": "php-src/sapi/micro",
|
"path": "php-src/sapi/micro",
|
||||||
"rev": "master",
|
"rev": "84beta",
|
||||||
"url": "https://github.com/static-php/phpmicro",
|
"url": "https://github.com/static-php/phpmicro",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
@@ -726,13 +738,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"swoole": {
|
"swoole": {
|
||||||
"type": "ghtar",
|
|
||||||
"path": "php-src/ext/swoole",
|
"path": "php-src/ext/swoole",
|
||||||
"repo": "swoole/swoole-src",
|
"type": "git",
|
||||||
"prefer-stable": true,
|
"rev": "master",
|
||||||
|
"url": "https://github.com/swoole/swoole-src.git",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
|
},
|
||||||
|
"alt": {
|
||||||
|
"type": "ghtar",
|
||||||
|
"repo": "swoole/swoole-src",
|
||||||
|
"prefer-stable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"swow": {
|
"swow": {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ use Symfony\Component\Console\Application;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const VERSION = '2.3.6';
|
public const VERSION = '2.4.0';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ abstract class BuilderBase
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (preg_match('/php-(\d+\.\d+\.\d+)/', $file, $match)) {
|
if (preg_match('/php-(\d+\.\d+\.\d+(?:RC\d+)?)\.tar\.(?:gz|bz2|xz)/', $file, $match)) {
|
||||||
return $match[1];
|
return $match[1];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
<?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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,6 +12,9 @@ class zlib extends Extension
|
|||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(): string
|
||||||
{
|
{
|
||||||
|
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||||
|
return '--with-zlib';
|
||||||
|
}
|
||||||
return '--with-zlib --with-zlib-dir="' . BUILD_ROOT_PATH . '"';
|
return '--with-zlib --with-zlib-dir="' . BUILD_ROOT_PATH . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class imap extends MacOSLibraryBase
|
|||||||
->exec('chmod +x src/osdep/unix/drivers')
|
->exec('chmod +x src/osdep/unix/drivers')
|
||||||
->exec('chmod +x src/osdep/unix/mkauths')
|
->exec('chmod +x src/osdep/unix/mkauths')
|
||||||
->exec(
|
->exec(
|
||||||
"yes | make osx {$ssl_options} EXTRACFLAGS='-Wimplicit-function-declaration -Wno-incompatible-function-pointer-types {$out}'"
|
"echo y | make osx {$ssl_options} EXTRACFLAGS='-Wno-implicit-function-declaration -Wno-incompatible-function-pointer-types {$out}'"
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
shell()
|
shell()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class DownloadCommand extends BaseCommand
|
|||||||
$this->addArgument('sources', InputArgument::REQUIRED, 'The sources will be compiled, comma separated');
|
$this->addArgument('sources', InputArgument::REQUIRED, 'The sources will be compiled, comma separated');
|
||||||
$this->addOption('shallow-clone', null, null, 'Clone shallow');
|
$this->addOption('shallow-clone', null, null, 'Clone shallow');
|
||||||
$this->addOption('with-openssl11', null, null, 'Use openssl 1.1');
|
$this->addOption('with-openssl11', null, null, 'Use openssl 1.1');
|
||||||
$this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.2)', '8.2');
|
$this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.3)', '8.3');
|
||||||
$this->addOption('clean', null, null, 'Clean old download cache and source before fetch');
|
$this->addOption('clean', null, null, 'Clean old download cache and source before fetch');
|
||||||
$this->addOption('all', 'A', null, 'Fetch all sources that static-php-cli needed');
|
$this->addOption('all', 'A', null, 'Fetch all sources that static-php-cli needed');
|
||||||
$this->addOption('custom-url', 'U', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Specify custom source download url, e.g "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"');
|
$this->addOption('custom-url', 'U', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Specify custom source download url, e.g "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"');
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ class SwitchPhpVersionCommand extends BaseCommand
|
|||||||
$this->addArgument(
|
$this->addArgument(
|
||||||
'php-major-version',
|
'php-major-version',
|
||||||
InputArgument::REQUIRED,
|
InputArgument::REQUIRED,
|
||||||
'PHP major version (supported: 7.4, 8.0, 8.1, 8.2, 8.3)',
|
'PHP major version (supported: 7.4, 8.0, 8.1, 8.2, 8.3, 8.4)',
|
||||||
null,
|
null,
|
||||||
fn () => ['7.4', '8.0', '8.1', '8.2', '8.3']
|
fn () => ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||||
);
|
);
|
||||||
$this->no_motd = true;
|
$this->no_motd = true;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ class SwitchPhpVersionCommand extends BaseCommand
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$php_ver = $this->input->getArgument('php-major-version');
|
$php_ver = $this->input->getArgument('php-major-version');
|
||||||
if (!in_array($php_ver, ['7.4', '8.0', '8.1', '8.2', '8.3'])) {
|
if (!in_array($php_ver, ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'])) {
|
||||||
// match x.y.z
|
// match x.y.z
|
||||||
preg_match('/^\d+\.\d+\.\d+$/', $php_ver, $matches);
|
preg_match('/^\d+\.\d+\.\d+$/', $php_ver, $matches);
|
||||||
if (!$matches) {
|
if (!$matches) {
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ class SourcePatcher
|
|||||||
FileSystem::addSourceExtractHook('pdo_sqlsrv', [SourcePatcher::class, 'patchSQLSRVWin32']);
|
FileSystem::addSourceExtractHook('pdo_sqlsrv', [SourcePatcher::class, 'patchSQLSRVWin32']);
|
||||||
FileSystem::addSourceExtractHook('yaml', [SourcePatcher::class, 'patchYamlWin32']);
|
FileSystem::addSourceExtractHook('yaml', [SourcePatcher::class, 'patchYamlWin32']);
|
||||||
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
|
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
|
||||||
|
FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']);
|
||||||
|
FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -370,6 +372,27 @@ class SourcePatcher
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch imap license file for PHP < 8.4
|
||||||
|
*/
|
||||||
|
public static function patchImapLicense(): bool
|
||||||
|
{
|
||||||
|
if (!file_exists(SOURCE_PATH . '/php-src/ext/imap/LICENSE') && is_dir(SOURCE_PATH . '/php-src/ext/imap')) {
|
||||||
|
file_put_contents(SOURCE_PATH . '/php-src/ext/imap/LICENSE', file_get_contents(ROOT_DIR . '/src/globals/extra/Apache_LICENSE'));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch imagick for PHP 8.4
|
||||||
|
*/
|
||||||
|
public static function patchImagickWith84(): bool
|
||||||
|
{
|
||||||
|
SourcePatcher::patchFile('imagick_php84.patch', SOURCE_PATH . '/php-src/ext/imagick');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch cli SAPI Makefile for Windows.
|
* Patch cli SAPI Makefile for Windows.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class PhpSource extends CustomSourceBase
|
|||||||
{
|
{
|
||||||
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.1';
|
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.1';
|
||||||
if ($major === '8.4') {
|
if ($major === '8.4') {
|
||||||
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://downloads.php.net/~saki/php-8.4.0RC1.tar.xz'], $force);
|
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://downloads.php.net/~saki/php-8.4.0RC3.tar.xz'], $force);
|
||||||
} else {
|
} else {
|
||||||
Downloader::downloadSource('php-src', self::getLatestPHPInfo($major), $force);
|
Downloader::downloadSource('php-src', self::getLatestPHPInfo($major), $force);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class GlobalEnvManager
|
|||||||
self::putenv('PKG_CONFIG=' . BUILD_BIN_PATH . '/pkg-config');
|
self::putenv('PKG_CONFIG=' . BUILD_BIN_PATH . '/pkg-config');
|
||||||
self::putenv('PKG_CONFIG_PATH=' . BUILD_ROOT_PATH . '/lib/pkgconfig');
|
self::putenv('PKG_CONFIG_PATH=' . BUILD_ROOT_PATH . '/lib/pkgconfig');
|
||||||
if ($builder instanceof BuilderBase) {
|
if ($builder instanceof BuilderBase) {
|
||||||
self::putenv('SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS=' . ($builder->getOption('no-strip') ? '-g -O0' : '-g -Os'));
|
self::putenv('SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS=' . ($builder->getOption('no-strip') ? '-g -O0' : '-g -fstack-protector-strong -fpic -fpie -Os -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ assert(function_exists('swoole_cpu_num'));
|
|||||||
assert(function_exists('swoole_string'));
|
assert(function_exists('swoole_string'));
|
||||||
assert(class_exists('Swoole\Coroutine'));
|
assert(class_exists('Swoole\Coroutine'));
|
||||||
assert(class_exists('Swoole\Coroutine\Http2\Client'));
|
assert(class_exists('Swoole\Coroutine\Http2\Client'));
|
||||||
assert(class_exists('Swoole\Coroutine\Redis'));
|
|
||||||
assert(class_exists('Swoole\Coroutine\WaitGroup'));
|
assert(class_exists('Swoole\Coroutine\WaitGroup'));
|
||||||
assert(class_exists('Swoole\Http2\Request'));
|
assert(class_exists('Swoole\Http2\Request'));
|
||||||
assert(constant('SWOOLE_VERSION'));
|
assert(constant('SWOOLE_VERSION'));
|
||||||
|
|||||||
201
src/globals/extra/Apache_LICENSE
Normal file
201
src/globals/extra/Apache_LICENSE
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
40
src/globals/patch/imagick_php84.patch
Normal file
40
src/globals/patch/imagick_php84.patch
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
From 65e27f2bc02e7e8f1bf64e26e359e42a1331fca1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= <mvorisek@mvorisek.cz>
|
||||||
|
Date: Wed, 25 Sep 2024 10:56:28 +0200
|
||||||
|
Subject: [PATCH] Fix removed "php_strtolower" for PHP 8.4
|
||||||
|
|
||||||
|
---
|
||||||
|
imagick.c | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/imagick.c b/imagick.c
|
||||||
|
index 1b765389..ebab7ae7 100644
|
||||||
|
--- a/imagick.c
|
||||||
|
+++ b/imagick.c
|
||||||
|
@@ -610,7 +610,7 @@ static zval *php_imagick_read_property(zend_object *object, zend_string *member,
|
||||||
|
if (format) {
|
||||||
|
retval = rv;
|
||||||
|
ZVAL_STRING(retval, format);
|
||||||
|
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||||
|
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||||
|
IMAGICK_FREE_MAGICK_MEMORY(format);
|
||||||
|
} else {
|
||||||
|
retval = rv;
|
||||||
|
@@ -683,7 +683,7 @@ static zval *php_imagick_read_property(zval *object, zval *member, int type, voi
|
||||||
|
if (format) {
|
||||||
|
retval = rv;
|
||||||
|
ZVAL_STRING(retval, format);
|
||||||
|
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||||
|
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||||
|
IMAGICK_FREE_MAGICK_MEMORY(format);
|
||||||
|
} else {
|
||||||
|
retval = rv;
|
||||||
|
@@ -766,7 +766,7 @@ static zval *php_imagick_read_property(zval *object, zval *member, int type, con
|
||||||
|
|
||||||
|
if (format) {
|
||||||
|
ZVAL_STRING(retval, format, 1);
|
||||||
|
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||||
|
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||||
|
IMAGICK_FREE_MAGICK_MEMORY(format);
|
||||||
|
} else {
|
||||||
|
ZVAL_STRING(retval, "", 1);
|
||||||
@@ -13,10 +13,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
// test php version
|
// test php version
|
||||||
$test_php_version = [
|
$test_php_version = [
|
||||||
'8.0',
|
|
||||||
'8.1',
|
'8.1',
|
||||||
'8.2',
|
'8.2',
|
||||||
'8.3',
|
'8.3',
|
||||||
|
'8.4',
|
||||||
];
|
];
|
||||||
|
|
||||||
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
|
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
|
||||||
@@ -36,7 +36,7 @@ $no_strip = false;
|
|||||||
$upx = false;
|
$upx = false;
|
||||||
|
|
||||||
// prefer downloading pre-built packages to speed up the build process
|
// prefer downloading pre-built packages to speed up the build process
|
||||||
$prefer_pre_built = true;
|
$prefer_pre_built = false;
|
||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
|
|||||||
Reference in New Issue
Block a user