Writes the changes to the configuration file.
768541
def dump(self):
        """"""
        try:
            import yaml
            cfg_file = self._cfg_file()
            cfg_dir, __ = os.path.split(cfg_file)
            os.makedirs(cfg_dir, exist_ok=True)
            with open(cfg_file, 'w') as f:
                yaml.dump(self, f)
        except ImportError as err:
            raise RuntimeError(
                'Cannot dump the configuration settings to file. You need to '
                'install the necessary dependencies (pyyaml, appdirs).'
            ) from err
821493
def _write_conf_file():
    
    with open(CONF_FILE, "w") as f:
        f.write(DEFAULT_PROFTPD_CONF)
        logger.debug("'%s' created.", CONF_FILE)
603697
def write(self):
        """"""
        with open(self.path, 'w') as f:
            self.config.write(f)
721080
public function onAfterWrite()
    {
        $changed = $this->owner->getChangedFields(true, 2);

        if (!$this->owner instanceof Folder && !$this->owner->CurrentVersionID) {
            $this->createVersion();
        }

        if (array_key_exists('Filename', $changed)) {
            if ($changed['Filename']['before'] == null) {
                return;
            }

            $oldDirname = '/' . trim(dirname($changed['Filename']['before']), '/');
            $newDirname = '/' . trim(dirname($changed['Filename']['after']), '/');

            if ($oldDirname == $newDirname) {
                return;
            }

            // First move the _versions directory across.
            $versionsDir = FileVersion::VERSION_FOLDER . '/' . $this->owner->ID;
            $oldVersions = BASE_PATH . $oldDirname . '/' . $versionsDir;
            $newVersions = BASE_PATH . $newDirname . '/' . $versionsDir;

            if (is_dir($oldVersions)) {
                if (!is_dir($newVersions)) {
                    mkdir($newVersions, Config::inst()->get('Filesystem', 'folder_create_mask'), true);
                }

                if (!is_dir($newVersions)) {
                    rename($oldVersions, $newVersions);
                }
            }

            // Then update individual version records to point to the new
            // location.
            foreach ($this->owner->Versions() as $version) {
                if (strpos($version->Filename, $oldDirname) === 0) {
                    $version->Filename = $newDirname . substr($version->Filename, strlen($oldDirname));
                    $version->write();
                }
            }
        }
    }
1247715
public function writeConfiguration()
    {
        $configFile= APP_PATH.'config/database.php';
        $config    = $this->getPostConfiguration();

        $configStr = <<<CONFIG
<?php

\$config['database'] = array(
    'default'       => '{$config['driver']}',

    'connections'   => array(
        '{$config['driver']}'     => array(
            'driver'    => '{$config['driver']}',
            'host'      => isset(\$_SERVER['DB1_HOST']) ? \$_SERVER['DB1_HOST'] : '{$config['host']}',
            'database'  => isset(\$_SERVER['DB1_NAME']) ? \$_SERVER['DB1_NAME'] : '{$config['database']}',
            'username'  => isset(\$_SERVER['DB1_USER']) ? \$_SERVER['DB1_USER'] : '{$config['username']}',
            'password'  => isset(\$_SERVER['DB1_PASS']) ? \$_SERVER['DB1_PASS'] : '{$config['password']}',
            'charset'   => '{$config['charset']}',
            'collation' => '{$config['collation']}',
            'prefix'    => '{$config['prefix']}'
        )
    )
);
CONFIG;

        file_put_contents($configFile, $configStr);

        $this->makeConnection($config);
        $this->migrate();
        $this->seed();

        Response::redirect($this->data['baseUrl'].'install.php/finish');
    }
381654
def save_config(self, config_path=None):
        """"""
        if config_path is None:
            config_path = self.config_path
        else:
            self.config_path = config_path

        with open(config_path, 'w') as f:
            self.config.write(f)
1055959
protected void writeHeader()
		throws ConfigurationException, IOException
	{

		if (writer != null) {
			writer.close();
		}

		this.fileCounter++;
		String filePath = PATH_OUTPUT_SQL_FILES + this.outputName + "_"
				+ fileCounter + ".sql";

		SQLConsumerLogMessages.logFileCreation(logger, filePath);

		this.sqlFile = new File(filePath);

		this.writer = new BufferedWriter(new OutputStreamWriter(new BufferedOutputStream(
		        new FileOutputStream(filePath)), WIKIPEDIA_ENCODING));

;



		String[] revTable = this.sqlEncoder.getTable();

		for (String sTable : revTable) {
			this.writer.write(sTable + "\r\n");
		}

		this.writer.flush();
	}
256728
def write_new_config(self, updates):
        
        with open(self._new_config, 'w') as config_file:
            for update in updates:
                line = '{0}=={1}  # The installed version is: {2}\n'.format(
                    update.name,
                    update.new_version,
                    update.current_version
                )

                config_file.write(line)
1058382
def save(self):
        
        with open(self._filename, "w") as f:
            self.config.write(f)
87418
public static void writeConfigFile(String fileName, Class<?>[] classes) throws SQLException, IOException {
		writeConfigFile(fileName, classes, false);
	}
253658
public function commit()
    {
    	// Write the changes
        if (is_writable($this->file)) {
            $config = var_export($this->cfg, true);
            file_put_contents($this->file, "<?php return $config ;");

            return true;
        }
        throw new ConfigException("Could not write config file. $file is not writable", 1);
    }
185406
def save(self, filename=None, debug=False):
        """"""
        if not filename: filename = self.name
        with open(filename, "w") as f: # save config data file
            f.write(self.toJson(self.attrs))
        if self.debug or debug:
            print("saved configuration %s"%(self.name))
            for k,v in sorted(iteritems(self.attrs)):
                print("%15s : %s"%(k,v))
1001374
def _write_config(config, cfg_file):
    
    directory = os.path.dirname(cfg_file)
    if not os.path.exists(directory):
        os.makedirs(directory)
    with open(cfg_file, "w+") as output_file:
        config.write(output_file)
442804
def save(self):
        
        with open(self.config_file, "w") as f:
            f.write(dump(self.config, default_flow_style=False))
176423
public static void writeConfigFile(OutputStream outputStream, File searchDir) throws SQLException, IOException {
		writeConfigFile(outputStream, searchDir, false);
	}
1121897
def write(self):
        """"""
        if self.dirty:
            with open(self._cache_path, "w") as output_file:
                self._config.write(output_file)
1361259
def write(self, file_handle):
        
        for k, v in self.inputs.write_values().items():
            self.set('config', k, v)
        self.set('config', 'namespace', self.namespace)
        self.manifest.write(file_handle)