34 $currentErrors = libxml_get_errors();
35 libxml_clear_errors();
37 $level = count(self::$errorStack) - 1;
38 self::$errorStack[$level] = array_merge(self::$errorStack[$level], $currentErrors);
52 if (!function_exists(
'libxml_use_internal_errors')) {
56 if (count(self::$errorStack) === 0) {
58 self::$xmlErrorState = libxml_use_internal_errors(
true);
59 libxml_clear_errors();
68 self::$errorStack[] =
array();
77 public static function end()
81 if (!function_exists(
'libxml_use_internal_errors')) {
90 $ret = array_pop(self::$errorStack);
92 if (count(self::$errorStack) === 0) {
94 libxml_use_internal_errors(self::$xmlErrorState);
111 assert(
'$error instanceof LibXMLError');
113 ',msg=' . trim(
$error->message);
129 assert(
'is_array($errors)');
133 $ret .= self::formatError($error) .
"\n";
static formatError($error)
Format an error as a string.
static formatErrors($errors)
Format a list of errors as a string.
Create styles array
The data for the language used.
static begin()
Start error logging.
static addErrors()
Append current XML errors to the current stack level.
static end()
End error logging.