set extension dir before

This commit is contained in:
DubbleClick 2025-05-25 18:29:34 +07:00
parent d833d8946c
commit e2ea10d2eb
4 changed files with 10 additions and 4 deletions

View File

@ -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 !');

View File

@ -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);

View File

@ -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);

View File

@ -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);