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',
92 'docs' =>
'https://www.mediawiki.org/wiki/Special:MyLanguage/API',
120 foreach ( $apis as $name => $info ) {
123 'preferred' =>
wfBoolToStr( $name ==
'MediaWiki' ),
124 'apiLink' => $info[
'apiLink'],
125 'blogID' => $info[
'blogID'] ??
'',
128 if ( isset( $info[
'docs'] ) ) {
129 $settings[
'docs'] = $info[
'docs'];
130 ApiResult::setSubelementsList( $settings,
'docs' );
132 if ( isset( $info[
'settings'] ) ) {
133 foreach ( $info[
'settings'] as $setting => $val ) {
134 if ( is_bool( $val ) ) {
139 $setting = [
'name' => $setting ];
140 ApiResult::setContentValue( $setting,
'value', $xmlVal );
141 $settings[] = $setting;
144 if ( count( $settings ) ) {
145 ApiResult::setIndexedTagName( $settings,
'setting' );
146 $data[
'settings'] = $settings;
148 $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.
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...