This commit is contained in:
yunwuxin
2016-08-09 10:55:45 +08:00
parent 131aaf1357
commit 0f7924ed81
4 changed files with 17 additions and 17 deletions

View File

@@ -361,7 +361,7 @@ class Console
/** /**
* 某个指令是否存在 * 某个指令是否存在
* @param string $name 指令民初 * @param string $name 指令名称
* @return bool * @return bool
*/ */
public function has($name) public function has($name)
@@ -517,16 +517,6 @@ class Console
return $abbrevs; return $abbrevs;
} }
/**
* 呈现捕获的异常
* @param \Exception $e
* @param Stream $output
*/
public function renderException(\Exception $e, Stream $output)
{
}
/** /**
* 配置基于用户的参数和选项的输入和输出实例。 * 配置基于用户的参数和选项的输入和输出实例。
@@ -543,11 +533,6 @@ class Console
if (true === $input->hasParameterOption(['--no-interaction', '-n'])) { if (true === $input->hasParameterOption(['--no-interaction', '-n'])) {
$input->setInteractive(false); $input->setInteractive(false);
} elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('question')) {
$inputStream = $this->getHelperSet()->get('question')->getInputStream();
if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
$input->setInteractive(false);
}
} }
if (true === $input->hasParameterOption(['--quiet', '-q'])) { if (true === $input->hasParameterOption(['--quiet', '-q'])) {

View File

@@ -17,6 +17,16 @@ use think\console\output\driver\Buffer;
use think\console\output\driver\Console; use think\console\output\driver\Console;
use think\console\output\driver\Nothing; use think\console\output\driver\Nothing;
/**
* Class Output
* @package think\console
*
* @see think\console\output\driver\Console::setDecorated
* @method void setDecorated($decorated)
*
* @see think\console\output\driver\Buffer::fetch
* @method string fetch()
*/
class Output class Output
{ {
const VERBOSITY_QUIET = 0; const VERBOSITY_QUIET = 0;

View File

@@ -47,7 +47,7 @@ class Formatter
/** /**
* 设置外观标识 * 设置外观标识
* @param bool $decorated 是否美化文 * @param bool $decorated 是否美化文
*/ */
public function setDecorated($decorated) public function setDecorated($decorated)
{ {

View File

@@ -37,6 +37,11 @@ class Console
$this->formatter->setDecorated($decorated); $this->formatter->setDecorated($decorated);
} }
public function setDecorated($decorated)
{
$this->formatter->setDecorated($decorated);
}
public function write($messages, $newline = false, $type = Output::OUTPUT_NORMAL, $stream = null) public function write($messages, $newline = false, $type = Output::OUTPUT_NORMAL, $stream = null)
{ {
if (Output::VERBOSITY_QUIET === $this->output->getVerbosity()) { if (Output::VERBOSITY_QUIET === $this->output->getVerbosity()) {