This command loads all the exchange rates from base_currency to all available
currencies.

@param InputInterface  $input  The input interface
@param OutputInterface $output The output interface

@return int|null|void
169857
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $this
            ->entityTranslationEventDispatcher
            ->dispatchTranslatorWarmUp();

        $this->finishCommand($output);
    }
869287
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $plugins = $this
            ->pluginRepository
            ->findAll();

        /**
         * @var Plugin $plugin
         */
        foreach ($plugins as $plugin) {
            $this->printMessage(
                $output,
                'Plugin',
                $plugin->getNamespace() . ' - [Hash : ' . $plugin->getHash() . ']'
            );
        }

        $this->finishCommand($output);
    }
874976
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $countries = $this->getCountriesFromInput($input);

        foreach ($countries as $countryCode) {
            $countryCode = strtoupper($countryCode);
            $this
                ->deleteCountry(
                    $input,
                    $output,
                    $countryCode
                );
        }

        $this->finishCommand($output);
    }
509474
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        if (!$this->canRunAsRoot && $this->isRunningAsRoot() === true) {
            $this->confirmRunningAsRoot($input, $output);
        }
    }
821227
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = new SymfonyOutput($output);

        $this->input = $input;

        if (method_exists($this, 'handle')) {
            $this->handle();
        }
    }
965828
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $configurationIdentifier = $input->getArgument('identifier');
        $configurationValue = json_encode($this
            ->configurationManager
            ->get($configurationIdentifier));

        $this->printMessage(
            $output,
            'Configuration',
            $configurationIdentifier . ' : "' . $configurationValue . '"'
        );

        $this->finishCommand($output);
    }
350664
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output, false);
        $domains = $input->getOption('domain');
        $languages = $input->getOption('language');
        $project = $this->createProjectByInput($input);
        $questionHelper = $this->getHelper('question');

        while (true) {
            $randomTranslation = $project->getRandomMissingTranslation(
                $domains,
                $languages
            );

            if (!($randomTranslation instanceof Translation)) {
                $this
                    ->printMessage(
                        $output,
                        'Trans Server',
                        'No more translations for you!'
                    );

                break;
            }

            $this->printMessage(
                $output,
                'Trans Server',
                'Language : ' . $randomTranslation->getLanguage()
            );
            $this->printMessage(
                    $output,
                    'Trans Server',
                    'Key : ' . $randomTranslation->getKey()
                );
            $this->printMessage(
                    $output,
                    'Trans Server',
                    'Original : ' . $randomTranslation
                        ->getMasterTranslation()
                        ->getValue()
                );

            $question = new Question('[Trans Server] Translation : ');
            $translationValue = $questionHelper->ask(
                $input,
                $output,
                $question
            );

            if (false === $translationValue) {
                break;
            }

            $randomTranslation->setValue($translationValue);
            $masterStructure = $randomTranslation->getStructure();
            $this->overwriteLastValueFromStructure(
                $masterStructure,
                $translationValue
            );
            $randomTranslation->setStructure($masterStructure);

            $project->addTranslation($randomTranslation);
            $project->save();
            $output->writeln('');
        }

        $this->finishCommand($output);
    }
584800
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $results = Cache::flush();

    if ($results) return $output->writeln('<info>Cleared cache!</info>');

    return $output->writeln('Nothing to clear');
  }
579772
public function initialize($instance, ServiceLocatorInterface $serviceLocator)
	{
        if ($instance instanceof CurrencyExchangerAwareInterface) {
            if ($serviceLocator instanceof AbstractPluginManager) {
            	$serviceLocator = $serviceLocator->getServiceLocator();
            }

            $exchanger = $serviceLocator->get(CurrencyExchangerInterface::class);
            $instance->setCurrencyExchanger($exchanger);
        }
	}
305470
public function execute(InputInterface $input, OutputInterface $output)
    {
        $host = $input->getArgument('host');
        $ip = $input->getArgument('ip');

        $this->hostFile->add($host, $ip);

        $output->writeLn("\"$ip $host\" was added to file.");
    }
1139589
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->getBaseFiles();

        foreach ($this->languages as $lang) {
            $this->processLanguage($output, $lang);
        }
    }
69036
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $root = $this->getContainer()->getParameter('kernel.root_dir');
        chdir("$root/..");
        $path = "$root/Resources/gettext/messages.pot";
        $languages = $input->getArgument('languages');
        $results = $this->initializeFromTemplate($path, $languages);
        foreach ($results as $filename => $status) {
            $output->writeln("$status: $filename");
        }
    }
323992
protected function execute(InputInterface $input, OutputInterface $output)
	{
		$this->setupEnvironment('site', $input, $output);

		$version = new \JVersion;

		if ($input->getOption('short'))
		{
			$result = $version->getShortVersion();
		}
		elseif ($input->getOption('release'))
		{
			$result = $version->RELEASE;
		}
		else
		{
			$result = $version->getLongVersion();
		}
		$output->writeln($result);
	}
458761
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setOutput($output);
        $this->setVerbosity($output->getVerbosity());

        if (!$input->getOption('add') && !$input->getOption('delete') && !$input->getOption('skip') && !$input->getOption('info')) {
            throw new \InvalidArgumentException('You must specify whether you want to --add, --delete, --skip or --info the specified migration.');
        }

        $migrationService = $this->getMigrationService();
        $migrationNameOrPath = $input->getArgument('migration');

        if ($input->getOption('info')) {
            $output->writeln('');

            $migration = $migrationService->getMigration($migrationNameOrPath);
            if ($migration == null) {
                throw new \InvalidArgumentException(sprintf('The migration "%s" does not exist in the migrations table.', $migrationNameOrPath));
            }

            switch ($migration->status) {
                case Migration::STATUS_DONE:
                    $status = '<info>executed</info>';
                    break;
                case Migration::STATUS_STARTED:
                    $status = '<comment>execution started</comment>';
                    break;
                case Migration::STATUS_TODO:
                    // bold to-migrate!
                    $status = '<error>not executed</error>';
                    break;
                case Migration::STATUS_SKIPPED:
                    $status = '<comment>skipped</comment>';
                    break;
                case Migration::STATUS_PARTIALLY_DONE:
                    $status = '<comment>partially executed</comment>';
                    break;
                case Migration::STATUS_SUSPENDED:
                    $status = '<comment>suspended</comment>';
                    break;
                case Migration::STATUS_FAILED:
                    $status = '<error>failed</error>';
                    break;
            }

            $output->writeln('<info>Migration: ' . $migration->name . '</info>');
            $output->writeln('Status: ' . $status);
            $output->writeln('Executed on: <info>' . ($migration->executionDate != null ? date("Y-m-d H:i:s", $migration->executionDate) : '--'). '</info>');
            $output->writeln('Execution notes: <info>' . $migration->executionError . '</info>');

            if ($migration->status == Migration::STATUS_SUSPENDED) {
                /// @todo decode the suspension context: date, step, ...
            }

            $output->writeln('Definition path: <info>' . $migration->path . '</info>');
            $output->writeln('Definition md5: <info>' . $migration->md5 . '</info>');

            if ($migration->path != '') {
                // q: what if we have a loader which does not work with is_file? We could probably remove this check...
                if (is_file($migration->path)) {
                    try {
                        $migrationDefinitionCollection = $migrationService->getMigrationsDefinitions(array($migration->path));
                        if (count($migrationDefinitionCollection)) {
                            $migrationDefinition = reset($migrationDefinitionCollection);
                            $migrationDefinition = $migrationService->parseMigrationDefinition($migrationDefinition);

                            if ($migrationDefinition->status != MigrationDefinition::STATUS_PARSED) {
                                $output->writeln('Definition error: <error>' . $migrationDefinition->parsingError . '</error>');
                            }

                            if (md5($migrationDefinition->rawDefinition) != $migration->md5) {
                                $output->writeln('Notes: <comment>The migration definition file has now a different checksum</comment>');
                            }
                        } else {
                            $output->writeln('Definition error: <error>The migration definition file can not be loaded</error>');
                        }
                    } catch (\Exception $e) {
                        /// @todo one day we should be able to limit the kind of exceptions we have to catch here...
                        $output->writeln('Definition parsing error: <error>' . $e->getMessage() . '</error>');
                    }
                } else {
                    $output->writeln('Definition error: <error>The migration definition file can not be found any more</error>');
                }
            }

            $output->writeln('');
            return 0;
        }

        // ask user for confirmation to make changes
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
            $dialog = $this->getHelperSet()->get('question');
            if (!$dialog->ask(
                $input,
                $output,
                new ConfirmationQuestion('<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>', false)
            )
            ) {
                $output->writeln('<error>Migration change cancelled!</error>');
                return 0;
            }
        }

        if ($input->getOption('add')) {
            // will throw if a file is passed and it is not found, but not if an empty dir is passed
            $migrationDefinitionCollection = $migrationService->getMigrationsDefinitions(array($migrationNameOrPath));

            if (!count($migrationDefinitionCollection))
            {
                throw new \InvalidArgumentException(sprintf('The path "%s" does not correspond to any migration definition.', $migrationNameOrPath));
            }

            foreach ($migrationDefinitionCollection as $migrationDefinition) {
                $migrationName = basename($migrationDefinition->path);

                $migration = $migrationService->getMigration($migrationNameOrPath);
                if ($migration != null) {
                    throw new \InvalidArgumentException(sprintf('The migration "%s" does already exist in the migrations table.', $migrationName));
                }

                $migrationService->addMigration($migrationDefinition);
                $output->writeln('<info>Added migration' . $migrationDefinition->path . '</info>');
            }

            return 0;
        }

        if ($input->getOption('delete')) {
            $migration = $migrationService->getMigration($migrationNameOrPath);
            if ($migration == null) {
                throw new \InvalidArgumentException(sprintf('The migration "%s" does not exist in the migrations table.', $migrationNameOrPath));
            }

            $migrationService->deleteMigration($migration);

            return 0;
        }

        if ($input->getOption('skip')) {
            // will throw if a file is passed and it is not found, but not if an empty dir is passed
            $migrationDefinitionCollection = $migrationService->getMigrationsDefinitions(array($migrationNameOrPath));

            if (!count($migrationDefinitionCollection))
            {
                throw new \InvalidArgumentException(sprintf('The path "%s" does not correspond to any migration definition.', $migrationNameOrPath));
            }

            foreach ($migrationDefinitionCollection as $migrationDefinition) {
                $migrationService->skipMigration($migrationDefinition);
                $output->writeln('<info>Migration' . $migrationDefinition->path . ' marked as skipped</info>');
            }

            return 0;
        }

        throw new \InvalidArgumentException("Please specify one action to be taken on the given migration");
    }
343390
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $sitemaps = $this->builder->build();
        foreach ($sitemaps as $sitemap) {
            $output->writeln($sitemap);
        }
    }
21631
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setup->getLocator()->setParams(
            array(
                'release' => $input->getArgument('release'),
                'path' => $input->getOption('path'),
                'scriptName' => $input->getOption('script')
            )
        );

        $queries = $this->setup($input);

        $this->display($input, $output, $queries);
    }
120168
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        $this->transifexconfig = $input->getOption('transifex-config');
        $this->setProject($input, $output);
        $this->setPrefix($input, $output);
        $this->setXliffDirectory($input, $output);
        $this->setContaoLanguageDirectory($input, $output);
        $this->baselanguage = $input->getOption('base-language');
        $this->skipFiles    = $input->getOption('skip-files') ? explode(',', $input->getOption('skip-files')) : null;

        if (!$this->skipFiles) {
            $this->skipFiles = $this->getTransifexConfigValue('/skip_files') ?: array();
        } else {
            // Make sure it is an array.
            $this->skipFiles = array();
        }

        $activeLanguages = array();
        if (($langs = $input->getArgument('languages')) != 'all') {
            $activeLanguages = explode(',', $langs);
        }

        $this->determineLanguages($output, $this->getLanguageBasePath(), $activeLanguages);
    }