11 use Symfony\Component\Console\Input\InputInterface;
12 use Symfony\Component\Console\Output\OutputInterface;
29 private $commentParser;
36 private $configFilePool;
43 private $configWriter;
50 private $scopeValidator;
57 private $collectorFactory;
73 $this->commentParser = $commentParser;
74 $this->configFilePool = $configFilePool;
76 $this->scopeValidator = $scopeValidator;
77 $this->collectorFactory = $collectorFactory;
95 $this->scopeValidator->isValid($scope, $scopeCode);
96 $configPaths = $this->getConfigPaths();
97 $collector = $this->collectorFactory->create(
102 $this->configWriter->save(
$values, $scope, $scopeCode);
105 '<info>Configuration value%s saved in app/etc/%s</info>',
106 $isInteractive ?
's' :
'',
117 private function getConfigPaths()
121 $configPaths = $this->commentParser->execute($configFilePath);
124 'File app/etc/%1 can\'t be read. Please check if it exists and has read permissions.',
131 if (empty($configPaths)) {
132 throw new RuntimeException(
__(
'There are no sensitive configurations to fill'));
__construct(ConfigFilePool $configFilePool, CommentParserInterface $commentParser, ConfigWriter $configWriter, ValidatorInterface $scopeValidator, CollectorFactory $collectorFactory)
const INPUT_OPTION_INTERACTIVE
const INPUT_OPTION_SCOPE_CODE
process(InputInterface $input, OutputInterface $output)