devorto/exception-handler
Composer 安装命令:
composer require devorto/exception-handler
包简介
A class to convert standard php errors to exceptions and supports to log (un)caught to php-log and other loggers using LoggerInterface.
README 文档
README
Always wanted to convert php errors to exceptions? Or catch "uncaught exceptions" so you can log them with a logger?
Don't look any further and include this class now! 😁
Example
<?php // Init ExceptionHandler class: \Devorto\ExceptionHandler::init(); // Add a logger. \Devorto\ExceptionHandler::addLogger(new AnyLoggerImplementingLoggerInterface()); // This class removes the need of using `@` before php standard methods because we can now catch and continue with our code but still log that this happened. try { mkdir('/existing-path-which-results-in-a-notice'); } catch (ErrorException $exception) { // Log "caught" exception. \Devorto\ExceptionHandler::log($exception); } /** * This will result in a HTTP 500 Error Page. * This will however be logged using the exception handler and provided loggers. */ throw new Exception('It broke!');
devorto/exception-handler 适用场景与选型建议
devorto/exception-handler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.14k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 06 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 devorto/exception-handler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 devorto/exception-handler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-28