Executes the current command.

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

@return null|integer null or 0 if everything went fine, or an error code
437339
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $directory = $input->getArgument('dir');
        $fileOut = $input->getArgument('file');

        $names = $input->getOption('names');
        if ($names) {
            $names = explode(',', $names);
        } else {
            $names = array();
        }

        $ignoreNames = $input->getOption('ignore');
        if ($ignoreNames) {
            $ignoreNames = explode(',', $ignoreNames);
        } else {
            $ignoreNames = array();
        }

		$noSuffix = $input->hasParameterOption('--no-suffix');
        // here is where the magic happens
        $files = $this->findFiles($directory, $names, $ignoreNames);
        $outXml = $this->mergeFiles(realpath($directory), $files, $noSuffix);
        $result = $this->writeFile($outXml, $fileOut);

        $output->writeln(
            '<info>Found and processed ' . count($files) . ' files. Wrote merged result in \'' . $fileOut . '\'.</info>'
        );

        return (true === $result) ? 0 : 1;
    }
324753
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $pluginHash = $input->getArgument('hash');
        $plugin = $this
            ->pluginRepository
            ->findOneBy([
                'hash' => $pluginHash,
            ]);

        if (!($plugin instanceof Plugin)) {
            $this->printMessageFail(
                $output,
                'Plugin',
                'Plugin with hash "' . $pluginHash . '" not found'
            );

            return null;
        }

        $plugin->disable();
        $this
            ->pluginObjectManager
            ->flush($plugin);

        $this->printMessage(
            $output,
            'Plugin',
            'Plugin with hash "' . $pluginHash . '" disabled'
        );

        $this->finishCommand($output);
    }
11912
protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $builder = $this->getMenuBuilder($input, $output);
        if ($input->getOption('dump')) {
            $this->dumpCommands($builder, $output);
        } else {
            $builder->build()->open();
        }
        return 0;
    }
101557
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($input->getArgument('version') === null) {
            $version = $this->manager->getVersionFromProvider();
            $output->writeln(sprintf('Provider: <comment>%s</comment>', get_class($this->manager->getActiveProvider())));

            $formatter = $this->manager->getFormatter();
            if ($formatter instanceof FormatterInterface) {
                $output->writeln(sprintf('Formatter: <comment>%s</comment>', get_class($formatter)));
            } else {
                $output->writeln(sprintf('Formatter: <comment>%s</comment>', 'None'));
            }
        } else {
            $version = Version::fromString($input->getArgument('version'));
            $output->writeln(sprintf('Provider: <comment>%s</comment>', 'Symfony command'));
            $output->writeln(sprintf('Formatter: <comment>%s</comment>', 'Not available'));
        }

        $incrementMajor = (int) $input->getOption('major');
        if ($incrementMajor > 0) {
            for ($i = 0; $i < $incrementMajor; $i++) {
                $version = $version->withMajorIncremented();
            }
        }

        $incrementMinor = (int) $input->getOption('minor');
        if ($incrementMinor > 0) {
            for ($i = 0; $i < $incrementMinor; $i++) {
                $version = $version->withMinorIncremented();
            }
        }

        $incrementPatch = (int) $input->getOption('patch');
        if ($incrementPatch > 0) {
            for ($i = 0; $i < $incrementPatch; $i++) {
                $version = $version->withPatchIncremented();
            }
        }

        $preRelease = $input->getOption('prerelease');
        if (!empty($preRelease)) {
            if (in_array(null, $preRelease)) {
                $preRelease = array();
            }

            $version = $version->withPreRelease($preRelease);
        }

        $build = $input->getOption('build');
        if (!empty($build)) {
            if (in_array(null, $build)) {
                $build = array();
            }

            $version = $version->withBuild($build);
        }

        $currentVersion = $this->manager->getVersion();
        if ((string) $currentVersion == (string) $version) {
            $version = $version->withPatchIncremented();
        }

        $output->writeln(sprintf('Current version: <info>%s</info>', $currentVersion));
        $output->writeln(sprintf('New version: <info>%s</info>', $version));
        if ($input->getOption('dry-run')) {
            $output->writeln(sprintf('<question>%s</question>', 'Dry run, skipping version bump'));
        } else {
            $this->manager->writeVersion($version);
        }
    }
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);
    }
1062771
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $cmd        = $input->getArgument('cmd');
        $process    = $input->getArgument('server');

        $server = new Server(
            Config::get('name'),
            $process
        );

        $server->$cmd();
    }
1133146
public function run(InputInterface $input, OutputInterface $output)
    {
        return parent::run(
            $this->input = $input, $this->output = new OutputStyle($input, $output)
        );
    }
22261
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $success = $this->_queue->runNextJob();
        if ($success === true) {
            $output->writeln("Queue Processed.");
        } elseif ($success === false) {
            $output->writeln("Job failed.");
        } else {
            $output->writeln("No jobs in queue.");
        }
    }
534591
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getApplication()->getContainer();
        $container->configure();

        $classname = $input->getArgument('class');
        $method = $input->getArgument('method');

        if (!$this->confirm($input, $classname, $method)) {
            return;
        }

        $resource = $container->get('locator.resource_manager')->createResource($classname);

        $container->get('code_generator')->generate($resource, 'specification_method', [
            'method' => $method,
            'type' => $this->confirmMethodType($input, $output),
        ]);
    }
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);
    }
647715
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $name = $input->getArgument('name');
    $class = implode('', array_map('ucfirst', explode('_', str_replace(':', '_', $name))));

    if ($this->add($name, $class)) {
      return $output->writeln('<info>Command "' . $class . '" has been successfully created.</info>');
    }

    return $output->writeln('Command "' . $class . '" already exists.');
  }
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);
    }
632971
private function setInputAndOutput(InputInterface $input, OutputInterface $output)
    {
        if (is_null($this->assistant)) {
            $this->assistant = new CommandAssistant();
            $this->assistant->setQuestionHelper($this->getQuestionHelper());
            $this->assistant->setKernel($this->getApplication()->getKernel());
        }
        $this->assistant->setOutput($output);
        $this->assistant->setInput($input);
    }
1225427
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        return !is_null($this->exitCode) ? $this->exitCode : 0;
    }
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);
	}
503861
public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        try {
            $this->doExecute($input, $output);
        } catch (\Exception $e) {
            $this->writeException($e);
        }
    }
797085
protected function execute( InputInterface $input, OutputInterface $output )
	{
		$code = $input->getArgument( 'email' );
		if( ( $password = $input->getOption( 'password' ) ) === null )
		{
			$helper = $this->getHelper( 'question' );
			$question = new Question( 'Password' );
			$question->setHidden( true );

			$password = $helper->ask( $input, $output, $question );
		}

		$context = $this->getContainer()->get( 'aimeos.context' )->get( false, 'command' );
		$context->setEditor( 'aimeos:account' );

		$localeManager = \Aimeos\MShop::create( $context, 'locale' );
		$localeItem = $localeManager->bootstrap( $input->getArgument( 'site' ), '', '', false );
		$context->setLocale( $localeItem );

		$user = $this->createCustomerItem( $context, $code, $password );

		if( $input->getOption( 'admin' ) ) {
			$this->addGroup( $input, $output, $context, $user, 'admin' );
		}

		if( $input->getOption( 'editor' ) ) {
			$this->addGroup( $input, $output, $context, $user, 'editor' );
		}

		if( $this->getContainer()->has( 'fos_user.user_manager' ) )
		{
			$userManager = $this->getContainer()->get( 'fos_user.user_manager' );

			if( ( $fosUser = $userManager->findUserByUsername( $code ) ) === null ) {
				throw new \RuntimeException( 'No user created' );
			}

			$fosUser->setSuperAdmin( false );

			if( $input->getOption( 'super' ) ) {
				$fosUser->setSuperAdmin( true );
			}

			if( $input->getOption( 'admin' ) || $input->getOption( 'editor' ) ) {
				$fosUser->addRole( 'ROLE_ADMIN' );
			}

			$userManager->updateUser( $fosUser );
		}
	}