Compare commits

..

19 Commits
2.5.0 ... 2.5.1

Author SHA1 Message Date
tricker
3ba215c35c enable PDO_ODBC and ODBC extension statically (#661)
* enable PDO_ODBC and ODBC extension statically

* fix sorting of ext.json

* add odbc and pdo_odbc extension to tests

* Add full tests, remove pdo_odbc from bulk

* Remove windows support for docs

* Add ODBC and PDO_ODBC extension

* Revert curl static lib

* Add full tests

* Add iconv for macOS

* Add tests

* Fix linux pdo_odbc patch

* Sort config

---------

Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2025-03-23 23:26:36 +08:00
Jerry Ma
161a3924d2 Fix windows micro logo changer bug (illegal realpath) (#675) 2025-03-23 22:55:25 +08:00
Jerry Ma
7b6fae6d92 Fix windows ssl bug for curl (#674) 2025-03-23 22:33:26 +08:00
Marc
d0a66ab16b Merge pull request #663 from crazywhalecc/feat/mimalloc
Add mimalloc support for macOS and Linux
2025-03-23 10:12:08 +01:00
DubbleClick
744e066d5f Merge remote-tracking branch 'origin/main' into feat/mimalloc 2025-03-23 15:38:31 +07:00
Marc
e850df505c Merge pull request #671 from crazywhalecc/fix/phpize
fix phpize using wrong paths
2025-03-23 07:14:23 +01:00
DubbleClick
918223e7da fix phpize using wrong paths 2025-03-23 12:40:50 +07:00
Marc Henderkes
1552d992df fix typo in gettext 2025-03-21 07:41:19 +01:00
Marc
f0a895691b Merge pull request #670 from crazywhalecc/fix/gettext-typo
fix typo in gettext
2025-03-21 07:38:48 +01:00
Marc Henderkes
1f7c805da4 fix typo in gettext 2025-03-21 07:38:14 +01:00
crazywhalecc
1ad33556e9 Add full tests 2025-03-20 16:11:45 +08:00
crazywhalecc
6b5e83b98e Sync Chinese docs 2025-03-20 16:06:33 +08:00
Marc Henderkes
6fb9c2df3b test macos 2025-03-20 08:46:54 +01:00
Marc Henderkes
1b29803ed2 docs 2025-03-20 08:00:35 +01:00
Marc Henderkes
3477857584 mimalloc on mac (untested) 2025-03-20 07:41:13 +01:00
Marc Henderkes
0ce2c894e9 juggle mimalloc.o to the beginning 2025-03-20 07:27:38 +01:00
Marc Henderkes
92470a35da replace allocator with mimalloc (works for cli/fpm, embed needs to be tested) 2025-03-20 06:22:11 +01:00
Marc Henderkes
6447fec028 mimalloc WIP 2025-03-20 04:36:46 +01:00
Jerry Ma
0bc143cac3 Fix windows curl build >= 8.3 (#660)
* Test windows curl

* Test windows curl

* Fix windows curl build for PHP 8.3 and 8.4
2025-03-20 09:22:10 +08:00
20 changed files with 234 additions and 26 deletions

View File

@@ -426,6 +426,17 @@
}, },
"notes": true "notes": true
}, },
"odbc": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "builtin",
"arg-type-unix": "custom",
"lib-depends-unix": [
"unixodbc"
]
},
"opcache": { "opcache": {
"type": "builtin", "type": "builtin",
"arg-type-unix": "custom" "arg-type-unix": "custom"
@@ -492,6 +503,20 @@
"mysqlnd" "mysqlnd"
] ]
}, },
"pdo_odbc": {
"support": {
"BSD": "wip"
},
"type": "builtin",
"arg-type": "custom",
"lib-depends-unix": [
"unixodbc"
],
"ext-depends": [
"pdo",
"odbc"
]
},
"pdo_pgsql": { "pdo_pgsql": {
"support": { "support": {
"Windows": "wip", "Windows": "wip",

View File

@@ -68,7 +68,7 @@
"libcurl.a" "libcurl.a"
], ],
"static-libs-windows": [ "static-libs-windows": [
"libcurl.lib" "libcurl_a.lib"
], ],
"headers": [ "headers": [
"curl" "curl"
@@ -78,7 +78,6 @@
"zlib" "zlib"
], ],
"lib-depends-windows": [ "lib-depends-windows": [
"openssl",
"zlib", "zlib",
"libssh2", "libssh2",
"nghttp2" "nghttp2"
@@ -589,6 +588,12 @@
"openssl" "openssl"
] ]
}, },
"mimalloc": {
"source": "mimalloc",
"static-libs-unix": [
"mimalloc.o"
]
},
"ncurses": { "ncurses": {
"source": "ncurses", "source": "ncurses",
"static-libs-unix": [ "static-libs-unix": [

View File

@@ -636,6 +636,16 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"mimalloc": {
"type": "ghtagtar",
"repo": "microsoft/mimalloc",
"match": "v2.+",
"provide-pre-built": false,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"mongodb": { "mongodb": {
"type": "ghrel", "type": "ghrel",
"repo": "mongodb/mongo-php-driver", "repo": "mongodb/mongo-php-driver",

View File

@@ -76,8 +76,7 @@ and this extension cannot be compiled into php by static linking, so it cannot b
## xdebug ## xdebug
1. Xdebug is a Zend extension. The functions of Xdebug depend on PHP's Zend engine and underlying code. 1. Xdebug is only buildable as a shared extension. On Linux, you need to use static-php-cli with SPC_LIBC=glibc and then compile php-xdebug from source with the option `--with-php-config=/path/to/buildroot/bin/php-config`.
If you want to statically compile it into PHP, you may need a huge amount of patch code, which is not feasible.
2. The macOS platform can compile an xdebug extension under PHP compiled on the same platform, 2. The macOS platform can compile an xdebug extension under PHP compiled on the same platform,
extract the `xdebug.so` file, and then use the `--no-strip` parameter in static-php-cli to retain the debug symbol table and add the `ffi` extension. extract the `xdebug.so` file, and then use the `--no-strip` parameter in static-php-cli to retain the debug symbol table and add the `ffi` extension.
The compiled `./php` binary can be configured and run by specifying the INI, eg `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`. The compiled `./php` binary can be configured and run by specifying the INI, eg `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`.
@@ -149,3 +148,9 @@ Parallel is only supported on PHP 8.0 ZTS and above.
1. The [SPX extension](https://github.com/NoiseByNorthwest/php-spx) only supports NTS mode. 1. The [SPX extension](https://github.com/NoiseByNorthwest/php-spx) only supports NTS mode.
2. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx). 2. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx).
## mimalloc
1. This is not technically an extension, but a library.
2. Building with `--with-libs="mimalloc"` on Linux or macOS will override the default allocator.
3. This is experimental for now, but is recommended in threaded environments.

View File

@@ -70,7 +70,7 @@ bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli
## xdebug ## xdebug
1. Xdebug 是一个 Zend 扩展Xdebug 的功能依赖于 PHP 的 Zend 引擎和底层代码,如果要将其静态编译到 PHP 中,可能需要巨量的 patch 代码,这是不可行的 1. Xdebug 只能作为共享扩展构建。在 Linux 上,您需要使用带有 `SPC_LIBC=glibc` 的 static-php-cli然后使用选项 `--with-php-config=/path/to/buildroot/bin/php-config` 从源代码编译 php-xdebug
2. macOS 平台可以通过在相同平台编译的 PHP 下编译一个 xdebug 扩展,并提取其中的 `xdebug.so` 文件,再在 static-php-cli 中使用 `--no-strip` 参数保留调试符号表,同时加入 `ffi` 扩展。 2. macOS 平台可以通过在相同平台编译的 PHP 下编译一个 xdebug 扩展,并提取其中的 `xdebug.so` 文件,再在 static-php-cli 中使用 `--no-strip` 参数保留调试符号表,同时加入 `ffi` 扩展。
编译的 `./php` 二进制可以通过指定 INI 配置并运行,例如`./php -d 'zend_extension=xdebug.so' your-code.php` 编译的 `./php` 二进制可以通过指定 INI 配置并运行,例如`./php -d 'zend_extension=xdebug.so' your-code.php`
@@ -136,3 +136,9 @@ parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(`--
1. [SPX 扩展](https://github.com/NoiseByNorthwest/php-spx) 只支持非线程模式。 1. [SPX 扩展](https://github.com/NoiseByNorthwest/php-spx) 只支持非线程模式。
2. SPX 目前不支持 Windows且官方仓库也不支持静态编译static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。 2. SPX 目前不支持 Windows且官方仓库也不支持静态编译static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。
## mimalloc
1. 从技术上讲,这不是扩展,而是一个库。
2. 在 Linux 或 macOS 上使用 `--with-libs="mimalloc"` 进行构建将覆盖默认分配器。
3. 目前,这还处于实验阶段,但建议在线程环境中使用。

View File

@@ -32,7 +32,7 @@ use Symfony\Component\Console\Application;
*/ */
final class ConsoleApplication extends Application final class ConsoleApplication extends Application
{ {
public const VERSION = '2.5.0'; public const VERSION = '2.5.1';
public function __construct() public function __construct()
{ {

View File

@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('odbc')]
class odbc extends Extension
{
public function getUnixConfigureArg(): string
{
return '--with-unixODBC=' . BUILD_ROOT_PATH;
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('pdo_odbc')]
class pdo_odbc extends Extension
{
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/pdo_odbc/config.m4', 'PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags', 'PDO_ODBC_LDFLAGS="-liconv $pdo_odbc_def_ldflags');
return true;
}
public function getUnixConfigureArg(): string
{
return '--with-pdo-odbc=unixODBC,' . BUILD_ROOT_PATH;
}
public function getWindowsConfigureArg(): string
{
return '--with-pdo-odbc';
}
}

View File

@@ -150,12 +150,13 @@ class LinuxBuilder extends UnixBuilderBase
$enable_micro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO; $enable_micro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
$enable_embed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED; $enable_embed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
$mimallocLibs = $this->getLib('mimalloc') !== null ? BUILD_LIB_PATH . '/mimalloc.o ' : '';
// prepare build php envs // prepare build php envs
$envs_build_php = SystemUtil::makeEnvVarString([ $envs_build_php = SystemUtil::makeEnvVarString([
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'), 'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'),
'CPPFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS'), 'CPPFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS'),
'LDFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS'), 'LDFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS'),
'LIBS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LIBS'), 'LIBS' => $mimallocLibs . getenv('SPC_CMD_VAR_PHP_CONFIGURE_LIBS'),
]); ]);
// process micro upx patch if micro sapi enabled // process micro upx patch if micro sapi enabled
@@ -310,7 +311,15 @@ class LinuxBuilder extends UnixBuilderBase
shell()->cd(SOURCE_PATH . '/php-src') shell()->cd(SOURCE_PATH . '/php-src')
->exec('sed -i "s|//lib|/lib|g" Makefile') ->exec('sed -i "s|//lib|/lib|g" Makefile')
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install"); ->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
FileSystem::replaceFileStr(BUILD_BIN_PATH . '/php-config', 'prefix=""', 'prefix="' . BUILD_ROOT_PATH . '"'); FileSystem::replaceFileStr(BUILD_BIN_PATH . '/phpize', "prefix=''", "prefix='" . BUILD_ROOT_PATH . "'");
FileSystem::replaceFileStr(BUILD_BIN_PATH . '/phpize', 's##', 's#/usr/local#');
$php_config_str = FileSystem::readFile(BUILD_BIN_PATH . '/php-config');
str_replace('prefix=""', 'prefix="' . BUILD_ROOT_PATH . '"', $php_config_str);
// move mimalloc to the beginning of libs
$php_config_str = preg_replace('/(libs=")(.*?)\s*(' . preg_quote(BUILD_LIB_PATH, '/') . '\/mimalloc\.o)\s*(.*?)"/', '$1$3 $2 $4"', $php_config_str);
// move lstdc++ to the end of libs
$php_config_str = preg_replace('/(libs=")(.*?)\s*(-lstdc\+\+)\s*(.*?)"/', '$1$2 $4 $3"', $php_config_str);
FileSystem::writeFile(BUILD_BIN_PATH . '/php-config', $php_config_str);
} }
private function getMakeExtraVars(): array private function getMakeExtraVars(): array

View File

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

View File

@@ -148,10 +148,12 @@ class MacOSBuilder extends UnixBuilderBase
$enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED; $enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
// prepare build php envs // prepare build php envs
$mimallocLibs = $this->getLib('mimalloc') !== null ? BUILD_LIB_PATH . '/mimalloc.o ' : '';
$envs_build_php = SystemUtil::makeEnvVarString([ $envs_build_php = SystemUtil::makeEnvVarString([
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'), 'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'),
'CPPFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS'), 'CPPFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS'),
'LDFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS'), 'LDFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS'),
'LIBS' => $mimallocLibs . getenv('SPC_CMD_VAR_PHP_CONFIGURE_LIBS'),
]); ]);
if ($this->getLib('postgresql')) { if ($this->getLib('postgresql')) {
@@ -298,6 +300,13 @@ class MacOSBuilder extends UnixBuilderBase
->exec('rm ' . BUILD_ROOT_PATH . '/lib/libphp.a') ->exec('rm ' . BUILD_ROOT_PATH . '/lib/libphp.a')
->exec('ar rcs ' . BUILD_ROOT_PATH . '/lib/libphp.a *.o') ->exec('ar rcs ' . BUILD_ROOT_PATH . '/lib/libphp.a *.o')
->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o'); ->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o');
FileSystem::replaceFileStr(BUILD_BIN_PATH . '/phpize', "prefix=''", "prefix='" . BUILD_ROOT_PATH . "'");
FileSystem::replaceFileStr(BUILD_BIN_PATH . '/phpize', 's##', 's#/usr/local#');
$php_config_str = FileSystem::readFile(BUILD_BIN_PATH . '/php-config');
str_replace('prefix=""', 'prefix="' . BUILD_ROOT_PATH . '"', $php_config_str);
// move mimalloc to the beginning of libs
$php_config_str = preg_replace('/(libs=")(.*?)\s*(' . preg_quote(BUILD_LIB_PATH, '/') . '\/mimalloc\.o)\s*(.*?)"/', '$1$3 $2 $4"', $php_config_str);
FileSystem::writeFile(BUILD_BIN_PATH . '/php-config', $php_config_str);
} }
private function getMakeExtraVars(): array private function getMakeExtraVars(): array

View File

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

View File

@@ -17,13 +17,17 @@ trait gettext
$ldflags = $this->builder->getOption('enable-zts') ? '-lpthread' : ''; $ldflags = $this->builder->getOption('enable-zts') ? '-lpthread' : '';
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
->setEnv(['CFLAGS' => "{$this->getLibExtraCFlags()} {$cflags}", 'LDFLAGS' => $this->getLibExtraLdFlags() ?: $ldflags, 'LIBS' => $this->getLibExtraLibs()]) ->setEnv([
'CFLAGS' => "{$this->getLibExtraCFlags()} {$cflags}",
'LDFLAGS' => $this->getLibExtraLdFlags() ?: $ldflags,
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv( ->execWithEnv(
'./configure ' . './configure ' .
'--enable-static ' . '--enable-static ' .
'--disable-shared ' . '--disable-shared ' .
'--disable-java ' . '--disable-java ' .
'--disable-c+ ' . '--disable-c++ ' .
$zts . $zts .
$extra . $extra .
'--with-included-gettext ' . '--with-included-gettext ' .

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
trait mimalloc
{
/**
* @throws RuntimeException
* @throws FileSystemException
*/
protected function build(): void
{
$args = '';
if (getenv('SPC_LIBC') === 'musl') {
$args .= '-DMI_LIBC_MUSL=ON ';
}
$args .= '-DMI_BUILD_SHARED=OFF ';
$args .= '-DMI_INSTALL_TOPLEVEL=ON ';
FileSystem::resetDir($this->source_dir . '/build');
shell()->cd($this->source_dir . '/build')
->execWithEnv(
'cmake ' .
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
'-DCMAKE_BUILD_TYPE=Release ' .
$args .
'..'
)
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install');
}
}

View File

@@ -95,8 +95,9 @@ class WindowsBuilder extends BuilderBase
if (($logo = $this->getOption('with-micro-logo')) !== null) { if (($logo = $this->getOption('with-micro-logo')) !== null) {
// realpath // realpath
$logo = realpath($logo); // $logo = realpath($logo);
$micro_logo = '--enable-micro-logo=' . $logo . ' '; $micro_logo = '--enable-micro-logo=' . $logo . ' ';
copy($logo, SOURCE_PATH . '\php-src\\' . $logo);
} else { } else {
$micro_logo = ''; $micro_logo = '';
} }

View File

@@ -37,6 +37,8 @@ class curl extends WindowsLibraryBase
'-DBUILD_EXAMPLES=OFF ' . // disable examples '-DBUILD_EXAMPLES=OFF ' . // disable examples
'-DUSE_LIBIDN2=OFF ' . // disable libidn2 '-DUSE_LIBIDN2=OFF ' . // disable libidn2
'-DCURL_USE_LIBPSL=OFF ' . // disable libpsl '-DCURL_USE_LIBPSL=OFF ' . // disable libpsl
'-DCURL_USE_SCHANNEL=ON ' . // use Schannel instead of OpenSSL
'-DCURL_USE_OPENSSL=OFF ' . // disable openssl due to certificate issue
'-DCURL_ENABLE_SSL=ON ' . '-DCURL_ENABLE_SSL=ON ' .
'-DUSE_NGHTTP2=ON ' . // enable nghttp2 '-DUSE_NGHTTP2=ON ' . // enable nghttp2
'-DCURL_USE_LIBSSH2=ON ' . // enable libssh2 '-DCURL_USE_LIBSSH2=ON ' . // enable libssh2
@@ -48,5 +50,7 @@ class curl extends WindowsLibraryBase
$this->builder->makeSimpleWrapper('cmake'), $this->builder->makeSimpleWrapper('cmake'),
"--build cmakebuild --config Release --target install -j{$this->builder->concurrency}" "--build cmakebuild --config Release --target install -j{$this->builder->concurrency}"
); );
// move libcurl.lib to libcurl_a.lib
rename(BUILD_LIB_PATH . '\libcurl.lib', BUILD_LIB_PATH . '\libcurl_a.lib');
} }
} }

View File

@@ -69,14 +69,19 @@ class Downloader
retry: self::getRetryTime() retry: self::getRetryTime()
), true); ), true);
if (($source['prefer-stable'] ?? false) === false) { $url = null;
$url = $data[0]['tarball_url']; for ($i = 0; $i < count($data); ++$i) {
} else { if (($data[$i]['prerelease'] ?? false) === true && ($source['prefer-stable'] ?? false)) {
$id = 0; continue;
while ($data[$id]['prerelease'] === true) { }
++$id; if (!($source['match'] ?? null)) {
$url = $data[$i]['tarball_url'] ?? null;
break;
}
if (preg_match('|' . $source['match'] . '|', $data[$i]['tarball_url'])) {
$url = $data[$i]['tarball_url'];
break;
} }
$url = $data[$id]['tarball_url'] ?? null;
} }
if (!$url) { if (!$url) {
throw new DownloaderException("failed to find {$name} source"); throw new DownloaderException("failed to find {$name} source");

View File

@@ -42,6 +42,10 @@ class SPCConfigUtil
if ($this->builder->hasCpp()) { if ($this->builder->hasCpp()) {
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++'; $libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
} }
// mimalloc must come first
if (str_contains($libs, BUILD_LIB_PATH . '/mimalloc.o')) {
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);
}
return [ return [
'cflags' => $cflags, 'cflags' => $cflags,
'ldflags' => $ldflags, 'ldflags' => $ldflags,

View File

@@ -3,3 +3,16 @@
declare(strict_types=1); declare(strict_types=1);
assert(function_exists('curl_init')); assert(function_exists('curl_init'));
assert(function_exists('curl_setopt'));
assert(function_exists('curl_exec'));
assert(function_exists('curl_close'));
$curl_version = curl_version();
if (stripos($curl_version['ssl_version'], 'schannel') !== false) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://example.com/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
$data = curl_exec($curl);
curl_close($curl);
assert($data !== false);
}

View File

@@ -6,15 +6,15 @@ declare(strict_types=1);
/** /**
* This is GitHub Actions automatic test extension args generator. * This is GitHub Actions automatic test extension args generator.
* You can edit $extensions, $with_libs and $base_combination. * You can edit $test_php_version, $test_os, $zts, $no_strip, $upx, $prefer_pre_built, $extensions, $with_libs and $base_combination.
*/ */
// --------------------------------- edit area --------------------------------- // --------------------------------- edit area ---------------------------------
// test php version // test php version (8.1 ~ 8.4 available, multiple for matrix)
$test_php_version = [ $test_php_version = [
// '8.1', '8.1',
// '8.2', '8.2',
'8.3', '8.3',
'8.4', '8.4',
]; ];
@@ -24,7 +24,7 @@ $test_os = [
'macos-13', 'macos-13',
'macos-14', 'macos-14',
'ubuntu-latest', 'ubuntu-latest',
// 'windows-latest', 'windows-latest',
]; ];
// whether enable thread safe // whether enable thread safe
@@ -40,13 +40,13 @@ $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) {
'Linux', 'Darwin' => 'gd', 'Linux', 'Darwin' => 'odbc,pdo_odbc',
'Windows' => 'bcmath', 'Windows' => 'odbc,pdo_odbc',
}; };
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
$with_libs = match (PHP_OS_FAMILY) { $with_libs = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'freetype', 'Linux', 'Darwin' => '',
'Windows' => '', 'Windows' => '',
}; };