This command saves a configuration value.

@param InputInterface  $input  The input interface
@param OutputInterface $output The output interface
773421
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $configurationIdentifier = $input->getArgument('identifier');
        $configurationValue = json_decode($input->getArgument('value'), true);

        $this
            ->configurationManager
            ->set(
                $configurationIdentifier,
                $configurationValue
            );

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

        $this->finishCommand($output);
    }
922936
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $inputFile = $input->getArgument('input-file');
        $outputFile = $input->getArgument('output-file');

        if ($outputFile === null) {
            $outputFile = preg_replace('/\\.[^.]*$/', '.php', $inputFile);
        }

        $parserGenerator = new ParserGenerator(new PegFile());

        $output = "<?php\n\n" . $parserGenerator->createClass($inputFile);

        file_put_contents($outputFile, $output);
    }
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
        );
    }
306081
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $hash = $input->getOption('hash');
    $length = $input->getOption('length');
    $key = $this->newKey($hash, $length);

    if ($this->setKey($key)) return $output->writeln("<info>Application key [{$key}] set successfully.</info>");

    $output->writeln("Can't set application key. Please check if .env file exists");
  }
739175
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->validateCommand($input);

        $output->writeln('> Loading configuration file');
        $config = $input->getOption('config');
        $files = (new ConfigResolver())->getFileList($config);
        $output->writeLn('- Found '.count($files).' files');

        $preloader = (new Factory())->create($this->getOptions($input));

        $outputFile = $input->getOption('output');
        $handle = $preloader->prepareOutput($outputFile, $input->getOption('strict_types'));

        $output->writeln('> Compiling classes');

        $count = 0;
        $countSkipped = 0;
        $comments = !$input->getOption('strip_comments');

        foreach ($files as $file) {
            $count++;

            try {
                $code = $preloader->getCode($file, $comments);
                $output->writeln('- Writing '.$file);
                fwrite($handle, $code."\n");
            } catch (VisitorExceptionInterface $e) {
                $countSkipped++;
                $output->writeln('- Skipping '.$file);
            }
        }

        fclose($handle);

        $output->writeln("> Compiled loader written to $outputFile");
        $output->writeln('- Files: '.($count - $countSkipped).'/'.$count.' (skipped: '.$countSkipped.')');
        $output->writeln('- Filesize: '.(round(filesize($outputFile) / 1024)).' kb');
    }
509474
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        if (!$this->canRunAsRoot && $this->isRunningAsRoot() === true) {
            $this->confirmRunningAsRoot($input, $output);
        }
    }
589179
protected function getMigrationConfiguration(
        InputInterface $input,
        OutputInterface $output
    ): Configuration {
        if (!$this->configuration) {
            $conn = $this->getDatabaseConnection($input);

            $outputWriter = new OutputWriter(function($message) use ($output) {
                return $output->writeln($message);
            });

            $migrationsConfigFile = $input->getOption('configuration');

            $this->configuration = ConfigurationBuilder::create()
                ->setConnection($conn)
                ->setOutputWriter($outputWriter)
                ->setOnDiskConfiguration($migrationsConfigFile)
                ->build();
        }

        return $this->configuration;
    }
1188387
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        $io = new SymfonyStyle($input, $output);

        $config = $this->getConfigHelper()->load($input);
        $typeMap = TypeMap::fromMetadata(
            $config->getTypeNamespace(),
            $config->getEngine()->getMetadata()->getTypes()
        );

        $generator = new ClassMapGenerator(
            $config->getRuleSet(),
            $config->getClassMapName(),
            $config->getClassMapNamespace()
        );
        $path = $config->getClassMapDestination().DIRECTORY_SEPARATOR.$config->getClassMapName().'.php';
        $this->handleClassmap($generator, $typeMap, $path);

        $io->success('Generated classmap at ' . $path);
    }
1355032
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln(Yaml::dump($this->getContainer()->getValues(), 5, 4));
    }
1003589
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $config = $this->getContainer()->getParameter(CravlerMaxMindGeoIpExtension::CONFIG_KEY);

        foreach ($config['source'] as $key => $source) {
            if (!$source) {
                continue;
            }

            $output->writeln('');
            $output->write(sprintf('Downloading %s... ', $source));

            $tmpFile = $this->downloadFile($source);
            if (false === $tmpFile) {
                $output->writeln('FAILED');
                $output->writeln(sprintf('<error>Error during file download occurred on %s</error>', $source));
                continue;
            }

            $output->writeln('<info>Done</info>');
            $output->write('Unzipping the downloaded data... ');
            $tmpFileUnzipped = dirname($tmpFile).DIRECTORY_SEPARATOR.$config['db'][$key];

            $success = $this->decompressFile($tmpFile, $tmpFileUnzipped);

            if (!$input->getOption('no-md5-check')) {
                if (strpos($tmpFile, '.tar.gz') !== false) {
                    $calculatedMD5 = md5_file($tmpFile);
                } else {
                    $calculatedMD5 = md5_file($tmpFileUnzipped);
                }
            }

            unlink($tmpFile);

            if ($success) {
                $output->writeln('<info>Done</info>');
            } else {
                $output->writeln(sprintf('<error>An error occured when decompressing %s</error>', basename($tmpFile)));
                continue;
            }

            # MD5 check
            if (!$input->getOption('no-md5-check')) {
                $output->write('Checking file hash... ');
                if ($config['md5_check'][$key]) {
                    $expectedMD5 = file_get_contents($config['md5_check'][$key]);

                    if (!$expectedMD5 || strlen($expectedMD5) !== 32) {
                        unlink($tmpFileUnzipped);
                        $output->writeln(sprintf('<error>Unable to check MD5 for %s</error>', $source));
                        continue;
                    } elseif ($expectedMD5 !== $calculatedMD5) {
                        unlink($tmpFileUnzipped);
                        $output->writeln(sprintf('<error>MD5 for %s does not match</error>', $source));
                        continue;
                    } else {
                        $output->writeln('<info>File hash OK.</info>');
                    }
                } else {
                    $output->writeln('<comment>Skipped</comment>');
                }
            }

            if (!file_exists($config['path'])) {
                mkdir($config['path'], 0777, true);
            }

            $outputFilePath = $config['path'].DIRECTORY_SEPARATOR.$config['db'][$key];
            chmod(dirname($outputFilePath), 0777);
            $success = @rename($tmpFileUnzipped, $outputFilePath);

            if ($success) {
                $output->writeln(sprintf('<info>Update completed for %s.</info>', $key));
            } else {
                $output->writeln(sprintf('<error>Unable to update %s</error>', $key));
            }
        }
        $output->writeln('');
    }
1365760
protected function execute(InputInterface $input, OutputInterface $output)
    {
        foreach ($this->getFacade()->migrate() as $line) {
            $output->write($line);
        }
    }
854520
public function setOutput(OutputInterface $output)
    {
        $this->output = $output;
        $this->stdErr = $output instanceof ConsoleOutputInterface
            ? $output->getErrorOutput()
            : $output;
    }
235251
protected function configureOptions(InputInterface $input, OutputInterface $output, array $options)
    {
        if (empty($options)) {
            return;
        }

        foreach ($options as $module => $moduleOptions) {
            if (!is_array($moduleOptions) || empty($moduleOptions)) {
                continue;
            }

            foreach ($moduleOptions as $code => $value) {
                if (is_array($value)) {
                    if (isset($value['value']) && isset($value['siteId'])) {
                        Option::set($module, $code, $value['value'], $value['siteId']);
                    } else {
                        $output->writeln('<error>Invalid option for module "' . $module . '" with code "' . $code . '"</error>');
                    }
                } else {
                    Option::set($module, $code, $value);

                    $output->writeln('   option: "' . $code . '", module: "' . $module . '"');
                }
            }
        }
    }
74323
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $this->configBuilder = $this->getContainer()->get('admin.configuration.configbuilder');

        $this->configBuilder->addSection('demo', 'Demo');
        $this->configBuilder->addGroup('demo', 'demo', 'Demo');

        $types = array(
            'text' => 'Text Field',
            'textarea' => 'Text Area',
            'email' => 'Email',
            'checkbox' => 'Boolean',
            'choice' => 'Choice',
            'integer' => 'Integer',
            'number' => 'Number',
            'money' => 'Money',
            'percent' => 'Percent',
            'url' => 'Url',
            'datetime' => 'DateTime',
            'date' => 'Date',
            'time' => 'Time',
            'ckeditor' => 'WYSIWYG editor',
            'bootstrap_datepicker' => 'DatePicker',
            'bootstrap_timepicker' => 'TimePicker',
            'bootstrap_datetimepicker' => 'DateTimePicker',
            'bootstrap_email' => 'Bootstrap Email',
            'bootstrap_money' => 'Bootstrap Price',
            'bootstrap_percent' => 'Bootstrap Percent',
            'bootstrap_daterangepicker' => 'DateRangePicker',
            'bootstrap_colorpicker' => 'ColorPicker',
            'bootstrap_slider' => 'Slider',
            'bootstrap_chosen' => 'Chosen',
            'knob' => 'Knob',
        );

        // text field
        $this->_createValue('demo_text', 'text', 'Text field', '', '', array(), 0);
        $this->_createValue('demo_textarea', 'textarea', 'Text area', '', '', array(), 1);
        $this->_createValue('demo_email', 'email', 'Email', '', '', array(), 2);
        $this->_createValue('demo_bootstrap_email', 'bootstrap_email', 'Email', '', '', array(), 2);
        $this->_createValue('demo_checkbox', 'checkbox', 'Checkbox', '', '', array(), 3);
        $this->_createValue('demo_integer', 'integer', 'Integer', '', '', array(), 4);
        $this->_createValue('demo_number', 'number', 'Number', '', '', array(), 5);
        $this->_createValue('demo_money', 'money', 'Money', '', '', array(), 6);
        $this->_createValue('demo_bootstrap_money', 'bootstrap_money', 'Money', '', '', array(), 6);
        $this->_createValue('demo_percent', 'percent', 'Percent', '', '', array(), 7);
        $this->_createValue('demo_bootstrap_percent', 'bootstrap_percent', 'Percent', '', '', array(), 7);
        $this->_createValue('demo_url', 'url', 'Url', '', '', array(), 8);
        $this->_createValue('demo_datetime', 'datetime', 'Datetime', '', '', array(), 9);
        $this->_createValue('demo_date', 'date', 'Date', '', '', array(), 10);
        $this->_createValue('demo_time', 'time', 'Time', '', '', array(), 11);
        $this->_createValue('demo_ckeditor', 'ckeditor', 'Wysisyg', '', '', array(), 12);
        $this->_createValue('demo_bootstrap_datepicker', 'bootstrap_datepicker', 'DatePicker', '', '', array(), 13);
        $this->_createValue('demo_bootstrap_timepicker', 'bootstrap_timepicker', 'TimePicker', '', '', array(), 14);
        $this->_createValue('demo_bootstrap_datetimepicker', 'bootstrap_datetimepicker', 'DateTimePicker', '', '', array(), 15);
        $this->_createValue('demo_bootstrap_daterangepicker', 'bootstrap_daterangepicker', 'DateRangePicker', '', '', array(), 16);
        $this->_createValue('demo_bootstrap_colorpicker', 'bootstrap_colorpicker', 'ColorPicker', '', '', array(), 17);
        $this->_createValue('demo_bootstrap_slider', 'bootstrap_slider', 'Slider', '', '', array(), 18);
        $this->_createValue('demo_bootstrap_slider_deux', 'bootstrap_slider', 'Slider range', '', '', array('range'=>true), 18);
        $this->_createValue('demo_choice', 'choice', 'Choice', '', '', array('choices'=>array('fr'=>'France', 'uk'=>'United Kingdom', 'us'=>'United States')), 3);
        $this->_createValue('demo_bootstrap_chosen', 'bootstrap_chosen', 'Chosen', '', '', array('choices'=>array('fr'=>'France', 'uk'=>'United Kingdom', 'us'=>'United States')), 3);
        $this->_createValue('demo_knob', 'knob', 'Knob', '', '', array(), 19);

    }
131423
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $configurationPath = $input->getOption('configurationPath');
        $deploymentNames = $this->factory->getDeploymentNames($configurationPath);

        $output->writeln(sprintf(PHP_EOL . '<u>Deployments in "%s":</u>' . PHP_EOL, $this->factory->getDeploymentsBasePath($configurationPath)));
        foreach ($deploymentNames as $deploymentName) {
            $line = sprintf('  <info>%s</info>', $deploymentName);
            $output->writeln($line);
        }
        $output->writeln('');
    }
972897
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        parent::initialize($input, $output);
        $this->permissionResolver->setCurrentUserReference(
            $this->userService->loadUserByLogin($input->getOption('user'))
        );
    }
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>"
        );
    }