LnBlogXMLConfig

A dummy class for use with the SimpleXMLWriter class.  This is used simply to create blank objects that XML elements can be inserted into.

Summary
LnBlogXMLConfigA dummy class for use with the SimpleXMLWriter class.
XMLINIAn simple XML configuration file scheme that mimics the behavior of the INIParser class.
Functions
readFileRead the contents of an XML file into a class.
getFileSerializes the XML file into a string.
writeFileWrite the XML file back to the disk.
valueGet a value from the XML file.
valueIsSetDetermine if a particular key has been set.
setValueSets a value for a key.
getSectionReturns the given section as an array.
getSectionNamesGets a list of the section names available in the file.
mergeMerge another XML file into the current one.

XMLINI

An simple XML configuration file scheme that mimics the behavior of the INIParser class.  The main difference is, obviously, the storage format.  This class uses XML instead of an INI file, thus removing the single-line data value limit, among other things.

Summary
Functions
readFileRead the contents of an XML file into a class.
getFileSerializes the XML file into a string.
writeFileWrite the XML file back to the disk.
valueGet a value from the XML file.
valueIsSetDetermine if a particular key has been set.
setValueSets a value for a key.
getSectionReturns the given section as an array.
getSectionNamesGets a list of the section names available in the file.
mergeMerge another XML file into the current one.

Functions

readFile

function readFile()

Read the contents of an XML file into a class.  There is an array data member for each tag, with the children as the array elements.  Basically, it mirrors the section/key/value structure of an INI file.

getFile

function getFile()

Serializes the XML file into a string.

Returns

The configuration data as an XML string.

writeFile

function writeFile($file = false)

Write the XML file back to the disk.

Parameters

fileThe filename to write to.  Defaults to the filename property.

Returns

True if the write succeeds, false otherwise.

value

function value($sec,  
$var = false,
$default = false)

Get a value from the XML file.  The values are organized by section and key, just as in an INI file.

Parameters

secThe section of of the target key.
varThe target key within that section.
defaultThe optional default value if the target does not exist.

Returns

A string containing the value of the given key, or the default value.

valueIsSet

function valueIsSet($sec,
$var)

Determine if a particular key has been set.

Parameters

secThe section of of the target key.
varThe target key within that section.

Returns

True if the given key has been set, false otherwise.

setValue

function setValue ($sec,  
$var,  
$val = true)

Sets a value for a key.

Parameters

secThe section of of the target key.
varThe target key within that section.
valThe optional value.  If omitted, the key is set to boolean true;

Returns

The value to which the key was set.

getSection

function getSection($sec)

Returns the given section as an array.

Parameters

secThe section of the file to get.

Returns

An array of the section with variables as keys and values as elements.

getSectionNames

function getSectionNames()

Gets a list of the section names available in the file.

Returns

An array of strings, each of which is the name of a section.

merge

function merge($file)

Merge another XML file into the current one.  If a key from the other file is not set, it will be set with the value from the other file.  Keys that are already set will not be modified.

Parameters

fileThe XMLINI object to merge with the current object.
A class for converting objects into XML.
function readFile()
Read the contents of an XML file into a class.
function getFile()
Serializes the XML file into a string.
function writeFile($file = false)
Write the XML file back to the disk.
function value($sec,  
$var = false,
$default = false)
Get a value from the XML file.
function valueIsSet($sec,
$var)
Determine if a particular key has been set.
function setValue ($sec,  
$var,  
$val = true)
Sets a value for a key.
function getSection($sec)
Returns the given section as an array.
function getSectionNames()
Gets a list of the section names available in the file.
function merge($file)
Merge another XML file into the current one.
Close