mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
add readline support
This commit is contained in:
parent
b3296842b7
commit
2d597ed690
@ -18,7 +18,7 @@
|
||||
"ncurses": {
|
||||
"source": "ncurses",
|
||||
"static-libs-unix": [
|
||||
"libncursesw.a"
|
||||
"libncurses.a"
|
||||
]
|
||||
},
|
||||
"readline": {
|
||||
|
||||
15
src/SPC/builder/linux/library/ncurses.php
Normal file
15
src/SPC/builder/linux/library/ncurses.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class ncurses extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\ncurses;
|
||||
|
||||
public const NAME = 'ncurses';
|
||||
}
|
||||
15
src/SPC/builder/linux/library/readline.php
Normal file
15
src/SPC/builder/linux/library/readline.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class readline extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\readline;
|
||||
|
||||
public const NAME = 'readline';
|
||||
}
|
||||
@ -17,7 +17,7 @@ trait ncurses
|
||||
'--with-curses-h ' .
|
||||
'--enable-pc-files ' .
|
||||
'--enable-echo ' .
|
||||
'--enable-widec ' .
|
||||
// '--enable-widec ' .
|
||||
'--with-normal ' .
|
||||
'--with-ticlib ' .
|
||||
'--without-tests ' .
|
||||
|
||||
@ -82,6 +82,9 @@ class SourcePatcher
|
||||
if ($event = $builder->getExt('event')) {
|
||||
$patch[] = ['event check', '/-levent_openssl/', $event->getLibFilesString()];
|
||||
}
|
||||
if ($readline = $builder->getExt('readline')) {
|
||||
$patch[] = ['readline patch', '/-lncurses/', $readline->getLibFilesString()];
|
||||
}
|
||||
$patch[] = ['disable capstone', '/have_capstone="yes"/', 'have_capstone="no"'];
|
||||
foreach ($patch as $item) {
|
||||
logger()->info('Patching configure: ' . $item[0]);
|
||||
|
||||
@ -4,5 +4,4 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
bcscale(3);
|
||||
exit(bcdiv('105', '6.55957') === '16.007' ? 0 : 1);
|
||||
assert(function_exists('bcscale'));
|
||||
|
||||
@ -3,4 +3,6 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
$str = 'This is bz2 extension test';
|
||||
exit(bzdecompress(bzcompress($str, 9)) === $str ? 0 : 1);
|
||||
assert(function_exists('bzdecompress'));
|
||||
assert(function_exists('bzcompress'));
|
||||
assert(bzdecompress(bzcompress($str, 9)) === $str);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
exit(function_exists('cal_info') && is_array(cal_info(0)) ? 0 : 1);
|
||||
assert(function_exists('cal_info'));
|
||||
assert(is_array(cal_info(0)));
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
exit(function_exists('curl_init') ? 0 : 1);
|
||||
assert(function_exists('curl_init'));
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!class_exists('\\DOMDocument')) {
|
||||
exit(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>");
|
||||
exit($doc->getElementById('app')->nodeValue === 'Hello' ? 0 : 1);
|
||||
assert($doc->getElementById('app')->nodeValue === 'Hello');
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
exit(function_exists('filter_var') ? 0 : 1);
|
||||
assert(function_exists('filter_var'));
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
assert(function_exists('gd_info'));
|
||||
$info = gd_info();
|
||||
$true = ($true ?? true) && ($info['PNG Support'] ?? false);
|
||||
exit($true ? 0 : 1);
|
||||
assert($info['PNG Support'] ?? false);
|
||||
assert($info['GIF Create Support'] ?? false);
|
||||
assert($info['GIF Read Support'] ?? false);
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
exit(class_exists('\\Redis') ? 0 : 1);
|
||||
assert(class_exists('\\Redis'));
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
exit(class_exists('\\ZipArchive') ? 0 : 1);
|
||||
assert(class_exists('\\ZipArchive'));
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
exit(function_exists('gzcompress') ? 0 : 1);
|
||||
assert(function_exists('gzcompress'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user