Dump
Dump
Runtime dump diagnostic controller.
class Dump extends \Hazaar\Controller\DiagnosticExtends: Hazaar\Controller\Diagnostic
This controller specializes Hazaar\Controller\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 $dataType: array
backtrack
Whether generated outputs should include a synthetic backtrace.
private bool $backtrackType: bool
log
private array $logType: array
Methods
init
Initializes the Dump controller with the provided data.
public init(array $data): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | array | the data items to be dumped |
toggleBacktrace
Toggles the backtrace functionality.
public toggleBacktrace(bool $value = true): voidReturns: void
Parameters
| 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): voidReturns: void
This 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): Response\JSONReturns: Hazaar\Controller\Response\JSON
Parameters
| 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): Response\XMLReturns: Hazaar\Controller\Response\XML
Parameters
| 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): Response\TextReturns: Hazaar\Controller\Response\Text
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | array | The data to be displayed in the dump |
html
public html(array $data): Response\HTMLReturns: Hazaar\Controller\Response\HTML
This 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 Fri, 04 Sep 2026 23:32:16 +0000