peteraba/foo-debug

此包已被废弃,不再维护。未建议替代包。

Whoops 处理器 for Opulence

dev-master 2017-04-20 00:41 UTC

This package is auto-updated.

Last update: 2021-03-09 14:35:36 UTC


README

Opulence 中创建多语言应用的库,使操作变得简单。

Build Status License composer.lock Scrutinizer Code Quality Code Coverage Build Status

设置

使用 composer 安装库

composer install peteraba/foo-debug

替换您的异常配置文件

# config/http/exceptions.php

<?php

use Foo\Debug\Exceptions\Handlers\Whoops\ExceptionHandler;
use Foo\Debug\Exceptions\Handlers\Whoops\ExceptionRenderer;
use Opulence\Environments\Environment;
use Whoops\Run;

/**
 * ----------------------------------------------------------
 * Define the exception handler
 * ----------------------------------------------------------
 *
 * The last parameter lists any exceptions you do not want to log
 */
$isDevelopment = Environment::getVar('ENV_NAME') === Environment::DEVELOPMENT;

$exceptionRenderer = new ExceptionRenderer(new Run(), $isDevelopment);

return new ExceptionHandler(
    $logger,
    $exceptionRenderer,
    [
        HttpException::class
    ]
);