mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 23:35:37 +08:00
add some tests and iconv support
This commit is contained in:
@@ -111,7 +111,7 @@
|
|||||||
},
|
},
|
||||||
"iconv": {
|
"iconv": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with",
|
"arg-type": "custom",
|
||||||
"lib-depends-windows": [
|
"lib-depends-windows": [
|
||||||
"libiconv"
|
"libiconv"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,20 +8,20 @@
|
|||||||
| | Linux | macOS | Windows |
|
| | Linux | macOS | Windows |
|
||||||
|------------|--------------------------------------------------------------------|--------------------------------------------------------------------|---------|
|
|------------|--------------------------------------------------------------------|--------------------------------------------------------------------|---------|
|
||||||
| bcmath | yes | yes | |
|
| bcmath | yes | yes | |
|
||||||
| bz2 | yes | untested | |
|
| bz2 | yes | yes | |
|
||||||
| calendar | yes | yes | |
|
| calendar | yes | yes | |
|
||||||
| ctype | yes | yes | |
|
| ctype | yes | yes | |
|
||||||
| curl | untested | yes | |
|
| curl | untested | yes | |
|
||||||
| date | yes | yes | |
|
| date | yes | yes | |
|
||||||
| dba | yes | yes | |
|
| dba | yes | yes | |
|
||||||
| dom | untested | untested | |
|
| dom | yes | yes | |
|
||||||
| enchant | | | |
|
| enchant | | | |
|
||||||
| event | | | |
|
| event | | | |
|
||||||
| exif | yes | yes | |
|
| exif | yes | yes | |
|
||||||
| filter | yes | yes | |
|
| filter | yes | yes | |
|
||||||
| fileinfo | yes | | |
|
| fileinfo | yes | | |
|
||||||
| ftp | yes | yes | |
|
| ftp | yes | yes | |
|
||||||
| gd | untested | untested | |
|
| gd | untested | yes | |
|
||||||
| gettext | | | |
|
| gettext | | | |
|
||||||
| gmp | untested | untested | |
|
| gmp | untested | untested | |
|
||||||
| hash | yes | yes | |
|
| hash | yes | yes | |
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
| mysqli | | | |
|
| mysqli | | | |
|
||||||
| mysqlnd | yes | yes | |
|
| mysqlnd | yes | yes | |
|
||||||
| openssl | untested | yes | |
|
| openssl | untested | yes | |
|
||||||
| pcntl | untested | untested | |
|
| pcntl | untested | yes | |
|
||||||
| pdo | yes | yes | |
|
| pdo | yes | yes | |
|
||||||
| pdo_mysql | yes | yes | |
|
| pdo_mysql | yes | yes | |
|
||||||
| pdo_sqlite | yes | yes | |
|
| pdo_sqlite | yes | yes | |
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
| shmop | untested | | |
|
| shmop | untested | | |
|
||||||
| simplexml | untested | untested | |
|
| simplexml | untested | untested | |
|
||||||
| soap | untested | | |
|
| soap | untested | | |
|
||||||
| sockets | untested | | |
|
| sockets | untested | yes | |
|
||||||
| sqlite3 | untested | untested | |
|
| sqlite3 | untested | untested | |
|
||||||
| swow | | | |
|
| swow | | | |
|
||||||
| swoole | [faulty](https://github.com/crazywhalecc/static-php-cli/issues/32) | [faulty](https://github.com/crazywhalecc/static-php-cli/issues/32) | |
|
| swoole | [faulty](https://github.com/crazywhalecc/static-php-cli/issues/32) | [faulty](https://github.com/crazywhalecc/static-php-cli/issues/32) | |
|
||||||
|
|||||||
@@ -183,6 +183,9 @@ class Extension
|
|||||||
$arg .= ' --with-event-openssl --with-openssl-dir="' . BUILD_ROOT_PATH . '"';
|
$arg .= ' --with-event-openssl --with-openssl-dir="' . BUILD_ROOT_PATH . '"';
|
||||||
}
|
}
|
||||||
break;*/
|
break;*/
|
||||||
|
case 'iconv':
|
||||||
|
$arg = ' --with-iconv="' . BUILD_ROOT_PATH . '"';
|
||||||
|
break;
|
||||||
case 'mbstring':
|
case 'mbstring':
|
||||||
$arg = ' --disable-mbregex ONIG_CFLAGS=-I"' . BUILD_ROOT_PATH . '" ' .
|
$arg = ' --disable-mbregex ONIG_CFLAGS=-I"' . BUILD_ROOT_PATH . '" ' .
|
||||||
'ONIG_LIBS="' . $this->getLibFilesString() . '" ';
|
'ONIG_LIBS="' . $this->getLibFilesString() . '" ';
|
||||||
|
|||||||
47
src/SPC/builder/macos/library/libiconv.php
Normal file
47
src/SPC/builder/macos/library/libiconv.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2022 Yun Dou <dixyes@gmail.com>
|
||||||
|
*
|
||||||
|
* lwmbs is licensed under Mulan PSL v2. You can use this
|
||||||
|
* software according to the terms and conditions of the
|
||||||
|
* Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at:
|
||||||
|
*
|
||||||
|
* http://license.coscl.org.cn/MulanPSL2
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||||
|
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* See the Mulan PSL v2 for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
|
|
||||||
|
class libiconv extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
public const NAME = 'libiconv';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public function build()
|
||||||
|
{
|
||||||
|
[,,$destdir] = SEPARATED_PATH;
|
||||||
|
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->exec(
|
||||||
|
"{$this->builder->configure_env} ./configure " .
|
||||||
|
'--enable-static ' .
|
||||||
|
'--disable-shared ' .
|
||||||
|
'--prefix='
|
||||||
|
)
|
||||||
|
->exec('make clean')
|
||||||
|
->exec("make -j{$this->builder->concurrency}")
|
||||||
|
->exec('make install DESTDIR=' . $destdir);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,4 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
exit(class_exists('\\DOMDocument') ? 0 : 1);
|
if (!class_exists('\\DOMDocument')) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
$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>");
|
||||||
|
exit($doc->getElementById('app')->nodeValue === 'Hello' ? 0 : 1);
|
||||||
|
|||||||
8
src/globals/tests/gd.php
Normal file
8
src/globals/tests/gd.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
$info = gd_info();
|
||||||
|
$true = $info['JPEG Support'] ?? false;
|
||||||
|
$true = $true ? ($info['PNG Support'] ?? false) : false;
|
||||||
|
exit($true ? 0 : 1);
|
||||||
Reference in New Issue
Block a user