mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
change extension_dir, the env variable only has an effect during compilation
This commit is contained in:
parent
ad3860981a
commit
3052b1cca5
@ -243,6 +243,10 @@ class Extension
|
||||
}
|
||||
}
|
||||
|
||||
if ($ret !== '') {
|
||||
$ret = ' -d "extension_dir=' . BUILD_MODULES_PATH . '"' . $ret;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -255,7 +259,6 @@ class Extension
|
||||
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
||||
// If check failed, throw RuntimeException
|
||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||
putenv('EXTENSION_DIR=' . BUILD_MODULES_PATH);
|
||||
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
|
||||
@ -26,8 +26,7 @@ class mbregex extends Extension
|
||||
*/
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? ' -d "extension=mbstring"' : '';
|
||||
putenv('EXTENSION_DIR=' . BUILD_MODULES_PATH);
|
||||
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? '-d "extension_dir=' . BUILD_MODULES_PATH . '" -d "extension=mbstring"' : '';
|
||||
[$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,6 @@ class swoole_hook_mysql extends Extension
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
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) {
|
||||
|
||||
@ -38,7 +38,6 @@ class swoole_hook_pgsql extends Extension
|
||||
return;
|
||||
}
|
||||
$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) {
|
||||
|
||||
@ -38,7 +38,6 @@ class swoole_hook_sqlite extends Extension
|
||||
return;
|
||||
}
|
||||
$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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user