/**
  * Output a subscription feed listing recent edits to this page.
  *
  * @param $type String
  */
 protected function feed($type)
 {
     global $wgFeed, $wgFeedClasses, $wgFeedLimit;
     if (!$wgFeed) {
         $this->getOutput()->addWikiMsg('feed-unavailable');
         return;
     }
     if (!isset($wgFeedClasses[$type])) {
         $this->getOutput()->addWikiMsg('feed-invalid');
         return;
     }
     $feed = new $wgFeedClasses[$type]($this->feedTitle(), $this->msg('tagline')->text(), $this->getTitle()->getFullUrl());
     $pager = new NewPagesPager($this, $this->opts);
     $limit = $this->opts->getValue('limit');
     $pager->mLimit = min($limit, $wgFeedLimit);
     $feed->outHeader();
     if ($pager->getNumRows() > 0) {
         foreach ($pager->mResult as $row) {
             $feed->outItem($this->feedItem($row));
         }
     }
     $feed->outFooter();
 }