+ /**
+ * This class expects the result data to be in a custom format set by self::setResult()
+ * $result['_feed'] - an instance of one of the $wgFeedClasses classes
+ * $result['_feeditems'] - an array of FeedItem instances
+ */
+ public function initPrinter( $unused = false ) {
+ parent::initPrinter( $unused );
+
+ if ( $this->isDisabled() ) {
+ return;
+ }
+
+ $data = $this->getResult()->getResultData();
+ if ( isset( $data['_feed'] ) && isset( $data['_feeditems'] ) ) {
+ $data['_feed']->httpHeaders();
+ } else {
+ // Error has occurred, print something useful
+ ApiBase::dieDebug( __METHOD__, 'Invalid feed class/item' );
+ }
+ }
+