|
@@ -31,8 +31,12 @@ class category_helper
|
|
|
|
|
|
private function load_xml($file)
|
|
|
{
|
|
|
+ libxml_use_internal_errors(true);
|
|
|
$xml = simplexml_load_file($file);
|
|
|
if($xml === false) {
|
|
|
+ $err_msg = json_encode(libxml_get_errors(),JSON_UNESCAPED_UNICODE);
|
|
|
+ Log::record("{$err_msg}", Log::ERR);
|
|
|
+ libxml_clear_errors();
|
|
|
throw new Exception("无法解析XML文件");
|
|
|
}
|
|
|
|