CrossPHP

CoreException extends CrossException
in package

Tags
author

wonli wonli@live.com Class CoreException

Table of Contents

$httpStatusCode  : int
HTTP状态码
$ResponseData  : ResponseData
响应数据
$responseJSONExceptionMsg  : bool
是否返回JSON格式的异常信息
__construct()  : mixed
CrossException constructor.
addResponseData()  : void
设置扩展数据
cliErrorHandler()  : void
cli模式下的异常处理
cpExceptionSource()  : array<string|int, mixed>
根据trace信息分析源码,生成异常处理详细数据
errorHandler()  : void
异常处理方法
getHttpStatusCode()  : int
getResponseData()  : ResponseData
获取扩展数据
setHttpStatusCode()  : void
设置HTTP状态码
getCliTraceInfo()  : void
CLI trace
getTraceInfo()  : void
trace
hiddenFileRealPath()  : mixed
隐藏异常中的真实文件路径
alignmentTraceData()  : void
整理trace数据
highlightCode()  : mixed
高亮代码

Properties

$httpStatusCode

HTTP状态码

protected int $httpStatusCode = 500

$responseJSONExceptionMsg

是否返回JSON格式的异常信息

protected bool $responseJSONExceptionMsg = false

Methods

__construct()

CrossException constructor.

public __construct([string $message = 'CrossPHP Exception' ][, int|null $code = null ][, Throwable|null $previous = null ]) : mixed
Parameters
$message : string = 'CrossPHP Exception'
$code : int|null = null
$previous : Throwable|null = null
Return values
mixed

addResponseData()

设置扩展数据

public addResponseData(mixed $data) : void
Parameters
$data : mixed
Return values
void

cliErrorHandler()

cli模式下的异常处理

public cliErrorHandler(Throwable $e) : void
Parameters
$e : Throwable
Return values
void

cpExceptionSource()

根据trace信息分析源码,生成异常处理详细数据

public cpExceptionSource(Throwable $e) : array<string|int, mixed>
Parameters
$e : Throwable
Return values
array<string|int, mixed>

errorHandler()

异常处理方法

public errorHandler(Throwable $e) : void
Parameters
$e : Throwable
Return values
void

getHttpStatusCode()

public getHttpStatusCode() : int
Return values
int

setHttpStatusCode()

设置HTTP状态码

public setHttpStatusCode(int $code) : void
Parameters
$code : int
Return values
void

getCliTraceInfo()

CLI trace

protected getCliTraceInfo(array<string|int, mixed> &$trace,  &$traceTable) : void
Parameters
$trace : array<string|int, mixed>
$traceTable :
Return values
void

getTraceInfo()

trace

protected getTraceInfo(array<string|int, mixed> $trace,  &$content) : void
Parameters
$trace : array<string|int, mixed>
$content :
Return values
void

hiddenFileRealPath()

隐藏异常中的真实文件路径

protected hiddenFileRealPath(string $path) : mixed
Parameters
$path : string
Return values
mixed

alignmentTraceData()

整理trace数据

private alignmentTraceData([array<string|int, mixed> &$trace = [] ]) : void
Parameters
$trace : array<string|int, mixed> = []
Return values
void

highlightCode()

高亮代码

private static highlightCode(string $code) : mixed
Parameters
$code : string
Return values
mixed

Search results