Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change API requests from deprecated PHP format to JSON format #111

Merged
merged 2 commits into from
Jul 7, 2021

Conversation

Xymph
Copy link
Collaborator

@Xymph Xymph commented Jul 7, 2021

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.

@Xymph Xymph requested a review from waldyrious July 7, 2021 17:10
Wikimate.php Show resolved Hide resolved
@waldyrious
Copy link
Collaborator

waldyrious commented Jul 7, 2021

Overall this LGTM — I don't have a setup to test it myself, but I trust that your tests are sufficient to provide some assurance that things are working as expected.

@waldyrious waldyrious merged commit 8d540ca into hamstar:master Jul 7, 2021
@waldyrious waldyrious mentioned this pull request Jul 7, 2021
@Xymph Xymph deleted the 111-switch-data-format branch July 7, 2021 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants