當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。