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


PHP Application::doRunCommand方法代码示例

本文整理汇总了PHP中Symfony\Component\Console\Application::doRunCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::doRunCommand方法的具体用法?PHP Application::doRunCommand怎么用?PHP Application::doRunCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Console\Application的用法示例。


在下文中一共展示了Application::doRunCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doRunCommand

 /**
  * @override
  * @inheritDoc
  */
 protected function doRunCommand(SymfonyCommand $command, InputInterface $input, OutputInterface $output)
 {
     if ($command instanceof CommandInterface && $command->isAsync() === true) {
         $this->async = true;
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:kraken-php,项目名称:framework,代码行数:11,代码来源:CommandManager.php

示例2: doRunCommand

 /**
  * @inheritdoc
  */
 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($command->getName() != 'version') {
         $output->writeln($this->getLongVersion());
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:sclable,项目名称:xml-lint,代码行数:10,代码来源:Application.php

示例3: doRunCommand

 /**
  * Pass the container to Container Aware Command classes
  *
  * @param Command $command
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return mixed
  */
 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($command instanceof ContainerAwareInterface) {
         $command->setContainer($this->getContainer());
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:tests-always-included,项目名称:symfony-console-bootstrap,代码行数:15,代码来源:Application.php

示例4: doRunCommand

 /**
  * @param Command $command
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return int
  * @throws \Exception
  */
 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($command instanceof FactoryAwareInterface) {
         $command->setFactory($this->factory);
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:TYPO3,项目名称:Surf,代码行数:14,代码来源:ConsoleApplication.php

示例5: doRunCommand

 /**
  * {@inheritdoc}
  */
 public function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     //  Inject the kernel in to the command before we execute it.
     if ($command instanceof CommandInterface) {
         $command->setKernel($this->kernel);
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:eva,项目名称:eva,代码行数:11,代码来源:Application.php

示例6: doRunCommand

 /**
  * Runs the current command.
  *
  * If an event dispatcher has been attached to the application,
  * events are also dispatched during the life-cycle of the command.
  *
  * @param SingletonCommand $command A Command instance
  * @param InputInterface $input   An Input instance
  * @param OutputInterface $output  An Output instance
  *
  * @return int 0 if everything went fine, or an error code
  *
  * @throws \Exception when the command being run threw an exception
  */
 protected function doRunCommand(SingletonCommand $command, InputInterface $input, OutputInterface $output)
 {
     try {
         $command->lock();
         return parent::doRunCommand($command, $input, $output);
     } catch (\Exception $e) {
         $command->unlock();
     }
 }
开发者ID:RusinovIG,项目名称:stream-saver,代码行数:23,代码来源:SingletonApplication.php

示例7: doRunCommand

 /**
  * {@inheritdoc}
  */
 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if (!in_array($command->getName(), ['help', 'list'])) {
         $output = new ConsoleOutput($output->getVerbosity(), $output->isDecorated(), $output->getFormatter());
     }
     if ($command instanceof \Cawa\Console\Command) {
         $command->setInput($input);
         $command->setOutput($output);
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:cawaphp,项目名称:cawa,代码行数:14,代码来源:Application.php

示例8: doRunCommand

 protected function doRunCommand(BaseCommand $command, InputInterface $input, OutputInterface $output)
 {
     if (!$command instanceof Command) {
         return parent::doRunCommand($command, $input, $output);
     }
     $run = array_merge($this->resolveDependencies($command), [$command]);
     $exitCode = 0;
     foreach ($run as $command) {
         $output->writeln("Running {$command->getName()}...");
         $exitCode = parent::doRunCommand($command, $input, $output);
     }
     return $exitCode;
 }
开发者ID:niden,项目名称:task,代码行数:13,代码来源:Project.php

示例9: doRunCommand

 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($input->hasParameterOption(['--log', '-l']) && $command instanceof \App\Command) {
         $logPath = $input->getParameterOption(['--log', '-l']);
         $logDir = realpath(dirname($logPath));
         if (!$logDir) {
             throw new \InvalidArgumentException(sprintf('Log folder does not exist! %s', $logDir));
         }
         $log = new Logger('depipe');
         $log->pushHandler(new StreamHandler($logPath));
         $command->setLogger($log);
         $this->logger = $command;
     }
     parent::doRunCommand($command, $input, $output);
 }
开发者ID:renegare,项目名称:depipe,代码行数:15,代码来源:Console.php

示例10: doRunCommand

 /**
  * {@inheritDoc}
  */
 public function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($command instanceof ContainerAwareInterface) {
         $container = $this->buildContainer($input);
         $command->setContainer($container);
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:behcetenuygun,项目名称:cachetool,代码行数:11,代码来源:Application.php

示例11: doRunCommand

 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     $this->getHelperSet()->setCommand($command);
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:quickstrap,项目名称:quickstrap,代码行数:5,代码来源:Application.php

示例12: doRunCommand

 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($this->serviceLocator) {
         $this->serviceLocator->callInjects($command);
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:kdyby,项目名称:console,代码行数:7,代码来源:Application.php

示例13: doRunCommand

 /**
  * @override To limit access as root user
  */
 public function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($this->isRunByRoot() && !$this->isWhitelistedForRoot($command)) {
         $output->writeln('<error>You are not allowed to run this command as root.</error>');
         return ExitCode::EXIT_COMMAND_AS_ROOT_DENIED;
     }
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:inetprocess,项目名称:sugarcli,代码行数:11,代码来源:Application.php

示例14: doRunCommand

 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     if ($command instanceof \Owncloud\Updater\Command\Command) {
         $command->setContainer($this->getContainer());
         $commandName = $this->getCommandName($input);
         $this->getLogger()->info('Execution of ' . $commandName . ' command started');
         if (!empty($command->getMessage())) {
             $message = sprintf('<info>%s</info>', $command->getMessage());
             $output->writeln($message);
         }
         $exitCode = parent::doRunCommand($command, $input, $output);
         $this->getLogger()->info('Execution of ' . $commandName . ' command stopped. Exit code is ' . $exitCode);
     } else {
         $exitCode = parent::doRunCommand($command, $input, $output);
     }
     return $exitCode;
 }
开发者ID:JBarnden,项目名称:updater,代码行数:17,代码来源:Application.php

示例15: doRunCommand

 protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
 {
     $definition = $command->getDefinition();
     $definition->addOption(new InputOption('gruver_file', 'g', InputOption::VALUE_OPTIONAL, 'Location of gruver.yml file'));
     return parent::doRunCommand($command, $input, $output);
 }
开发者ID:mindgruve,项目名称:gruver,代码行数:6,代码来源:Application.php


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