lordfireen/backtrace 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lordfireen/backtrace

Composer 安装命令:

composer require lordfireen/backtrace

包简介

OOP for backtrace

README 文档

README

Pack of classes for object-oriented backtrace.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require lordfireen/backtrace

How to use

The use case is pretty simple:

$service = new \LF\Backtrace\BacktraceService();
$backtrace = $service->getFrames($limit, $options); // which is equivalent to debug_backtrace($options, $limit);

$frame = $backtrace[0]; // But instead of array we get object of LF\Backtrace\BacktaceFrame which is readonly class.
$frame->file; // is equivalent to debug_backtrace()[0]['file']
$frame->line; // is equivalent to debug_backtrace()[0]['line']
$frame->function; // is equivalent to debug_backtrace()[0]['function']
$frame->class; // is equivalent to debug_backtrace()[0]['class']
$frame->object; // is equivalent to debug_backtrace()[0]['object']
$frame->args; // is equivalent to debug_backtrace()[0]['args']

$type = $frame->type; // is equivalent to debug_backtrace()[0]['type'] and it's an enum LF\Backtrace\CallType

You could receive a single frame in any depth as follows:

function foo($service) {
    echo $service->getSingleFrame(1)->function . ' & ';
    echo $service->getSingleFrame(2)->function;
}
function bar($service) {
    foo($service);
}
bar(new \LF\Backtrace\BacktraceService()); // foo & bar

The frame could return the caller name as follows:

$frame->getCallerName(); // Which could be `Class->method`, `Class::method` or `method` 

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固