Show the migration status.

@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return int 0 if all migrations are up, or an error code
976113
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->bootstrap($input, $output);

        $environment = $input->getOption('environment');
        $format = $input->getOption('format');

        if ($environment === null) {
            $environment = $this->getConfig()->getDefaultEnvironment();
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
        } else {
            $output->writeln('<info>using environment</info> ' . $environment);
        }
        if ($format !== null) {
            $output->writeln('<info>using format</info> ' . $format);
        }

        $output->writeln('<info>ordering by </info>' . $this->getConfig()->getVersionOrder() . " time");

        // print the status
        return $this->getManager()->printStatus($environment, $format);
    }
380888
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $this->io = new StratumStyle($input, $output);

    $sourceFilename = $input->getArgument('source');
    $targetFilename = dirname($sourceFilename).'/'.basename($input->getArgument('target'));

    if (basename($sourceFilename)===basename($targetFilename))
    {
      throw new RuntimeException('Source and target files is the same file');
    }

    self::staticToStatic($sourceFilename, $targetFilename);

    return 0;
  }
818425
protected function execute(InputInterface $input, OutputInterface $output): int
    {
        if (null === $path = $input->getOption('path')) {
            $config = $this->getConfig()->jsonSerialize();
        } else {
            $config = $this->getConfig($path);
        }
        $output->writeln(Yaml::dump($config));
        return 0;
    }
615416
public function showMigratingInfo($output, $level = 0)
    {
        $output->info(
            str_repeat("_",$level) . 'Migrating ' . class_basename($this) . ' ('. $this->id . ')' .
            ' | Start time ' . $this->start_time .
            ' | End time '   . $this->end_time .
            '...'
        );
    }
370118
public function run(InputInterface $input, OutputInterface $output): int
    {
        $command = (string) $input;
        $command = strtr($command, [
            ' -name' => ' -N',
            ' -type' => ' -T',
            ' -maxdepth' => ' -M',
            ' -delete' => ' -d true',
        ]);

        return parent::run(new StringInput($command), $output);
    }
935911
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $uuids = array();

        $count = filter_var(
            $input->getOption('count'),
            FILTER_VALIDATE_INT,
            array(
                'default' => 1,
                'min_range' => 1,
            )
        );

        for ($i = 0; $i < $count; $i++) {
            $uuids[] = $this->createUuid(
                $input->getArgument('version'),
                $input->getArgument('namespace'),
                $input->getArgument('name')
            );
        }

        foreach ($uuids as $uuid) {
            $output->writeln((string) $uuid);
        }
    }
546576
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln(GeneralUtility::makeInstance(KauderwelschService::class)->getLoremIpsum());
        return 0;
    }
964378
protected function getProgress(InputInterface $input, OutputInterface $output)
    {
        if ($input->getOption('no-progress')) {
            $output = new NullOutput();
        }

        // export progress only for one storage
        if (!$input->getArgument('storage')) {
            $input->setOption('export', null);
        }

        if ($export_file = $input->getOption('export')) {
            // progress is redirected to the export file
            $input->setOption('no-progress', true);
            $progress = new Export($this->getHelperSet()->get('progress'), new NullOutput(), $export_file);
        } else {
            $progress = new PresetOutput($this->getHelperSet()->get('progress'), $output);
        }

        $progress->setBarCharacter('<comment>=</comment>');

        return $progress;
    }
972209
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = microtime(true);

        $this->setOutput($output);
        $this->setVerbosity($output->getVerbosity());

        $this->getContainer()->get('ez_migration_bundle.step_executed_listener.tracing')->setOutput($output);

        $migrationService = $this->getMigrationService();

        $migrationName = $input->getOption('migration');
        if ($migrationName != null) {
            $suspendedMigration = $migrationService->getMigration($migrationName);
            if (!$suspendedMigration) {
                throw new \Exception("Migration '$migrationName' not found");
            }
            if ($suspendedMigration->status != Migration::STATUS_SUSPENDED) {
                throw new \Exception("Migration '$migrationName' is not suspended, can not resume it");
            }

            $suspendedMigrations = array($suspendedMigration);
        } else {
            $suspendedMigrations = $migrationService->getMigrationsByStatus(Migration::STATUS_SUSPENDED);
        };

        $output->writeln('<info>Found ' . count($suspendedMigrations) . ' suspended migrations</info>');

        if (!count($suspendedMigrations)) {
            $output->writeln('Nothing to do');
            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 resuming cancelled!</error>');
                return 0;
            }
        }

        $executed = 0;
        $failed = 0;

        foreach($suspendedMigrations as $suspendedMigration) {
            $output->writeln("<info>Resuming {$suspendedMigration->name}</info>");

            try {
                $migrationService->resumeMigration($suspendedMigration, !$input->getOption('no-transactions'));

                $executed++;
            } catch (\Exception $e) {
                if ($input->getOption('ignore-failures')) {
                    $this->errOutput->writeln("\n<error>Migration failed! Reason: " . $e->getMessage() . "</error>\n");
                    $failed++;
                    continue;
                }
                $this->errOutput->writeln("\n<error>Migration aborted! Reason: " . $e->getMessage() . "</error>");
                return 1;
            }
        }

        $time = microtime(true) - $start;
        $output->writeln("Resumed $executed migrations, failed $failed");
        $output->writeln("Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB');

        if ($failed) {
            return 2;
        }

        return 0;
    }
640325
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $output->writeln($this->crypt->generateKey());
        return 0;
    }
796724
protected function execute(InputInterface $input, OutputInterface $output)
    {

        $credentials = $GLOBALS['TYPO3_CONF_VARS']['DB']["Connections"]["Default"];
        $filename = "database";

        $output->writeln('<comment>Import local database.</comment>');
        exec('mysql -u' . $credentials['user'] . ' -h' . $credentials['host'] . ' -p' . $credentials['password'] . ' ' . $credentials['dbname'] . ' < ' . $filename . '.dump');


        return 0;

    }
1132827
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        parent::execute($input, $output);

        $this->queue->consume(function (Message $message) {
            return $this->consumeCallback($message);
        });

        return $this->sendExitCode();
    }
868029
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->initializeLicenser($input, $output);

        $sources = $input->getArgument('sources');

        $this->licenser->process(
            $sources,
            (bool) $input->getOption('replace-existing'),
            (bool) $input->getOption('dry-run')
        );

        return 0;
    }
271765
protected function execute(InputInterface $input, OutputInterface $output) {
		if (!file_exists(\Skeleton\Database\Migration\Config::$migration_directory)) {
			$output->writeln('<error>Config::$migration_directory is not set to a valid directory</error>');
			return 1;
		}

		if (isset(\Skeleton\Object\Config::$cache_handler) AND \Skeleton\Object\Config::$cache_handler != '') {
			$output->writeln('Flush cache');
			\Skeleton\Object\Cache::cache_flush();
		}

		$output->writeln('Running migrations');
		$migrations = \Skeleton\Database\Migration\Runner::get_runnable();

		foreach ($migrations as $migration) {
			try {
				$package = $migration->get_skeleton();
				$package = $package->name;
			} catch (\Exception $e) {
				$package = 'project';
			}


			if (preg_match('@\\\\([\w]+)$@', get_class($migration), $matches)) {
				$classname = $matches[1];
			} else {
				$classname = get_class($migration);
			}
			$output->write("\t" . $package . ' / ' . $classname . ' ');
			try {
				$migration->run('up');
				$output->writeln('<info>ok</info>');
			} catch (\Exception $e) {
				$output->writeln('<error>' . $e->getMessage() . '</error>');
				$output->writeln('<comment>' . $e->getTraceAsString() . '</comment>');
				return 1;
			}
		}

		$output->writeln('Database up-to-date' );
		return 0;
	}
310074
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $adapter = $this->databaseImportExportAdapterManager->getAdapter($input->getOption('adapter'));
        $adapter->setLogger($this->logger);

        $database = $input->getArgument('database');
        $filename = $input->getArgument('filename');

        $this->logger->info("Importing \"$filename\" into database \"$database\".");
        $adapter->importFromFile(
            $filename,
            $database,
            [] // This command does not yet support any options
        );
        $this->logger->info("\"$filename\" imported into database \"$database\".");
        return 0;
    }
193480
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $this->logger->info('Getting database metadata.');
        $databaseAdapter = $this->databaseAdapterManager->getAdapter($input->getOption('adapter'));
        $databases = $databaseAdapter->getDatabaseMetadata();
        $databases = $this->sort($databases, $input->getOption('sort'), $input->getOption('reverse-sort'));
        $databases = $this->format(
            $databases,
            $input->getOption('unit'),
            $input->getOption('precision')
        );

        $outputTable = new Table($output);
        $outputTable
            ->setHeaders(array('Database', 'Size in ' . $input->getOption('unit')));
        foreach ($databases as $name => $database) {
            $outputTable->addRow([$name, $database['size']]);
        }
        $outputTable->render();
        return 0;
    }
1264419
public function execute(InputInterface $input, OutputInterface $output)
    {
        $filesystem = new Filesystem();
        $discouraged = RootDirectories::getDiscouraged();
        $found = [];

        foreach ($discouraged as $directory => $comment) {
            if ($filesystem->exists($directory) && is_dir($directory)) {
                $found[] = [$directory, $comment];
            }
        }

        if (count($found) == 0) {
            $output->writeln('<fg=green>No issues found.</fg=green>');

            return 0;
        }

        $output->writeln('The following issues where found:');

        $table = new Table($output);

        $table->setHeaders(['Directory', 'Comment']);
        $table->setRows($found);
        $table->render();

        return 1;
    }