Diagnostic
Diagnostic
Basic controller class
This controller does basic stuff
Properties
code
protected int $code = 204caller
protected array $callerMethods
__default
Executes the diagnostic run process.
public __default(string $controllerName, string $actionName): ResponseThis method determines the appropriate response type based on the presence of a response type method or the existence of a 'run' method. If neither is found, it defaults to an HTML response. The response is then wrapped in the appropriate Response object if it is not already an instance of Response.
Parameters
| Parameter | Type | Description |
|---|---|---|
$controllerName | string | |
$actionName | string |
setCaller
public setCaller(array $caller): voidParameters
| Parameter | Type | Description |
|---|---|---|
$caller | array |
setResponseType
Sets the response type for the diagnostic controller.
public setResponseType(ResponseType $type): voidParameters
| Parameter | Type | Description |
|---|---|---|
$type | ResponseType | the type of response to be returned |
json
Returns a JSON response with an error message.
public json(): voidxml
Generates an XML-RPC response.
public xml(): voidThis method creates a SimpleXMLElement with a root element xml and adds a child element data with the content 'NO CONTENT'. It then returns this XML structure wrapped in a Response\XML object.
html
Generates an HTML response with a predefined message.
public html(): voidtext
Returns a text response with the content 'NO CONTENT' and the specified status code.
public text(): voidhazaar
Outputs a diagnostic dump and terminates the script.
public hazaar(): voidThis method sets the HTTP response code to the value of the $code property, outputs a diagnostic message, dumps a placeholder string 'NO CONTENT', prints a backtrace, and then exits the script.
Generated by Hazaar API Doc Generator on Sun, 01 Mar 2026 09:22:26 +0000