|
Moodle
2.2.1
http://www.collinsharper.com
|


Protected Member Functions | |
| open_xml_writer ($filename) | |
| close_xml_writer () | |
| has_xml_writer () | |
| write_xml ($element, array $data, array $attribs=array(), $parent= '/') | |
| make_sure_xml_exists ($filename, $rootelement=false, $content=array()) | |
Protected Attributes | |
| $xmlfilename | |
| $xmlwriter | |
Base backup conversion handler that generates an XML file
Definition at line 146 of file handlerlib.php.
| close_xml_writer | ( | ) | [protected] |
Close the XML writer
At the moment, the caller must close all tags before calling
Reimplemented in moodle1_qtype_handler.
Definition at line 186 of file handlerlib.php.

| has_xml_writer | ( | ) | [protected] |
Checks if the XML writer has been opened by self::open_xml_writer()
Definition at line 200 of file handlerlib.php.

| make_sure_xml_exists | ( | $ | filename, |
| $ | rootelement = false, |
||
| $ | content = array() |
||
| ) | [protected] |
Makes sure that a new XML file exists, or creates it itself
This is here so we can check that all XML files that the restore process relies on have been created by an executed handler. If the file is not found, this method can create it using the given $rootelement as an empty root container in the file.
| string | $filename | relative file name like 'course/course.xml' |
| string | bool | $rootelement | root element to use, false to not create the file |
| array | $content | content of the root element |
Definition at line 274 of file handlerlib.php.


| open_xml_writer | ( | $ | filename | ) | [protected] |
Opens the XML writer - after calling, one is free to use $xmlwriter
| string | $filename | XML file name to write into |
Definition at line 160 of file handlerlib.php.


Writes the given XML tree data into the currently opened file
| string | $element | the name of the root element of the tree |
| array | $data | the associative array of data to write |
| array | $attribs | list of additional fields written as attributes instead of nested elements |
| string | $parent | used internally during the recursion, do not set yourself |
Definition at line 217 of file handlerlib.php.

$xmlfilename [protected] |
Definition at line 149 of file handlerlib.php.
$xmlwriter [protected] |
Definition at line 152 of file handlerlib.php.