* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- require_once( 'ApiBase.php' );
-}
-
/**
* API module for sending out RSD information
* @ingroup API
*/
class ApiRsd extends ApiBase {
- public function __construct( $main, $action ) {
- parent::__construct( $main, $action );
- }
-
public function execute() {
$result = $this->getResult();
$service = array( 'apis' => $this->formatRsdApiList() );
ApiResult::setContent( $service, 'MediaWiki', 'engineName' );
- ApiResult::setContent( $service, 'http://www.mediawiki.org/w/api.php', 'engineLink' );
- ApiResult::setContent( $service, 'http://www.mediawiki.org/', 'homePageLink' );
+ ApiResult::setContent( $service, 'https://www.mediawiki.org/', 'engineLink' );
+ ApiResult::setContent( $service, Title::newMainPage()->getCanonicalURL(), 'homePageLink' );
$result->setIndexedTagName( $service['apis'], 'api' );
}
public function getDescription() {
- return 'Export an RSD (Really Simple Discovery) schema';
+ return 'Export an RSD (Really Simple Discovery) schema.';
}
- protected function getExamples() {
+ public function getExamples() {
return array(
'api.php?action=rsd'
);
$apis = array(
'MediaWiki' => array(
// The API link is required for all RSD API entries.
- 'apiLink' => wfExpandUrl( wfScript( 'api' ) ),
+ 'apiLink' => wfExpandUrl( wfScript( 'api' ), PROTO_CURRENT ),
// Docs link is optional, but recommended.
- 'docs' => 'http://www.mediawiki.org/wiki/API',
+ 'docs' => 'https://www.mediawiki.org/wiki/API',
// Some APIs may need a blog ID, but it may be left blank.
'blogID' => '',
),
);
wfRunHooks( 'ApiRsdServiceApis', array( &$apis ) );
+
return $apis;
}
}
$outputData[] = $data;
}
- return $outputData;
- }
- public function getVersion() {
- return __CLASS__ . ': $Id$';
+ return $outputData;
}
}
public function getMimeType() {
return 'application/rsd+xml';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}