level == LIBXML_ERR_WARNING ? self::WARN_MSG_FORMAT : self::ERR_MSG_FORMAT; $msgs[] = sprintf($format, $err->file, $err->line, $err->column, $err->message, $err->code); } $msg .= implode("\n", $msgs); if (isset($file)) { $msg .= ' (' . $file; if (isset($line)) $msg .= ': ' . $line; $msg .= ')'; } parent::__construct($msg, $code); } public static function initializeFromError($code, $str, $file, $line, $cxt) { //printf("\n\nCODE: %s %s\n\n", $code, $str); $class = __CLASS__; throw new $class($str, $code, $file, $line); } }