awesomite / stack-trace
The wrapper for debug_backtrace() function
Installs: 14 365
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^5.3 || ^7.0
- ext-pcre: *
- awesomite/iterators: ^1.0
- awesomite/var-dumper: ^1.0
- composer/semver: ^1.4.2
Requires (Dev)
- awesomite/phpunit-4.8-fixer: ^1.0
- phpunit/phpunit: ^4.8.36
- sebastian/comparator: >=1.2.3
- symfony/console: ^2.7 || ^3.0
- dev-master
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.12.0
- v0.11.0
- v0.10.4
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.1
- v0.8.0
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.1
- v0.6.0
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.2
- v0.1.1
- v0.1.0
- dev-redundant_at
This package is auto-updated.
Last update: 2024-11-06 09:28:21 UTC
README
Abstract layer for debug_backtrace()
function.
This library allows you to serialize whole stack trace including variables.
It handles all types of data, including resources.
Usage
See documentation.
<?php use Awesomite\StackTrace\StackTraceFactory; use Awesomite\StackTrace\Steps\StepInterface; use Awesomite\StackTrace\SourceCode\PlaceInCodeInterface; $factory = new StackTraceFactory(); $stackTrace = $factory->create(); foreach ($stackTrace as $step) { /** @var StepInterface $step */ $function = $step->getCalledFunction()->getName(); echo "Function {$function}"; if ($step->hasPlaceInCode()) { /** @var PlaceInCodeInterface $placeInCode */ $placeInCode = $step->getPlaceInCode(); $fileName = $placeInCode->getFileName(); $line = $placeInCode->getLineNumber(); $function = $step->getCalledFunction()->getName(); echo " is called from {$fileName}:{$line}"; } echo "\n"; } $data = serialize($stackTrace); $unserializedStackTrace = unserialize($data);
Installation
composer require awesomite/stack-trace
Versioning
The version numbers follow the Semantic Versioning 2.0.0 scheme. Read more about backward compatibility.
Examples
See more examples.
License
This library is released under the MIT license.