mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add ext yac (#407)
* add ext yac * enable yac for windows * enable yac test for windows * correct
This commit is contained in:
parent
99aadd3e73
commit
b4ed4ea956
@ -623,6 +623,14 @@
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"yac": {
|
||||
"type": "external",
|
||||
"source": "yac",
|
||||
"arg-type-unix": "custom",
|
||||
"ext-depends-unix": [
|
||||
"igbinary"
|
||||
]
|
||||
},
|
||||
"yaml": {
|
||||
"type": "external",
|
||||
"source": "yaml",
|
||||
|
||||
@ -673,6 +673,16 @@
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"yac": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/yac",
|
||||
"path": "php-src/ext/yac",
|
||||
"filename": "yac.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"yaml": {
|
||||
"type": "git",
|
||||
"path": "php-src/ext/yaml",
|
||||
|
||||
26
src/SPC/builder/extension/yac.php
Normal file
26
src/SPC/builder/extension/yac.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('yac')]
|
||||
class yac extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yac/storage/allocator/yac_allocator.h', 'defined(HAVE_SHM_MMAP_ANON)', 'defined(YAC_ALLOCATOR_H)');
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yac/serializer/igbinary.c', '#ifdef YAC_ENABLE_IGBINARY', '#if 1');
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yac/serializer/json.c', '#if YAC_ENABLE_JSON', '#if 1');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(): string
|
||||
{
|
||||
return '--enable-yac --enable-igbinary --enable-json';
|
||||
}
|
||||
}
|
||||
@ -13,8 +13,8 @@ declare(strict_types=1);
|
||||
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'pgsql,intl,xml,openssl',
|
||||
'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi,ds,simdjson',
|
||||
'Linux', 'Darwin' => 'yac',
|
||||
'Windows' => 'mbstring,pdo_sqlite,mbregex,yac',
|
||||
};
|
||||
|
||||
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user