Add extension dio support (#590)

* Add extension dio support

* cs-fix
This commit is contained in:
Jerry Ma 2025-01-25 18:43:12 +09:00 committed by GitHub
parent 36b4ef306e
commit f19e90afd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 52 additions and 6 deletions

View File

@ -57,6 +57,13 @@
"qdbm" "qdbm"
] ]
}, },
"dio": {
"support": {
"BSD": "wip"
},
"type": "external",
"source": "dio"
},
"dom": { "dom": {
"support": { "support": {
"BSD": "wip" "BSD": "wip"

View File

@ -69,6 +69,16 @@
"path": "COPYING" "path": "COPYING"
} }
}, },
"dio": {
"type": "url",
"url": "https://pecl.php.net/get/dio",
"path": "php-src/ext/dio",
"filename": "dio.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-ds": { "ext-ds": {
"type": "url", "type": "url",
"url": "https://pecl.php.net/get/ds", "url": "https://pecl.php.net/get/ds",

View File

@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('dio')]
class dio extends Extension
{
public function patchBeforeBuildconf(): bool
{
if (!file_exists(SOURCE_PATH . '/php-src/ext/dio/php_dio.h')) {
FileSystem::writeFile(SOURCE_PATH . '/php-src/ext/dio/php_dio.h', FileSystem::readFile(SOURCE_PATH . '/php-src/ext/dio/src/php_dio.h'));
return true;
}
return false;
}
}

View File

@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
assert(function_exists('dio_open'));

View File

@ -13,15 +13,17 @@ declare(strict_types=1);
// test php version // test php version
$test_php_version = [ $test_php_version = [
'8.3', // '8.1',
// '8.2',
// '8.3',
'8.4', '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)
$test_os = [ $test_os = [
'macos-14', 'macos-14',
'macos-13',
'ubuntu-latest', 'ubuntu-latest',
// 'windows-latest',
]; ];
// whether enable thread safe // whether enable thread safe
@ -33,12 +35,12 @@ $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 = false; $prefer_pre_built = true;
// 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' => 'imagick', 'Linux', 'Darwin' => 'dio',
'Windows' => 'ast', 'Windows' => 'dio',
}; };
// 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`).
@ -51,7 +53,7 @@ $with_libs = match (PHP_OS_FAMILY) {
// You can use `common`, `bulk`, `minimal` or `none`. // You can use `common`, `bulk`, `minimal` or `none`.
// note: combination is only available for *nix platform. Windows must use `none` combination // note: combination is only available for *nix platform. Windows must use `none` combination
$base_combination = match (PHP_OS_FAMILY) { $base_combination = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'minimal', 'Linux', 'Darwin' => 'none',
'Windows' => 'none', 'Windows' => 'none',
}; };