All Projects → zeuxisoo → Php Slim Whoops

zeuxisoo / Php Slim Whoops

PHP whoops error on slim framework

Projects that are alternatives of or similar to Php Slim Whoops

Webpack Hmr 3 Ways
Three ways to set up your webpack hot module replacement: webpack-dev-server CLI, webpack-dev-server API, and express with webpack-hot-middleware.
Stars: ✭ 108 (-13.6%)
Mutual labels:  middleware
Guzzle Advanced Throttle
A Guzzle middleware that can throttle requests according to (multiple) defined rules. It is also possible to define a caching strategy, e.g. get the response from cache when the rate limit is exceeded or always get a cached value to spare your rate limits. Using wildcards in host names is also supported.
Stars: ✭ 120 (-4%)
Mutual labels:  middleware
Graphql Serverless
GraphQL (incl. a GraphiQL interface) middleware for the webfunc serverless web framework.
Stars: ✭ 124 (-0.8%)
Mutual labels:  middleware
Gzip
💾 Golang gzip middleware for Gin and net/http | Golang gzip中间件,支持Gin和net/http,开箱即用同时可定制
Stars: ✭ 113 (-9.6%)
Mutual labels:  middleware
Legacy
[Deprecated] Nano-framework for Node.js. Use PRO version
Stars: ✭ 117 (-6.4%)
Mutual labels:  middleware
Slim Oauth2
Routes and Middleware for Using OAuth2 Server within a Slim Framework API
Stars: ✭ 121 (-3.2%)
Mutual labels:  middleware
Gin Web
由gin + gorm + jwt + casbin组合实现的RBAC权限管理脚手架Golang版, 搭建完成即可快速、高效投入业务开发
Stars: ✭ 107 (-14.4%)
Mutual labels:  middleware
Joynr
A transport protocol agnostic (MQTT, HTTP, WebSockets etc.) Franca IDL based communication framework supporting multiple communication paradigms (RPC, Pub-Sub, broadcast etc.)
Stars: ✭ 124 (-0.8%)
Mutual labels:  middleware
Auth
Authenticator via oauth2
Stars: ✭ 118 (-5.6%)
Mutual labels:  middleware
Apollo upload server Ruby
Stars: ✭ 124 (-0.8%)
Mutual labels:  middleware
Martian
Martian is a library for building custom HTTP/S proxies
Stars: ✭ 1,589 (+1171.2%)
Mutual labels:  middleware
Hooks
Async middleware for JavaScript and TypeScript
Stars: ✭ 117 (-6.4%)
Mutual labels:  middleware
Faygo
Faygo is a fast and concise Go Web framework that can be used to develop high-performance web app(especially API) with fewer codes. Just define a struct handler, faygo will automatically bind/verify the request parameters and generate the online API doc.
Stars: ✭ 1,557 (+1145.6%)
Mutual labels:  middleware
Maxwell
Maxwell is an HTTP client which support for middleware and multiple adapters.
Stars: ✭ 111 (-11.2%)
Mutual labels:  middleware
Resource Router Middleware
🚴 Express REST resources as middleware mountable anywhere
Stars: ✭ 124 (-0.8%)
Mutual labels:  middleware
Ln Paywall
Go middleware for monetizing your API on a per-request basis with Bitcoin and Lightning ⚡️
Stars: ✭ 108 (-13.6%)
Mutual labels:  middleware
Awilix Koa
Awilix helpers/middleware for Koa 2
Stars: ✭ 121 (-3.2%)
Mutual labels:  middleware
Http Router
🎉 Release 2.0 is released! Very fast HTTP router for PHP 7.1+ (incl. PHP8 with attributes) based on PSR-7 and PSR-15 with support for annotations and OpenApi (Swagger)
Stars: ✭ 124 (-0.8%)
Mutual labels:  middleware
Giraffe
Giraffe is an F# micro web framework for building rich web applications. It has been heavily inspired and is similar to Suave, but has been specifically designed with ASP.NET Core in mind and can be plugged into the ASP.NET Core pipeline via middleware. Giraffe applications are composed of so called HttpHandler functions which can be thought of a mixture of Suave's WebParts and ASP.NET Core's middleware.
Stars: ✭ 1,703 (+1262.4%)
Mutual labels:  middleware
Gin Swagger
gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
Stars: ✭ 2,001 (+1500.8%)
Mutual labels:  middleware

Slim whoops

PHP whoops error on slim framework

Status

Build Status Coverage Status Downloads this Month Latest Stable Version

Installation

Install the composer

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

Edit composer.json

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

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

Now, install or update the dependencies

php composer.phar install

Basic Usage

Add to middleware with default settings

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

Or you can pass more settings to the WhoopsMiddleware

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

Custom Handler Usage

In this usage, you can make your own handler for whoops, like:

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

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

And then pass it to the WhoopsMiddleware:

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

Important Note

Version 0.3.0 or above version

Version 0.2.0

  • You must to install the whoops library manually.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].