hamstar / Wikimate

A MediaWiki API wrapper for PHP based wikibots that [shouldn't] be confusing to use
MIT License
57 stars 24 forks source link

Update Wikimate::token() to remember CSRF token (fixes #115) #122

Closed Xymph closed 3 years ago

Xymph commented 3 years ago

See issue #115. Storing and re-using the token reduces the number of API calls when invoking multiple edit/delete/etc actions in a session, as is typical bot behavior.

The error value of token() is also changed to null (false should only be used by boolean methods). Since token() is an internal method, I don't consider this an API-breaking change.

Xymph commented 3 years ago

Not really, but I think I'll need to rebase/push for the merge conflict first, right?

Edit: Done, conflict resolved, ready for merge.

waldyrious commented 3 years ago

I think it's nice to rebase even when there aren't conflicts, to avoid crossing branches and provide a semi-linear git graph. :)