michaelhall / coredump
Dump a core file with debug information
Installs: 2 600
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-10-24 05:26:37 UTC
README
Create a core dump file with debug information.
Requirements
- PHP >= 8.0
Install with composer
$ composer require michaelhall/coredump
Basic usage
<?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');
The core dump file
The core dump file contains human-readable debug information from:
- An optional
Throwable
passed to theCoreDump
constructor. - Optional variables added by the
add()
method. - Superglobals like
$_SERVER
,$_GET
,$_POST
etc.
License
MIT