LnBlogXMLConfig
LnBlogObject
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.

XMLINI
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.

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(
$filefalse
)

Write the XML file back to the disk.

Parameters
file

The filename to write to.  Defaults to the filename property.

Returns

True if the write succeeds, false otherwise.

value
function value(
$sec,
$varfalse,
$defaultfalse
)

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

Parameters
sec

The section of of the target key.

var

The target key within that section.

default

The 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
sec

The section of of the target key.

var

The target key within that section.

Returns

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

setValue
function setValue (
$sec,
$var,
$valtrue
)

Sets a value for a key.

Parameters
sec

The section of of the target key.

var

The target key within that section.

val

The 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
sec

The 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
file

The XMLINI object to merge with the current object.