N98\Magento\Command\Config\SetCommand::execute PHP 메소드

execute() 보호된 메소드

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | void
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
리턴 integer | void
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->detectMagento($output, true);
        if (!$this->initMagento()) {
            return;
        }
        $config = $this->_getConfigModel();
        if (!$config->getResourceModel()) {
            // without a resource model, a config option can't be saved.
            return;
        }
        $allowZeroScope = $input->getOption('force');
        $scope = $input->getOption('scope');
        $this->_validateScopeParam($scope);
        $scopeId = $this->_convertScopeIdParam($scope, $input->getOption('scope-id'), $allowZeroScope);
        $value = str_replace(array('\\n', '\\r'), array("\n", "\r"), $input->getArgument('value'));
        $value = $this->_formatValue($value, $input->getOption('encrypt') ? 'encrypt' : false);
        $config->saveConfig($input->getArgument('path'), $value, $scope, $scopeId);
        $output->writeln('<comment>' . $input->getArgument('path') . "</comment> => <comment>" . $input->getArgument('value') . '</comment>');
    }