Executes the command.

@param InputInterface $input An InputInterface instance
@param OutputInterface $output An OutputInterface instance

@throws \RuntimeException
@throws \Doctrine\ORM\ORMException

@return int|null|void
199622
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getQuestionHelper();

        GeneratorUtils::ensureOptionsProvided($input, array('entity'));

        $entity = Validators::validateEntityName($input->getOption('entity'));
        list($bundle, $entity) = $this->parseShortcutNotation($entity);

        $entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($bundle) . '\\' . $entity;
        $metadata = $this->getEntityMetadata($entityClass);
        /** @var Bundle $bundle */
        $bundle = $this->getContainer()->get('kernel')->getBundle($bundle);

        $questionHelper->writeSection($output, 'AdminList Generation');

        /** @var AdminListGenerator $generator */
        $generator = $this->getGenerator($this->getApplication()->getKernel()->getBundle("KunstmaanGeneratorBundle"));
        $generator->setQuestion($questionHelper);
        $generator->generate($bundle, $entityClass, $metadata[0], $output, $input->getOption('sortfield'));

        $parts = explode('\\', $entity);
        $entityClass = array_pop($parts);

        $generator->generateRouting($bundle, $entityClass);
    }
821227
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = new SymfonyOutput($output);

        $this->input = $input;

        if (method_exists($this, 'handle')) {
            $this->handle();
        }
    }
442127
protected function runCommand(InputInterface $input, OutputInterface $output)
    {
        $appName = $input->getArgument('app-name');
        list($_, $indexUUID) = $this->getRepositoryAndIndex($input, $output);

        $this
            ->repositoryBucket
            ->findRepository($appName)
            ->resetIndex($indexUUID);
    }
143170
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $loader = new Loader();
        $executor = new ORMExecutor($this->em, new ORMPurger());

        $loader->loadFromDirectory($this->mainDir);
        foreach ($this->dirs as $dir) {
            $loader->loadFromDirectory($dir);
        }

        $executor->execute($loader->getFixtures(), true);
    }
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);
    }
347975
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setInputAndOutput($input, $output);

        return $this->doExecute();
    }
121437
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->requireConfig();

        $output->writeln('Starting <fg=blue>Magallanes</>');
        $output->writeln('');

        try {
            $this->runtime->setEnvironment($input->getArgument('environment'));

            $strategy = $this->runtime->guessStrategy();
            $this->taskFactory = new TaskFactory($this->runtime);

            if (!$this->runtime->getEnvOption('releases', false)) {
                throw new RuntimeException('Releases are not enabled', 70);
            }

            $releaseToRollback = $input->getArgument('release');
            if (($releaseId = $this->checkReleaseAvailability($releaseToRollback)) === false) {
                throw new RuntimeException(sprintf('Release "%s" is not available on all hosts', $releaseToRollback), 72);
            }

            $this->runtime->setReleaseId($releaseId)->setRollback(true);

            $output->writeln(sprintf('    Environment: <fg=green>%s</>', $this->runtime->getEnvironment()));
            $this->log(sprintf('Environment: %s', $this->runtime->getEnvironment()));

            $output->writeln(sprintf('    Rollback to Release Id: <fg=green>%s</>', $this->runtime->getReleaseId()));
            $this->log(sprintf('Release ID: %s', $this->runtime->getReleaseId()));

            if ($this->runtime->getConfigOption('log_file', false)) {
                $output->writeln(sprintf('    Logfile: <fg=green>%s</>', $this->runtime->getConfigOption('log_file')));
            }

            $output->writeln(sprintf('    Strategy: <fg=green>%s</>', $strategy->getName()));

            $output->writeln('');
            $this->runDeployment($output, $strategy);
        } catch (RuntimeException $exception) {
            $output->writeln(sprintf('<error>%s</error>', $exception->getMessage()));
            $this->statusCode = $exception->getCode();
        }

        $output->writeln('Finished <fg=blue>Magallanes</>');

        return $this->statusCode;
    }
1365760
protected function execute(InputInterface $input, OutputInterface $output)
    {
        foreach ($this->getFacade()->migrate() as $line) {
            $output->write($line);
        }
    }
1275154
public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input  = $input;
        $this->output = $output;
        $logger       = $this->logger;

        Resque_Event::listen(
            'onFailure',
            function ($exception, $job) use ($logger) {
                $logger->error('Error processing job', [
                    'exception' => $exception
                ]);
            }
        );

        if ($input->getOption('shutdown')) {
            $this->shutdownWorkers();
            return;
        }

        $queues = $input->getArgument('queue');
        if (! count($queues)) {
            throw new RuntimeException('Not enough arguments.');
        }

        $count    = $input->getOption('count');
        $interval = $input->getOption('interval');

        if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE) {
            $logLevel = Resque_Worker::LOG_NORMAL;
        } elseif ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
            $logLevel = Resque_Worker::LOG_VERBOSE;
        } else {
            $logLevel = Resque_Worker::LOG_NONE;
        }

        $this->startWorkers($queues, $count, $logLevel, $interval);
    }
952891
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<info>Following strategies to extract an authentication key are available:</info>');
        $output->writeln(
            "<info>\t* " .
            implode(PHP_EOL . "\t* ", $this->strategies) .
            "</info>"
        );
    }
1281580
public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        if ($input !== null) {
            $in = $input;
        } else {
            $in = $this->getInput();
        }

        return parent::run($in, $output);
    }
489985
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $finder     = new Finder();
        $filesystem = new Filesystem();
        $filesystem->remove($finder->directories()->in($this->getLanguageBasePath()));
    }
828092
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->addOption('--environment', '-e', InputArgument::OPTIONAL);
        $input->setOption('environment', getenv('RAD_ENVIRONMENT'));
        parent::execute($input, $output);
    }
186021
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $dir = $input->getArgument('dir');

        Console::setCustomEnvDirectory($dir);

        $output->writeln('### ENV directory has been set to '.$dir.' ###');
    }
53704
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->before($input, $output);
        $this->runTransient($input, $output);
        $this->after($input, $output);
    }
239355
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->requireConfig();

        $output->writeln('Starting <fg=blue>Magallanes</>');
        $output->writeln('');

        $output->writeln(sprintf('<comment>%s</comment>', var_export($this->runtime->getConfiguration(), true)));

        $output->writeln('');
        $output->writeln('Finished <fg=blue>Magallanes</>');

        return 0;
    }
1112681
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $force = $input->getOption('force');

        if (!$force) {
            throw new \RuntimeException('Include --force option if you really want to proceed');
        }

        $container = $this->getContainer();
        $entityManager = $container->get('doctrine')->getManager();
        $encryptionService = $container->get('jagilpe_encryption.encryption.service');

        // Encrypt the entities in the database
        $encryptedEntityTypes = $encryptionService->getEncryptionEnabledEntitiesMetadata();
        foreach ($encryptedEntityTypes as $encryptedEntityType) {
            $entityClass = $encryptedEntityType->name;
            $repository = $entityManager->getRepository($entityClass);
            $entities = $repository->findBy(array('encrypted' => false));
            $total = count($entities);
            if ($total > 0){
                $message = "Encrypting $total entities of type $entityClass";
                $output->writeln($message);
                $progress = new ProgressBar($output, $total);
                foreach ($entities as $entity) {
                    if (!$entity->isEncrypted()) {
                        $encryptionService->processEntityMigration($entity);
                        $repository->save($entity);
                    }
                    $progress->advance();
                }

                $progress->finish();
                $output->writeln('');
            }
        }
    }