User:Krinkle/API PHP cURL example

This script is an example of how one can login the MediaWiki API, maintain a session cookie and then do something with.

In this example we request the userinfo


 * First configuration variables are defined in the $app array.
 * Then the login procedure follows. Including extensive checking for errors
 * With the cookiefile in memory and the login session active the userinfo query is done
 * As a proof of concept it

Known issues  Non that I know of, though if you spread this script over multiple files, don't forget to maintain or elaborate on the "Exit protocol" which deletes the session, or more importantly deletes the cookie file. These can stack up in your /tmp director !! 