mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
fix readline
This commit is contained in:
@@ -21,6 +21,11 @@ class mbregex extends Extension
|
||||
return '';
|
||||
}
|
||||
|
||||
public function buildUnixShared(): void
|
||||
{
|
||||
print('mbregex is already built as part of mbstring, skipping build' . PHP_EOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* mbregex is not an extension, we need to overwrite the default check.
|
||||
*/
|
||||
|
||||
@@ -20,4 +20,15 @@ class mbstring extends Extension
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-mbstring';
|
||||
if ($this->builder->getExt('mbregex') === null) {
|
||||
$arg .= ' --disable-mbregex';
|
||||
} else {
|
||||
$arg .= ' --enable-mbregex';
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,22 @@ class readline extends Extension
|
||||
{
|
||||
return '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
public function patchBeforeSharedConfigure(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr($this->source_dir . '/configure',
|
||||
'test "$PHP_LIBEDIT" = "no" && PHP_LIBEDIT=yes',
|
||||
''
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function buildUnixShared(): void
|
||||
{
|
||||
if (!file_exists(BUILD_BIN_PATH . '/php') || !file_exists(BUILD_INCLUDE_PATH . '/php/sapi/cli/cli.h')) {
|
||||
logger()->warning('CLI mode is not enabled, skipping readline build');
|
||||
return;
|
||||
}
|
||||
parent::buildUnixShared();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user