Runs the current application.
public doRun ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | ||
$input | Symfony\Component\Console\Input\InputInterface | An Input instance |
$output | Symfony\Component\Console\Output\OutputInterface | An Output instance |
Résultat | integer | 0 if everything went fine, or an error code |
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); }
/** * @inheritdoc */ public function doRun(InputInterface $input, OutputInterface $output) { $this->loadServices(); $this->addServiceCommands(); $output->writeln(sprintf('<comment>%s</comment>', self::TITLE)); parent::doRun($input, $output); }
public function doRun(InputInterface $input, OutputInterface $output) { $password = getenv('VAULT_PASSWORD'); $tries = 0; while (!$password) { $question = new Question('Vault password: '******'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); }
/** * @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); }
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; }
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); }
public function doRun(InputInterface $input, OutputInterface $output) { if (!$this->logger) { $this->logger = new ConsoleLogger($output); } parent::doRun($input, $output); }
/** * 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); }
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); }
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); }
/** * @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); }
/** * 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); }
/** * {@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); }
/** * 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; }
/** * 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); }
/** * {@inheritDoc} */ public function doRun(InputInterface $input, OutputInterface $output) { $this->setHelperSet(ConsoleRunner::createHelperSet($this->app->get('doctrine.orm.entity_manager'))); $this->getHelperSet()->set(new QuestionHelper()); $this->getHelperSet()->set(new DialogHelper()); $this->registerCommands(); $this->io = new ConsoleIO($input, $output, $this->getHelperSet()); return parent::doRun($input, $output); }
/** * Process an error happened during initialization of commands, if any * * @param InputInterface $input * @param OutputInterface $output * @return int * @throws \Exception */ public function doRun(InputInterface $input, OutputInterface $output) { $exitCode = parent::doRun($input, $output); if ($this->initException) { $output->writeln("<error>We're sorry, an error occurred. Try clearing the cache and code generation directories. " . "By default, they are: var/cache, var/di, var/generation, and var/page_cache.</error>"); throw $this->initException; } return $exitCode; }
/** * @param InputInterface $input * @param OutputInterface $output * * @return int */ public function doRun(InputInterface $input, OutputInterface $output) { foreach ($this->all() as $command) { if ($command instanceof ContainerAwareInterface) { $command->setContainer($this->container); } } return parent::doRun($input, $output); }
/** * 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 (true === $input->hasParameterOption(array('--shell', '-s'))) { $shell = new Shell($this); $shell->run(); return 0; } return parent::doRun($input, $output); }
/** * 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) { // always show the version information except when the user invokes the help // command as that already does it if (false === $input->hasParameterOption(array('--help', '-h')) && null !== $input->getFirstArgument()) { $output->writeln($this->getLongVersion()); $output->writeln(''); } return parent::doRun($input, $output); }
public function doRun(InputInterface $input, OutputInterface $output) { $commandName = $this->getCommandName($input); if ($this->isInPharMode() && in_array($commandName, array('new', 'demo'), true)) { if (!$this->checkIfInstallerIsUpdated()) { $output->writeln(sprintf(" <comment>[WARNING]</comment> Your Symfony Installer version is outdated.\n" . ' Execute the command "%s selfupdate" to get the latest version.', $_SERVER['PHP_SELF'])); } } return parent::doRun($input, $output); }
/** * {@inheritDoc} */ public function doRun(InputInterface $input, OutputInterface $output) { if ($this->isLocalInstall()) { $this->setupAdminUser(); $this->registerActiveInstanceCommands(); } else { $this->registerQuickstartCommands(); } return parent::doRun($input, $output); }
/** * {@inheritDoc} */ public function doRun(InputInterface $input = null, OutputInterface $output = null) { $env = $input->getParameterOption('--env', null); if (null === $env) { $env = $input->getParameterOption('-e', 'dev'); } $this->app = new SilexApplication($env); $this->app->boot(); return parent::doRun($input, $output); }
/** * 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 (!$input->hasParameterOption('--quiet')) { $output->write(sprintf("phpunit-skelgen %s by Sebastian Bergmann.\n\n", $this->getVersion())); } if ($input->hasParameterOption('--version') || $input->hasParameterOption('-V')) { exit; } parent::doRun($input, $output); }
/** * Runs the current application. * * @param InputInterface $input An Input instance * @param OutputInterface $output An Output instance * * @return int 0 if everything went fine, or an error code */ public function doRun(InputInterface $input, OutputInterface $output) { if (!$input->hasParameterOption('--quiet')) { $output->write(sprintf("phpcov-runner %s by Levi Govaerts.\n\n", $this->getVersion())); } if ($input->hasParameterOption('--version') || $input->hasParameterOption('-V')) { exit; } parent::doRun($input, $output); }
public function doRun(InputInterface $input, OutputInterface $output) { if (!$input->hasParameterOption('--quiet')) { $output->write(sprintf("<info>%s</info> <comment>v%s</comment> by <comment>%s</comment> <%s>\n\n", self::APP_NAME, $this->getVersion(), self::AUTHOR_NAME, self::AUTHOR_EMAIL)); } if ($input->hasParameterOption('--version') || $input->hasParameterOption('-V')) { return 0; } return parent::doRun($input, $output); }
public function doRun(InputInterface $input, OutputInterface $output) { if (!$input->hasParameterOption('--quiet')) { $output->write(sprintf("phpqa %s by Rodrigo Moyle.\n\n", $this->getVersion())); } if ($input->hasParameterOption('--version') || $input->hasParameterOption('-V')) { exit; } return parent::doRun($input, $output); }
/** * This cli application main process. */ public function doRun(InputInterface $input, OutputInterface $output) { $this->configureContainer($input, $output); $this->registerBuiltinCommands(); $this->registerBaseModules(); $this->loadConfiguration($input, $output); $this->registerTasksAsConsoleCommands(); // Runs specified command under the symfony console. return parent::doRun($input, $output); }
/** * Runs the current application. * * @param InputInterface $input * @param OutputInterface $output * * @return integer 0 if everything went fine, or an error code */ public function doRun(InputInterface $input, OutputInterface $output) { // construct container $container = new ContainerBuilder(); $this->loadConfiguration($container, $input); $container->compile(); // setup command into application $this->add($container->get('behat.console.command')); return parent::doRun($input, $output); }
/** * 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) { $this->registerCommands(); if (true === $input->hasParameterOption(array('--shell', '-s'))) { $shell = new Shell($this); $shell->setProcessIsolation($input->hasParameterOption(array('--process-isolation'))); $shell->run(); return 0; } return parent::doRun($input, $output); }