本文整理匯總了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()) . '</>');
}