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

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