butterfly-team/whoops
Composer 安装命令:
composer require butterfly-team/whoops
包简介
php error handling for cool kids
README 文档
README
PHP errors for cool kids
whoops is an error handler framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debug your web projects, but at heart it's a simple yet powerful stacked error handling system.
Features
- Flexible, stack-based error handling
- Stand-alone library with (currently) no required dependencies
- Simple API for dealing with exceptions, trace frames & their data
- Includes a pretty rad error page for your webapp projects
- Includes the ability to open referenced files directly in your editor and IDE
- Includes handlers for different response formats (JSON, XML, SOAP)
- Easy to extend and integrate with existing libraries
- Clean, well-structured & tested code-base
Sponsors
Installing
If you use Laravel 4, Laravel 5.5+ or Mezzio, you already have Whoops. There are also community-provided instructions on how to integrate Whoops into Silex 1, Silex 2, Phalcon, Laravel 3, Laravel 5, CakePHP 3, CakePHP 4, Zend 2, Zend 3, Yii 1, FuelPHP, Slim, Pimple, Laminas, or any framework consuming StackPHP middlewares or PSR-7 middlewares.
If you are not using any of these frameworks, here's a very simple way to install:
-
Use Composer to install Whoops into your project:
composer require filp/whoops
-
Register the pretty handler in your code:
$whoops = new \Whoops\Run; $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); $whoops->register();
For more options, have a look at the example files in examples/ to get a feel for how things work. Also take a look at the API Documentation and the list of available handlers below.
You may also want to override some system calls Whoops does. To do that, extend Whoops\Util\SystemFacade, override functions that you want and pass it as the argument to the Run constructor.
You may also collect the HTML generated to process it yourself:
$whoops = new \Whoops\Run; $whoops->allowQuit(false); $whoops->writeToOutput(false); $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); $html = $whoops->handleException($e);
Available Handlers
whoops currently ships with the following built-in handlers, available in the Whoops\Handler namespace:
PrettyPageHandler- Shows a pretty error page when something goes pants-upPlainTextHandler- Outputs plain text message for use in CLI applicationsCallbackHandler- Wraps a closure or other callable as a handler. You do not need to use this handler explicitly, whoops will automatically wrap any closure or callable you pass toWhoops\Run::pushHandlerJsonResponseHandler- Captures exceptions and returns information on them as a JSON string. Can be used to, for example, play nice with AJAX requests.XmlResponseHandler- Captures exceptions and returns information on them as a XML string. Can be used to, for example, play nice with AJAX requests.
You can also use pluggable handlers, such as SOAP handler.
Authors
This library was primarily developed by Filipe Dobreira, and is currently maintained by Denis Sokolov. A lot of awesome fixes and enhancements were also sent in by various contributors. Special thanks to Graham Campbell and Markus Staab for continuous participation.
butterfly-team/whoops 适用场景与选型建议
butterfly-team/whoops 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24.93k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 06 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「library」 「exception」 「error」 「handling」 「whoops」 「throwable」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 butterfly-team/whoops 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 butterfly-team/whoops 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 butterfly-team/whoops 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Inbox pattern process implementation for your Laravel Applications
PHP Error Handler module that captures and displays all throwable errors in a given format, making debugging easier and more efficient
Error and Exception override and observers.
Error handler based on Booboo with HTML and JSON support
Error Share App, for handle error page
Core library that defines common interfaces used by the rest of the intahwebz..
统计信息
- 总下载量: 24.93k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-09