| 包 | XS | 
|---|---|
| 继承关系 | class XSErrorException » XSException » Exception | 
| 实现接口 | Throwable | 
| 版本 | 1.0.0 | 
| 源代码 | sdk/php/lib/XS.class.php | 
| 名称 | 描述 | 定义于 | 
|---|---|---|
| __construct() | 构造函数 | XSErrorException | 
| __toString() | 将类对象转换成字符串 | XSErrorException | 
| __wakeup() | Exception | |
| getCode() | Exception | |
| getFile() | Exception | |
| getLine() | Exception | |
| getMessage() | Exception | |
| getPrevious() | Exception | |
| getRelPath() | 取得相对当前的文件路径 | XSException | 
| getTrace() | Exception | |
| getTraceAsString() | Exception | 
| 
public void __construct(int $code, string $message, string $file, int $line, Exception $previous=NULL) | ||
| $code | int | 出错代码 | 
| $message | string | 出错信息 | 
| $file | string | 出错所在文件 | 
| $line | int | 出错所在的行数 | 
| $previous | Exception | |
public function __construct($code, $message, $file, $line, $previous = null)
{
    $this->_file = $file;
    $this->_line = $line;
    if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
        parent::__construct($message, $code, $previous);
    } else {
        parent::__construct($message, $code);
    }
}
构造函数 将 $file, $line 记录到私有属性在 __toString 中使用
| 
public string __toString() | ||
| {return} | string | 异常的简要描述信息 | 
public function __toString()
{
    $string = '[' . __CLASS__ . '] ' . $this->getRelPath($this->_file) . '(' . $this->_line . '): ';
    $string .= $this->getMessage() . '(' . $this->getCode() . ')';
    return $string;
}
将类对象转换成字符串
| 包 | XS | 
|---|---|
| 继承关系 | class XSErrorException » XSException » Exception | 
| 实现接口 | Throwable | 
| 版本 | 1.0.0 | 
| 源代码 | sdk/php/lib/XS.class.php | 
| 名称 | 描述 | 定义于 | 
|---|---|---|
| __construct() | 构造函数 | XSErrorException | 
| __toString() | 将类对象转换成字符串 | XSErrorException | 
| __wakeup() | Exception | |
| getCode() | Exception | |
| getFile() | Exception | |
| getLine() | Exception | |
| getMessage() | Exception | |
| getPrevious() | Exception | |
| getRelPath() | 取得相对当前的文件路径 | XSException | 
| getTrace() | Exception | |
| getTraceAsString() | Exception | 
| 
public void __construct(int $code, string $message, string $file, int $line, Exception $previous=NULL) | ||
| $code | int | 出错代码 | 
| $message | string | 出错信息 | 
| $file | string | 出错所在文件 | 
| $line | int | 出错所在的行数 | 
| $previous | Exception | |
public function __construct($code, $message, $file, $line, $previous = null)
{
    $this->_file = $file;
    $this->_line = $line;
    if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
        parent::__construct($message, $code, $previous);
    } else {
        parent::__construct($message, $code);
    }
}
构造函数 将 $file, $line 记录到私有属性在 __toString 中使用
| 
public string __toString() | ||
| {return} | string | 异常的简要描述信息 | 
public function __toString()
{
    $string = '[' . __CLASS__ . '] ' . $this->getRelPath($this->_file) . '(' . $this->_line . '): ';
    $string .= $this->getMessage() . '(' . $this->getCode() . ')';
    return $string;
}
将类对象转换成字符串
留下一条评论吧!
请到论坛 登录 后刷新本页面!