Change API requests from deprecated PHP format to JSON format #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PHP format is deprecated and only maintained for now due to its popularity. New users should stick to JSON, and some API calls like opensearch don't even support PHP format. See PR #104 for further discussion.
The Wikimate methods return nested associative arrays, which were produced by unserialize from the PHP format. Fortunately, while json_decode normally returns a stdClass object, setting the $associative flag will produce the same arrays.
Ideally this switch would be unit-tested with before/after comparisons, but that is beyond my expertise and available time. I have however run my client scripts with the switched format for a while and not encountered any issues.