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