Open jimsafley opened 7 years ago
The only way I've found to get the MediaWiki version from the API:
$params = array('meta' => 'siteinfo');
$response = $this->query($params);
preg_match('/MediaWiki ([\d\.]+)/i', $response['query']['general']['generator'], $matches);
// $matches[1] should be the version
We could use version_compare() to test for compatibility.
See https://www.mediawiki.org/wiki/API:Login
Since MediaWiki 1.27.0 the
login
action has been deprecated in favor of the newclientlogin
action. We've already seen an inconsistency in the API result (see #25) but we need to prepare forlogin
's eventual removal.In
Scripto_Service_MediaWiki::login()
we'll need to replace the existinglogin
requests with theclientlogin
interactive flow:On top of this we'll need a way to determine when to use the
login
action for older installations.