mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
commit
856db3df08
@ -323,6 +323,18 @@
|
||||
"openssl"
|
||||
]
|
||||
},
|
||||
"lz4": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "external",
|
||||
"source": "ext-lz4",
|
||||
"arg-type": "custom",
|
||||
"lib-depends": [
|
||||
"liblz4"
|
||||
]
|
||||
},
|
||||
"libxml": {
|
||||
"support": {
|
||||
"BSD": "wip"
|
||||
|
||||
@ -161,6 +161,17 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"ext-lz4": {
|
||||
"type": "ghtagtar",
|
||||
"repo": "kjdev/php-ext-lz4",
|
||||
"path": "php-src/ext/lz4",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": [
|
||||
"LICENSE"
|
||||
]
|
||||
}
|
||||
},
|
||||
"ext-memcache": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/memcache",
|
||||
|
||||
22
src/SPC/builder/extension/lz4.php
Normal file
22
src/SPC/builder/extension/lz4.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('lz4')]
|
||||
class lz4 extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--enable-lz4' . ($shared ? '=shared' : '') . ' --with-lz4-includedir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
{
|
||||
return '--enable-lz4';
|
||||
}
|
||||
}
|
||||
15
src/globals/ext-tests/lz4.php
Normal file
15
src/globals/ext-tests/lz4.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
assert(function_exists('lz4_compress'));
|
||||
assert(function_exists('lz4_uncompress'));
|
||||
|
||||
$input = str_repeat('The quick brown fox jumps over the lazy dog. ', 10);
|
||||
$compressed = lz4_compress($input);
|
||||
assert(is_string($compressed));
|
||||
assert(strlen($compressed) < strlen($input));
|
||||
|
||||
$uncompressed = lz4_uncompress($compressed);
|
||||
assert(is_string($uncompressed));
|
||||
assert($uncompressed === $input);
|
||||
@ -13,22 +13,22 @@ declare(strict_types=1);
|
||||
|
||||
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
||||
$test_php_version = [
|
||||
'8.1',
|
||||
'8.2',
|
||||
'8.3',
|
||||
// '8.1',
|
||||
// '8.2',
|
||||
// '8.3',
|
||||
'8.4',
|
||||
];
|
||||
|
||||
// test os (macos-13, macos-14, macos-15, ubuntu-latest, windows-latest are available)
|
||||
$test_os = [
|
||||
// 'macos-13',
|
||||
// 'macos-14',
|
||||
// 'macos-15',
|
||||
'macos-13',
|
||||
'macos-14',
|
||||
'macos-15',
|
||||
'ubuntu-latest',
|
||||
// 'ubuntu-22.04',
|
||||
// 'ubuntu-24.04',
|
||||
// 'ubuntu-22.04-arm',
|
||||
// 'ubuntu-24.04-arm',
|
||||
'ubuntu-22.04',
|
||||
'ubuntu-24.04',
|
||||
'ubuntu-22.04-arm',
|
||||
'ubuntu-24.04-arm',
|
||||
// 'windows-latest',
|
||||
];
|
||||
|
||||
@ -45,7 +45,7 @@ $prefer_pre_built = false;
|
||||
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'xsl,simplexml,xlswriter',
|
||||
'Linux', 'Darwin' => 'lz4',
|
||||
'Windows' => 'xlswriter,openssl',
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user