数据库错误时首页出现的信息
errorInfo: mysqli::mysqli(): (HY000/2002): 锟斤拷锟斤拷目锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷芫锟斤拷锟斤拷薹锟斤拷锟斤拷印锟�
errorFile: IWEB_PATH/lib/db/driver/mysqli_class.php
errorLine: 30
errorCode: 2
errorTime: 2018-05-10 14:27:37
#0 IWEB_PATH/lib/db/driver/mysqli_class.php(30): mysqli->mysqli(localhost,root,,bhwyc,3306)
#1 IWEB_PATH/lib/db/db_class.php(107): IMysqli->connect()
#2 IWEB_PATH/lib/web/model/model_class.php(200): IDB->query(SELECT class_name FROM bhwycshop_plugin WHERE is_open = 1 ORDER BY sort asc limit 50000)
#3 IWEB_PATH/classes/plugin.php(23): IModel->query(is_open = 1,class_name,sort asc)
#4 IWEB_PATH/classes/plugin.php(198): plugin::init()
#5 : plugin::onCreateApp()
#6 IWEB_PATH/lib/core/interceptor_class.php(114): call_user_func()
#7 IWEB_PATH/lib/core/application_class.php(93): IInterceptor::run(onCreateApp)
#8 IWEB_PATH/index.php(5): IApplication->run()
目的隐藏
数据库出错时弹出错误信息修改
lib/core/util/exception_class.php 第192行
原来
* @brief 在页面中显示错误
* @param $infoData 错误信息
*/
public static function show($infoData)
{
$logString = "<pre style='border:2px solid red'>".$infoData."</pre>";
die($logString);
}
}
改成
public static function show($infoData)
{
$logString = "数据维护中,请稍候访问!";
die($logString);
}
}
出错时页面这样
OK