New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

addwiki/mediawiki-api-base

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addwiki/mediawiki-api-base

Simple MediaWiki API library

Source
Packagist
This package is abandoned and is no longer maintained.
The author recommends using addwiki/addwiki instead.
This version has been yanked by its maintainers and should not be used.
Version
3.1.0
Version published
Total downloads
165K
Maintainers
1
Created
Source

mediawiki-api-base

GitHub issue custom search in repo Latest Stable Version Download count

This library provides basic access to the MediaWiki Action API. This library features simple methods allowing you to login, logout and do both GET and POST requests. This library should work with most if not all MediaWiki versions due to its simplicity.

You can find the full documentation at https://addwiki.github.io/mediawiki-api-base/

Example

A quick example can be found below:

use \Addwiki\Mediawiki\Api\Client\Auth\UserAndPassword;
use \Addwiki\Mediawiki\Api\Client\Action\MediawikiApi;

$auth = new UserAndPassword( 'username', 'password' );
$api = MediawikiApi::newFromPage( 'https://en.wikipedia.org/wiki/Berlin', $auth );
$purgeRequest = FluentRequest::factory()->setAction( 'purge' )->setParam( 'titles', 'Berlin' );
$api->postRequest( $purgeRequest );

Integration tests

Run the MediaWiki test site:

docker compose -f docker-compose-ci.yml up -d

Run the tests:

composer phpunit-integration

Destroy the site that was used for testing:

docker compose -f docker-compose-ci.yml down --volumes

Keywords

api

FAQs

Package last updated on 15 Oct 2024

Related posts