承接 jowy/exception-handling-middleware 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jowy/exception-handling-middleware

最新稳定版本:v1.0

Composer 安装命令:

composer require jowy/exception-handling-middleware

包简介

PSR7 Http Exception Handling Middleware

README 文档

README

Build Status

PSR 7 error handling middleware

Intallation & Requirements

Install using composer

$ composer require jowy/error-handling-middleware

This library has following dependencies:

  • zendframework/zend-diactoros, used for PSR 7 implementation
  • zendframework/zend-stratigility, provide abstraction for PSR 7 middleware
  • flip/whoops, used for error formatting
  • psr/log, provide abstration for logging

This library has conflict with following library:

  • symfony/http-kernel, because this library has already used Symfony\Component\HttpKernel\Exception, despite require whole symfony/http-kernel package it only require the exception class

Usage

Usage on zendframework/zend-stratigility

use Zend\Stratigility\MiddlewarePipe;
use Jowy\ExceptionHandler\ExceptionHandler;

$app = new MiddlewarePipe();
$route_middleware = new ExceptionHandler($whoops_output_handler, $psr3_logger, $catch);

$app->pipe($route_middleware);

Usage on relay\relay

use Pimple\Container;
use Relay\Relay;
use Jowy\ExceptionHandler\ExceptionHandler;

$container = new Container();

$container["middleware"] = [
    ExceptionHandler::class => function() {
        return new ExceptionHandler($whoops_output_handler, $psr3_logger, $catch);
    }
];

$resolver = function ($class) use ($container) {
    return $container[$class];
}

new Relay(array_keys($container["middleware"], $resolver);

API

use Psr\Log\LoggerInterface;
use Whoops\Handler\HandlerInterface;

class ExceptionHandler
{
    public function __construct(HandlerInterface $error_handler, LoggerInterface $logger, $catch = true);
}

License

MIT, see LICENSE.

统计信息

  • 总下载量: 70
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-22