Info object/Paraminfo

From Apibot
Jump to: navigation, search

MediaWiki supports a special request that will return all info about the parameters supported by the wiki. The Apibot Info object (a property of the Core object) typically requests it, and will consider it to be one of the types of info it provides - the "param" 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

  • param_info() - the entire param info structure, as a PHP array
  • param_info_isset() - true if the param info is available, false if it is not
  • param_element ( $key ) - the param info element with this key
  • param_element_isset ( $key ) - true if this param info element is present, false if it is not
  • param_element_subs_count ( $key ) - the count of the subelements in the param info element (which presumably is an array) with this key
  • param_element_arraykeys ( $key ) - an array with the keys of the subelements in the param info element (which presumably is an array) with this key

Module data by module name

The MediaWiki API is organized into modules. Every module does a specific task. For example, the Query module allows a bot to retrieve a huge diversity of info about the wiki objects - pages, users etc. The Edit module allows editing a page. The Block module allows blocking an user. The Paraminfo module allows retrieving the info about the wiki modules - the same info that you read now how to access. And so on.

Most MediaWiki API modules belong to a module group:

  • All querymodules belong to the "querymodules" group - that is, the $rootmodulename most functions below need for them is "querymodules".
  • All proper modules (that is, all modules that are not querymodules, main module or pageset module) belong to the "modules" group - that is, the $rootmodulename most functions below need for them is "modules".
  • Main module and pageset module do not belong to a group, so you don't supply a $rootmodulename when retrieving info about them.

General

  • param_anymodules_names ( $rootmodulename = NULL ) - an array with the names (keys) of all param info modules
  • param_known_anymodules_names ( $rootmodulename = NULL ) - an array with the names (keys) of the explicitly known to Apibot param info modules (who are accessible through the specific functions below)
  • param_unknown_anymodules_names ( $rootmodulename = NULL ) - an array with the names (keys) of the param info modules that are not explicitly known to Apibot (who might be accessible only through these general functions)

Specific module generic data

  • param_anymodule ( $modulename, $rootmodulename = NULL ) - the param info structure for this param module
  • param_anymodule_exists ( $modulename, $rootmodulename = NULL ) - true if this param info module is present, false if it is not
  • param_anymodule_element ( $elementname, $modulename, $rootmodulename = NULL ) - the param info structure for the element with this name of this param module
  • param_anymodule_element_isset ( $elementname, $modulename, $rootmodulename = NULL ) - true if this element of this param info module is present, false if it is not

Specific module data fields

  • param_anymodule_classname ( $modulename, $rootmodulename = NULL ) - the classname of this param module
  • param_anymodule_description ( $modulename, $rootmodulename = NULL ) - the description of this param module
  • param_anymodule_examples ( $modulename, $rootmodulename = NULL ) - the short examples for this param module
  • param_anymodule_version ( $modulename, $rootmodulename = NULL ) - the version of this param module
  • param_anymodule_prefix ( $modulename, $rootmodulename = NULL ) - the API request parameters prefix of this param module
  • param_anymodule_readrights ( $modulename, $rootmodulename = NULL ) - true if this param info module requires read rights, false if it does not
  • param_anymodule_writerights ( $modulename, $rootmodulename = NULL ) - true if this param info module requires write rights, false if it does not
  • param_anymodule_mustbeposted ( $modulename, $rootmodulename = NULL ) - true if this param info module requires the HTTP request to be sent via POST method, false if it does not
  • param_anymodule_generator ( $modulename, $rootmodulename = NULL ) - true if this param info module is generator, false if it is not
  • param_anymodule_helpurls ( $modulename, $rootmodulename = NULL ) - the help URLs of this param module
  • param_anymodule_allexamples ( $modulename, $rootmodulename = NULL ) - all examples of this param module
  • param_anymodule_parameters ( $modulename, $rootmodulename = NULL ) - the parameters descriptions (as an array) of this param module
  • param_anymodule_errors ( $modulename, $rootmodulename = NULL ) - all errors this param module can return
  • param_anymodule_querytype ( $modulename, $rootmodulename = NULL ) - the query type of this param module

Specific module parameters and their elements

  • param_anymodule_parameters_names ( $modulename, $rootmodulename = NULL ) - the names of all parameters of this param module
  • param_anymodule_parameter ( $paramname, $modulename, $rootmodulename = NULL ) - the paraminfo generic structure for this parameter of this param module
  • param_anymodule_parameter_element ( $elementname, $paramname, $modulename, $rootmodulename = NULL ) - this element in the paraminfo generic structure for this parameter of this param module
  • param_anymodule_parameter_element_isset ( $elementname, $paramname, $modulename, $rootmodulename = NULL ) - true if this element in the paraminfo generic structure for this parameter of this param module is set, false if it is not
  • param_anymodule_parameter_description ( $paramname, $modulename, $rootmodulename = NULL ) - the description of this parameter of this param module
  • param_anymodule_parameter_multi ( $paramname, $modulename, $rootmodulename = NULL ) - true if this parameter of this param module allows multiple values, false if it does not
  • param_anymodule_parameter_required ( $paramname, $modulename, $rootmodulename = NULL ) - true if this parameter of this param module is mandatory, false if it does not
  • param_anymodule_parameter_allowsduplicates ( $paramname, $modulename, $rootmodulename = NULL ) - true if this parameter of this param module allows duplicating values, false if it does not
  • param_anymodule_parameter_limit ( $paramname, $modulename, $rootmodulename = NULL ) - the limit for the number of the values for this parameter of this param module
  • param_anymodule_parameter_lowlimit ( $paramname, $modulename, $rootmodulename = NULL ) - the limit for the number of the values for this parameter of this param module, for limited accounts
  • param_anymodule_parameter_highlimit ( $paramname, $modulename, $rootmodulename = NULL ) - the limit for the number of the values for this parameter of this param module, for accounts with the "highlimits" right (typically bots)
  • param_anymodule_parameter_default ( $paramname, $modulename, $rootmodulename = NULL ) - the default value for this parameter of this param module
  • param_anymodule_parameter_max ( $paramname, $modulename, $rootmodulename = NULL ) - the maximal value for this parameter of this param module
  • param_anymodule_parameter_highmax ( $paramname, $modulename, $rootmodulename = NULL ) - the maximal value for this parameter of this param module, for accounts with the "highlimits" right (typically bots)
  • param_anymodule_parameter_min ( $paramname, $modulename, $rootmodulename = NULL ) - the minimal value for this parameter of this param module
  • param_anymodule_parameter_type ( $paramname, $modulename, $rootmodulename = NULL ) - the type of this parameter of this param module (eg. "integer", "string", "boolean", "namespace"...)

Specific module errors

  • param_anymodule_errors_codes ( $modulename, $rootmodulename = NULL ) - the codes of all errors that can be returned by this param module
  • param_anymodule_error ( $code, $modulename, $rootmodulename = NULL ) - the generic info structure for the error with this code, by this param module
  • param_anymodule_error_info ( $code, $modulename, $rootmodulename = NULL ) - the info string for the error with this code, by this param module

Mainmodule

  • param_mainmodule() - the mainmodule param info structure (may be missing in too old MW versions)
  • param_mainmodule_exists() - true if the mainmodule param info is available, false if it is not
  • param_mainmodule_classname() - the mainmodule class name
  • param_mainmodule_description() - the mainmodule description
  • param_mainmodule_examples() - the mainmodule examples
  • param_mainmodule_version() - the mainmodule version
  • param_mainmodule_prefix() - the mainmodule API request parameters prefix
  • param_mainmodule_helpurls() - the mainmodule help URLs
  • param_mainmodule_allexamples() - the mainmodule all examples element
  • param_mainmodule_parameters() - the mainmodule parameters
  • param_mainmodule_errors() - the mainmodule errors
  • param_mainmodule_parameters_names() - the names of all parameters of the mainmodule
  • param_mainmodule_parameter ( $paramname ) - the paraminfo generic structure for this parameter
  • param_mainmodule_parameter_description ( $paramname ) - the description of this parameter
  • param_mainmodule_parameter_default ( $paramname ) - the default value for this parameter
  • param_mainmodule_parameter_type ( $paramname ) - the type of this parameter
  • param_mainmodule_errors_codes() - the codes of all errors that can be returned by the mainmodule
  • param_mainmodule_error ( $code ) - the generic info structure for the error with this code
  • param_mainmodule_error_info ( $code ) - the info string for the error with this code

Pagesetmodule

  • param_pagesetmodule() - the pagesetmodule param info structure (may be missing in too old MW versions)
  • param_pagesetmodule_exists() - true if the pagesetmodule param info is available, false if it is not
  • param_pagesetmodule_classname() - the pagesetmodule class name
  • param_pagesetmodule_description() - the pagesetmodule description
  • param_pagesetmodule_examples() - the pagesetmodule examples
  • param_pagesetmodule_version() - the pagesetmodule version
  • param_pagesetmodule_readrights() - true if the pagesetmodule requires read rights, false if it does not
  • param_pagesetmodule_prefix() - the pagesetmodule API request parameters prefix
  • param_pagesetmodule_helpurls() - the pagesetmodule help URLs
  • param_pagesetmodule_allexamples() - the pagesetmodule all examples element
  • param_pagesetmodule_parameters() - the pagesetmodule parameters
  • param_pagesetmodule_errors() - the pagesetmodule errors
  • param_pagesetmodule_parameters_names() - the names of all parameters of the pagesetmodule
  • param_pagesetmodule_parameter ( $paramname ) - the paraminfo generic structure for this parameter
  • param_pagesetmodule_parameter_description ( $paramname ) - the description of this parameter
  • param_pagesetmodule_parameter_multi ( $paramname ) - true if this parameter allows multiple values, false if it does not
  • param_pagesetmodule_parameter_limit ( $paramname ) - the limit for the number of the values for this parameter
  • param_pagesetmodule_parameter_lowlimit ( $paramname ) - the limit for the number of the values for this parameter, for limited accounts
  • param_pagesetmodule_parameter_highlimit ( $paramname ) - the limit for the number of the values for this parameter, for accounts with the "highlimits" right (typically bots)
  • param_pagesetmodule_parameter_type ( $paramname ) - the type of this parameter
  • param_pagesetmodule_errors_codes() - the codes of all errors that can be returned by the pagesetmodule
  • param_pagesetmodule_error ( $code ) - the generic info structure for the error with this code
  • param_pagesetmodule_error_info ( $code ) - the info string for the error with this code

Proper modules

(These are the MediaWiki API modules per se - mainmodule, pagesetmodule and querymodules are not included here.)

General

  • param_modules_names() - an array with the names (keys) of all param info (proper) modules

Specific module generic data

  • param_module ( $modulename ) - the param info structure for this param module
  • param_module_exists ( $modulename ) - true if this module is present, false if it is not

Specific module data fields

  • param_module_classname ( $modulename ) - the classname of this param module
  • param_module_description ( $modulename ) - the description of this param module
  • param_module_examples ( $modulename ) - the short examples for this param module
  • param_module_version ( $modulename ) - the version of this param module
  • param_module_prefix ( $modulename ) - the API request parameters prefix of this param module
  • param_module_readrights ( $modulename ) - true if this param info module requires read rights, false if it does not
  • param_module_writerights ( $modulename ) - true if this param info module requires write rights, false if it does not
  • param_module_mustbeposted ( $modulename ) - true if this param info module requires the HTTP request to be sent via POST method, false if it does not
  • param_module_generator ( $modulename ) - true if this param info module is generator, false if it is not
  • param_module_helpurls ( $modulename ) - the help URLs of this param module
  • param_module_allexamples ( $modulename ) - all examples of this param module
  • param_module_parameters ( $modulename ) - the parameters descriptions (as an array) of this param module
  • param_module_errors ( $modulename ) - all errors this param module can return

Specific module parameters and their elements

  • param_module_parameters_names ( $modulename ) - the names of all parameters of this param module
  • param_module_parameter ( $paramname, $modulename ) - the paraminfo generic structure for this parameter
  • param_module_parameter_description ( $paramname, $modulename ) - the description of this parameter
  • param_module_parameter_multi ( $paramname, $modulename ) - true if this parameterallows multiple values, false if it does not
  • param_module_parameter_required ( $paramname, $modulename ) - true if this parameter is mandatory, false if it does not
  • param_module_parameter_allowsduplicates ( $paramname, $modulename ) - true if this parameter allows duplicating values, false if it does not
  • param_module_parameter_limit ( $paramname, $modulename ) - the limit for the number of the values for this parameter
  • param_module_parameter_lowlimit ( $paramname, $modulename ) - the limit for the number of the values for this parameter, for limited accounts
  • param_module_parameter_highlimit ( $paramname, $modulename ) - the limit for the number of the values for this parameter, for accounts with the "highlimits" right (typically bots)
  • param_module_parameter_default ( $paramname, $modulename ) - the default value for this parameter
  • param_module_parameter_max ( $paramname, $modulename ) - the maximal value for this parameter
  • param_module_parameter_highmax ( $paramname, $modulename ) - the maximal value for this parameter, for accounts with the "highlimits" right (typically bots)
  • param_module_parameter_min ( $paramname, $modulename ) - the minimal value for this parameter of this param module
  • param_module_parameter_type ( $paramname, $modulename ) - the type of this parameter

Specific module errors

  • param_module_errors_codes ( $modulename ) - the codes of all errors that can be returned by this param module
  • param_module_error ( $code, $modulename ) - the generic info structure for the error with this code
  • param_module_error_info ( $code, $modulename ) - the info string for the error with this code

Querymodules

General

  • param_querymodules_names() - an array with the names (keys) of all param info querymodules

Specific querymodule generic data

  • param_querymodule ( $modulename ) - the param info structure for this querymodule
  • param_querymodule_exists ( $modulename ) - true if this querymodule is present, false if it is not

Specific querymodule data fields

  • param_querymodule_classname ( $modulename ) - the classname of this querymodule
  • param_querymodule_description ( $modulename ) - the description of this querymodule
  • param_querymodule_examples ( $modulename ) - the short examples for this querymodule
  • param_querymodule_version ( $modulename ) - the version of this querymodule
  • param_querymodule_prefix ( $modulename ) - the API request parameters prefix of this querymodule
  • param_querymodule_readrights ( $modulename ) - true if this querymodule requires read rights, false if it does not
  • param_querymodule_writerights ( $modulename ) - true if this querymodule requires write rights, false if it does not
  • param_querymodule_mustbeposted ( $modulename ) - true if this querymodule requires the HTTP request to be sent via POST method, false if it does not
  • param_querymodule_generator ( $modulename ) - true if this querymodule is generator, false if it is not
  • param_querymodule_helpurls ( $modulename ) - the help URLs of this querymodule
  • param_querymodule_allexamples ( $modulename ) - all examples of this querymodule
  • param_querymodule_parameters ( $modulename ) - the parameters descriptions (as an array) of this querymodule
  • param_module_errors ( $modulename ) - all errors this param module can return

Specific querymodule parameters and their elements

  • param_querymodule_parameters_names ( $modulename ) - the names of all parameters of this querymodule
  • param_querymodule_parameter ( $paramname, $modulename ) - the paraminfo generic structure for this parameter
  • param_querymodule_parameter_description ( $paramname, $modulename ) - the description of this parameter
  • param_querymodule_parameter_multi ( $paramname, $modulename ) - true if this parameter allows multiple values, false if it does not
  • param_querymodule_parameter_required ( $paramname, $modulename ) - true if this parameter is mandatory, false if it does not
  • param_querymodule_parameter_allowsduplicates ( $paramname, $modulename ) - true if this parameter allows duplicating values, false if it does not
  • param_querymodule_parameter_limit ( $paramname, $modulename ) - the limit for the number of the values for this parameter
  • param_querymodule_parameter_lowlimit ( $paramname, $modulename ) - the limit for the number of the values for this parameter, for limited accounts
  • param_querymodule_parameter_highlimit ( $paramname, $modulename ) - the limit for the number of the values for this parameter, for accounts with the "highlimits" right (typically bots)
  • param_querymodule_parameter_default ( $paramname, $modulename ) - the default value for this parameter
  • param_querymodule_parameter_max ( $paramname, $modulename ) - the maximal value for this parameter
  • param_querymodule_parameter_highmax ( $paramname, $modulename ) - the maximal value for this parameter, for accounts with the "highlimits" right (typically bots)
  • param_querymodule_parameter_min ( $paramname, $modulename ) - the minimal value for this parameter
  • param_querymodule_parameter_type ( $paramname, $modulename ) - the type of this parameter

Specific querymodule errors

  • param_querymodule_errors_codes ( $modulename ) - the codes of all errors that can be returned by this querymodule
  • param_querymodule_error ( $code, $modulename ) - the generic info structure for the error with this code
  • param_querymodule_error_info ( $code, $modulename ) - the info string for the error with this code

See also