定制 loilo/traceback 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

loilo/traceback

最新稳定版本:1.0.0

Composer 安装命令:

composer require loilo/traceback

包简介

Get the file or directory calling your code

README 文档

README

Traceback logo: two dog footprints next to each other

Traceback

Tests Version on packagist.org

Get the file or directory calling your code.

Installation

composer require loilo/traceback

Usage

/var/www/foo.php

require_once __DIR__ . '/vendor/autoload.php';

use Loilo\Traceback\Traceback;

function foo()
{
    var_dump(
        // File path calling foo()
        Traceback::file(),

        // Directory of file calling foo()
        Traceback::dir(),

        // File path calling foo() but skipping
        // the first file in the chain
        Traceback::file(1),

        // Directory of file calling foo() with skipping
        Traceback::dir(1)
    );
}

/var/www/bar.php

require_once __DIR__ . '/foo.php';

foo();

/var/www/baz/qux.php

require_once __DIR__ . '/../bar.php';

Running qux.php will output:

string(16) "/var/www/bar.php"
string(8) "/var/www"
string(20) "/var/www/baz/qux.php"
string(12) "/var/www/baz"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-16