loilo/traceback
最新稳定版本:1.0.0
Composer 安装命令:
composer require loilo/traceback
包简介
Get the file or directory calling your code
README 文档
README
Traceback
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
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-16