spatie/backtrace
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Spatie/Backtrace is a comprehensive PHP package designed to enhance the functionality of the debug_backtrace
function. The debug_backtrace
function, by default, can be challenging to work with due to its complex structure. Spatie/Backtrace addresses these challenges, providing users with a more streamlined way of working with a back trace. Using this package ensures that the reported function name for each data frame aligns correctly to the appropriate frame instead of the previous one. Moreover, the need for bitmask in passing options is eliminated.
To implement Spatie/Backtrace, start by installing the package via composer using the command composer require spatie/backtrace
. Once installed, you can create a backtrace instance by calling Spatie\Backtrace\Backtrace::create()
. Collect all frames using the frames
method: $frames = $backtrace->frames();
. Each Spatie\Backtrace\Frame
includes properties such as file
for the file name, lineNumber
for the line number, class
for class name, and others. By using these features, users gain comprehensive data for each specific frame. Additional features allow for collecting arguments, reducing arguments for viewing purposes, settling the application path, getting a certain part of a trace, and limiting frames' number.
$backtrace = Spatie\Backtrace\Backtrace::create();
$frames = $backtrace->frames();
The Spatie/Backtrace package documentation can be found on the GitHub repository page at GitHub - Spatie/Backtrace. The repository contains all the necessary information about the package, including installation instructions, usage examples, and helpful resources for troubleshooting or extending the package's functionality. Contributions are welcomed by the Spatie community and detailed information on contributing is also found on this page. Please note that terms of use of Spatie/Backtrace are governed by the MIT License.