Diagnostic
Diagnostic
Basic controller class
This controller does basic stuff
Properties
code
protected int $code = 204responseType
protected int $responseType = 'Response'caller
protected array $callerMethods
initialize
Initializes the controller with the given request and determines the response type.
public initialize(Request $request): voidThis method overrides the parent initialize method to set the response type based on various conditions such as environment variables, the PHP SAPI, and request headers.
Parameters
| Parameter | Type | Description |
|---|---|---|
$request | Request | the request object, or null if not available |
setCaller
public setCaller(array $caller): voidParameters
| Parameter | Type | Description |
|---|---|---|
$caller | array |
run
public run(?Route $route): ResponseParameters
| Parameter | Type | Description |
|---|---|---|
$route | Route |
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 Mon, 27 Oct 2025 13:01:29 +0000