Info object/Allmessages

From Apibot
Jump to: navigation, search

The MediaWiki API Allmessages request provides information about the MediaWiki messages. The Apibot Info object (a property of the Core object) can request it, and will consider it to be one of the types of info it provides - the "allmessages" info.

In principle, all of this info can be retrieved through the infotype_element ( "info", $element ) function, where $element is the info element key in the site info array. (Often the info element will be array on its own, sometimes with yet more subarrays in it.) However, retrieving this info through special functions might be more convenient (and might make the bot and bot scripts PHP code more readable). A list of the implemented site info functions follows.


Elements by generic structure

  • allmessages_info() - the entire allmessages info structure
  • allmessages_info_isset() - true if the allmessages info is available, false if it is not
  • allmessages_count() - the count of the allmessages
  • allmessages_names() - the names of the allmessages
  • allmessage_by_name ( $name ) - the MediaWiki message with this name

See also