Removed JSON encode depth parameter to keep PHP 5.3 compatibility.

pull/301/head v1.3.0
Mike Cao 8 years ago
parent b30d5e5fa2
commit 9c8d492799

@ -887,8 +887,8 @@ Flight::error($exception) // Sends an HTTP 500 response.
Flight::notFound() // Sends an HTTP 404 response.
Flight::etag($id, [$type]) // Performs ETag HTTP caching.
Flight::lastModified($time) // Performs last modified HTTP caching.
Flight::json($data, [$code], [$encode], [$charset], [$encodeOption], [$encodeDepth]) // Sends a JSON response.
Flight::jsonp($data, [$param], [$code], [$encode], [$charset], [$encodeOption], [$encodeDepth]) // Sends a JSONP response.
Flight::json($data, [$code], [$encode], [$charset], [$option]) // Sends a JSON response.
Flight::jsonp($data, [$param], [$code], [$encode], [$charset], [$option]) // Sends a JSONP response.
```
Any custom methods added with `map` and `register` can also be filtered.

@ -1 +1 @@
1.2.22
1.3.0

@ -457,18 +457,16 @@ class Engine {
* @param int $code HTTP status code
* @param bool $encode Whether to perform JSON encoding
* @param string $charset Charset
* @param int $encodeOption Bitmask Json constant such as JSON_HEX_QUOT
* @param int $encodeDepth Maximum encoding depth, must be greater than 0
* @param int $option Bitmask Json constant such as JSON_HEX_QUOT
*/
public function _json(
$data,
$code = 200,
$encode = true,
$charset = 'utf-8',
$encodeOption = 0,
$encodeDepth = 512
$option = 0
) {
$json = ($encode) ? json_encode($data, $encodeOption, $encodeDepth) : $data;
$json = ($encode) ? json_encode($data, $option) : $data;
$this->response()
->status($code)
@ -485,8 +483,7 @@ class Engine {
* @param int $code HTTP status code
* @param bool $encode Whether to perform JSON encoding
* @param string $charset Charset
* @param int $encodeOption Bitmask Json constant such as JSON_HEX_QUOT
* @param int $encodeDepth Maximum encoding depth, must be greater than 0
* @param int $option Bitmask Json constant such as JSON_HEX_QUOT
*/
public function _jsonp(
$data,
@ -494,10 +491,9 @@ class Engine {
$code = 200,
$encode = true,
$charset = 'utf-8',
$encodeOption = 0,
$encodeDepth = 512
$option = 0
) {
$json = ($encode) ? json_encode($data, $encodeOption, $encodeDepth) : $data;
$json = ($encode) ? json_encode($data, $option) : $data;
$callback = $this->request()->query[$param];

Loading…
Cancel
Save