skymvc/function/fun_error.php
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
function error404(){
if(isset($_GET["ajax"])){
echo json_encode(array(
"error"=>1,
"message"=>"404错误"
));
exit;
}else{
echo '<div>404错误:资源不存在</div>';
exit;
}
}
function showError($sql='')
{
$array=debug_backtrace();
unset($array[0]);
echo $str='<style>
.debug-list{background-color:rgb(240, 226, 126); padding:20px 40px; }
.debug-list .item{margin-bottom:10px; display:block; border-bottom:1px solid #ccc; line-height:25px; padding:0px 5px;}
</style>';
if($sql){
$html="<div class='debug-list'><h1 style='color:red'>SQL错误提示</h1><div class='item'>系统:PHP " . PHP_VERSION . " (" . PHP_OS . ")</div><div class='item'>".$sql."</div>\n";
}else{
$html="<div class='debug-list'><h1 style='color:red'>错误提示</h1><div class='item'>系统:PHP " . PHP_VERSION . " (" . PHP_OS . ")</div>\n";
}
foreach($array as $row)
{
$html .="<div class='item'>".$row['file'].':'.$row['line'].'行,调用方法:'.$row['function']." </div>";
}
$html.='<div class="item">请联系管理员</div></div>';
$html=str_replace(TABLE_PRE,"",$html);
echo $html;
/* Don't execute PHP internal error handler */
return false;
}
function my_error_handler($errno=NULL, $errstr=NULL, $errfile=NULL, $errline=NULL ){
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting
return;
}
echo $str='<style>
.debug-list{background-color:rgb(240, 226, 126); padding:20px 40px; }
.debug-list .item{margin-bottom:10px; display:block; border-bottom:1px solid #ccc; line-height:25px; padding:0px 5px;}
</style>';
$html="<div class='debug-list'><h1 style='color:red'>错误提示</h1><div class='item'>系统:PHP " . PHP_VERSION . " (" . PHP_OS . ")</div>\n";
skyLog("error.txt","<div class='item'>错误类型:WARNING<br> 内容:$errstr 错误位置:$errfile 行:$errline </div>");
switch ($errno) {
case E_USER_WARNING:
$html.="<div class='item'>错误类型:USER_WARNING<br> 内容:$errstr 错误位置:$errfile 行:$errline </div>\n";
break;
case E_USER_NOTICE:
$html.="<div class='item'>错误类型:USER_NOTICE<br> 内容:$errstr 错误位置:$errfile 行:$errline </div>\n";
break;
后面还有 29 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。