mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge pull request #341 from crazywhalecc/no-ansi-build
Apply default `--no-ansi` output
This commit is contained in:
commit
78f4317660
@ -56,11 +56,6 @@ abstract class BaseCommand extends Command
|
|||||||
// 如果 return false 则错误会继续递交给 PHP 标准错误处理
|
// 如果 return false 则错误会继续递交给 PHP 标准错误处理
|
||||||
return true;
|
return true;
|
||||||
}, E_ALL | E_STRICT);
|
}, E_ALL | E_STRICT);
|
||||||
if ($input->getOption('debug')) {
|
|
||||||
global $ob_logger;
|
|
||||||
$ob_logger = new ConsoleLogger(LogLevel::DEBUG);
|
|
||||||
define('DEBUG_MODE', true);
|
|
||||||
}
|
|
||||||
$version = ConsoleApplication::VERSION;
|
$version = ConsoleApplication::VERSION;
|
||||||
if (!$this->no_motd) {
|
if (!$this->no_motd) {
|
||||||
echo " _ _ _ _
|
echo " _ _ _ _
|
||||||
@ -83,6 +78,14 @@ abstract class BaseCommand extends Command
|
|||||||
$this->input = $input;
|
$this->input = $input;
|
||||||
$this->output = $output;
|
$this->output = $output;
|
||||||
|
|
||||||
|
global $ob_logger;
|
||||||
|
if ($input->getOption('debug')) {
|
||||||
|
$ob_logger = new ConsoleLogger(LogLevel::DEBUG, decorated: !$input->getOption('no-ansi'));
|
||||||
|
define('DEBUG_MODE', true);
|
||||||
|
} else {
|
||||||
|
$ob_logger = new ConsoleLogger(decorated: !$input->getOption('no-ansi'));
|
||||||
|
}
|
||||||
|
|
||||||
// windows fallback
|
// windows fallback
|
||||||
Prompt::fallbackWhen(PHP_OS_FAMILY === 'Windows');
|
Prompt::fallbackWhen(PHP_OS_FAMILY === 'Windows');
|
||||||
ConfirmPrompt::fallbackUsing(function (ConfirmPrompt $prompt) use ($input, $output) {
|
ConfirmPrompt::fallbackUsing(function (ConfirmPrompt $prompt) use ($input, $output) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user