2017 © Pedro Peláez
 

middleware exception-handling-middleware

PSR7 Http Exception Handling Middleware

image

jowy/exception-handling-middleware

PSR7 Http Exception Handling Middleware

  • Monday, June 22, 2015
  • by Atriedes
  • Repository
  • 1 Watchers
  • 0 Stars
  • 43 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Error Handling Middleware

Build Status, (*1)

PSR 7 error handling middleware, (*2)

Intallation & Requirements

Install using composer, (*3)

$ composer require jowy/error-handling-middleware

This library has following dependencies:, (*4)

  • 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:, (*5)

  • 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, (*6)

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, (*7)

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., (*8)

The Versions

22/06 2015

dev-master

9999999-dev

PSR7 Http Exception Handling Middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

by Prasetyo Wicaksono

middleware psr-7 exception handling

22/06 2015

v1.0

1.0.0.0

PSR7 Http Exception Handling Middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

by Prasetyo Wicaksono

middleware psr-7 exception handling