37 $result->addValue(
null,
'version',
'1.0' );
38 $result->addValue(
null,
'xmlns',
'http://archipelago.phrasewise.com/rsd' );
42 'engineName' =>
'MediaWiki',
43 'engineLink' =>
'https://www.mediawiki.org/',
44 'homePageLink' => Title::newMainPage()->getCanonicalURL(),
47 ApiResult::setSubelementsList( $service, [
'engineName',
'engineLink',
'homePageLink' ] );
48 ApiResult::setIndexedTagName( $service[
'apis'],
'api' );
50 $result->addValue(
null,
'service', $service );
60 =>
'apihelp-rsd-example-simple',
87 $urlUtils = MediaWikiServices::getInstance()->getUrlUtils();
94 'docs' =>
'https://www.mediawiki.org/wiki/Special:MyLanguage/API',
122 foreach ( $apis as $name => $info ) {
125 'preferred' =>
wfBoolToStr( $name ==
'MediaWiki' ),
126 'apiLink' => $info[
'apiLink'],
127 'blogID' => $info[
'blogID'] ??
'',
130 if ( isset( $info[
'docs'] ) ) {
131 $settings[
'docs'] = $info[
'docs'];
132 ApiResult::setSubelementsList( $settings,
'docs' );
134 if ( isset( $info[
'settings'] ) ) {
135 foreach ( $info[
'settings'] as $setting => $val ) {
136 if ( is_bool( $val ) ) {
141 $setting = [
'name' => $setting ];
142 ApiResult::setContentValue( $setting,
'value', $xmlVal );
143 $settings[] = $setting;
146 if ( count( $settings ) ) {
147 ApiResult::setIndexedTagName( $settings,
'setting' );
148 $data[
'settings'] = $settings;
150 $outputData[] = $data;
wfScript( $script='index')
Get the URL path to a MediaWiki entry point.
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.
getHookRunner()
Get an ApiHookRunner for running core API hooks.
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...