Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

This class represent one XMLDB file

Copyright: 1999 onwards Martin Dougiamas http://dougiamas.com
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 204 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

xmldb_file:: (10 methods):
  __construct()
  fileExists()
  fileWriteable()
  getStructure()
  validateXMLStructure()
  loadXMLStructure()
  arr2xmldb_structure()
  setDTD()
  setSchema()
  saveXMLFile()


Class: xmldb_file  - X-Ref

__construct($path)   X-Ref
Constructor of the xmldb_file

param: string $path

fileExists()   X-Ref
Determine if the XML file exists

return: bool

fileWriteable()   X-Ref
Determine if the XML is writeable

return: bool

getStructure()   X-Ref
No description

validateXMLStructure()   X-Ref
This function will check/validate the XML file for correctness
Dynamically if will use the best available checker/validator
(expat syntax checker or DOM schema validator

return: true

loadXMLStructure()   X-Ref
Load and the XMLDB structure from file

return: true

arr2xmldb_structure($xmlarr)   X-Ref
This function takes an xmlized array and put it into one xmldb_structure

param: array $xmlarr
return: xmldb_structure

setDTD($path)   X-Ref
This function sets the DTD of the XML file

param: string

setSchema($path)   X-Ref
This function sets the schema of the XML file

param: string

saveXMLFile()   X-Ref
This function saves the whole xmldb_structure to its file

return: int|bool false on failure, number of written bytes on success