michaelhall / coredump
生成包含调试信息的核心转储文件
v2.0.0
2022-09-20 16:12 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-09-20 21:06:19 UTC
README
创建包含调试信息的核心转储文件。
需求
- PHP >= 8.0
使用 composer 安装
$ composer require michaelhall/coredump
基本用法
<?php require_once __DIR__ . '/vendor/autoload.php'; use MichaelHall\CoreDump\CoreDump; // Creates a core dump and add some extra content. // Superglobals like $_SERVER, $_GET, $_POST etc. are added automatically. $coreDump = new CoreDump(); $coreDump->add('Foo', 'Bar'); // Outputs the core dump. echo $coreDump; // Saves the core dump with an auto-generated file name in the current directory. // Also returns the file name. $coreDump->save(); // As above, but saves the core dump in the /tmp-directory. $coreDump->save('/tmp');
核心转储文件
核心转储文件包含来自以下内容的可读调试信息:
- 传递给
CoreDump
构造函数的可选Throwable
。 - 通过
add()
方法添加的可选变量。 - 像
$_SERVER
、$_GET
、$_POST
等超级全局变量。
许可证
MIT