Class ResponseUtil
Standalone environmentally-agnostic content/message feedback utility.
In the scope of a web request, it will respond via JSON (i.e. for use in an API or AJAX response action). When run in a command line interface, it will echo messages without exiting.
Setting elements of an object of this class (using the ArrayAccess implementation) will control the properties of the JSON that is returned when using it in a web request.
- ResponseUtil implements ArrayAccess
Located at x2engine/protected/components/util/ResponseUtil.php
public static
|
|
public static
|
|
public static
array
|
|
public static
boolean
|
|
public static
|
|
public static
|
#
respondWithError( type $no, type $st, type $fi = Null, type $ln = Null )
Error handler method that uses the web-agnostic response method. |
public static
|
#
respondFatalErrorMessage( )
Shutdown function for handling fatal errors not caught by |
public static
|
|
public static
string
|
|
public
|
#
__construct( )
Constructor. If one tries to instantiate two |
public
type
|
|
public
type
|
|
public
|
|
public
|
|
public
|
|
protected
|
#
sendHttpHeader( boolean $replace = true )
Sends HTTP headers. This method should be called before any content is sent. |
public
|
public static
boolean
|
$exitNonFatal | false |
#
Exit on non-fatal PHP errors. |
public static
integer
|
$errorCode | 500 |
#
The default HTTP status code to use when handling an internal error. |
public static
boolean
|
$includeExtraneousOutput | false |
#
Whether to include or ignore any unintentional output |
public static
string|array|closure
|
$shutdown | 'die();' |
#
Shutdown method. |
public static
type
|
$longErrorTrace | false |
#
Produce extended error traces in responses triggered by error handlers. |
public
string
|
$body |
|
#
Override body. |
public
array
|
$httpHeader | array(
'Content-Type' => 'application/json'
) |
#
HTTP header fields. |