74 abstract public function outItem( $item );
95 $varyOnXFP = MediaWikiServices::getInstance()->getMainConfig()
96 ->get( MainConfigNames::VaryOnXFP );
97 # We take over from $wgOut, excepting its cache header info
99 $mimetype = $this->contentType();
100 header(
"Content-type: $mimetype; charset=UTF-8" );
103 $mimeAnalyzer = MediaWikiServices::getInstance()->getMimeAnalyzer();
104 $ext = $mimeAnalyzer->getExtensionFromMimeTypeOrNull( $mimetype ) ??
'xml';
105 header(
"Content-Disposition: inline; filename=\"feed.{$ext}\"" );
108 $wgOut->addVaryHeader(
'X-Forwarded-Proto' );
110 $wgOut->sendCacheControl();
120 private function contentType() {
123 $ctype =
$wgRequest->getVal(
'ctype',
'application/xml' );
127 'application/rss+xml',
128 'application/atom+xml'
131 return ( in_array( $ctype, $allowedctypes ) ? $ctype :
'application/xml' );
139 echo
'<?xml version="1.0"?>' .
"\n";
if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode $wgOut
Class to support the outputting of syndication feeds in Atom and RSS format.
outFooter()
Generate Footer of the feed.
TemplateParser $templateParser
outHeader()
Generate Header of the feed.
__construct( $title, $description, $url, $date='', $author='', $comments='')
httpHeaders()
Setup and send HTTP headers.
outItem( $item)
Generate an item.
outXmlHeader()
Output the initial XML headers.
A base class for outputting syndication feeds (e.g.
A class containing constants representing the names of configuration variables.
if(!is_readable( $file)) $ext