refactor some terminal outputs

This commit is contained in:
crazywhalecc 2024-02-16 18:57:32 +08:00
parent d9bd96af71
commit 0954ddcc96
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 24 additions and 5 deletions

View File

@ -77,12 +77,23 @@ class BuildCliCommand extends BuildCommand
if (!empty($this->input->getOption('with-hardcoded-ini'))) {
$indent_texts['Hardcoded INI'] = $this->input->getOption('with-hardcoded-ini');
}
$this->printFormatInfo($indent_texts);
if ($this->input->getOption('disable-opcache-jit')) {
$indent_texts['Opcache JIT'] = 'disabled';
}
try {
$ver = $builder->getPHPVersion();
$indent_texts['PHP Version'] = $ver;
} catch (\Throwable) {
if (($ver = $builder->getPHPVersionFromArchive()) !== false) {
$indent_texts['PHP Version'] = $ver;
}
}
if (!empty($not_included)) {
logger()->warning('Some extensions will be enabled due to dependencies: ' . implode(',', $not_included));
$indent_texts['Extra Exts (' . count($not_included) . ')'] = implode(', ', $not_included);
}
logger()->info('Build will start after 2s ...');
$this->printFormatInfo($indent_texts);
logger()->notice('Build will start after 2s ...');
sleep(2);
if ($this->input->getOption('with-clean')) {

View File

@ -227,8 +227,12 @@ class FileSystem
{
$dir = self::convertPath($dir);
// 不是目录不扫,直接 false 处理
if (!file_exists($dir)) {
logger()->debug('Scan dir failed, no such file or directory.');
return false;
}
if (!is_dir($dir)) {
logger()->warning('Scan dir failed, no such directory.');
logger()->warning('Scan dir failed, not directory.');
return false;
}
logger()->debug('scanning directory ' . $dir);
@ -317,8 +321,12 @@ class FileSystem
$dir = FileSystem::convertPath($dir);
logger()->debug('Removing path recursively: "' . $dir . '"');
// 不是目录不扫,直接 false 处理
if (!file_exists($dir)) {
logger()->debug('Scan dir failed, no such file or directory.');
return false;
}
if (!is_dir($dir)) {
logger()->warning('Scan dir failed, no such directory.');
logger()->warning('Scan dir failed, not directory.');
return false;
}
logger()->debug('scanning directory ' . $dir);