代码格式调整

This commit is contained in:
麦当苗儿
2013-04-17 11:33:39 +08:00
parent 20b9354b9b
commit f203a905b7

View File

@@ -42,13 +42,13 @@ class Error {
* @return void * @return void
*/ */
static public function appError($errno, $errstr, $errfile, $errline) { static public function appError($errno, $errstr, $errfile, $errline) {
$errorStr = "[{$errno}] {$errstr} {$errfile}{$errline} 行.";
switch ($errno) { switch ($errno) {
case E_ERROR: case E_ERROR:
case E_PARSE: case E_PARSE:
case E_CORE_ERROR: case E_CORE_ERROR:
case E_COMPILE_ERROR: case E_COMPILE_ERROR:
case E_USER_ERROR: case E_USER_ERROR:
$errorStr = "[$errno] $errstr ".$errfile."$errline 行.";
Log::record($errorStr, 'ERROR'); Log::record($errorStr, 'ERROR');
self::halt($errorStr); self::halt($errorStr);
break; break;
@@ -56,7 +56,6 @@ class Error {
case E_USER_WARNING: case E_USER_WARNING:
case E_USER_NOTICE: case E_USER_NOTICE:
default: default:
$errorStr = "[$errno] $errstr ".$errfile."$errline 行.";
Log::record($errorStr, 'NOTIC'); Log::record($errorStr, 'NOTIC');
break; break;
} }
@@ -81,9 +80,7 @@ class Error {
* @return void * @return void
*/ */
static public function halt($error) { static public function halt($error) {
if(IS_CLI) { IS_CLI && exit(is_array($error)?$error['message']:$error);
exit(is_array($error)?$error['message']:$error);
}
$e = []; $e = [];
if (Config::get('app_debug')) { if (Config::get('app_debug')) {
//调试模式下输出错误信息 //调试模式下输出错误信息