本文整理汇总了PHP中Symfony\Component\Console\Output\ConsoleOutput::setDecorated方法的典型用法代码示例。如果您正苦于以下问题:PHP ConsoleOutput::setDecorated方法的具体用法?PHP ConsoleOutput::setDecorated怎么用?PHP ConsoleOutput::setDecorated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Console\Output\ConsoleOutput
的用法示例。
在下文中一共展示了ConsoleOutput::setDecorated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
$this->oldApplicationContext = ApplicationContext::getInstance();
$this->applicationContext = $this->createApplicationContext();
$this->applicationContext->setPlugin($this->getPlugin());
$this->applicationContext->setComponent('input', new ArgvInput());
$output = new ConsoleOutput();
$output->setDecorated(false);
$this->applicationContext->setComponent('output', $output);
ApplicationContext::setInstance($this->applicationContext);
}
示例2: __construct
public function __construct()
{
$this->setGlobalInput();
$this->consoleOutput = new ConsoleOutput();
if ($this->globalInput->hasParameterOption(array('--ansi'))) {
$this->consoleOutput->setDecorated(true);
} elseif ($this->globalInput->hasParameterOption(array('--no-ansi'))) {
$this->consoleOutput->setDecorated(false);
}
parent::__construct(self::NAME, self::VERSION);
$dispatcher = new EventDispatcher();
$dispatcher->addListener(ConsoleEvents::COMMAND, array($this, 'onCommand'));
$this->setDispatcher($dispatcher);
$this->loadConfig();
$this->addCoreCommands();
// start output buffering to intercept show_error calls
ob_start();
register_shutdown_function(array($this, 'shutdown'));
}
示例3: terminate
public function terminate($request, $response)
{
$output = new ConsoleOutput();
$output->setDecorated(true);
$output->writeln('<fg=green>REQUEST:</> ' . '<fg=yellow>Method: ' . $request->method() . '</>; ' . '<fg=yellow>Ajax: ' . $request->ajax() . '</>; ' . '<fg=yellow>Input: ' . json_encode($request->all()) . '</>');
}