Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 180 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: XMLReader  - X-Ref


openFileInZip(string $zipFilePath, string $fileInsideZipPath)   X-Ref
Opens the XML Reader to read a file located inside a ZIP file.

param: string $zipFilePath       Path to the ZIP file
param: string $fileInsideZipPath Relative or absolute path of the file inside the zip
return: bool TRUE on success or FALSE on failure

getRealPathURIForFileInZip(string $zipFilePath, string $fileInsideZipPath)   X-Ref
Returns the real path for the given path components.
This is useful to avoid issues on some Windows setup.

param: string $zipFilePath       Path to the ZIP file
param: string $fileInsideZipPath Relative or absolute path of the file inside the zip
return: string The real path URI

read()   X-Ref
Move to next node in document.


readUntilNodeFound(string $nodeName)   X-Ref
Read until the element with the given name is found, or the end of the file.

param: string $nodeName Name of the node to find
return: bool TRUE on success or FALSE on failure

next($localName = null)   X-Ref
Move cursor to next node skipping all subtrees.

param: null|string $localName The name of the next node to move to

isPositionedOnStartingNode(string $nodeName)   X-Ref

return: bool Whether the XML Reader is currently positioned on the starting node with given name

isPositionedOnEndingNode(string $nodeName)   X-Ref

return: bool Whether the XML Reader is currently positioned on the ending node with given name

getCurrentNodeName()   X-Ref

return: string The name of the current node, un-prefixed

fileExistsWithinZip(string $zipStreamURI)   X-Ref
Returns whether the file at the given location exists.

param: string $zipStreamURI URI of a zip stream, e.g. "zip://file.zip#path/inside.xml"
return: bool TRUE if the file exists, FALSE otherwise

isPositionedOnNode(string $nodeName, int $nodeType)   X-Ref

return: bool Whether the XML Reader is currently positioned on the node with given name and type