Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Make usage of zend-json fully optional #113

Merged

Conversation

weierophinney
Copy link
Member

Adds a new method to AbstractRestfulController, jsonEncode() which:

  • checks for presence of json_encode(); if present, uses it to decode the provided string.
  • checks for presence of Zend\Json\Json; if present, uses Zend\Json\Json::decode() to decode the provided string.
  • throws an exception if neither is available

The above is now used by both processPostData() and processBodyContent() when parsing JSON.

Removed zend-json from the require-dev section, and updated its description in the suggest section.

Adds a new method to `AbstractRestfulController`, `jsonEncode()` which:

- checks for presence of `json_encode()`; if present, uses it to decode the
  provided string.
- checks for presence of `Zend\Json\Json`; if present, uses
  `Zend\Json\Json::decode()` to decode the provided string.
- throws an exception if neither is available

The above is now used by both `processPostData()` and `processBodyContent()`
when parsing JSON.

Removed `zend-json` from the `require-dev` section, and updated its description
in the `suggest` section.
@weierophinney weierophinney added this to the 3.0.0 milestone Apr 2, 2016
@weierophinney weierophinney self-assigned this Apr 2, 2016
@weierophinney weierophinney merged commit b529b1d into zendframework:develop Apr 2, 2016
weierophinney added a commit that referenced this pull request Apr 2, 2016
weierophinney added a commit that referenced this pull request Apr 2, 2016
@weierophinney weierophinney deleted the features/json-optional branch April 2, 2016 00:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant