ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDomDocument Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilDomDocument:

Public Member Functions

 __construct ()
 Constructor. More...
 
 __call (string $a_method, array $a_args)
 
 getErrors ()
 
 handleError (int $a_no, string $a_string, string $a_file=null, int $a_line=null, array $a_context=null)
 

Private Attributes

DOMDocument $doc
 
array $errors = array()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Dom document wrapper.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:

Definition at line 24 of file class.ilDomDocument.php.

Constructor & Destructor Documentation

◆ __construct()

ilDomDocument::__construct ( )

Constructor.

Parameters
DOMDocumentPHP dom document

Definition at line 33 of file class.ilDomDocument.php.

34  {
35  $this->doc = new DOMDocument();
36  }

Member Function Documentation

◆ __call()

ilDomDocument::__call ( string  $a_method,
array  $a_args 
)

Definition at line 38 of file class.ilDomDocument.php.

39  {
40  if (in_array($a_method, array("validate", "loadXML"))) {
41  set_error_handler(array($this, "handleError"));
42  $rv = call_user_func_array(array($this->doc, $a_method), $a_args);
43  restore_error_handler();
44  return $rv;
45  } else {
46  return call_user_func_array(array($this->doc, $a_method), $a_args);
47  }
48  }

◆ getErrors()

ilDomDocument::getErrors ( )

Definition at line 50 of file class.ilDomDocument.php.

References $errors.

50  : array
51  {
52  return $this->errors;
53  }

◆ handleError()

ilDomDocument::handleError ( int  $a_no,
string  $a_string,
string  $a_file = null,
int  $a_line = null,
array  $a_context = null 
)

Definition at line 55 of file class.ilDomDocument.php.

61  : void {
62  $pos = strpos($a_string, "]:");
63  $err = trim(substr($a_string, $pos + 2));
64  $this->errors[] = $err;
65  }

Field Documentation

◆ $doc

DOMDocument ilDomDocument::$doc
private

Definition at line 26 of file class.ilDomDocument.php.

◆ $errors

array ilDomDocument::$errors = array()
private

Definition at line 27 of file class.ilDomDocument.php.

Referenced by getErrors().


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