Execute code.

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

@throws InvalidAliasException If any alias is not defined
193382
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /**
         * Define all channels this command must listen to
         */
        $this->define();

        $serializer = $this->getContainer()->get('rs_queue.serializer');
        $resolver = $this->getContainer()->get('rs_queue.resolver.queuealias');
        $eventDispatcher = $this->getContainer()->get('event_dispatcher');
        $methods = $this->methods;

        $channelAliases = array_keys($methods);
        $channels = $resolver->getQueues($channelAliases);

        if ($this->shuffleQueues()) {

            shuffle($channels);
        }

        $this
            ->getContainer()
            ->get('rs_queue.redis')
            ->subscribe($channels, function ($redis, $channel, $payloadSerialized) use ($methods, $resolver, $serializer, $eventDispatcher, $input, $output) {

                $channelAlias = $resolver->getQueueAlias($channel);
                $method = $methods[$channelAlias];
                $payload = $serializer->revert($payloadSerialized);

                /**
                 * Dispatching subscriber event...
                 */
                $subscriberEvent = new RSQueueSubscriberEvent($payload, $payloadSerialized, $channelAlias, $channel, $redis);
                $eventDispatcher->dispatch(RSQueueEvents::RSQUEUE_SUBSCRIBER, $subscriberEvent);

                /**
                 * All custom methods must have these parameters
                 *
                 * InputInterface  $input   An InputInterface instance
                 * OutputInterface $output  An OutputInterface instance
                 * Mixed           $payload Payload
                 */
                $this->$method($input, $output, $payload);
            });
    }
556352
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $router = $this->getContainer()->get($this->getRouterServiceId());
        $name = $input->getArgument('name');
        $helper = new DescriptorHelper();

        if ($name) {
            $route = $router->getRouteCollection()->get($name);
            if (!$route) {
                throw new \InvalidArgumentException(sprintf('The route "%s" does not exist.', $name));
            }
            $this->convertItinerary($route);
            $helper->describe($output, $route, [
                'format' => $input->getOption('format'),
                'raw_text' => $input->getOption('raw'),
                'name' => $name,
            ]);
        } else {
            $routes = $router->getRouteCollection();

            foreach ($routes as $route) {
                $this->convertItinerary($route);
            }

            $helper->describe($output, $routes, [
                'format' => $input->getOption('format'),
                'raw_text' => $input->getOption('raw'),
                false,
            ]);
        }
    }
491684
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $method = $this->method;
        $this->setHelperSet($this->getApplication()->getHelperSet());
        if ($this->argument != null) {
            $argument = $input->getArgument($this->argument);
            $this->$method($argument);

            return;
        }

        $this->$method($input,$output);
    }
174037
protected function execute(InputInterface $input, OutputInterface $output) : void
    {
        $io     = $this->getIO($input, $output);
        $config = $this->getConfig($input->getOption('configuration'), true);
        $repo   = new Repository();
        $args   = new Config\Options(['file' => $input->getOption('message')]);
        $name   = $input->getArgument('hook');
        $class  = '\\CaptainHook\\App\\Runner\\Hook\\' . Util::getHookCommand($name);

        /** @var \CaptainHook\App\Runner\Hook $hook */
        $hook = new $class($io, $config, $repo, $args);
        $hook->run();
    }
122566
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $command = sprintf(
            'exec -i %s %s',
            $input->getArgument('container'),
            $input->getArgument('execcmd')
        );

        $response = $this->getFacade()->runDocker($command);

        if ($output->isVerbose()) {
            $output->writeln($response);
        }
    }
530565
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $helper = $this->getHelper('question');
        if (null === $this->configurationChain) {
            $this->configurationChain = $this->getContainer()->get('kunstmaan_search.search_configuration_chain');
        }

        /**
         * @var string
         * @var SearchConfigurationInterface $searchConfiguration
         */
        foreach ($this->configurationChain->getConfigurations() as $alias => $searchConfiguration) {
            $languagesNotAnalyzed = $searchConfiguration->getLanguagesNotAnalyzed();
            if (count($languagesNotAnalyzed) > 0) {
                $question = new ChoiceQuestion(
                    sprintf('Languages analyzer is not available for: %s. Do you want continue?', implode(', ', $languagesNotAnalyzed)),
                    ['No', 'Yes']
                );
                $question->setErrorMessage('Answer %s is invalid.');
                if ($helper->ask($input, $output, $question) === 'No') {
                    return;
                }
            }

            $searchConfiguration->createIndex();
            $output->writeln('Index created : ' . $alias);
        }
    }
178770
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln("<info>Start converting {$input->getArgument('source')}</info>");

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

        if (!file_exists($source)) {
            throw InvalidParameter::sourceDoesNotExist($source);
        }

        if (is_file($source)) {
            $this->convertFile($input);
        }
        if (is_dir($source)) {
            $this->convertPHPFilesInDirectory($input, $output);
        }
        $output->writeln('<info>All done!</info>');

        return 0;
    }
983759
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setIo($input, $output);

        $repo = $this->prepareRepository();

        $this->rebuild();

        $this->deployWithGit($repo);
    }
863939
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $persistence = $this->getPersistence();
        $output->writeln(sprintf(
            'Pulling translations in %s',
            $persistence->getDirectoryName()
        ));

        $gitOutput = $persistence->pullTranslations();
        $output->writeln($gitOutput);

        $output->writeln('Done.');
    }
1215728
public function execute(InputInterface $input, OutputInterface $output)
    {
        $host = $input->getArgument('host');

        $valid = $this->hostFile->check($host);

        $msg = $valid ? 'Host was found in the host file.' : 'Host was not found in the host file.';

        $output->writeln($msg);

        if ($valid) {
            $output->writeLn($valid);
        }
    }
853340
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;

        $this->arguments = $input->getArguments();
        $this->options = $input->getOptions();
        $this->stub = $this->getStub();

        if ($this->stub) {
            $this
                ->replaceFrequency()
                ->replaceConstraint()
                ->replaceCommand()
                ->replacePath()
                ->replaceDescription()
            ;
        }

        if ($this->save()) {
            $output->writeln('<info>The task file generated successfully</info>');
        } else {
            $output->writeln('<comment>There was a problem when generating the file. Please check your command.</comment>');
        }
    }
306872
protected function execute(InputInterface $input, OutputInterface $output)
    {
        //  validate the content types unless validation is ignored

        if ($input->getArgument('id') && !$input->getOption('ignore')) {
            $code = $this->executeValidation($input, $output);

            if ($code) {
                return $code;
            }
        }

        if ($input->getOption('delete')) {
            return $this->executeDelete($input, $output);
        }

        if (!$input->getArgument('id') && !$input->getOption('full')) {
            throw new InvalidArgumentException(
                'You need to give one or more content types or choose the --full or --delete option'
            );
        }

        return $this->executeIndex($input, $output);
    }
608343
public function execute(InputInterface $input, OutputInterface $output)
    {
        if (empty($path = $input->getArgument('path'))) {
            $this->render($input, $output);
        } else {
            $this->test($input->getArgument('method'), $path, $input, $output);
        }

        return 0;
    }
700997
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path = $input->getOption('path') ?: $this->paths[$input->getOption('type')];

        $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);

        if (file_exists($path) === true) {
            $source = $this->package($input->getArgument('name'));

            $this->migrate($output, $source, $path, $input->getOption('type'));

            $message = ucfirst($this->type) . ' created successfully!';

            return $output->writeln('<info>' . $message . '</info>');
        }

        $message = 'Folder "' . $path . '" does not exists!';

        throw new \InvalidArgumentException((string) $message);
    }
289977
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (null === $this->configurationChain) {
            $this->configurationChain = $this->getContainer()->get('kunstmaan_search.search_configuration_chain');
        }
        /**
         * @var string
         * @var SearchConfigurationInterface $searchConfiguration
         */
        foreach ($this->configurationChain->getConfigurations() as $alias => $searchConfiguration) {
            $searchConfiguration->deleteIndex();
            $output->writeln('Index deleted : ' . $alias);
        }
    }
694970
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $files = $input->getArgument('files');
        $fileSuffix = ' -f ' . implode(' -f ', $files);

        $command = sprintf('%s stop -d', $fileSuffix);
        $response = $this->getFacade()->runDockerCompose($command);

        if ($output->isVerbose()) {
            $output->writeln($response);
        }
    }
390096
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->initializeLicenser($input, $output);

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

        $this->licenser->check($sources);
    }