Source for file Writer.class.php
Documentation is available at Writer.class.php
* Gumbo Library Framework
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* Config Writer Interface
* A Config Writer will take a Composite object and write the details into
* a file. The Writer will define the particular formatting of the file.
* A Config Writer performs the opposite operation of a Config Reader. It will
* accept a Composite object, a file to write to, and whether the original file
* should be replaced (if found). The rules are the same as the Config Reader, where
* the type of file being written is determined by the class name.
* In order to apply a Config Writer to Library, simply create a new class inside
* the '/gumbo/config/writer/*' directory. The class name should be defined as
* 'Gumbo_Config_Writer_[type]' where 'type' is the type of configuration file
* it will be responsible for writing. For example, supplied with the Library
* is a Gumbo_Config_Writer_Ini class. This class will write INI files.
* The data must be in the form of a Composite. Refer to the Composite Package
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* @desc Config Writer Interface
gumbo_load ("Interface_Composite");
* Writes the supplied values into the configuration file
* @param Gumbo_Interface_Composite $tree data to write
* @param string $file file to write (full path)
* @param bool $replace if replaces file (if found)
* @return bool if successful
public function write (Gumbo_Interface_Composite $tree, $file, $replace=
true);