codeinc / error-renderer
此包已被放弃,不再维护。未建议替代包。
Code Inc. 的错误显示库
1.3.8
2018-10-04 13:12 UTC
Requires
- php: >=7.1
- kevinlebrun/colors.php: ^1
- matthiasmullie/minify: ^1.3
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2020-02-04 16:10:30 UTC
README
PHP 7 库提供了两个类,专门用于渲染异常和错误(实现 Throwable
的所有内容)。
使用方法
<?php use CodeInc\ErrorRenderer\HtmlErrorRenderer; use CodeInc\ErrorRenderer\ConsoleErrorRenderer; // Creating a fake exception $fakeException = new \Exception("A last exception", 1010, new \Exception("A child exception", 0, new \Exception("A source exception"))); // Rendering for a web browser echo new HtmlErrorRenderer($fakeException); // Rendering for CLI echo new ConsoleErrorRenderer($fakeException); // Rendering using option (all option enabled) echo new ConsoleErrorRenderer($fakeException, ConsoleErrorRenderer::OPT_ALL); // Rendering with all options but no colors echo new ConsoleErrorRenderer($fakeException, ConsoleErrorRenderer::OPT_ALL ^ ConsoleErrorRenderer::OPT_COLORS);
安装
此库可通过 Packagist 获得,并可以使用 Composer 进行安装
composer require codeinc/error-renderer
许可协议
该库在 MIT 许可协议下发布(见 LICENSE
文件)。