mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 00:35:41 +08:00
add some tests and iconv support
This commit is contained in:
@@ -183,6 +183,9 @@ class Extension
|
||||
$arg .= ' --with-event-openssl --with-openssl-dir="' . BUILD_ROOT_PATH . '"';
|
||||
}
|
||||
break;*/
|
||||
case 'iconv':
|
||||
$arg = ' --with-iconv="' . BUILD_ROOT_PATH . '"';
|
||||
break;
|
||||
case 'mbstring':
|
||||
$arg = ' --disable-mbregex ONIG_CFLAGS=-I"' . BUILD_ROOT_PATH . '" ' .
|
||||
'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);
|
||||
|
||||
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