35 $result->addValue(
null,
'version',
'1.0' );
36 $result->addValue(
null,
'xmlns',
'http://archipelago.phrasewise.com/rsd' );
40 'engineName' =>
'MediaWiki',
41 'engineLink' =>
'https://www.mediawiki.org/',
42 'homePageLink' => Title::newMainPage()->getCanonicalURL(),
48 $result->addValue(
null,
'service', $service );
58 =>
'apihelp-rsd-example-simple',
90 'docs' =>
'https://www.mediawiki.org/wiki/Special:MyLanguage/API',
103 Hooks::run(
'ApiRsdServiceApis', [ &$apis ] );
118 foreach ( $apis as $name => $info ) {
121 'preferred' =>
wfBoolToStr( $name ==
'MediaWiki' ),
122 'apiLink' => $info[
'apiLink'],
123 'blogID' => $info[
'blogID'] ??
'',
126 if ( isset( $info[
'docs'] ) ) {
127 $settings[
'docs'] = $info[
'docs'];
130 if ( isset( $info[
'settings'] ) ) {
131 foreach ( $info[
'settings'] as $setting => $val ) {
132 if ( is_bool( $val ) ) {
137 $setting = [
'name' => $setting ];
139 $settings[] = $setting;
142 if ( count( $settings ) ) {
144 $data[
'settings'] = $settings;
146 $outputData[] = $data;
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
wfBoolToStr( $value)
Convenience function converts boolean values into "true" or "false" (string) values.
This abstract class implements many basic API functions, and is the base of all API classes.
getMain()
Get the main module.
getResult()
Get the result object.
static setSubelementsList(array &$arr, $names)
Causes the elements with the specified names to be output as subelements rather than attributes.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
API module for sending out RSD information.
isReadMode()
Indicates whether this module requires read rights.
formatRsdApiList()
Formats the internal list of exposed APIs into an array suitable to pass to the API's XML formatter.
getExamplesMessages()
Returns usage examples for this module.
getRsdApiList()
Builds an internal list of APIs to expose information about.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
getCustomPrinter()
If the module may only be used with a certain format module, it should override this method to return...