niletphp/error-handling

NiletPHP 错误处理组件。

v1.0.0 2017-03-02 09:22 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:47:35 UTC


README

##自定义错误处理

注册自定义错误处理器,当PHP发出 E_WARNING 或 E_ERROR 时抛出 \Error。

要求

PHP >= 7.0

安装

Composer

{
    "require": {
        "niletphp/error-handling": ">=v1.0"
    }
}

示例

use Nilet\Components\ErrorHandling\ErrorHandler;

$eh = new ErrorHandler();

// Registering the custom error handler
$eh->handleErrors();

// Restore the previous event handler
$eh->restoreErrorHandler();