mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 12:24:53 +08:00
Fix phpunit, add SPC_SKIP_TOOLCHAIN_CHECK
This commit is contained in:
parent
fcaa7c5f42
commit
7f45f4aeec
@ -4,5 +4,6 @@
|
||||
>
|
||||
<php>
|
||||
<env name="SPC_IGNORE_BAD_HASH" value="yes" force="true" />
|
||||
<env name="SPC_SKIP_TOOLCHAIN_CHECK" value="yes" force="true" />
|
||||
</php>
|
||||
</phpunit>
|
||||
|
||||
@ -29,10 +29,7 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
|
||||
// apply global environment variables
|
||||
GlobalEnvManager::init();
|
||||
|
||||
if (!$this->getOption('no-env-check')) {
|
||||
GlobalEnvManager::afterInit();
|
||||
}
|
||||
GlobalEnvManager::afterInit();
|
||||
|
||||
// ---------- set necessary compile vars ----------
|
||||
// concurrency
|
||||
|
||||
@ -32,7 +32,6 @@ abstract class BaseCommand extends Command
|
||||
parent::__construct($name);
|
||||
$this->addOption('debug', null, null, 'Enable debug mode');
|
||||
$this->addOption('no-motd', null, null, 'Disable motd');
|
||||
$this->addOption('no-env-check', null, null, 'Disable env check for builder');
|
||||
}
|
||||
|
||||
public function initialize(InputInterface $input, OutputInterface $output): void
|
||||
@ -100,7 +99,7 @@ abstract class BaseCommand extends Command
|
||||
// init GlobalEnv
|
||||
if (!$this instanceof BuildCommand) {
|
||||
GlobalEnvManager::init();
|
||||
$this->input->setOption('no-env-check', true);
|
||||
f_putenv('SPC_SKIP_TOOLCHAIN_CHECK=yes');
|
||||
}
|
||||
if ($this->shouldExecute()) {
|
||||
try {
|
||||
|
||||
@ -108,7 +108,9 @@ class GlobalEnvManager
|
||||
*/
|
||||
public static function afterInit(): void
|
||||
{
|
||||
ToolchainManager::afterInitToolchain();
|
||||
if (!filter_var(getenv('SPC_SKIP_TOOLCHAIN_CHECK'), FILTER_VALIDATE_BOOL)) {
|
||||
ToolchainManager::afterInitToolchain();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user