Use composer to install the library and all its dependencies:
composer require "addwiki/mediawiki-api:~0.3.0"
// Load all the stuff
require_once( __DIR__ . '/vendor/autoload.php' );
// Log in to a wiki
$api = new \Mediawiki\Api\MediawikiApi( 'http://localhost/w/api.php' );
$api->login( new \Mediawiki\Api\ApiUser( 'username', 'password' ) );
$services = new \Mediawiki\Api\MediawikiFactory( $api );
// Get a page
$page = $services->newPageGetter()->getFromTitle( 'Foo' );
// Edit a page
$revision = $page->getRevisions()->getLatest();
$revision->getContent()->setText( 'NewText' );
$services->newRevisionSaver()->save( $revision );
// Move a page
$services->newPageMover()->move(
$services->newPageGetter()->getFromTitle( 'FooBar' ),
new Title( 'FooBar' )
);
// Delete a page
$deleteOptions = new DeleteOptions();
$deleteOptions->setReason( 'Reason for Deletion' );
$services->newPageDeleter()->delete(
$services->newPageGetter()->getFromTitle( 'DeleteMe!' ),
$deleteOptions
);