mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
refactor some terminal outputs
This commit is contained in:
@@ -77,12 +77,23 @@ class BuildCliCommand extends BuildCommand
|
|||||||
if (!empty($this->input->getOption('with-hardcoded-ini'))) {
|
if (!empty($this->input->getOption('with-hardcoded-ini'))) {
|
||||||
$indent_texts['Hardcoded INI'] = $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)) {
|
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);
|
sleep(2);
|
||||||
|
|
||||||
if ($this->input->getOption('with-clean')) {
|
if ($this->input->getOption('with-clean')) {
|
||||||
|
|||||||
@@ -227,8 +227,12 @@ class FileSystem
|
|||||||
{
|
{
|
||||||
$dir = self::convertPath($dir);
|
$dir = self::convertPath($dir);
|
||||||
// 不是目录不扫,直接 false 处理
|
// 不是目录不扫,直接 false 处理
|
||||||
|
if (!file_exists($dir)) {
|
||||||
|
logger()->debug('Scan dir failed, no such file or directory.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
logger()->warning('Scan dir failed, no such directory.');
|
logger()->warning('Scan dir failed, not directory.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
logger()->debug('scanning directory ' . $dir);
|
logger()->debug('scanning directory ' . $dir);
|
||||||
@@ -317,8 +321,12 @@ class FileSystem
|
|||||||
$dir = FileSystem::convertPath($dir);
|
$dir = FileSystem::convertPath($dir);
|
||||||
logger()->debug('Removing path recursively: "' . $dir . '"');
|
logger()->debug('Removing path recursively: "' . $dir . '"');
|
||||||
// 不是目录不扫,直接 false 处理
|
// 不是目录不扫,直接 false 处理
|
||||||
|
if (!file_exists($dir)) {
|
||||||
|
logger()->debug('Scan dir failed, no such file or directory.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
logger()->warning('Scan dir failed, no such directory.');
|
logger()->warning('Scan dir failed, not directory.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
logger()->debug('scanning directory ' . $dir);
|
logger()->debug('scanning directory ' . $dir);
|
||||||
|
|||||||
Reference in New Issue
Block a user