steevanb / php-backtrace
优秀的debug_backtrace()输出,包含调用和代码预览
2.1.0
2021-05-16 16:56 UTC
Requires
- php: ^5.4|^7.0|^8.0
Requires (Dev)
- phpunit/phpunit: 4.8.*
- symfony/console: 2.8.*
README
php-backtrace
展示与debug_backtrace()
相同效果的输出,包含调用者,代码预览等。
可在HTML中使用,或与symfony/console一起使用。
安装
composer require --dev steevanb/php-backtrace ^2.1
配置
// configure how file paths will be shown // true : remove path prefix, based on DumpBacktrace.php path (assume it is in vendor/ dir) // false : do not remove anything in file paths // string : remove this prefix \DumpBacktrace::setRemovePathPrefix($remove);
以HTML格式输出
// get backtrace dump as array \DebugBacktraceHtml::getBacktraces(); // get backtrace dump as HTML \DebugBacktraceHtml::getDump(); // write getDump() HTML with echo \DebugBacktraceHtml::dump(); // write getDump() HTML with echo, and exit \DebugBacktraceHtml::eDump();
在symfony/console应用程序中输出
// Write dump \DebugBacktraceConsole::dump(); // Write dump and exit \DebugBacktraceConsole::eDump();