This command saves a configuration value.

@param InputInterface  $input  The input interface
@param OutputInterface $output The output interface
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);
    }
626709
protected function execute(InputInterface $input, OutputInterface $output) : void
    {

        $io     = $this->getIO($input, $output);
        $config = $this->getConfig($input->getOption('configuration'), true);
        $repo   = new Repository(dirname($input->getOption('git-directory')));

        $installer = new Installer($io, $config, $repo);
        $installer->setForce($input->getOption('force'))
                  ->setHook((string) $input->getArgument('hook'));

        $installer->run();
    }
896252
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->configFilePath = $input->getOption('config-path');

        if (!$this->verifyNotInstalled($output)) {
            return;
        }

        $output->writeln('');
        $output->writeln('<info>******************</info>');
        $output->writeln('<info> '.Lang::get('welcome_to_phpci').'</info>');
        $output->writeln('<info>******************</info>');
        $output->writeln('');

        $this->checkRequirements($output);

        $output->writeln(Lang::get('please_answer'));
        $output->writeln('-------------------------------------');
        $output->writeln('');

        // ----
        // Get MySQL connection information and verify that it works:
        // ----
        $connectionVerified = false;

        while (!$connectionVerified) {
            $db = $this->getDatabaseInformation($input, $output);

            $connectionVerified = $this->verifyDatabaseDetails($db, $output);
        }

        $output->writeln('');

        $conf = array();
        $conf['b8']['database'] = $db;

        // ----
        // Get basic installation details (URL, etc)
        // ----
        $conf['phpci'] = $this->getPhpciConfigInformation($input, $output);

        $this->writeConfigFile($conf);
        $this->setupDatabase($output);
        $admin = $this->getAdminInformation($input, $output);
        $this->createAdminUser($admin, $output);
    }
702613
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;
		}

		$migration = \Skeleton\Database\Migration::get_by_version($input->getArgument('name'));

		try {
			$migration->up();
			$output->writeln(get_class($migration) . "\t" . ' <info>ok</info>');
		} catch (\Exception $e) {
			$output->writeln(get_class($migration) . "\t" . ' <error>' . $e->getMessage() . '</error>');
			$output->writeln('<comment>' . $e->getTraceAsString() . '</comment>');
			return 1;
		}

		return 0;
	}
677052
protected function setIO(InputInterface $input, OutputInterface $output)
    {
        $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
    }
133478
protected function configureIO(InputInterface $input, OutputInterface $output)
    {
        if (true === $input->hasParameterOption(array('--ansi'), true)) {
            $output->setDecorated(true);
        } elseif (true === $input->hasParameterOption(array('--no-ansi'), true)) {
            $output->setDecorated(false);
        }

        if (true === $input->hasParameterOption(array('--no-interaction', '-n'), true)) {
            $input->setInteractive(false);
        } elseif (function_exists('posix_isatty')) {
            $inputStream = null;

            if ($input instanceof StreamableInputInterface) {
                $inputStream = $input->getStream();
            }

            // This check ensures that calling QuestionHelper::setInputStream() works
            // To be removed in 4.0 (in the same time as QuestionHelper::setInputStream)
            if (!$inputStream && $this->getHelperSet()->has('question')) {
                $inputStream = $this->getHelperSet()->get('question')->getInputStream(false);
            }

            if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
                $input->setInteractive(false);
            }
        }

        if (true === $input->hasParameterOption(array('--quiet', '-q'), true)) {
            $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
            $input->setInteractive(false);
        } else {
            if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || $input->getParameterOption('--verbose', false, true) === 3) {
                $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
            } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || $input->getParameterOption('--verbose', false, true) === 2) {
                $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
            } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) {
                $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
            }
        }
    }
1006015
protected function createConfiguration(InputInterface $input, OutputInterface $output)
    {
        $path = $this->getApplication()->getRoot() . '/.jedi.php';

        $output->writeln('  - Configuration');

        if (file_exists($path)) {
            $question = new ConfirmationQuestion(
                '    <error>Configuration file ' . $path . ' already exists</error>' . PHP_EOL
                . '    <info>Overwrite? [Y/n]</info> ',
                true,
                '/^(y|j)/i'
            );

            if (!$this->questionHelper->ask($input, $output, $question)) {
                return;
            }
        }

        $fs = new Filesystem();

        $question = new Question('    <info>Enter path to web directory relative to '
            . $this->getApplication()->getRoot() . ':</info> ' . PHP_EOL
            . '    (or do not specify if you are already in the web directory)' . PHP_EOL);

        $question->setValidator(function ($answer) use ($fs) {
            $path = $answer;

            if ($answer === null) {
                $path = $this->getApplication()->getRoot();
            } elseif (!$fs->isAbsolutePath($answer)) {
                $path = $this->getApplication()->getRoot() . '/' . $answer;
            }

            if (!is_dir($path)) {
                throw new \RuntimeException('Directory "' . $path . '" is missing');
            }

            return $answer;
        });

        $webDir = $this->questionHelper->ask($input, $output, $question);

        $content = file_get_contents($this->tmplDir . '/.jedi.php');
        $content = str_replace(
            ['%web-dir%', '%env-dir%'],
            [addslashes($webDir), addslashes($this->envDir)],
            $content
        );
        $fs->dumpFile($path, $content);

        $output->writeln('    Created configuration file of application <comment>' . $path . '</comment>');
    }
32411
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->init($input, $output);

        $this->force_prompt();
                
        $this->publish_packages($this->get_packages());
        
        // Feedback how many files were copied.
        if (\count($this->copied)) {
            $this->output->writeln(
                \sprintf(
                    "\n<info>Published %d %s successfully:\n%s</info>",
                    \count($this->copied),
                    _n('file', 'files', \count($this->copied)),
                    \implode($this->copied, "\n")
                )
            );
            exit;
        }
        
        $this->output->writeln("\n<info>Nothing needed to be published</info>");
    }
966996
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var ConfigurationHelper $configurationHelper */
        $configurationHelper = $this->getHelper('phpdocumentor_configuration');

        $progress = $this->getProgressBar($input);
        if (! $progress) {
            $this->connectOutputToEvents($output);
        }

        // initialize transformer
        $transformer = $this->getTransformer();

        $target = (string) $configurationHelper->getOption($input, 'target', 'transformer/target');
        $fileSystem = new Filesystem();
        if (! $fileSystem->isAbsolutePath($target)) {
            $target = getcwd() . DIRECTORY_SEPARATOR . $target;
        }
        $transformer->setTarget($target);

        $source = realpath($configurationHelper->getOption($input, 'source', 'parser/target'));
        if (!file_exists($source) || !is_dir($source)) {
            throw new \Exception('Invalid source location provided, a path to an existing folder was expected');
        }

        $this->getCache()->getOptions()->setCacheDir($source);

        $projectDescriptor = $this->getBuilder()->getProjectDescriptor();
        $mapper = new ProjectDescriptorMapper($this->getCache());
        $output->writeTimedLog('Load cache', array($mapper, 'populate'), array($projectDescriptor));

        foreach ($this->getTemplates($input) as $template) {
            $output->writeTimedLog(
                'Preparing template "'. $template .'"',
                array($transformer->getTemplates(), 'load'),
                array($template, $transformer)
            );
        }
        $output->writeTimedLog(
            'Preparing ' . count($transformer->getTemplates()->getTransformations()) . ' transformations',
            array($this, 'loadTransformations'),
            array($transformer)
        );

        if ($progress) {
            $progress->start($output, count($transformer->getTemplates()->getTransformations()));
        }

        /** @var CompilerPassInterface $pass */
        foreach ($this->compiler as $pass) {
            $output->writeTimedLog($pass->getDescription(), array($pass, 'execute'), array($projectDescriptor));
        }

        if ($progress) {
            $progress->finish();
        }

        return 0;
    }
397348
public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->ensurePhpExtIsAvailable('CURL');
        $this->ensurePhpExtIsAvailable('mbstring');
        $this->options = $input->getOptions();
        $this->output = $output;

        // load config
        $config = $this->getGlobalConfig();

        // update config from options
        if (count($this->options['override'])) {
            $config = $this->overrideConfig($this->options['override']);
        }
        if ($this->options['ext']) {
            $config = $this->enableExtensions($this->options['ext']);
        }

        if (!$this->options['colors']) {
            $this->options['colors'] = $config['settings']['colors'];
        }

        if (!$this->options['silent']) {
            $this->output->writeln(
                Codecept::versionString() . "\nPowered by " . \PHPUnit\Runner\Version::getVersionString()
            );
            $this->output->writeln(
                "Running with seed: " . $this->options['seed'] . "\n"
            );
        }
        if ($this->options['debug']) {
            $this->output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
        }

        $userOptions = array_intersect_key($this->options, array_flip($this->passedOptionKeys($input)));
        $userOptions = array_merge(
            $userOptions,
            $this->booleanOptions($input, [
                'xml' => 'report.xml',
                'phpunit-xml' => 'phpunit-report.xml',
                'html' => 'report.html',
                'json' => 'report.json',
                'tap' => 'report.tap.log',
                'coverage' => 'coverage.serialized',
                'coverage-xml' => 'coverage.xml',
                'coverage-html' => 'coverage',
                'coverage-text' => 'coverage.txt',
                'coverage-crap4j' => 'crap4j.xml',
                'coverage-phpunit' => 'coverage-phpunit'])
        );
        $userOptions['verbosity'] = $this->output->getVerbosity();
        $userOptions['interactive'] = !$input->hasParameterOption(['--no-interaction', '-n']);
        $userOptions['ansi'] = (!$input->hasParameterOption('--no-ansi') xor $input->hasParameterOption('ansi'));

        if (!$this->options['seed']) {
            $userOptions['seed'] = rand();
        } else {
            $userOptions['seed'] = intval($this->options['seed']);
        }
        if ($this->options['no-colors'] || !$userOptions['ansi']) {
            $userOptions['colors'] = false;
        }
        if ($this->options['group']) {
            $userOptions['groups'] = $this->options['group'];
        }
        if ($this->options['skip-group']) {
            $userOptions['excludeGroups'] = $this->options['skip-group'];
        }
        if ($this->options['report']) {
            $userOptions['silent'] = true;
        }
        if ($this->options['coverage-xml'] or $this->options['coverage-html'] or $this->options['coverage-text'] or $this->options['coverage-crap4j'] or $this->options['coverage-phpunit']) {
            $this->options['coverage'] = true;
        }
        if (!$userOptions['ansi'] && $input->getOption('colors')) {
            $userOptions['colors'] = true; // turn on colors even in non-ansi mode if strictly passed
        }

        $suite = $input->getArgument('suite');
        $test = $input->getArgument('test');

        if ($this->options['group']) {
            $this->output->writeln(sprintf("[Groups] <info>%s</info> ", implode(', ', $this->options['group'])));
        }
        if ($input->getArgument('test')) {
            $this->options['steps'] = true;
        }

        if (!$test) {
            // Check if suite is given and is in an included path
            if (!empty($suite) && !empty($config['include'])) {
                $isIncludeTest = false;
                // Remember original projectDir
                $projectDir = Configuration::projectDir();

                foreach ($config['include'] as $include) {
                    // Find if the suite begins with an include path
                    if (strpos($suite, $include) === 0) {
                        // Use include config
                        $config = Configuration::config($projectDir.$include);

                        if (!isset($config['paths']['tests'])) {
                            throw new \RuntimeException(
                                sprintf("Included '%s' has no tests path configured", $include)
                            );
                        }

                        $testsPath = $include . DIRECTORY_SEPARATOR.  $config['paths']['tests'];

                        try {
                            list(, $suite, $test) = $this->matchTestFromFilename($suite, $testsPath);
                            $isIncludeTest = true;
                        } catch (\InvalidArgumentException $e) {
                            // Incorrect include match, continue trying to find one
                            continue;
                        }
                    } else {
                        $result = $this->matchSingleTest($suite, $config);
                        if ($result) {
                            list(, $suite, $test) = $result;
                        }
                    }
                }

                // Restore main config
                if (!$isIncludeTest) {
                    $config = Configuration::config($projectDir);
                }
            } elseif (!empty($suite)) {
                $result = $this->matchSingleTest($suite, $config);
                if ($result) {
                    list(, $suite, $test) = $result;
                }
            }
        }

        if ($test) {
            $filter = $this->matchFilteredTestName($test);
            $userOptions['filter'] = $filter;
        }

        if (!$this->options['silent'] && $config['settings']['shuffle']) {
            $this->output->writeln(
                "[Seed] <info>" . $userOptions['seed'] . "</info>"
            );
        }

        $this->codecept = new Codecept($userOptions);

        if ($suite and $test) {
            $this->codecept->run($suite, $test, $config);
        }

        // Run all tests of given suite or all suites
        if (!$test) {
            $suites = $suite ? explode(',', $suite) : Configuration::suites();
            $this->executed = $this->runSuites($suites, $this->options['skip']);

            if (!empty($config['include']) and !$suite) {
                $current_dir = Configuration::projectDir();
                $suites += $config['include'];
                $this->runIncludedSuites($config['include'], $current_dir);
            }

            if ($this->executed === 0) {
                throw new \RuntimeException(
                    sprintf("Suite '%s' could not be found", implode(', ', $suites))
                );
            }
        }

        $this->codecept->printResult();

        if (!$input->getOption('no-exit')) {
            if (!$this->codecept->getResult()->wasSuccessful()) {
                exit(1);
            }
        }
    }
705578
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $configurationIdentifier = $input->getArgument('identifier');
        $this
            ->configurationManager
            ->delete(
                $configurationIdentifier
            );

        $this->printMessage(
            $output,
            'Configuration',
            'Deleted configuration "' . $configurationIdentifier . '"'
        );

        $this->finishCommand($output);
    }
376279
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $name = $input->getArgument('name');

        $cpath = app_path().'/controllers/';
        $filename = $name.'.php';
        $filepath = $cpath.$filename;

        if (file_exists($filepath)) {
            unlink($filepath);
            $output->writeln("<info>Controller: $name was deleted</info>");

            shell_exec('composer dump-autoload -o');
        } else {
            $output->writeln("<error>Controller: $name doesn't exists!");
        }
    }
448242
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setIo($input, $output);

        /** @var Repository $config */
        $config = $this->container['config'];

        $sourceRepoPath = $config['source.directory'];
        $sourceRepoUrl = $config['source.git.url'];
        $sourceRepoBranch = $config['source.git.branch'];

        $this->checkSourceRepoSettings($sourceRepoPath, $sourceRepoUrl);

        $output->writeln([
            "<b>steak pull configuration:</b>",
            " Source repository remote is <path>{$sourceRepoUrl}</path>",
            " Source repository branch is <path>{$sourceRepoBranch}</path>",
            " Path to local repository is <path>{$sourceRepoPath}</path>",
        ], OutputInterface::VERBOSITY_VERBOSE);

        if ($this->files->exists($sourceRepoPath)) {

            $workingCopy = $this->git->workingCopy($sourceRepoPath);

            if ( ! $workingCopy->isCloned()) {
                throw new RuntimeException("<path>{$sourceRepoPath}</path> exists but is not a git repository.");
            }

            if ($workingCopy->getBranches()->head() != $sourceRepoBranch) {
                throw new RuntimeException("<path>{$sourceRepoPath}</path> exists but isn't on the <path>{$sourceRepoBranch}</path> branch.");
            }

            $this->git->streamOutput();
            $workingCopy->pull();

        } else {
            $output->writeln([
                "The source directory <path>$sourceRepoPath</path> does not exist.",
                "  Attempting clone from {$sourceRepoUrl}",
            ]);

            $this->git->streamOutput();
            $this->git->cloneRepository($sourceRepoUrl, $sourceRepoPath, [
                'single-branch' => true,
                'branch' => $sourceRepoBranch
            ]);

            $output->writeln("<info>Clone complete! Edit your sources in <path>{$sourceRepoPath}</path></info>");
        }

        $output->writeln("Try <comment>steak serve</comment> to fire up the local development server...");
    }
136960
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $config = new Config(
            $input->getOption('prod'),
            $input->getOption('destination'),
            '/sites/all/modules/%s',
            '/sites/all/themes/%s',
            '/sites/all/drush/%s',
            '/profiles/%s',
            '/sites/default/files',
            '/sites/default/files-private',
            '/sites/default/settings.php'
        );

        $finder = new Finder(
             $input->getOption('source'),
            $input->getOption('destination'),
            'cnf/files',
            'cnf/private',
            'cnf/settings.php'
        );

        $im = $this->getComposer()->getInstallationManager();
        $rm = $this->getComposer()->getRepositoryManager();

        $mapper = new Mapper($config, $finder, $im, $rm);
        $mapper->clear();
        $mapper->mirror($mapper->getMap());
    }
815015
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path = $input->getArgument('path');
        $excludes = $input->getOption('exclude');
        $verbose = $output->getVerbosity();
        $configValue = $this->getUsableConfig($input);

        if ($verbose >= OutputInterface::VERBOSITY_VERBOSE) {
            $this
                ->printInitMessage(
                    $input,
                    $output,
                    $path,
                    $excludes
                );
            $output->writeln('#');
            $output->writeln('# Executing process with this configuration');
            $this->printUsableConfig($output, $configValue);
        }

        $files = $this
            ->loadFiles(
                $path,
                $excludes
            );

        if ($verbose >= OutputInterface::VERBOSITY_VERBOSE) {
            $output->writeln('# Found ' . $files->count() . ' files');
            $output->writeln('# Starting format...');
            $output->writeln('#');
        }

        $fixer = $this->getFixer($configValue);
        $this->fixFiles(
            $input,
            $output,
            $files,
            $fixer
        );
    }
426264
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $dumper = new \Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;
        $config = $dumper->dump(
            new \Edyan\Neuralyzer\Configuration\ConfigDefinition
        );

        $output->writeLn($config);
    }
1216702
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setupConsole($input, $output);
        $this->serve();
    }