t4web/error-handler

ZF2 模块。用于处理和记录错误

1.0.2 2016-08-17 12:49 UTC

This package is auto-updated.

Last update: 2024-08-26 18:01:54 UTC


README

ZF2 模块。用于处理和记录错误

如果启用,您可以将所有PHP错误、通知、警告等记录下来

安装

在您的composer.json中添加此项目

"require": {
    "t4web/error-handler": "~1.0.0"
}

现在运行以下命令,让composer下载T4web\ErrorHandler

$ php composer.phar update

安装后

在您的application.config.php文件中启用它。

<?php
return array(
    'modules' => array(
        // ...
        'T4web\Log',
        'T4web\ErrorHandler',
    ),
    // ...
);

简介

例如,我们生成一些错误。在我们的Application\Controller\IndexController

public function indexAction()
{
    $e = $a['i'];  // this is Notice
    asd();  // this is Fatal
    return new ViewModel();
}

如果您在日志中使用t4web\admin,您可以看到:后端错误处理日志条目