Gumbo_Interface_Config_Writer
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 for more details.
Author(s): |
Michael Luster <mluster79@yahoo.com> |
License: | New BSD License |
Copyright: | Copyright (c) 2007, iBayou, Michael Luster |
Link: | http://sourceforge.net/projects/phpgumbo |
Version: | 0.0.1 |
Interface Methods
Writes the supplied values into the configuration file
Parameter(s):
- (Gumbo_Interface_Composite) $tree :: data to write
- (string) $file :: file to write (full path)
- (bool) $replace :: if replaces file (if found)
- return:
if successful
[ Top ]