Config_Lite::write PHP Method

write() public method

writes the global options and sections with normalized Values, that means "bool" values to human readable representation, doublequotes strings and numeric values without any quotes. prepends a php exit if suffix is php, it is valid to write an empty Config file, this method is used by save and is public for explicit usage, eg. if you do not want to hold the whole configuration in the object.
public write ( string $filename, array $sectionsarray, integer $flags = null ) : boolean
$filename string filename
$sectionsarray array array with sections
$flags integer for file-put-contents
return boolean
    public function write($filename, $sectionsarray, $flags = null)
    {
        $content = $this->buildOutputString($sectionsarray);
        if (false === file_put_contents($filename, $content, $flags)) {
            throw new Config_Lite_Exception_Runtime(sprintf('failed to write file `%s\' for writing.', $filename));
        }
        return true;
    }