//This function read the xml file and store it data from the info zone in an object
function restore_read_xml_info ($xml_file) {
- //We call the main read_xml function, with todo = INFO
+ //We call the main read_xml function, with $todo = INFO
$info = restore_read_xml ($xml_file,"INFO",false);
return $info;
//This function read the xml file and store it data from the course header zone in an object
function restore_read_xml_course_header ($xml_file) {
- //We call the main read_xml function, with todo = COURSE_HEADER
+ //We call the main read_xml function, with $todo = COURSE_HEADER
$info = restore_read_xml ($xml_file,"COURSE_HEADER",false);
return $info;
//This function read the xml file and store its data from the blocks in a object
function restore_read_xml_blocks ($restore, $xml_file) {
- //We call the main read_xml function, with todo = BLOCKS
+ //We call the main read_xml function, with $todo = BLOCKS
$info = restore_read_xml ($xml_file,'BLOCKS',$restore);
return $info;
//This function read the xml file and store its data from the sections in a object
function restore_read_xml_sections ($xml_file) {
- //We call the main read_xml function, with todo = SECTIONS
+ //We call the main read_xml function, with $todo = SECTIONS
$info = restore_read_xml ($xml_file,"SECTIONS",false);
return $info;
//This function read the xml file and store its data from the course format in an object
function restore_read_xml_formatdata ($xml_file) {
- //We call the main read_xml function, with todo = FORMATDATA
+ //We call the main read_xml function, with $todo = FORMATDATA
$info = restore_read_xml ($xml_file,'FORMATDATA',false);
return $info;
//This function read the xml file and store its data from the metacourse in a object
function restore_read_xml_metacourse ($xml_file) {
- //We call the main read_xml function, with todo = METACOURSE
+ //We call the main read_xml function, with $todo = METACOURSE
$info = restore_read_xml ($xml_file,"METACOURSE",false);
return $info;
//This function read the xml file and store its data from the gradebook in a object
function restore_read_xml_gradebook ($restore, $xml_file) {
- //We call the main read_xml function, with todo = GRADEBOOK
+ //We call the main read_xml function, with $todo = GRADEBOOK
$info = restore_read_xml ($xml_file,"GRADEBOOK",$restore);
return $info;
//backup_ids->info db (and user's id in $info)
function restore_read_xml_users ($restore,$xml_file) {
- //We call the main read_xml function, with todo = USERS
+ //We call the main read_xml function, with $todo = USERS
$info = restore_read_xml ($xml_file,"USERS",$restore);
return $info;
//backup_ids->message backup_ids->message_read and backup_ids->contact and db (and their counters in info)
function restore_read_xml_messages ($restore,$xml_file) {
- //We call the main read_xml function, with todo = MESSAGES
+ //We call the main read_xml function, with $todo = MESSAGES
$info = restore_read_xml ($xml_file,"MESSAGES",$restore);
return $info;
//backup_ids->blog and backup_ids->blog_tag and db (and their counters in info)
function restore_read_xml_blogs ($restore,$xml_file) {
- //We call the main read_xml function, with todo = BLOGS
+ //We call the main read_xml function, with $todo = BLOGS
$info = restore_read_xml ($xml_file,"BLOGS",$restore);
return $info;
//backup_ids->info db (and category's id in $info)
function restore_read_xml_questions ($restore,$xml_file) {
- //We call the main read_xml function, with todo = QUESTIONS
+ //We call the main read_xml function, with $todo = QUESTIONS
$info = restore_read_xml ($xml_file,"QUESTIONS",$restore);
return $info;
//backup_ids->info db (and scale's id in $info)
function restore_read_xml_scales ($restore,$xml_file) {
- //We call the main read_xml function, with todo = SCALES
+ //We call the main read_xml function, with $todo = SCALES
$info = restore_read_xml ($xml_file,"SCALES",$restore);
return $info;
//backup_ids->info db (and group's id in $info)
function restore_read_xml_groups ($restore,$xml_file) {
- //We call the main read_xml function, with todo = GROUPS
+ //We call the main read_xml function, with $todo = GROUPS
$info = restore_read_xml ($xml_file,"GROUPS",$restore);
return $info;
//backup_ids->info db (and grouping's id in $info)
function restore_read_xml_groupings ($restore,$xml_file) {
- //We call the main read_xml function, with todo = GROUPINGS
+ //We call the main read_xml function, with $todo = GROUPINGS
$info = restore_read_xml ($xml_file,"GROUPINGS",$restore);
return $info;
//backup_ids->info db (and grouping's id in $info)
function restore_read_xml_groupings_groups ($restore,$xml_file) {
- //We call the main read_xml function, with todo = GROUPINGS
+ //We call the main read_xml function, with $todo = GROUPINGS
$info = restore_read_xml ($xml_file,"GROUPINGSGROUPS",$restore);
return $info;
//backup_ids->info db (and event's id in $info)
function restore_read_xml_events ($restore,$xml_file) {
- //We call the main read_xml function, with todo = EVENTS
+ //We call the main read_xml function, with $todo = EVENTS
$info = restore_read_xml ($xml_file,"EVENTS",$restore);
return $info;
//backup_ids->info
function restore_read_xml_modules ($restore,$xml_file) {
- //We call the main read_xml function, with todo = MODULES
+ //We call the main read_xml function, with $todo = MODULES
$info = restore_read_xml ($xml_file,"MODULES",$restore);
return $info;
//backup_ids->info
function restore_read_xml_logs ($restore,$xml_file) {
- //We call the main read_xml function, with todo = LOGS
+ //We call the main read_xml function, with $todo = LOGS
$info = restore_read_xml ($xml_file,"LOGS",$restore);
return $info;
}
function restore_read_xml_roles ($xml_file) {
- //We call the main read_xml function, with todo = ROLES
+ //We call the main read_xml function, with $todo = ROLES
$info = restore_read_xml ($xml_file,"ROLES",false);
return $info;
/// This is the class used to split, in first instance, the monolithic moodle.xml into
/// smaller xml files allowing the MoodleParser later to process only the required info
- /// based in each TODO, instead of processing the whole xml for each TODO. In theory
+ /// based in each $todo, instead of processing the whole xml for each $todo. In theory
/// processing time can be reduced upto 1/20th of original time (depending of the
- /// number of TODOs in the original moodle.xml file)
+ /// number of $todo in the original moodle.xml file)
///
/// Anyway, note it's a general splitter parser, and only needs to be instantiated
/// with the proper destination dir and the tosplit configuration. Be careful when
return trim($this->content);
}
- //This is the startTag handler we use where we are reading the info zone (todo="INFO")
+ //This is the startTag handler we use where we are reading the info zone ($todo="INFO")
function startElementInfo($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
// echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br />\n"; //Debug
}
- //This is the startTag handler we use where we are reading the info zone (todo="INFO")
+ //This is the startTag handler we use where we are reading the info zone ($todo="INFO")
function startElementRoles($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
- //This is the startTag handler we use where we are reading the course header zone (todo="COURSE_HEADER")
+ //This is the startTag handler we use where we are reading the course header zone ($todo="COURSE_HEADER")
function startElementCourseHeader($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
// echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br />\n"; //Debug
}
- //This is the startTag handler we use where we are reading the blocks zone (todo="BLOCKS")
+ //This is the startTag handler we use where we are reading the blocks zone ($todo="BLOCKS")
function startElementBlocks($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag handler we use where we are reading the sections zone (todo="SECTIONS")
+ //This is the startTag handler we use where we are reading the sections zone ($todo="SECTIONS")
function startElementSections($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
// echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br />\n"; //Debug
}
- //This is the startTag handler we use where we are reading the optional format data zone (todo="FORMATDATA")
+ //This is the startTag handler we use where we are reading the optional format data zone ($todo="FORMATDATA")
function startElementFormatData($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
// echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br />\n"; //Debug
}
- //This is the startTag handler we use where we are reading the metacourse zone (todo="METACOURSE")
+ //This is the startTag handler we use where we are reading the metacourse zone ($todo="METACOURSE")
function startElementMetacourse($parser, $tagName, $attrs) {
//Refresh properties
// echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br />\n"; //Debug
}
- //This is the startTag handler we use where we are reading the gradebook zone (todo="GRADEBOOK")
+ //This is the startTag handler we use where we are reading the gradebook zone ($todo="GRADEBOOK")
function startElementGradebook($parser, $tagName, $attrs) {
//Refresh properties
}
}
- //This is the startTag handler we use where we are reading the gradebook zone (todo="GRADEBOOK")
+ //This is the startTag handler we use where we are reading the gradebook zone ($todo="GRADEBOOK")
function startElementOldGradebook($parser, $tagName, $attrs) {
//Refresh properties
}
- //This is the startTag handler we use where we are reading the user zone (todo="USERS")
+ //This is the startTag handler we use where we are reading the user zone ($todo="USERS")
function startElementUsers($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
// echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br />\n"; //Debug
}
- //This is the startTag handler we use where we are reading the messages zone (todo="MESSAGES")
+ //This is the startTag handler we use where we are reading the messages zone ($todo="MESSAGES")
function startElementMessages($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag handler we use where we are reading the blogs zone (todo="BLOGS")
+ //This is the startTag handler we use where we are reading the blogs zone ($todo="BLOGS")
function startElementBlogs($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag handler we use where we are reading the questions zone (todo="QUESTIONS")
+ //This is the startTag handler we use where we are reading the questions zone ($todo="QUESTIONS")
function startElementQuestions($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag handler we use where we are reading the scales zone (todo="SCALES")
+ //This is the startTag handler we use where we are reading the scales zone ($todo="SCALES")
function startElementScales($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag handler we use where we are reading the events zone (todo="EVENTS")
+ //This is the startTag handler we use where we are reading the events zone ($todo="EVENTS")
function startElementEvents($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag handler we use where we are reading the modules zone (todo="MODULES")
+ //This is the startTag handler we use where we are reading the modules zone ($todo="MODULES")
function startElementModules($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag handler we use where we are reading the logs zone (todo="LOGS")
+ //This is the startTag handler we use where we are reading the logs zone ($todo="LOGS")
function startElementLogs($parser, $tagName, $attrs) {
//Refresh properties
$this->level++;
}
}
- //This is the startTag default handler we use when todo is undefined
+ //This is the startTag default handler we use when $todo is undefined
function startElement($parser, $tagName, $attrs) {
$this->level++;
$this->tree[$this->level] = $tagName;
echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br />\n"; //Debug
}
- //This is the endTag handler we use where we are reading the info zone (todo="INFO")
+ //This is the endTag handler we use where we are reading the info zone ($todo="INFO")
function endElementInfo($parser, $tagName) {
//Check if we are into INFO zone
if ($this->tree[2] == "INFO") {
}
}
- //Stop parsing if todo = INFO and tagName = INFO (en of the tag, of course)
+ //Stop parsing if $todo = INFO and tagName = INFO (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "INFO") {
$this->finished = true;
}
}
- //Stop parsing if todo = ROLES and tagName = ROLES (en of the tag, of course)
+ //Stop parsing if $todo = ROLES and tagName = ROLES (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "ROLES") {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the course_header zone (todo="COURSE_HEADER")
+ //This is the endTag handler we use where we are reading the course_header zone ($todo="COURSE_HEADER")
function endElementCourseHeader($parser, $tagName) {
//Check if we are into COURSE_HEADER zone
if ($this->tree[3] == "HEADER") {
} /// ends FILTERCONFIGS
}
- //Stop parsing if todo = COURSE_HEADER and tagName = HEADER (en of the tag, of course)
+ //Stop parsing if $todo = COURSE_HEADER and tagName = HEADER (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "HEADER") {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the sections zone (todo="BLOCKS")
+ //This is the endTag handler we use where we are reading the sections zone ($todo="BLOCKS")
function endElementBlocks($parser, $tagName) {
//Check if we are into BLOCKS zone
if ($this->tree[3] == 'BLOCKS') {
} /// ends role_overrides
}
- //Stop parsing if todo = BLOCKS and tagName = BLOCKS (en of the tag, of course)
+ //Stop parsing if $todo = BLOCKS and tagName = BLOCKS (en of the tag, of course)
//Speed up a lot (avoid parse all)
- //WARNING: ONLY EXIT IF todo = BLOCKS (thus tree[3] = "BLOCKS") OTHERWISE
+ //WARNING: ONLY EXIT IF $todo = BLOCKS (thus tree[3] = "BLOCKS") OTHERWISE
// THE BLOCKS TAG IN THE HEADER WILL TERMINATE US!
if ($this->tree[3] == 'BLOCKS' && $tagName == 'BLOCKS') {
$this->finished = true;
$this->content = "";
}
- //This is the endTag handler we use where we are reading the sections zone (todo="SECTIONS")
+ //This is the endTag handler we use where we are reading the sections zone ($todo="SECTIONS")
function endElementSections($parser, $tagName) {
//Check if we are into SECTIONS zone
if ($this->tree[3] == "SECTIONS") {
}
}
- //Stop parsing if todo = SECTIONS and tagName = SECTIONS (en of the tag, of course)
+ //Stop parsing if $todo = SECTIONS and tagName = SECTIONS (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "SECTIONS") {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the optional format data zone (todo="FORMATDATA")
+ //This is the endTag handler we use where we are reading the optional format data zone ($todo="FORMATDATA")
function endElementFormatData($parser, $tagName) {
//Check if we are into FORMATDATA zone
if ($this->tree[3] == 'FORMATDATA') {
$this->content = "";
}
- //This is the endTag handler we use where we are reading the metacourse zone (todo="METACOURSE")
+ //This is the endTag handler we use where we are reading the metacourse zone ($todo="METACOURSE")
function endElementMetacourse($parser, $tagName) {
//Check if we are into METACOURSE zone
if ($this->tree[3] == 'METACOURSE') {
}
}
- //Stop parsing if todo = METACOURSE and tagName = METACOURSE (en of the tag, of course)
+ //Stop parsing if $todo = METACOURSE and tagName = METACOURSE (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($this->tree[3] == 'METACOURSE' && $tagName == 'METACOURSE') {
$this->finished = true;
$this->content = "";
}
- //This is the endTag handler we use where we are reading the gradebook zone (todo="GRADEBOOK")
+ //This is the endTag handler we use where we are reading the gradebook zone ($todo="GRADEBOOK")
function endElementGradebook($parser, $tagName) {
//Check if we are into GRADEBOOK zone
if ($this->tree[3] == "GRADEBOOK") {
}
}
- //Stop parsing if todo = GRADEBOOK and tagName = GRADEBOOK (en of the tag, of course)
+ //Stop parsing if $todo = GRADEBOOK and tagName = GRADEBOOK (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "GRADEBOOK" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the gradebook zone (todo="GRADEBOOK")
+ //This is the endTag handler we use where we are reading the gradebook zone ($todo="GRADEBOOK")
function endElementOldGradebook($parser, $tagName) {
//Check if we are into GRADEBOOK zone
if ($this->tree[3] == "GRADEBOOK") {
}
}
- //Stop parsing if todo = GRADEBOOK and tagName = GRADEBOOK (en of the tag, of course)
+ //Stop parsing if $todo = GRADEBOOK and tagName = GRADEBOOK (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "GRADEBOOK" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the users zone (todo="USERS")
+ //This is the endTag handler we use where we are reading the users zone ($todo="USERS")
function endElementUsers($parser, $tagName) {
global $CFG;
//Check if we are into USERS zone
} // closes if this->tree[3]=="users"
- //Stop parsing if todo = USERS and tagName = USERS (en of the tag, of course)
+ //Stop parsing if $todo = USERS and tagName = USERS (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "USERS" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the messages zone (todo="MESSAGES")
+ //This is the endTag handler we use where we are reading the messages zone ($todo="MESSAGES")
function endElementMessages($parser, $tagName) {
//Check if we are into MESSAGES zone
if ($this->tree[3] == "MESSAGES") {
}
}
- //Stop parsing if todo = MESSAGES and tagName = MESSAGES (en of the tag, of course)
+ //Stop parsing if $todo = MESSAGES and tagName = MESSAGES (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "MESSAGES" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the blogs zone (todo="BLOGS")
+ //This is the endTag handler we use where we are reading the blogs zone ($todo="BLOGS")
function endElementBlogs($parser, $tagName) {
//Check if we are into BLOGS zone
if ($this->tree[3] == "BLOGS") {
}
}
- //Stop parsing if todo = BLOGS and tagName = BLOGS (end of the tag, of course)
+ //Stop parsing if $todo = BLOGS and tagName = BLOGS (end of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "BLOGS" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the questions zone (todo="QUESTIONS")
+ //This is the endTag handler we use where we are reading the questions zone ($todo="QUESTIONS")
function endElementQuestions($parser, $tagName) {
//Check if we are into QUESTION_CATEGORIES zone
if ($this->tree[3] == "QUESTION_CATEGORIES") {
}
}
- //Stop parsing if todo = QUESTION_CATEGORIES and tagName = QUESTION_CATEGORY (en of the tag, of course)
+ //Stop parsing if $todo = QUESTION_CATEGORIES and tagName = QUESTION_CATEGORY (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "QUESTION_CATEGORIES" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the scales zone (todo="SCALES")
+ //This is the endTag handler we use where we are reading the scales zone ($todo="SCALES")
function endElementScales($parser, $tagName) {
//Check if we are into SCALES zone
if ($this->tree[3] == "SCALES") {
}
}
- //Stop parsing if todo = SCALES and tagName = SCALE (en of the tag, of course)
+ //Stop parsing if $todo = SCALES and tagName = SCALE (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "SCALES" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the groups zone (todo="GROUPS")
+ //This is the endTag handler we use where we are reading the groups zone ($todo="GROUPS")
function endElementGroups($parser, $tagName) {
//Check if we are into GROUPS zone
if ($this->tree[3] == "GROUPS") {
}
}
- //Stop parsing if todo = GROUPS and tagName = GROUP (en of the tag, of course)
+ //Stop parsing if $todo = GROUPS and tagName = GROUP (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "GROUPS" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the groupings zone (todo="GROUPINGS")
+ //This is the endTag handler we use where we are reading the groupings zone ($todo="GROUPINGS")
function endElementGroupings($parser, $tagName) {
//Check if we are into GROUPINGS zone
if ($this->tree[3] == "GROUPINGS") {
}
}
- //Stop parsing if todo = GROUPINGS and tagName = GROUPING (en of the tag, of course)
+ //Stop parsing if $todo = GROUPINGS and tagName = GROUPING (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "GROUPINGS" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the groupingsgroups zone (todo="GROUPINGGROUPS")
+ //This is the endTag handler we use where we are reading the groupingsgroups zone ($todo="GROUPINGGROUPS")
function endElementGroupingsGroups($parser, $tagName) {
//Check if we are into GROUPINGSGROUPS zone
if ($this->tree[3] == "GROUPINGSGROUPS") {
}
}
- //Stop parsing if todo = GROUPINGS and tagName = GROUPING (en of the tag, of course)
+ //Stop parsing if $todo = GROUPINGS and tagName = GROUPING (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "GROUPINGSGROUPS" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the events zone (todo="EVENTS")
+ //This is the endTag handler we use where we are reading the events zone ($todo="EVENTS")
function endElementEvents($parser, $tagName) {
//Check if we are into EVENTS zone
if ($this->tree[3] == "EVENTS") {
}
}
- //Stop parsing if todo = EVENTS and tagName = EVENT (en of the tag, of course)
+ //Stop parsing if $todo = EVENTS and tagName = EVENT (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "EVENTS" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the modules zone (todo="MODULES")
+ //This is the endTag handler we use where we are reading the modules zone ($todo="MODULES")
function endElementModules($parser, $tagName) {
//Check if we are into MODULES zone
if ($this->tree[3] == "MODULES") {
}
- //Stop parsing if todo = MODULES and tagName = MODULES (en of the tag, of course)
+ //Stop parsing if $todo = MODULES and tagName = MODULES (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "MODULES" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag handler we use where we are reading the logs zone (todo="LOGS")
+ //This is the endTag handler we use where we are reading the logs zone ($todo="LOGS")
function endElementLogs($parser, $tagName) {
//Check if we are into LOGS zone
if ($this->tree[3] == "LOGS") {
}
}
- //Stop parsing if todo = LOGS and tagName = LOGS (en of the tag, of course)
+ //Stop parsing if $todo = LOGS and tagName = LOGS (en of the tag, of course)
//Speed up a lot (avoid parse all)
if ($tagName == "LOGS" and $this->level == 3) {
$this->finished = true;
}
- //This is the endTag default handler we use when todo is undefined
+ //This is the endTag default handler we use when $todo is undefined
function endElement($parser, $tagName) {
if (trim($this->content)) //Debug
echo "C".str_repeat(" ",($this->level+2)*2).$this->getContents()."<br />\n"; //Debug
/// If enabled in the site, use split files instead of original moodle.xml file
/// This will speed parsing speed upto 20x.
if (!empty($CFG->experimentalsplitrestore)) {
- /// Use splite file, else nothing to process (saves one full parsing for each non-existing todo)
+ /// Use splite file, else nothing to process (saves one full parsing for each non-existing $todo)
$splitfile= dirname($xml_file) . '/' . strtolower('split_' . $todo . '.xml');
if (file_exists($splitfile)) {
$xml_file = $splitfile;
- debugging("Info: todo=$todo, using split file", DEBUG_DEVELOPER);
+ debugging("Info: \$todo=$todo, using split file", DEBUG_DEVELOPER);
} else {
- /// For some todos, that are used in earlier restore steps (restore_precheck(), restore_form...
- /// allow fallback to monolithic moodle.xml. Those todos are at the beggining of the xml, so
+ /// For some values of $todo, that are used in earlier restore steps (restore_precheck(), restore_form...
+ /// allow fallback to monolithic moodle.xml. Those values of $todo are at the beggining of the xml, so
/// it doesn't hurts too much.
if ($todo == 'INFO' || $todo == 'COURSE_HEADER' || $todo == 'ROLES') {
- debugging("Info: todo=$todo, no split file. Fallback to moodle.xml", DEBUG_DEVELOPER);
+ debugging("Info: \$todo=$todo, no split file. Fallback to moodle.xml", DEBUG_DEVELOPER);
} else {
- debugging("Info: todo=$todo, no split file. Parse skipped", DEBUG_DEVELOPER);
+ debugging("Info: \$todo=$todo, no split file. Parse skipped", DEBUG_DEVELOPER);
return true;
}
}
$moodle_parser->todo = $todo;
$moodle_parser->preferences = $preferences;
xml_set_object($xml_parser,$moodle_parser);
- //Depending of the todo we use some element_handler or another
+ //Depending of the $todo we use some element_handler or another
if ($todo == "INFO") {
xml_set_element_handler($xml_parser, "startElementInfo", "endElementInfo");
} else if ($todo == "ROLES") {