Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
moodle1_parser_processor Class Reference

XML parser processor used for processing parsed moodle.xml. More...

Inheritance diagram for moodle1_parser_processor:
grouped_parser_processor simplified_parser_processor progressive_parser_processor

Public Member Functions

 __construct (moodle1_converter $converter)
 
 add_path ($path, $grouped=false)
 
 add_path ($path)
 
 after_path ($path)
 The parser fires this each time one path has been parsed.
 
 before_path ($path)
 The parser fires this each time one path is going to be parsed.
 
 debug_info ()
 
 process_cdata ($cdata)
 Provides NULL decoding.
 
 process_chunk ($data)
 Get one chunk of parsed data and make it simpler adding attributes as tags and delegating to dispatch_chunk() the procesing of the resulting chunk.
 
 receive_chunk ($data)
 

Protected Member Functions

 add_missing_sub ($grouped, $path, $tags)
 Add non-existing subarray elements.
 
 build_currentdata ($grouped, $data)
 This function will accumulate the chunk into the specified grouped element for later dispatching once it is complete.
 
 dispatch_chunk ($data)
 Dispatches the data chunk to the converter class.
 
 get_parent_path ($path)
 Get the parent path using a local cache for performance.
 
 grouped_child_exists ($path)
 Function that will look for any grouped child for the given path, returning it if found, false if not.
 
 grouped_parent_exists ($path)
 Function that will look for any grouped parent for the given path, returning it if found, false if not.
 
 notify_path_end ($path)
 Informs the converter at the end of a watched path.
 
 notify_path_start ($path)
 Informs the converter at the start of a watched path.
 
 path_is_grouped ($path)
 
 path_is_selected ($path)
 
 path_is_selected_parent ($path)
 
 postprocess_chunk ($data)
 Override this method so grouping will be happening here also deciding between accumulating/dispatching.
 
 process_pending_startend_notifications ($path, $action)
 Adjust start/end til finding one match start/end path (included)
 
 selected_parent_exists ($path)
 Returns the first selected parent if available or false.
 

Protected Attributes

 $chunks
 
moodle1_converter $converter
 
 $currentdata
 
array $groupedparentprefixtree
 Search tree storing the grouped paths.
 
 $groupedpaths
 
 $inittime
 
array $parentcache = array()
 Keep cache of parent directory paths for XML parsing.
 
integer $parentcacheavailablesize = 2048
 Remaining space for parent directory paths.
 
 $parentpaths
 
 $parentsinfo
 
 $paths
 
 $startendinfo
 

Detailed Description

XML parser processor used for processing parsed moodle.xml.

Member Function Documentation

◆ after_path()

grouped_parser_processor::after_path ( $path)
inherited

The parser fires this each time one path has been parsed.

Parameters
string$pathxml path which parsing has ended

Reimplemented from simplified_parser_processor.

◆ before_path()

grouped_parser_processor::before_path ( $path)
inherited

The parser fires this each time one path is going to be parsed.

Parameters
string$pathxml path which parsing has started

Reimplemented from simplified_parser_processor.

◆ dispatch_chunk()

moodle1_parser_processor::dispatch_chunk ( $data)
protected

Dispatches the data chunk to the converter class.

Parameters
array$datathe chunk of parsed data

Reimplemented from simplified_parser_processor.

◆ get_parent_path()

grouped_parser_processor::get_parent_path ( $path)
protectedinherited

Get the parent path using a local cache for performance.

Parameters
$pathstring The pathname you wish to obtain the parent name for.
Return values
stringThe parent pathname.

◆ notify_path_end()

moodle1_parser_processor::notify_path_end ( $path)
protected

Informs the converter at the end of a watched path.

Parameters
string$path

Reimplemented from simplified_parser_processor.

◆ notify_path_start()

moodle1_parser_processor::notify_path_start ( $path)
protected

Informs the converter at the start of a watched path.

Parameters
string$path

Reimplemented from simplified_parser_processor.

◆ postprocess_chunk()

grouped_parser_processor::postprocess_chunk ( $data)
protectedinherited

Override this method so grouping will be happening here also deciding between accumulating/dispatching.

Reimplemented from simplified_parser_processor.

Reimplemented in restore_structure_parser_processor.

◆ process_cdata()

moodle1_parser_processor::process_cdata ( $cdata)

Provides NULL decoding.

Note that we do not decode $@FILEPHP$ and friends here as we are going to write them back immediately into another XML file.

Reimplemented from progressive_parser_processor.

◆ process_chunk()

simplified_parser_processor::process_chunk ( $data)
inherited

Get one chunk of parsed data and make it simpler adding attributes as tags and delegating to dispatch_chunk() the procesing of the resulting chunk.

Reimplemented from progressive_parser_processor.

◆ process_pending_startend_notifications()

simplified_parser_processor::process_pending_startend_notifications ( $path,
$action )
protectedinherited

Adjust start/end til finding one match start/end path (included)

This will trigger all the pending {

See also
notify_path_start} and {
notify_path_end} calls for one given path and action
Parameters
stringpath the path to look for as limit
stringaction the action to look for as limit

The documentation for this class was generated from the following file: