本文整理匯總了PHP中Symfony\Component\Console\Output\ConsoleOutput::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConsoleOutput::__construct方法的具體用法?PHP ConsoleOutput::__construct怎麽用?PHP ConsoleOutput::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Console\Output\ConsoleOutput
的用法示例。
在下文中一共展示了ConsoleOutput::__construct方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
{
// Use our own formatter
parent::__construct($verbosity, $decorated, $formatter);
// set some custom styles
$this->getFormatter()->setStyle('error', new OutputFormatterStyle('white', 'red'));
$this->getFormatter()->setStyle('green', new OutputFormatterStyle('green'));
$this->getFormatter()->setStyle('yellow', new OutputFormatterStyle('yellow'));
$this->getFormatter()->setStyle('question', new OutputFormatterStyle('black', 'cyan'));
$this->getFormatter()->setStyle('title', new OutputFormatterStyle('white', 'blue'));
}
示例2: OutputFormatter
function __construct($config)
{
$this->config = array_merge($this->config, $config);
$formatter = new OutputFormatter($this->config['colors']);
$formatter->setStyle('bold', new OutputFormatterStyle(null, null, array('bold')));
$formatter->setStyle('focus', new OutputFormatterStyle('magenta', null, array('bold')));
$formatter->setStyle('ok', new OutputFormatterStyle('white', 'magenta'));
$formatter->setStyle('error', new OutputFormatterStyle('white', 'red'));
$formatter->setStyle('debug', new OutputFormatterStyle('cyan'));
$formatter->setStyle('info', new OutputFormatterStyle('yellow'));
$this->formatHelper = new FormatterHelper();
parent::__construct($this->config['verbosity'], $this->config['colors'], $formatter);
}
示例3: __construct
/**
* Construct a ShellOutput instance.
*
* @param mixed $verbosity (default: self::VERBOSITY_NORMAL)
* @param bool $decorated (default: null)
* @param OutputFormatterInterface $formatter (default: null)
* @param null|string|OutputPager $pager (default: null)
*/
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null, $pager = null)
{
parent::__construct($verbosity, $decorated, $formatter);
$this->initFormatters();
if ($pager === null) {
$this->pager = new PassthruPager($this);
} elseif (is_string($pager)) {
$this->pager = new ProcOutputPager($this, $pager);
} elseif ($pager instanceof OutputPager) {
$this->pager = $pager;
} else {
throw new \InvalidArgumentException('Unexpected pager parameter: ' . $pager);
}
}
示例4: isset
function __construct($config)
{
$this->config = array_merge($this->config, $config);
// enable interactive output mode for CLI
$this->isInteractive = $this->config['interactive'] && isset($_SERVER['TERM']) && php_sapi_name() == 'cli' && $_SERVER['TERM'] != 'linux';
$formatter = new OutputFormatter($this->config['colors']);
$formatter->setStyle('bold', new OutputFormatterStyle(null, null, array('bold')));
$formatter->setStyle('focus', new OutputFormatterStyle('magenta', null, array('bold')));
$formatter->setStyle('ok', new OutputFormatterStyle('white', 'magenta'));
$formatter->setStyle('error', new OutputFormatterStyle('white', 'red'));
$formatter->setStyle('debug', new OutputFormatterStyle('cyan'));
$formatter->setStyle('info', new OutputFormatterStyle('yellow'));
$this->formatHelper = new FormatterHelper();
parent::__construct($this->config['verbosity'], $this->config['colors'], $formatter);
}
示例5: __construct
/**
* {@inheritdoc}
*/
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
{
parent::__construct($verbosity, $decorated, $formatter);
}
示例6: __construct
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
parent::__construct();
}
示例7: __construct
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
{
// Use our own formatter
parent::__construct($verbosity, $decorated, new Formatter());
}
示例8: __construct
/**
* Constructor.
*
* @author Art <a.molcanovas@gmail.com>
*/
public function __construct()
{
parent::__construct(self::VERBOSITY_NORMAL, null, new OutputFormatter());
}