搜索
系统检测到您的用户名不符合规范:

新手求助: 非法操作forget 求高手谢谢

浏览:1006 发布日期:2015年08月21日 分类:求助交流


点忘记密码以后显示
无法加载模块:Forget
错误位置
FILE: /data/home/qxu1192160158/htdocs/ThinkPHP/Common/functions.php LINE: 112
( APP_DEBUG && throw_exception($msg) 这一行错误)




funsion.php 代码

function halt($error) {
$e = array();
if (APP_DEBUG) {
//调试模式下输出错误信息
if (!is_array($error)) {
$trace = debug_backtrace();
$e['message'] = $error;
$e['file'] = $trace[0]['file'];
$e['line'] = $trace[0]['line'];
ob_start();
debug_print_backtrace();
$e['trace'] = ob_get_clean();
} else {
$e = $error;
}
} else {
//否则定向到错误页面
$error_page = C('ERROR_PAGE');
if (!empty($error_page)) {
redirect($error_page);
} else {
if (C('SHOW_ERROR_MSG'))
$e['message'] = is_array($error) ? $error['message'] : $error;
else
$e['message'] = C('ERROR_MESSAGE');
}
}
// 包含异常页面模板
include C('TMPL_EXCEPTION_FILE');
exit;
}

/**
* 自定义异常处理
* @param string $msg 异常消息
* @param string $type 异常类型 默认为ThinkException
* @param integer $code 异常代码 默认为0
* @return void
*/
function throw_exception($msg, $type='ThinkException', $code=0) {
if (class_exists($type, false))
throw new $type($msg, $code);
else
halt($msg); // 异常类型不存在则输出错误信息字串
}

/**
* 浏览器友好的变量输出
* @param mixed $var 变量
* @param boolean $echo 是否输出 默认为True 如果为false 则返回输出字符串
* @param string $label 标签 默认为空
* @param boolean $strict 是否严谨 默认为true
* @return void|string
*/
function dump($var, $echo=true, $label=null, $strict=true) {
$label = ($label === null) ? '' : rtrim($label) . ' ';
if (!$strict) {
if (ini_get('html_errors')) {
$output = print_r($var, true);
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>';
} else {
$output = $label . print_r($var, true);
}
} else {
ob_start();
var_dump($var);
$output = ob_get_clean();
if (!extension_loaded('xdebug')) {
$output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output);
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>';
}
}
if ($echo) {
echo($output);
return null;
}else
return $output;
}

/**
* 404处理
* 调试模式会抛异常
* 部署模式下面传入url参数可以指定跳转页面,否则发送404信息
* @param string $msg 提示信息
* @param string $url 跳转URL地址
* @return void
*/
function _404($msg='',$url='') {
APP_DEBUG && throw_exception($msg);
if($msg && C('LOG_EXCEPTION_RECORD')) Log::write($msg);
if(empty($url) && C('URL_404_REDIRECT')) {
$url = C('URL_404_REDIRECT');
}
if($url) {
redirect($url);
}else{
send_http_status(404);
exit;
}
}

附件 未标题-1.jpg ( 634.21 KB 下载:2 次 )

最佳答案
评论() 相关
后面还有条评论,
评论支持使用[code][/code]标签添加代码
您需要登录后才可以评论 登录 | 立即注册
收藏
Winsion_NG
积分:42 等级:LV0
热点推荐
(追記) (追記ここまで)
最新更新

我们

合作

网站

信息

ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。

AltStyle によって変換されたページ (->オリジナル) /