因業(yè)務(wù)需要,http://www.vxbq.cn/discuz/X3.2論壇插件開發(fā)中需要使用到PHPExcel組件來讀取Execl電子表格中的數(shù)據(jù),在實(shí)際開發(fā)中發(fā)現(xiàn),把PHPExcel組件單獨(dú)放到1個(gè)頁面中時(shí),成功讀取了電子表格中的數(shù)據(jù),但當(dāng)集成到http://www.vxbq.cn/discuz/的插件體系中時(shí),調(diào)用失敗。
出錯(cuò)提示:
http://www.vxbq.cn/discuz/! System Error
Oops! System file lost: class/phpexcel/phpexcel_shared_string.php
沖突緣由:
http://www.vxbq.cn/discuz/和PHPExcel都使用了php類的autoload技術(shù)來自動(dòng)注冊(cè)類,但http://www.vxbq.cn/discuz/阻斷了spl_autoload_call的調(diào)用進(jìn)程。
解決辦法:
修改sourceclassclass_core.php文件,找到public static function autoload($class)函數(shù),把最下面的discuz_error::exception_error($exc);注釋掉便可。以下圖: