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