ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
php4DOMDocument Class Reference
+ Collaboration diagram for php4DOMDocument:

Public Member Functions

 __construct ($source, $file=true, $a_mode=0)
 

Data Fields

 $success = null
 
string $error = ""
 
DOMDocument $myDOMDocument
 

Detailed Description

Definition at line 53 of file inc.xml5compliance.php.

Constructor & Destructor Documentation

◆ __construct()

php4DOMDocument::__construct (   $source,
  $file = true,
  $a_mode = 0 
)

Definition at line 60 of file inc.xml5compliance.php.

References staticxmlerror(), and ILIAS\UI\examples\MessageBox\Success\success().

61  {
62  $this->myDOMDocument = new DOMDocument();
63  // temporary set error handler
64  set_error_handler('staticxmlerror');
65  $old = ini_set('html_errors', false);
66 
67  if (is_object($source)) {
68  $this->myDOMDocument = $source;
69  $this->success = true;
70  } else {
71  if ($file) {
72  $this->success = @$this->myDOMDocument->load($source, $a_mode);
73  } else {
74  $this->success = $this->myDOMDocument->loadXML($source, $a_mode);
75  }
76  }
77 
78  // Restore error handling
79  ini_set('html_errors', $old);
80  restore_error_handler();
81 
82  if (!$this->success) {
83  $this->error_arr = staticxmlerror(0, "", "", 0, null, true);
84  foreach ($this->error_arr as $error) {
85  $error = str_replace("DOMDocument::loadXML():", "", $error);
86  $this->error .= $error . "<br />";
87  }
88  }
89  }
staticxmlerror(int $errno, string $errstr, ?string $errfile=null, ?int $errline=null, ?array $errcontext=null, bool $ret=false)
+ Here is the call graph for this function:

Field Documentation

◆ $error

string php4DOMDocument::$error = ""

Definition at line 56 of file inc.xml5compliance.php.

◆ $myDOMDocument

DOMDocument php4DOMDocument::$myDOMDocument

Definition at line 57 of file inc.xml5compliance.php.

◆ $success

php4DOMDocument::$success = null

Definition at line 55 of file inc.xml5compliance.php.


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