json_Core Class Reference

Help class for handling JSON encode or decode since we can't always know for sure that we have the built-in PHP json_encode function and should use ZEND_Json instead. More...

Static Public Member Functions

static decode ($var=false)
 Decode JSON data into PHP.
static encode ($var=false)
 Encode variable data into JSON.
static fail ($reason=null, $http_status_code=500)
 Give it anything, it will turn it into JSON.
static ok ($result=null, $http_status_code=200)
 Give it anything, it will turn it into JSON.

Detailed Description

Help class for handling JSON encode or decode since we can't always know for sure that we have the built-in PHP json_encode function and should use ZEND_Json instead.


Member Function Documentation

static json_Core::decode ( var = false  )  [static]

Decode JSON data into PHP.

Parameters:
$var json-encoded string to decode
Returns:
false on error, json-decoded data on success
static json_Core::encode ( var = false  )  [static]

Encode variable data into JSON.

Parameters:
$var Variable to encode
Returns:
false on error, json-encoded string on success.
static json_Core::fail ( reason = null,
http_status_code = 500 
) [static]

Give it anything, it will turn it into JSON.

Parameters:
$reason string
$http_status_code int = 500
static json_Core::ok ( result = null,
http_status_code = 200 
) [static]

Give it anything, it will turn it into JSON.

Parameters:
$result string
$http_status_code int = 200

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 22 Nov 2012 for ninja by  doxygen 1.6.1