本文整理汇总了PHP中Symfony\Component\Console\Application::configureIO方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::configureIO方法的具体用法?PHP Application::configureIO怎么用?PHP Application::configureIO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Console\Application
的用法示例。
在下文中一共展示了Application::configureIO方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configureIO
/**
* @inheritdoc
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
// code style
$code = new OutputFormatterStyle('black', 'white');
$output->getFormatter()->setStyle('code', $code);
}
示例2: configureIO
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$formatter = $output->getFormatter();
$formatter->setStyle('fail', new OutputFormatterStyle('red'));
$formatter->setStyle('highlight', new OutputFormatterStyle('blue', null, array('bold')));
}
示例3: configureIO
/**
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
if (null !== $this->container) {
$this->container->set('console.input', $input);
$this->container->set('console.output', $output);
}
}
示例4: configureIO
/**
* {@inheritdoc}
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$formatter = $output->getFormatter();
$formatter->setStyle('warning', new OutputFormatterStyle('white', 'blue', ['bold']));
$formatter->setStyle('url', new OutputFormatterStyle('blue'));
$formatter->setStyle('bold', new OutputFormatterStyle(null, null, ['bold']));
}
示例5: configureIO
protected function configureIO(InputInterface $input, OutputInterface $output)
{
if (true === $input->hasParameterOption(array('--colors'))) {
$output->setDecorated(true);
} elseif (true === $input->hasParameterOption(array('--no-colors'))) {
$output->setDecorated(false);
}
parent::configureIO($input, $output);
}
示例6: configureIO
/**
* Configures the input and output instances based on the user arguments and options.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
foreach ($this->getHelperSet()->getIterator() as $helper) {
if ($helper instanceof AbstractHelper) {
$helper->setWorkingDirectory(getcwd() . DIRECTORY_SEPARATOR);
$helper->setIO($input, $output);
$helper->init();
}
}
parent::configureIO($input, $output);
// TODO: Change the autogenerated stub
}
示例7: configureIO
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$level = Logger::DEBUG;
switch ($output->getVerbosity()) {
case OutputInterface::VERBOSITY_VERY_VERBOSE:
$level = Logger::INFO;
break;
case OutputInterface::VERBOSITY_VERBOSE:
$level = Logger::NOTICE;
break;
case OutputInterface::VERBOSITY_DEBUG:
$level = Logger::DEBUG;
break;
case OutputInterface::VERBOSITY_NORMAL:
$level = Logger::WARNING;
break;
case OutputInterface::VERBOSITY_QUIET:
$level = Logger::CRITICAL;
break;
}
$handler = new ConsoleHandler($level);
$handler->install();
}
示例8: configureIO
/**
* {@inheritdoc}
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$output->getFormatter()->setStyle('greenbg', new OutputFormatterStyle('black', 'green', array()));
}
示例9: configureIO
/**
* Configure IO of GrumPHP objects
*
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$container = $this->getContainer();
$io = new ConsoleIO($input, $output);
// Overwrite the nullIO with the console IO.
$container->set('grumphp.io.console', $io);
$container->setAlias('grumphp.io', 'grumphp.io.console');
// Make sure to let the logger log to the stdout in verbose mode!
if ($io->isVerbose()) {
/** @var Logger $logger */
$logger = $container->get('grumphp.logger');
$logger->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG));
}
}
示例10: configureIO
/**
* Configures the input and output instances based on the user arguments and options.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$style = new OutputFormatterStyle();
$style->setApplication($this);
$style->setWrap('-', '-');
$output->getFormatter()->setStyle('h1', $style);
$style = new OutputFormatterStyle();
$style->setPaddingOutside(' ===> ');
$output->getFormatter()->setStyle('h2', $style);
$style = new OutputFormatterStyle();
$style->setPaddingOutside(' - ');
$output->getFormatter()->setStyle('p', $style);
$style = new OutputFormatterStyle('white', 'red');
$style->setPadding(' [EE] ');
$output->getFormatter()->setStyle('p-error', $style);
}
示例11: configureIO
/**
* Configure IO of GrumPHP objects
*
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$container = $this->getContainer();
// Register the console input and output to the container
$container->set('console.input', $input);
$container->set('console.output', $output);
// Redirect the GrumPHP logger to the stdout in verbose mode
/** @var IOInterface $io */
$io = $container->get('grumphp.io.console');
if ($io->isVerbose()) {
/** @var Logger $logger */
$logger = $container->get('grumphp.logger');
$logger->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG));
}
}
示例12: configureIO
/**
* Override configureIO() so that we can check if the global --no-time-limit option was set.
*
* {@inheritDoc}
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
if ($input->hasParameterOption("--no-time-limit")) {
$this->timeLimit = false;
} else {
$this->timeLimit = true;
}
parent::configureIO($input, $output);
}
示例13: configureIO
/**
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
parent::configureIO($input, $output);
$input->bind(new InputDefinition([new InputArgument('configuration'), new InputArgument('files'), new InputOption('verbose', '-v', InputOption::VALUE_OPTIONAL, '', true)]));
$input->setArgument('configuration', serialize($this->configuration));
$input->setArgument('files', serialize($this->files));
}
示例14: configureIO
/**
* @param InputInterface $input
* @param OutputInterface $output
*/
public function configureIO(InputInterface $input, OutputInterface $output)
{
$this->container['env'] = $input->getParameterOption(array('--env', '-e'), getenv('APP_ENV') ?: 'dev');
$this->container['debug'] = getenv('APP_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $this->container['env'] !== 'prod';
parent::configureIO($input, $output);
}
示例15: configureIO
/**
* {@inheritdoc}
*/
public function configureIO(InputInterface $input, OutputInterface $output)
{
$this->loadConfig($input);
return parent::configureIO($input, $output);
}