2017 © Pedro Peláez
 

library slim-whoops

Slim Framework 3 error handler built on top of the Whoops error handler

image

dopesong/slim-whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  • Thursday, May 17, 2018
  • by dopesong
  • Repository
  • 2 Watchers
  • 4 Stars
  • 4,056 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 8 Versions
  • 25 % Grown

The README.md

Slim Whoops

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Slim Framework 3 error handler built on top of Whoops Error Handler, (*2)

Installing

Use Composer to install Whoops into your project:, (*3)

composer require dopesong/slim-whoops

Requirements

  • PHP >=5.6.0
  • Whoops ^2.0

Usage With Slim 3

use Dopesong\Slim\Error\Whoops as WhoopsError;

include "vendor/autoload.php";

$app = new Slim\App();
$container = $app->getContainer();

$container['phpErrorHandler'] = $container['errorHandler'] = function($c) {
    return new WhoopsError();
};

$app->run();

Additional handlers

Custom handlers can be added to execute additional tasks. For example, you might want to log the error like so:, (*4)

include "vendor/autoload.php";

use Whoops\Handler\Handler;
use Dopesong\Slim\Error\Whoops as WhoopsError;

$app = new Slim\App();
$container = $app->getContainer();

$container['phpErrorHandler'] = $container['errorHandler'] = function ($container) {
    $logger = $container['logger'];
    $whoopsHandler = new WhoopsError();

    $whoopsHandler->pushHandler(
        function ($exception) use ($logger) {
            /** @var \Exception $exception */
            $logger->error($exception->getMessage(), ['exception' => $exception]);
            return Handler::DONE;
        }
    );

    return $whoopsHandler;
};

The Versions

17/05 2018

2.x-dev

2.9999999.9999999.9999999-dev https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops

17/05 2018

2.3.0

2.3.0.0 https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops

09/11 2016

2.2.0

2.2.0.0 https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops

16/08 2016

2.1.0

2.1.0.0 https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops

27/04 2016

2.0.0

2.0.0.0 https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops

26/11 2015

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops

26/11 2015

1.0.0

1.0.0.0 https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops

11/11 2015

0.1

0.1.0.0 https://github.com/dopesong/Slim-Whoops

Slim Framework 3 error handler built on top of the Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

framework slim error handler whoops