Diagnostic
Diagnostic
Basic controller class
This controller does basic stuff
Properties
code
protected int $code = 204
responseType
protected int $responseType = 'Response'
caller
protected array $caller
Methods
initialize
Initializes the controller with the given request and determines the response type.
public initialize(Request $request): ?Response
This 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): void
Parameters
Parameter | Type | Description |
---|---|---|
$caller | array |
run
public run(?Route $route): Response
Parameters
Parameter | Type | Description |
---|---|---|
$route | Route |
json
Returns a JSON response with an error message.
public json(): void
xml
Generates an XML-RPC response.
public xml(): void
This 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(): void
text
Returns a text response with the content 'NO CONTENT' and the specified status code.
public text(): void
hazaar
Outputs a diagnostic dump and terminates the script.
public hazaar(): void
This 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