Skip to content

Commit f19e90a

Browse files
authored
Add extension dio support (#590)
* Add extension dio support * cs-fix
1 parent 36b4ef3 commit f19e90a

File tree

5 files changed

+52
-6
lines changed

5 files changed

+52
-6
lines changed

config/ext.json

+7
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
"qdbm"
5858
]
5959
},
60+
"dio": {
61+
"support": {
62+
"BSD": "wip"
63+
},
64+
"type": "external",
65+
"source": "dio"
66+
},
6067
"dom": {
6168
"support": {
6269
"BSD": "wip"

config/source.json

+10
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@
6969
"path": "COPYING"
7070
}
7171
},
72+
"dio": {
73+
"type": "url",
74+
"url": "https://pecl.php.net/get/dio",
75+
"path": "php-src/ext/dio",
76+
"filename": "dio.tgz",
77+
"license": {
78+
"type": "file",
79+
"path": "LICENSE"
80+
}
81+
},
7282
"ext-ds": {
7383
"type": "url",
7484
"url": "https://pecl.php.net/get/ds",

src/SPC/builder/extension/dio.php

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\extension;
6+
7+
use SPC\builder\Extension;
8+
use SPC\store\FileSystem;
9+
use SPC\util\CustomExt;
10+
11+
#[CustomExt('dio')]
12+
class dio extends Extension
13+
{
14+
public function patchBeforeBuildconf(): bool
15+
{
16+
if (!file_exists(SOURCE_PATH . '/php-src/ext/dio/php_dio.h')) {
17+
FileSystem::writeFile(SOURCE_PATH . '/php-src/ext/dio/php_dio.h', FileSystem::readFile(SOURCE_PATH . '/php-src/ext/dio/src/php_dio.h'));
18+
return true;
19+
}
20+
return false;
21+
}
22+
}

src/globals/ext-tests/dio.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
assert(function_exists('dio_open'));

src/globals/test-extensions.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313

1414
// test php version
1515
$test_php_version = [
16-
'8.3',
16+
// '8.1',
17+
// '8.2',
18+
// '8.3',
1719
'8.4',
1820
];
1921

2022
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
2123
$test_os = [
2224
'macos-14',
23-
'macos-13',
2425
'ubuntu-latest',
26+
// 'windows-latest',
2527
];
2628

2729
// whether enable thread safe
@@ -33,12 +35,12 @@
3335
$upx = false;
3436

3537
// prefer downloading pre-built packages to speed up the build process
36-
$prefer_pre_built = false;
38+
$prefer_pre_built = true;
3739

3840
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
3941
$extensions = match (PHP_OS_FAMILY) {
40-
'Linux', 'Darwin' => 'imagick',
41-
'Windows' => 'ast',
42+
'Linux', 'Darwin' => 'dio',
43+
'Windows' => 'dio',
4244
};
4345

4446
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
@@ -51,7 +53,7 @@
5153
// You can use `common`, `bulk`, `minimal` or `none`.
5254
// note: combination is only available for *nix platform. Windows must use `none` combination
5355
$base_combination = match (PHP_OS_FAMILY) {
54-
'Linux', 'Darwin' => 'minimal',
56+
'Linux', 'Darwin' => 'none',
5557
'Windows' => 'none',
5658
};
5759

0 commit comments

Comments
 (0)