Helper for working with XML files/data.

 Methods

createDomCdataSection()

createDomCdataSection(\DOMDocument $document, $text) 
Static

Parameters

$document

$text

Creates a DOM element.

createDomElement(\DOMDocument $document, string $tagName, string | \DOMNode | false $value) : \DOMElement
Static

This automatically escapes the value (unlike createElement).

Parameters

$document

\DOMDocument

$tagName

string

$value

string\DOMNodefalse

If not false, the value for child nodes

Returns

createDomElements()

createDomElements(\DOMElement $rootNode, array $pairs) 
Static

Parameters

$rootNode

$pairs

Workaround for PHP bug 50670, where SimpleXML iteration fails on large data sets when complex work is done on each iteration.

fixPhpBug50670(array | object $input) : array
Static

See http://bugs.php.net/bug.php?id=50670

Parameters

$input

arrayobject

Returns

array

processSimpleXmlCdata()

processSimpleXmlCdata($cdata) 
Static

Parameters

$cdata

Reads all of the meta-data out of the specified file.

readMetaDataFile(string $metaDataFile) : array
Static

Parameters

$metaDataFile

string

Path to meta data file

Returns

arrayFormat: [title] => meta-data

Makes changes to a meta-data file and writes it out.

writeMetaDataOutput(string $metaDataFile, string $title, array | false $metaData, array $metaDataKeys) 
Static

Parameters

$metaDataFile

string

Path to meta-data file

$title

string

The title of the key being modified

$metaData

arrayfalse

If array, inserts/updates the key; if false, deletes the key

$metaDataKeys

arraynull

If updating and this is specified, names the keys that will be written; if null, all keys written