mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
代码规范
This commit is contained in:
@@ -11,13 +11,15 @@
|
||||
|
||||
namespace think;
|
||||
|
||||
class Error {
|
||||
class Error
|
||||
{
|
||||
/**
|
||||
* 自定义异常处理
|
||||
* @access public
|
||||
* @param mixed $e 异常对象
|
||||
*/
|
||||
public static function appException($e) {
|
||||
public static function appException($e)
|
||||
{
|
||||
$error = [
|
||||
'message' => $e->getMessage(),
|
||||
'file' => $e->getFile(),
|
||||
@@ -40,7 +42,8 @@ class Error {
|
||||
* @param int $errline 错误行数
|
||||
* @return void
|
||||
*/
|
||||
public static function appError($errno, $errstr, $errfile, $errline) {
|
||||
public static function appError($errno, $errstr, $errfile, $errline)
|
||||
{
|
||||
$errorStr = "[{$errno}] {$errstr} {$errfile} 第 {$errline} 行.";
|
||||
switch ($errno) {
|
||||
case E_USER_ERROR:
|
||||
@@ -59,7 +62,8 @@ class Error {
|
||||
* 应用关闭处理
|
||||
* @return void
|
||||
*/
|
||||
public static function appShutdown() {
|
||||
public static function appShutdown()
|
||||
{
|
||||
// 记录日志
|
||||
Log::save();
|
||||
if ($e = error_get_last()) {
|
||||
@@ -82,7 +86,8 @@ class Error {
|
||||
* @param mixed $error 错误
|
||||
* @param int $code
|
||||
*/
|
||||
public static function halt($error, $code = 1) {
|
||||
public static function halt($error, $code = 1)
|
||||
{
|
||||
$message = is_array($error) ? $error['message'] : $error;
|
||||
$code = is_array($error) ? $error['code'] : $code;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user