}
/**
- * Overriding class returns the mime type that should be sent to the client.
+ * Overriding class returns the MIME type that should be sent to the client.
* This method is not called if getIsHtml() returns true.
* @return string
*/
public function getDescription() {
return $this->getIsHtml() ? ' (pretty-print in HTML)' : '';
}
+
+ /**
+ * To avoid code duplication with the deprecation of dbg, dump, txt, wddx,
+ * and yaml, this method is added to do the necessary work. It should be
+ * removed when those deprecated formats are removed.
+ */
+ protected function markDeprecated() {
+ $fm = $this->getIsHtml() ? 'fm' : '';
+ $name = $this->getModuleName();
+ $this->logFeatureUsage( "format=$name" );
+ $this->setWarning( "format=$name has been deprecated. Please use format=json$fm instead." );
+ }
}
/**
* Call this method to initialize output data. See execute()
* @param ApiResult $result
* @param object $feed An instance of one of the $wgFeedClasses classes
- * @param array $feedItems of FeedItem objects
+ * @param array $feedItems Array of FeedItem objects
*/
public static function setResult( $result, $feed, $feedItems ) {
// Store output in the Result data.