Fix several patches & newer phpmicro support (#470)

* use upstream phpmicro

* move src/global/tests to src/global/ext-tests

* move src/global/tests to src/global/ext-tests

* prevent file_get_contents memory insufficience

* update README

* fix libxml >= 2.12 with older PHP (<=8.1) build bug

* cleanup code, support newer phpmicro

* add --no-strip and --with-upx-pack tests

* fix windows sanity check for newer phpmicro

* fix windows sanity check for newer phpmicro

* test

* test

* test

* update deps for ci
This commit is contained in:
Jerry Ma
2024-06-03 23:16:15 +08:00
committed by GitHub
parent 3057d02e37
commit d258417afb
36 changed files with 742 additions and 71 deletions

View File

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

View File

@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);
$str = 'This is bz2 extension test';
assert(function_exists('bzdecompress'));
assert(function_exists('bzcompress'));
assert(bzdecompress(bzcompress($str, 9)) === $str);

View File

@@ -0,0 +1,6 @@
<?php
declare(strict_types=1);
assert(function_exists('cal_info'));
assert(is_array(cal_info(0)));

View File

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

View File

@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);
assert(class_exists('\\DOMDocument'));
$doc = new DOMDocument();
$doc->loadHtml('<html><head><meta charset="UTF-8"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body id="app">Hello</body></html>');
assert($doc->getElementById('app')->nodeValue === 'Hello');

View File

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

View File

@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
assert(function_exists('gd_info'));
$info = gd_info();
assert($info['PNG Support'] ?? false);
assert($info['GIF Create Support'] ?? false);
assert($info['GIF Read Support'] ?? false);

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
assert(function_exists('gettext'));
assert(function_exists('bindtextdomain'));
assert(function_exists('textdomain'));
assert(function_exists('bind_textdomain_codeset'));
if (!is_dir('locale/en_US/LC_MESSAGES/')) {
mkdir('locale/en_US/LC_MESSAGES/', 0755, true);
}
if (!file_exists('locale/en_US/LC_MESSAGES/test.mo')) {
$mo = '3hIElQAAAAACAAAAHAAAACwAAAAFAAAAPAAAAAAAAABQAAAABgAAAFEAAAAXAQAAWAAAAAcAAABwAQAAAQAAAAAAAAAAAAAAAgAAAAAAAAAA56S65L6LAFByb2plY3QtSWQtVmVyc2lvbjogUEFDS0FHRSBWRVJTSU9OClJlcG9ydC1Nc2dpZC1CdWdzLVRvOiAKUE8tUmV2aXNpb24tRGF0ZTogWUVBUi1NTy1EQSBITzpNSStaT05FCkxhc3QtVHJhbnNsYXRvcjogRlVMTCBOQU1FIDxFTUFJTEBBRERSRVNTPgpMYW5ndWFnZS1UZWFtOiBMQU5HVUFHRSA8TExAbGkub3JnPgpMYW5ndWFnZTogCk1JTUUtVmVyc2lvbjogMS4wCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA4Yml0CgBFeGFtcGxlAA==';
file_put_contents('locale/en_US/LC_MESSAGES/test.mo', base64_decode($mo));
}
putenv('LANG=en_US');
setlocale(LC_ALL, 'en_US');
$domain = 'test';
bindtextdomain($domain, 'locale/');
bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain);
assert(gettext(json_decode('"\u793a\u4f8b"', true)) === 'Example');

View File

@@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
assert(class_exists(NumberFormatter::class));

View File

@@ -0,0 +1,6 @@
<?php
declare(strict_types=1);
assert(function_exists('openssl_digest'));
assert(openssl_digest('123456', 'md5') === 'e10adc3949ba59abbe56e057f20f883e');

View File

@@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
assert(class_exists('\parallel\Runtime'));

View File

@@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
assert(class_exists('\\Redis'));

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
assert(function_exists('swoole_cpu_num'));
assert(function_exists('swoole_string'));
assert(class_exists('Swoole\Coroutine'));
assert(class_exists('Swoole\Coroutine\Http2\Client'));
assert(class_exists('Swoole\Coroutine\Redis'));
assert(class_exists('Swoole\Coroutine\WaitGroup'));
assert(class_exists('Swoole\Http2\Request'));
assert(constant('SWOOLE_VERSION'));

View File

@@ -0,0 +1,6 @@
<?php
declare(strict_types=1);
assert(function_exists('uuid_create'));
assert(strlen(uuid_create(0)) === 36);

View File

@@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
assert(class_exists('\\ZipArchive'));

View File

@@ -0,0 +1,6 @@
<?php
declare(strict_types=1);
assert(function_exists('gzcompress'));
assert(gzdecode(gzencode('aaa')) === 'aaa');