Core class

From Apibot
Revision as of 21:49, 21 April 2013 by Grigor Gatchev (talk | contribs) (moving the class info here)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a container class that exports the objects providing the base Apibot functionality. A Mains object is required for creating nearly every object from the Apibot interfaces.

Creation

Creating an object of this class requires two parameters:

  • $account - a MediaWiki account, as an array structure
  • $settings - bot settings array

Public properties

Best treat these properties as read-only. Do not attempt to set them unless you really know what you are doing.

  • $browser (class Browser) - the object that provides the HTTP(S) level exchange
  • $exchanger_api (class Exchanger) - the object that provides the API interface specific exchange with the wiki
  • $exchanger_web (class Exchanger) - the object that provides the web interface specific exchange with the wiki
  • $identity (class Identity) - the object that does the bot identity (account) management
  • $info (class Info) - the object that exports methods providing info about the wiki, bot account etc.
  • $infostore (class Infostore) - the object that stores in files and retrieves different info (wiki etc)
  • $settings (class Settings) - the object that keeps and manages the bot global settings
  • $log (class Log) - the object that provides the bot logging facilities
  • $tokens_api (class Tokens) - the object that collects and provides the MediaWiki API-specific action tokens
  • $tokens_web (class Tokens) - the object that collects and provides the MediaWiki web-specific action tokens
  • $wiki - a piece of the bot settings that provides the wiki settings
  • $account - a piece of the bot settings that provides the account settings

Public methods

  • login() - logs the bot in the wiki, and (re-)creates the properties $account, $wiki, $identity, $infostore and $info.
  • logout() - unlogs the bot in the wiki, and (re-)creates the properties $identity, $infostore and $info.