Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Abstract xml parser processor able to group chunks as configured and dispatch them to other arbitrary methods. More...
Public Member Functions | |
__construct (array $paths=array()) | |
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) | |
Perform custom transformations in the processed cdata. | |
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) | |
Get the already simplified chunk and dispatch it. | |
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) | |
Get one selected path and notify about end. | |
notify_path_start ($path) | |
Get one selected path and notify about start. | |
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. | |
Abstract xml parser processor able to group chunks as configured and dispatch them to other arbitrary methods.
This @progressive_parser_processor handles the requested paths, allowing to group information under any of them, dispatching them to the methods specified
Note memory increases as you group more and more paths, so use it for well-known structures being smaller enough (never to group MBs into one in-memory structure)
TODO: Complete phpdocs
grouped_parser_processor::__construct | ( | array | $paths = array() | ) |
Reimplemented from simplified_parser_processor.
grouped_parser_processor::after_path | ( | $path | ) |
The parser fires this each time one path has been parsed.
string | $path | xml path which parsing has ended |
Reimplemented from simplified_parser_processor.
grouped_parser_processor::before_path | ( | $path | ) |
The parser fires this each time one path is going to be parsed.
string | $path | xml path which parsing has started |
Reimplemented from simplified_parser_processor.
|
abstractprotectedinherited |
Get the already simplified chunk and dispatch it.
Reimplemented in moodle1_parser_processor, restore_inforef_parser_processor, restore_moodlexml_parser_processor, restore_questions_parser_processor, restore_roles_parser_processor, restore_structure_parser_processor, and restore_users_parser_processor.
|
protected |
Get the parent path using a local cache for performance.
$path | string The pathname you wish to obtain the parent name for. |
string | The parent pathname. |
|
abstractprotectedinherited |
Get one selected path and notify about end.
Reimplemented in moodle1_parser_processor, restore_inforef_parser_processor, restore_moodlexml_parser_processor, restore_questions_parser_processor, restore_roles_parser_processor, restore_structure_parser_processor, and restore_users_parser_processor.
|
abstractprotectedinherited |
Get one selected path and notify about start.
Reimplemented in moodle1_parser_processor, restore_inforef_parser_processor, restore_moodlexml_parser_processor, restore_questions_parser_processor, restore_roles_parser_processor, restore_structure_parser_processor, and restore_users_parser_processor.
|
protected |
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.
|
inherited |
Perform custom transformations in the processed cdata.
Reimplemented in moodle1_parser_processor, restore_questions_parser_processor, restore_roles_parser_processor, restore_structure_parser_processor, and restore_users_parser_processor.
|
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.
|
protectedinherited |
Adjust start/end til finding one match start/end path (included)
This will trigger all the pending {
string | path the path to look for as limit |
string | action the action to look for as limit |