Core class

From Apibot
Jump to: navigation, search

This is a container class that creates and exports the objects providing the core Apibot functionality. A Core object is a required parameter 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
  • $hooks (class Hooks) - the object that maintains the Apibot internal calls hooks
  • $infostore (class Infostore) - the object that stores in files and retrieves different info (wiki etc)
  • $log (class Log) - the object that provides the bot logging facilities
  • $settings (class Settings) - the object that keeps and manages the bot global settings
  • $backends - an array with objects of descendants of the Backend class
  • $info - an Info class object

Public methods

  • log ( $message, $loglevel = LL_INFO, $logpreface = "" ) - writes a message to the bot log
  • version() - returns the Apibot version (eg. 0.40.20)
  • backend ( $name ) - returns the Backend object with this name, or NULL if no such object exists
  • available_backends_names() - returns an array with the names of the available backends (both operable and non-operable)
  • active_backends_names() - returns an array with the names of the active (can be used on this type of wiki, but might be non-operable for some reason on this specific wiki) backends
  • operable_backends_names() - returns an array with the names of the operable (able to work on this wiki, maybe not for all possible tasks) backends