當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application::doRun方法代碼示例

本文整理匯總了PHP中Symfony\Component\Console\Application::doRun方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::doRun方法的具體用法?PHP Application::doRun怎麽用?PHP Application::doRun使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Console\Application的用法示例。


在下文中一共展示了Application::doRun方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doRun

 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $container = $this->container;
     $container->set('ui.input', $input);
     $container->set('ui.output', $output);
     $container->get('logger.handler')->setOutput($output);
     foreach ($container->getByPrefix('commands') as $command) {
         $this->add($command);
     }
     if ($input->hasParameterOption(array('--tags', '-t'))) {
         $tags = $input->getParameterOption(array('--tags', '-t'));
         $tags = explode(',', $tags);
         $container->setParameter('filter.tags', $tags);
         $container->get('logger')->addDebug('Filtered using tags', array('tags' => $tags));
     }
     if ($input->hasParameterOption(array('--coverage', '-r'))) {
         $container->setParameter('coverage.enabled', true);
     }
     $event = new GenericEvent($container);
     $container->get('dispatcher')->dispatch(ApplicationEvents::initialize, $event);
     $command = $this->getCommandName($input);
     if (trim($command) === '') {
         $input = new StringInput('start');
     }
     return parent::doRun($input, $output);
 }
開發者ID:phpguard,項目名稱:phpguard,代碼行數:26,代碼來源:Application.php

示例2: doRun

 /**
  * @inheritdoc
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $this->loadServices();
     $this->addServiceCommands();
     $output->writeln(sprintf('<comment>%s</comment>', self::TITLE));
     parent::doRun($input, $output);
 }
開發者ID:gsdevme,項目名稱:drupalcontainer,代碼行數:10,代碼來源:Application.php

示例3: doRun

 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $password = getenv('VAULT_PASSWORD');
     $tries = 0;
     while (!$password) {
         $question = new Question('Vault password: ', null);
         $question->setHidden(true);
         $question->setHiddenFallback(false);
         $helperSet = $this->getHelperSet();
         $helper = $helperSet->get('question');
         $password = $helper->ask($input, $output, $question);
     }
     $this->vault = new Vault($password, $output);
     // Defaults
     $this->vault->setStoragePath(getcwd() . '/vault');
     $this->vault->setWorkPath(getcwd() . '/secure');
     $this->vault->verify();
     // Load droid.yml
     $filename = $this->getVaultFilename();
     if ($filename && file_exists($filename)) {
         $loader = new JsonLoader();
         $loader->load($vault, $filename);
     } else {
     }
     return parent::doRun($input, $output);
 }
開發者ID:linkorb,項目名稱:vault,代碼行數:26,代碼來源:Application.php

示例4: doRun

 /**
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return int
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $helperSet = $this->getHelperSet();
     $this->container->set('console.input', $input);
     $this->container->set('console.output', $output);
     $this->container->setShared('console.prompter.factory', function ($c) use($helperSet) {
         return new Factory($c->get('console.input'), $c->get('console.output'), $helperSet);
     });
     $this->container->setShared('process.executioncontext', function () {
         return JsonExecutionContext::fromEnv($_SERVER);
     });
     $assembler = new ContainerAssembler();
     $assembler->build($this->container);
     $this->loadConfigurationFile($input, $this->container);
     foreach ($this->container->getByPrefix('console.commands') as $command) {
         $this->add($command);
     }
     $this->setDispatcher($this->container->get('console_event_dispatcher'));
     $this->container->get('console.io')->setConsoleWidth($this->getTerminalWidth());
     StreamWrapper::reset();
     foreach ($this->container->getByPrefix('loader.resource_loader.spec_transformer') as $transformer) {
         StreamWrapper::addTransformer($transformer);
     }
     StreamWrapper::register();
     return parent::doRun($input, $output);
 }
開發者ID:nix9,項目名稱:laracasts,代碼行數:32,代碼來源:Application.php

示例5: doRun

 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
     if (version_compare(PHP_VERSION, '5.3.2', '<')) {
         $output->writeln('<warning>Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP ' . PHP_VERSION . ', upgrading is strongly recommended.</warning>');
     }
     if (defined('COMPOSER_DEV_WARNING_TIME') && $this->getCommandName($input) !== 'self-update' && $this->getCommandName($input) !== 'selfupdate') {
         if (time() > COMPOSER_DEV_WARNING_TIME) {
             $output->writeln(sprintf('<warning>Warning: This development build of composer is over 30 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF']));
         }
     }
     if (getenv('COMPOSER_NO_INTERACTION')) {
         $input->setInteractive(false);
     }
     if ($input->hasParameterOption('--profile')) {
         $startTime = microtime(true);
         $this->io->enableDebugging($startTime);
     }
     if ($newWorkDir = $this->getNewWorkingDir($input)) {
         $oldWorkingDir = getcwd();
         chdir($newWorkDir);
     }
     $result = parent::doRun($input, $output);
     if (isset($oldWorkingDir)) {
         chdir($oldWorkingDir);
     }
     if (isset($startTime)) {
         $output->writeln('<info>Memory usage: ' . round(memory_get_usage() / 1024 / 1024, 2) . 'MB (peak: ' . round(memory_get_peak_usage() / 1024 / 1024, 2) . 'MB), time: ' . round(microtime(true) - $startTime, 2) . 's');
     }
     return $result;
 }
開發者ID:itillawarra,項目名稱:cmfive,代碼行數:31,代碼來源:Application.php

示例6: doRun

 public function doRun(InputInterface $input, OutputInterface $output)
 {
     if (extension_loaded('xdebug')) {
         $output->writeln('<comment>You are running propel with xdebug enabled. This has a major impact on runtime performance.</comment>' . "\n");
     }
     return parent::doRun($input, $output);
 }
開發者ID:SwissalpS,項目名稱:Propel2,代碼行數:7,代碼來源:Application.php

示例7: doRun

 public function doRun(InputInterface $input, OutputInterface $output)
 {
     if (!$this->logger) {
         $this->logger = new ConsoleLogger($output);
     }
     parent::doRun($input, $output);
 }
開發者ID:slbmeh,項目名稱:dotfiles,代碼行數:7,代碼來源:Application.php

示例8: doRun

 /**
  * Runs the current application.
  *
  * Always show the version information except when the user invokes the help
  * command as that already does it
  *
  * @param InputInterface $input An Input instance
  * @param OutputInterface $output An Output instance
  * @return integer 0 if everything went fine, or an error code otherwise
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     if ($this->showWelcomeMessage && $input->hasParameterOption(array('--help', '-h')) === false && $input->getFirstArgument() !== null) {
         $output->writeln($this->getLongVersion());
         $output->writeln('');
     }
     return parent::doRun($input, $output);
 }
開發者ID:joseki,項目名稱:console,代碼行數:18,代碼來源:Application.php

示例9: doRun

 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('Tombstone Analyzer ' . $this->getVersion());
     if (!$input->getFirstArgument()) {
         $input = new ArrayInput(array('--help'));
     }
     AbstractApplication::doRun($input, $output);
 }
開發者ID:scheb,項目名稱:tombstone-analyzer,代碼行數:8,代碼來源:Application.php

示例10: doRun

 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $this->registerCommands();
     /** @var \Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher $eventDispatcher */
     $eventDispatcher = $this->getContainer()->get('event_dispatcher');
     $this->setDispatcher($eventDispatcher);
     return parent::doRun($input, $output);
 }
開發者ID:margery,項目名稱:thelia,代碼行數:8,代碼來源:Application.php

示例11: doRun

 /**
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return int
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $this->config = $this->parseConfigurationFile($input);
     $this->container = new ContainerBuilder();
     $loader = new YamlFileLoader($this->container, new FileLocator(__DIR__ . '/../Resources'));
     $loader->load('services.yml');
     return parent::doRun($input, $output);
 }
開發者ID:gajdaw,項目名稱:stamp,代碼行數:14,代碼來源:Application.php

示例12: doRun

 /**
  * Runs the current application.
  *
  * @param InputInterface  $input  An Input instance
  * @param OutputInterface $output An Output instance
  *
  * @return integer 0 if everything went fine, or an error code
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     if (!$this->commandsRegistered) {
         $this->registerCommands();
         $this->commandsRegistered = true;
     }
     return parent::doRun($input, $output);
 }
開發者ID:mickaelsteinberg,項目名稱:BackBee,代碼行數:16,代碼來源:Console.php

示例13: doRun

 /**
  * {@inheritDoc}
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
     if (version_compare(PHP_VERSION, '5.3.3', '<')) {
         $output->writeln('<warning>Vaultage only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP ' . PHP_VERSION . ', upgrading is strongly recommended.</warning>');
     }
     return parent::doRun($input, $output);
 }
開發者ID:rezzza,項目名稱:vaultage,代碼行數:11,代碼來源:Application.php

示例14: doRun

 /**
  * Run the Peridot application
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return int
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $command = $this->getPeridotCommand($output);
     $this->add($command);
     $exitCode = parent::doRun($input, $output);
     $this->environment->getEventEmitter()->emit('peridot.end', $exitCode, $input, $output);
     return $exitCode;
 }
開發者ID:peridot-php,項目名稱:peridot-cli,代碼行數:15,代碼來源:Application.php

示例15: doRun

 /**
  * Runs the current application.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface    $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  * @return int
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $styles = Factory::createAdditionalStyles();
     foreach ($styles as $name => $style) {
         $output->getFormatter()->setStyle($name, $style);
     }
     $this->consoleIo = new ConsoleIO($input, $output, $this->getHelperSet());
     return parent::doRun($input, $output);
 }
開發者ID:kevindierkx,項目名稱:muse,代碼行數:16,代碼來源:ProxyApplication.php


注:本文中的Symfony\Component\Console\Application::doRun方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。