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