2017 © Pedro Peláez
 

library slim-whoops

PHP whoops error on slim framework

image

zeuxisoo/slim-whoops

PHP whoops error on slim framework

  • Monday, June 25, 2018
  • by zeuxisoo
  • Repository
  • 6 Watchers
  • 94 Stars
  • 121,355 Installations
  • PHP
  • 30 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 14 Versions
  • 10 % Grown

The README.md

Slim whoops

PHP whoops error on slim framework, (*1)

Status

Build Status Coverage Status Downloads this Month Latest Stable Version, (*2)

Installation

Install the composer, (*3)

curl -sS https://getcomposer.org/installer | php

Edit composer.json, (*4)

Slim Whoops Version Global Mode PHP DI
1 n/a 0.1.* no no
2 1.* 0.3.* no no
3 <= 1.* 0.4.* no no
3 >= 2.* 0.5.* no no
3 >= 2.* 0.6.* yes yes
4 >= 2.* 0.7.* no no

For Slim framework 4, The composer.json will looks like, (*5)

{
    "require": {
        "zeuxisoo/slim-whoops": "0.7.*"
    }
}

Now, install or update the dependencies, (*6)

composer install

Basic Usage

Add to middleware with default settings, (*7)

$app->add(new Zeuxisoo\Whoops\Slim\WhoopsMiddleware());

Or you can pass more settings to the WhoopsMiddleware, (*8)

$app->add(new Zeuxisoo\Whoops\Slim\WhoopsMiddleware([
    'enable' => true,
    'editor' => 'sublime',
    'title'  => 'Custom whoops page title',
]));

Custom Editor String

If your editor do not included in [default editor list][2], you can custom it like, (*9)

$app->add(new Zeuxisoo\Whoops\Slim\WhoopsMiddleware([
    'editor' => function($file, $line) {
        return "http://localhost:8091?message=%file:%line";
    }
]));

Custom Handler Usage

In this usage, you can make your own handler for whoops, like:, (*10)

$simplyErrorHandler = function($exception, $inspector, $run) {
    $message = $exception->getMessage();
    $title   = $inspector->getExceptionName();

    echo "{$title} -> {$message}";
    exit;
};

And then pass it to the WhoopsMiddleware:, (*11)

new Zeuxisoo\Whoops\Slim\WhoopsMiddleware([], [$simplyErrorHandler]);

Important Note

Version 0.3.0 or above version, (*12)

Version 0.2.0, (*13)

  • You must to install the whoops library manually.

The Versions

25/06 2018

dev-master

9999999-dev https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

25/06 2018

0.6.4

0.6.4.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

26/02 2018

0.6.3

0.6.3.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

13/02 2018

0.6.2

0.6.2.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

23/03 2017

0.6.1

0.6.1.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

18/01 2017

0.6.0

0.6.0.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

09/01 2017

0.5.2

0.5.2.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

19/04 2016

0.5.1

0.5.1.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

31/01 2016

0.5.0

0.5.0.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

08/12 2015

0.4.0

0.4.0.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

08/12 2015

0.4.0.x-dev

0.4.0.9999999-dev https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

06/11 2014

0.3.0

0.3.0.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

exception slim error whoops

02/04 2014

0.2.0

0.2.0.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

exception slim error whoops

14/01 2014

0.1.0

0.1.0.0 https://github.com/zeuxisoo/php-slim-whoops/

PHP whoops error on slim framework

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

exception slim error whoops