mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
set extension dir before
This commit is contained in:
parent
d833d8946c
commit
e2ea10d2eb
@ -26,7 +26,8 @@ class mbregex extends Extension
|
||||
*/
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? ' -d "extension=mbstring.so"' : '';
|
||||
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? ' -d "extension=mbstring"' : '';
|
||||
putenv('EXTENSION_DIR=' . BUILD_MODULES_PATH);
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $sharedext . ' --ri "mbstring" | grep regex', false);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
|
||||
|
||||
@ -29,7 +29,8 @@ class swoole_hook_mysql extends Extension
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
|
||||
putenv('EXTENSION_DIR=' . BUILD_MODULES_PATH);
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n'. $this->getSharedExtensionLoadString() . ' --ri "swoole"', false);
|
||||
$out = implode('', $out);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
|
||||
@ -37,7 +37,9 @@ class swoole_hook_pgsql extends Extension
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
|
||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||
putenv('EXTENSION_DIR=' . BUILD_MODULES_PATH);
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
$out = implode('', $out);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
|
||||
@ -37,7 +37,9 @@ class swoole_hook_sqlite extends Extension
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
|
||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||
putenv('EXTENSION_DIR=' . BUILD_MODULES_PATH);
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
$out = implode('', $out);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user