Save config section
Require set: section, website, store and groups

@throws \Exception
@return $this
500433
public function save()
    {
        $this->initScope();

        $sectionId = $this->getSection();
        $groups = $this->getGroups();
        if (empty($groups)) {
            return $this;
        }

        $oldConfig = $this->_getConfig(true);

        $deleteTransaction = $this->_transactionFactory->create();
        $saveTransaction = $this->_transactionFactory->create();

        $extraOldGroups = [];

        foreach ($groups as $groupId => $groupData) {
            $this->_processGroup(
                $groupId,
                $groupData,
                $groups,
                $sectionId,
                $extraOldGroups,
                $oldConfig,
                $saveTransaction,
                $deleteTransaction
            );
        }

        try {
            $deleteTransaction->delete();
            $saveTransaction->save();
            $this->_appConfig->reinit();
            $this->scopePool->clean();
            $this->_eventManager->dispatch(
                "smile_elasticsuite_relevance_config_changed_section_{$this->getSection()}",
                ['container' => $this->getContainer(), 'store' => $this->getStore()]
            );
        } catch (\Exception $e) {
            $this->_appConfig->reinit();
            throw $e;
        }

        return $this;
    }
103035
public function save()
    {
        if (true === $this->modified) {
            if (null !== $this->uid) {
                $this->update($this->parameters());
            } else {
                $this->insert($this->parameters());
            }
        }

        return $this;
    }
1239810
public function save()
    {
        // ordered articles
        if (($blSave = parent::save()) && $this->isNewOrderItem()) {
            $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
            if ($myConfig->getConfigParam('blUseStock') &&
                $myConfig->getConfigParam('blPsBasketReservationEnabled')
            ) {
                $this->getSession()
                    ->getBasketReservations()
                    ->commitArticleReservation(
                        $this->oxorderarticles__oxartid->value,
                        $this->oxorderarticles__oxamount->value
                    );
            } else {
                $this->updateArticleStock($this->oxorderarticles__oxamount->value * (-1), $myConfig->getConfigParam('blAllowNegativeStock'));
            }

            // seting downloadable products article files
            $this->_setOrderFiles();

            // marking object as "non new" disable further stock changes
            $this->setIsNewOrderItem(false);
        }

        return $blSave;
    }
59654
protected function loadConfiguration()
    {
        try {
            $configuration = $this->configurationStorage->loadFromFile()->get();
        } catch (NoConfigurationException $e) {

            $this->io->comment($e->getMessage());

            if (!$this->secret) {
                $this->secret = $this->io->ask('Secret');
            }
            $configuration = $this->parseConfigurationKey();
        }
        $this->serverUrl = $configuration['socket_url'];
        $this->secret = $configuration['secret'];
        $this->configurationStorage->merge($configuration)->save();
    }
1168058
public function save()
    {
        $dir = dirname($this->path);

        if (!is_dir($dir)) {
            $mask = @umask(0);
            $result = @mkdir($dir, $this->dirMode, true);
            @umask($mask);

            if (!$result) {
                throw new Exception("Unable to create the directory '$dir'.");
            }
        }

        if (@file_put_contents($this->path, $this->content) === false) {
            throw new Exception("Unable to write the file '{$this->path}'.");
        }

        $mask = @umask(0);
        @chmod($this->path, $this->mode);
        @umask($mask);

        return true;
    }
307481
public function add() {
        if ($this->request->is('post')) {
            $this->Config->create();
            if ($this->Config->save($this->request->data)) {
                $this->Flash->success(__('The config has been saved.'));
                return $this->redirect(array('action' => 'index'));
            } else {
                $this->Flash->error(__('The config could not be saved. Please, try again.'));
            }
        }
        $configCategoryes = $this->Config->ConfigCategory->find('list');
        $this->set(compact('configCategoryes'));
    }
636705
public function setDefaultsFromConfiguration()
    {
        $set = [
            "urlType",
            "siteUrl",
            "baseUrl",
            "staticSiteUrl",
            "staticBaseUrl",
            "scriptName",
        ];
        
        foreach ($set as $item) {
            if (!isset($this->config[$item])) {
                continue;
            }
            
            $this->$item = $this->config[$item];
        }

        return $this;
    }
200279
private function saveCache($section) {
    $content = serialize($this->cache[$section]);
    $file = $this->getCacheFile($section);
    $this->fileUtil->mkdirRec(dirname($file));
    $fh = fopen($file, "w");
    if ($fh !== false) {
      fwrite($fh, $content);
      fclose($fh);
    }
    else {
      throw new ConfigurationException("The cache path is not writable: ".$file);
    }
  }
571567
public function save()
    {
        $aModule = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aModules");

        $aModules = [];
        if ($tmp = json_decode($aModule, true)) {
            foreach ($tmp as $key => $value) {
                $sanitizedKey = str_replace(self::BACKSLASH_REPLACEMENT, "\\", $key);
                $aModules[$sanitizedKey] = $value;
            }
            $oModuleInstaller = oxNew(\OxidEsales\Eshop\Core\Module\ModuleInstaller::class);
            $aModules = $oModuleInstaller->buildModuleChains($aModules);
        }

        \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("aarr", "aModules", $aModules);
    }
1015747
public function Save () {
		$rawContent = $this->Dump();
		if ($rawContent === FALSE) 
			throw new \Exception('Configuration data was not possible to dump.');
		$app = self::$app ?: self::$app = & \MvcCore\Application::GetInstance();
		$toolClass = $app->GetToolClass();
		try {
			$toolClass::SingleProcessWrite(
				$this->fullPath, 
				$rawContent, 
				'w',	// Open for writing only; place pointer at the beginning and truncate to zero length. If file doesn't exist, create it.
				10,		// Milliseconds to wait before next lock file existence is checked in `while()` cycle.
				5000,	// Maximum milliseconds time to wait before thrown an exception about not possible write.
				30000	// Maximum milliseconds time to consider lock file as operative or as old after some died process.
			);
		} catch (\Exception $ex) {
			throw $ex;
		}
		return TRUE;
	}
178369
protected function setHttpOptions(): self
    {
        if ($this->config->has('http') && is_array($this->config->get('http'))) {
            $this->config->forget('http.base_uri');
            $this->httpOptions = $this->config->get('http');
        }

        return $this;
    }
67459
protected function saveConfigurationCache()
    {
        // Make sure that all configuration types are loaded before writing configuration caches.
        foreach (array_keys($this->configurationTypes) as $configurationType) {
            if (!isset($this->unprocessedConfiguration[$configurationType]) || !is_array($this->unprocessedConfiguration[$configurationType])) {
                $this->loadConfiguration($configurationType, $this->packages);
            }
        }

        if ($this->temporaryDirectoryPath === null) {
            return;
        }

        $cachePathAndFilename = $this->constructConfigurationCachePath();
        if (!file_exists(dirname($cachePathAndFilename))) {
            Files::createDirectoryRecursively(dirname($cachePathAndFilename));
        }

        file_put_contents($cachePathAndFilename, '<?php return ' . $this->replaceVariablesInPhpString(var_export($this->unprocessedConfiguration, true)) . ';');
        OpcodeCacheHelper::clearAllActive($cachePathAndFilename);
        $this->cacheNeedsUpdate = false;
    }
25246
public function save()
    {
        $filepath = $this->getFilepath();
        $this->validateConfig($this->rules, $this->configData);
        $fileSystem = $this->createNew(FileSystem::class);
        $fileSystem->filePutContents($filepath, json_encode($this->configData, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
    }
345617
def _save_config(section, token, value):
    '''
    
    '''
    cmd = NIRTCFG_PATH
    cmd += ' --set section={0},token=\'{1}\',value=\'{2}\''.format(section, token, value)
    if __salt__['cmd.run_all'](cmd)['retcode'] != 0:
        exc_msg = 'Error: could not set {} to {} for {}\n'.format(token, value, section)
        raise salt.exceptions.CommandExecutionError(exc_msg)
329176
protected function save( $contents ) {
		if ( ! trim( $contents ) ) {
			throw new Exception( 'Cannot save the config file with empty contents.' );
		}

		if ( $contents === $this->wp_config_src ) {
			return false;
		}

		$result = file_put_contents( $this->wp_config_path, $contents, LOCK_EX );

		if ( false === $result ) {
			throw new Exception( 'Failed to update the config file.' );
		}

		return true;
	}
971372
public function save(){
        $this->_contentArray =  array_merge($this->_codesBeforeEditArea, $this->_editArea, $this->_codesAfterEditArea);
        return $this;
    }
607555
public function save()
    {
        // save article changes
        $aArticleChanges = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editval');
        $oArticle = $this->getArticle();
        $oArticle->assign($aArticleChanges);
        $oArticle->save();

        //update article files
        $aArticleFiles = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('article_files');
        if (is_array($aArticleFiles)) {
            foreach ($aArticleFiles as $sArticleFileId => $aArticleFileUpdate) {
                $oArticleFile = oxNew(\OxidEsales\Eshop\Application\Model\File::class);
                $oArticleFile->load($sArticleFileId);
                $aArticleFileUpdate = $this->_processOptions($aArticleFileUpdate);
                $oArticleFile->assign($aArticleFileUpdate);

                if ($oArticleFile->isUnderDownloadFolder()) {
                    $oArticleFile->save();
                } else {
                    \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay('EXCEPTION_NOFILE');
                }
            }
        }
    }