Dump
Dump
Runtime dump diagnostic controller.
class Dump extends \Hazaar\Controller\DiagnosticThis controller specializes {@see Diagnostic} to emit structured debug dumps of runtime context, including timer metrics, arbitrary payload data, optional log entries, and optional generated backtraces.
It supports multiple output formats (JSON, XML, text, and HTML) so the same diagnostic payload can be consumed by browsers, APIs, and developer tooling.
Properties
data
The data to be dumped. Can literally be an array of anything.
private array $databacktrack
Whether generated outputs should include a synthetic backtrace.
private bool $backtracklog
private array $logMethods
init
Initializes the Dump controller with the provided data.
public init(array $data): voidParameters
| Parameter | Type | Description |
|---|---|---|
$data | array | the data items to be dumped |
toggleBacktrace
Toggles the backtrace functionality.
public toggleBacktrace(bool $value = true): voidParameters
| Parameter | Type | Description |
|---|---|---|
$value | bool | Optional. If true, enables backtrace. If false, disables backtrace. Default is true. |
addLogEntries
Adds log entries to the controller.
public addLogEntries(array $entries): voidThis method accepts an array of log entries and assigns it to the log property.
Parameters
| Parameter | Type | Description |
|---|---|---|
$entries | array | an array of log entries to be added |
json
Generates a JSON response with execution details and data.
public json(array $dump): voidParameters
| Parameter | Type | Description |
|---|---|---|
$dump | array | optional array to include additional data in the response |
xml
This is the default XML response for the dump controller.
public xml(array $data): voidParameters
| Parameter | Type | Description |
|---|---|---|
$data | array | The data to be displayed in the dump |
text
This is the default text response for the dump controller.
public text(array $data): voidParameters
| Parameter | Type | Description |
|---|---|---|
$data | array | The data to be displayed in the dump |
html
public html(array $data): voidThis is the default HTML response for the dump controller
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | array | The data to be displayed in the dump |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000