Avoid useless exception on startup version mismatch

This commit is contained in:
crazywhalecc
2025-07-15 21:11:38 +08:00
parent a5d26d6517
commit 5f2459ae43
2 changed files with 10 additions and 4 deletions

View File

@@ -159,7 +159,7 @@ class BuildPHPCommand extends BuildCommand
$indent_texts['UPX Pack'] = 'enabled';
}
$ver = $builder->getPHPVersionFromArchive() ?: $builder->getPHPVersion();
$ver = $builder->getPHPVersionFromArchive() ?: $builder->getPHPVersion(false);
$indent_texts['PHP Version'] = $ver;
if (!empty($not_included)) {
@@ -269,6 +269,7 @@ class BuildPHPCommand extends BuildCommand
} catch (WrongUsageException $e) {
// WrongUsageException is not an exception, it's a user error, so we just print the error message
logger()->critical($e->getMessage());
logger()->error($e->getTraceAsString());
return static::FAILURE;
} catch (\Throwable $e) {
if ($this->getOption('debug')) {