Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are 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