steevanb / php-backtrace
Nice debug_backtrace() dump, with call and code preview
Installs: 97 056
Dependents: 6
Suggesters: 0
Security: 0
Stars: 21
Watchers: 3
Forks: 3
Open Issues: 0
Requires
- php: ^5.4|^7.0|^8.0
Requires (Dev)
- phpunit/phpunit: 4.8.*
- symfony/console: 2.8.*
README
php-backtrace
Show nice equivalent to debug_backtrace()
, with caller, code preview etc.
Can be used in HTML, or with symfony/console.
Installation
composer require --dev steevanb/php-backtrace ^2.1
Configuration
// 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);
Dump as 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();
Dump in symfony/console application
// Write dump \DebugBacktraceConsole::dump(); // Write dump and exit \DebugBacktraceConsole::eDump();