Settings class

From Apibot
Revision as of 01:30, 10 November 2014 by Grigor Gatchev (talk | contribs) (Mains -> Core)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Apibot can be configured extensively - so much that its settings deserve the support of a special module, the Settings module. It is situated in the Core module.

Like some other Core objects, this one is identity-specific. Login into another wiki or user will demand creating it anew and replacing with it the old one in the Core object.


Creating an object of the Settings class requires two parameters:

  • $settings - an array with the general bot settings
  • $account - the bot account settings structure

Public methods

  • get ( $key1, $key2 = NULL, $key3 = NULL, $key4 = NULL, $key5 = NULL ) - acquire the settings value (or array) for $key1 (and the consequent sub-keys, if not NULL)
  • get_withbackend ( $backend, $key1, $key2 = NULL, $key3 = NULL, $key4 = NULL, $key5 = NULL ) - like get(), but also checks in the result for a subkey named after this backend. If yes, removes it and merges its contents with the result. (Thus, you can have different overriding subarrays of settings for the different task backends.)