Saves shop configuration variables
486914
public function saveConfVars()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        $this->resetContentCache();

        $sShopId = $this->getEditObjectId();
        $sModule = $this->_getModuleForConfigVars();

        $configValidator = oxNew(\OxidEsales\Eshop\Core\NoJsValidator::class);
        foreach ($this->_aConfParams as $sType => $sParam) {
            $aConfVars = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sParam, true);
            if (is_array($aConfVars)) {
                foreach ($aConfVars as $sName => $sValue) {
                    $oldValue = $myConfig->getConfigParam($sName);
                    if ($sValue !== $oldValue) {
                        $sValueToValidate = is_array($sValue) ? join(', ', $sValue) : $sValue;
                        if (!$configValidator->isValid($sValueToValidate)) {
                            $error = oxNew(\OxidEsales\Eshop\Core\DisplayError::class);
                            $error->setFormatParameters(htmlspecialchars($sValueToValidate));
                            $error->setMessage("SHOP_CONFIG_ERROR_INVALID_VALUE");
                            \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($error);
                            continue;
                        }
                        $myConfig->saveShopConfVar(
                            $sType,
                            $sName,
                            $this->_serializeConfVar($sType, $sName, $sValue),
                            $sShopId,
                            $sModule
                        );
                    }
                }
            }
        }
    }
1180941
function config(options) {
    var current = config.current
    Object.assign(current, options)
    api._init(current)
}
73464
private function saveConfiguration()
    {
        $this->info("Writing configuration file...");

        // Save in .env file
        $this->env->setEnv(
            [
            'APP_URL' => $this->APP_URL,
            'DB_CONNECTION' => $this->DB_TYPE,
            'DB_HOST' => $this->DB_HOST,
            'DB_PORT' => $this->DB_PORT,
            'DB_DATABASE' => $this->DB_DATABASE,
            'DB_USERNAME' => $this->DB_USERNAME,
            'DB_PASSWORD' => $this->DB_PASSWORD,
            ]
        );

        // save in runtime

        config(['app.url' => $this->APP_URL]);
        config(['app.name' => str_replace(' ', '_', $this->APP_NAME)]);
        config(['database.connections.mysql.driver' => $this->DB_TYPE]);
        config(['database.connections.mysql.host' => $this->DB_HOST]);
        config(['database.connections.mysql.port' => $this->DB_PORT]);
        config(['database.connections.mysql.database' => $this->DB_DATABASE]);
        config(['database.connections.mysql.username' => $this->DB_USERNAME]);
        config(['database.connections.mysql.password' => $this->DB_PASSWORD]);

        // save in app.config
        $content = File::get(config_path('app.php'));
        $newContent = str_replace(
            "'name' => '".config('app.name')."'",
            "'name' => '".$this->APP_NAME."'",
            $content
        );

        FILe::put(config_path('app.php'), $newContent);

        $this->advanceBar();

        $this->clearCaches();

        return $this;
    }
360474
def save(self):
        """"""
        for server, conf in self.servers.iteritems():
            self._add_index_server()
            for conf_k, conf_v in conf.iteritems():
                if not self.conf.has_section(server):
                    self.conf.add_section(server)
                self.conf.set(server, conf_k, conf_v)

        with open(self.rc_file, 'wb') as configfile:
            self.conf.write(configfile)
        self.conf.read(self.rc_file)
880748
public function saveConfVars()
    {
        $sModuleId = $this->getEditObjectId();

        if ($sModuleId === 'bestitamazonpay4oxid') {
            $sQuickConfig = $this->_getContainer()->getConfig()->getRequestParameter('bestitAmazonPay4OxidQuickConfig');

            try {
                $aQuickConfig = json_decode($sQuickConfig, true);

                $aMap = array(
                    'merchant_id' => array('confstrs', 'sAmazonSellerId'),
                    'access_key' => array('confstrs', 'sAmazonAWSAccessKeyId'),
                    'secret_key' => array('confpassword', 'sAmazonSignature'),
                    'client_id' => array('confstrs', 'sAmazonLoginClientId')
                );

                foreach ($aMap as $sAmazonKey => $aConfigKeys) {
                    if (isset($aQuickConfig[$sAmazonKey]) === true) {
                        list($sMainKey, $sSubKey) = $aConfigKeys;
                        $_POST[$sMainKey][$sSubKey] = $aQuickConfig[$sAmazonKey];
                    }
                }
            } catch (\Exception $oException) {
                //Do nothing
            }
        }

        $this->_parentSaveConfVars();
    }
705953
def save_config(config):
    

    configfile = get_configfile()

    if not os.path.exists(configfile):
        configdir = os.path.dirname(configfile)

        if not os.path.exists(configdir):
            os.makedirs(configdir)

    data = config

    with open(configfile, 'wb') as f:
        json.dump(data, f, indent=2)
544612
def save_config(
        self, cmd="configuration write", confirm=False, confirm_response=""
    ):
        """"""
        output = self.enable()
        output += self.config_mode()
        output += self.send_command(cmd)
        output += self.exit_config_mode()
        return output
1202651
def __prepare_config(config, project_mapping, session_variables_set=None):
    
    # get config variables
    raw_config_variables = config.pop("variables", {})
    raw_config_variables_mapping = utils.ensure_mapping_format(raw_config_variables)
    override_variables = utils.deepcopy_dict(project_mapping.get("variables", {}))
    functions = project_mapping.get("functions", {})

    # override config variables with passed in variables
    raw_config_variables_mapping.update(override_variables)

    if raw_config_variables_mapping:
        config["variables"] = raw_config_variables_mapping

    check_variables_set = set(raw_config_variables_mapping.keys())
    check_variables_set |= (session_variables_set or set())
    prepared_config = prepare_lazy_data(config, functions, check_variables_set, cached=True)
    return prepared_config
986342
def save_settings(self, filename):
        '''
        '''

        data = dict()
        data['valueRanges'] = self._value_ranges
        data['best_values'] = [str(value) for value in self._best_values]
        data['minimize'] = self._minimize
        data['num_employers'] = self._num_employers
        data['best_score'] = str(self._best_score)
        data['limit'] = self._limit
        data['best_error'] = self._best_error
        with open(filename, 'w') as outfile:
            json.dump(data, outfile, indent=4, sort_keys=True)
5992
public function saveConfigAction() {
        $cfgr = Mage::getModel('turpentine/varnish_admin')->getConfigurator();
        if (is_null($cfgr)) {
            $this->_getSession()->addError(
                $this->__('Failed to load configurator') );
        } else {
            Mage::dispatchEvent('turpentine_varnish_save_config',
                array('cfgr' => $cfgr));
            $result = $cfgr->save($cfgr->generate(
                Mage::helper('turpentine')->shouldStripVclWhitespace('save') ));
            if ($result[0]) {
                $this->_getSession()
                    ->addSuccess(Mage::helper('turpentine')
                        ->__('The VCL file has been saved.'));
            } else {
                $this->_getSession()
                    ->addError(Mage::helper('turpentine')
                        ->__('Failed to save the VCL file: '.$result[1]['message']));
            }
        }
        $this->_redirect('*/cache');
    }
1314081
def save_configs(self):
        

        if self.startup_config_content or self.private_config_content:
            startup_config_content, private_config_content = self.extract_configs()
            if startup_config_content:
                config_path = os.path.join(self.working_dir, "startup-config.cfg")
                try:
                    config = startup_config_content.decode("utf-8", errors="replace")
                    with open(config_path, "wb") as f:
                        log.info("saving startup-config to {}".format(config_path))
                        f.write(config.encode("utf-8"))
                except (binascii.Error, OSError) as e:
                    raise IOUError("Could not save the startup configuration {}: {}".format(config_path, e))

            if private_config_content and private_config_content != b'\nend\n':
                config_path = os.path.join(self.working_dir, "private-config.cfg")
                try:
                    config = private_config_content.decode("utf-8", errors="replace")
                    with open(config_path, "wb") as f:
                        log.info("saving private-config to {}".format(config_path))
                        f.write(config.encode("utf-8"))
                except (binascii.Error, OSError) as e:
                    raise IOUError("Could not save the private configuration {}: {}".format(config_path, e))
1252907
def save(self):
        """"""
        try:
            os.makedirs(os.path.dirname(self._configfile))
        except:
            pass

        with open(self._configfile, 'w') as f:
            self._config.write(f)
431177
def set_config(self, key, value):
        

        keyname = "config:" + key

        self.kvstore.set(keyname, value)
424359
def save_config(self):
        
        if not os.path.exists(self._conf_dir):
            os.makedirs(self._conf_dir)
        conf_file = os.path.join(self._conf_dir, "dql.json")
        with open(conf_file, "w") as ofile:
            json.dump(self.conf, ofile, indent=2)
912931
def save_config(self):
        """"""
        for option, value in list(self.explorer.get_options().items()):
            self.set_option(option, value)
        self.set_option('expanded_state',
                        self.explorer.treewidget.get_expanded_state())
        self.set_option('scrollbar_position',
                        self.explorer.treewidget.get_scrollbar_position())
439669
def save_configuration(self):
        
        self.check_credentials()
        # get distutils to do the work
        c = self._get_pypirc_command()
        c._store_pypirc(self.username, self.password)
1308057
function (pkg, options) {
    var settingsFile = new SettingsFile(pkg, options);

    var save = settingsFile.save;

    settingsFile.save = _.bind(function (config) {
      return save.call(settingsFile, config)
        .then(function () {
          client.emit('config.global-changed', {
            app: pkg,
            config: config
          });
        });
    }, settingsFile);

    var settingsSet = settingsFile.set;

    settingsFile.set = _.bind(function (config) {
      return settingsSet.call(settingsFile, config)
        .then(function () {
          client.emit('config.global-changed', {
            app: pkg,
            config: config
          });
        });
    }, settingsFile);

    /**
     * Register for global settings changes
     *
     * @param {function} cb Event callback
     */
    settingsFile.onChange = function (cb) {
      client.on('settings.global-changed:' + pkg, cb);
    };

    var instance = settingsFile.instance;

    settingsFile.instance = _.bind(function (id) {
      var returnedInstance = instance.call(settingsFile, id);

      var save = returnedInstance.save;

      returnedInstance.save = _.bind(function (config) {
        return save.call(returnedInstance, config)
          .then(function () {
            client.emit('settings.instance-changed:' + returnedInstance._id, {
              instance: returnedInstance._id,
              config: config
            });
          });
      }, returnedInstance);

      var instanceSet = returnedInstance.set;

      returnedInstance.set = _.bind(function (config) {
        return instanceSet.call(returnedInstance, config)
          .then(function () {
            client.emit('settings.instance-changed:' + returnedInstance._id, {
              instance: returnedInstance._id,
              config: config
            });
          });
      }, returnedInstance);

      /**
       * Register for instance settings changes
       *
       * @param {function} cb Event callback
       */
      returnedInstance.onChange = function (cb) {
        client.on('settings.instance-changed:' + returnedInstance._id, cb);
      };

      return returnedInstance;
    }, settingsFile);

    return settingsFile;
  }