Difference between revisions of "Info object/Allmessages"

From Apibot
Jump to: navigation, search
(userification)
m (Mains -> Core)
 
Line 1: Line 1:
The MediaWiki API Allmessages request provides information about the MediaWiki messages. The Apibot [[Info object]] (a property of the [[Mains object]]) can request it, and will consider it to be one of the types of info it provides - the "allmessages" info.
+
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 <code>infotype_element ( "info", $element )</code> function, where <code>$element</code> 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.
 
In principle, all of this info can be retrieved through the <code>infotype_element ( "info", $element )</code> function, where <code>$element</code> 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.
Line 23: Line 23:
  
 
* [[Info object]]
 
* [[Info object]]
* [[Mains object]]
+
* [[Core object]]

Latest revision as of 01:43, 10 November 2014

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.

Common

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