Opened 13 years ago
Closed 6 years ago
#25692 closed enhancement (duplicate)
Update /info/ API endpoints
| Reported by: | johnbillion | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Upgrade/Install | Version: | 3.7 |
| Severity: | normal | Keywords: | has-patch needs-refresh |
| Cc: | Focuses: |
Description
The /info/ API endpoints need to be updated to use JSON encoding.
Previously: #25311
Attachments (3)
Change History (8)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This isn't as simply as switching serialize() to json_encode() (and vice versa) unfortunately.
JSON doesn't support associative arrays, which the API makes use of, all associative arrays are encoded as JSON objects.
PHP's
json_decode()has support to decode all objects to associative arrays as a result, but unfortunately the API makes use of both objects and associative arrays, so using that breaks the API response formatUnfortunately this means there's only really a few options:
plugins_api()andthemes_api()$argspresentmore on #5, it'd be us adding a wrapper around
json_decode()andjson_encode()and walking over the returned arrays and if aobjectitem is present converting it to an object, something like 25692.layer.diff