This is an interface similar to most other MW bot interfaces (including that of Apibot 0.3x). You can find some examples on how to use it here.
It consists of a single object of the Bridge class.
Constructing the class requires passing to it a Core object:
require_once ( dirname ( __FILE__ ) . '/apibot/settings.php' ); require_once ( dirname ( __FILE__ ) . '/apibot/logins.php' ); require_once ( dirname ( __FILE__ ) . '/apibot/core/core.php' ); require_once ( dirname ( __FILE__ ) . '/apibot/interfaces/bridge/bridge.php' ); $core = new Core ( $login, $settings ); $bridge = new Bridge ( $core );
Alternatively, you can construct a "standalone" Bridge object by passing it directly the login and settings it needs. (In this case, its
Core object will be created internally.)
$bridge = new Standalone_Bridge ( $login, $settings );
This object exports the following:
$coreproperty - the bot Core object
$infoproperty - the Core Info object, shortcutted here for convenience
A lot of the Bridge methods are functions that return objects called queries. These objects are of the type Query and can return specific types of information from the wiki - the results from different submodules of the MediaWiki API Query module, or its counterpart in another Apibot backend. (Click here for more info about an Query object.)
The rest of the
Bridge class are functions that use other API modules or its counterparts for another Apibot backends. With these functions you edit the wiki, perform different actions on it etc.
log ( $message, $loglevel = LL_INFO, $preface = "" )- the standard way to log something in Apibot
xfer ( $uri, $params = array(), $files = array() )- directly fetch and/or submit something over HTTP. (Returns the fetched data, or
falseif the request failed.)