当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::configureIO方法代码示例

本文整理汇总了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);
 }
开发者ID:mrgrain,项目名称:autobahn-cli,代码行数:10,代码来源:Application.php

示例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')));
 }
开发者ID:phpguard,项目名称:phpguard,代码行数:7,代码来源:Application.php

示例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);
     }
 }
开发者ID:d4rk4ng3l,项目名称:advanced-oxid-modules,代码行数:12,代码来源:Application.php

示例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']));
 }
开发者ID:bigwhoop,项目名称:trellog,代码行数:11,代码来源:App.php

示例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);
 }
开发者ID:phpzone,项目名称:phpzone,代码行数:9,代码来源:Application.php

示例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
 }
开发者ID:sseidelmann,项目名称:devutils,代码行数:18,代码来源:Application.php

示例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();
 }
开发者ID:oasmobile,项目名称:php-slimapp,代码行数:24,代码来源:ConsoleApplication.php

示例8: configureIO

 /**
  * {@inheritdoc}
  */
 protected function configureIO(InputInterface $input, OutputInterface $output)
 {
     parent::configureIO($input, $output);
     $output->getFormatter()->setStyle('greenbg', new OutputFormatterStyle('black', 'green', array()));
 }
开发者ID:b-viguier,项目名称:phpbench,代码行数:8,代码来源:Application.php

示例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));
     }
 }
开发者ID:llaville,项目名称:grumphp,代码行数:21,代码来源:Application.php

示例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);
 }
开发者ID:jousch,项目名称:clitools,代码行数:23,代码来源:Application.php

示例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));
     }
 }
开发者ID:phpro,项目名称:grumphp,代码行数:22,代码来源:Application.php

示例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);
 }
开发者ID:lightglitch,项目名称:console,代码行数:14,代码来源:Application.php

示例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));
 }
开发者ID:Techbot,项目名称:php-hooks,代码行数:11,代码来源:Application.php

示例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);
 }
开发者ID:saxulum,项目名称:saxulum-console,代码行数:10,代码来源:ConsoleApplication.php

示例15: configureIO

 /**
  * {@inheritdoc}
  */
 public function configureIO(InputInterface $input, OutputInterface $output)
 {
     $this->loadConfig($input);
     return parent::configureIO($input, $output);
 }
开发者ID:renegare,项目名称:skip,代码行数:8,代码来源:ConsoleApplication.php


注:本文中的Symfony\Component\Console\Application::configureIO方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。