44 $this->templateParser =
new TemplateParser();
64 abstract public function outItem( $item );
86 # We take over from $wgOut, excepting its cache header info
89 header(
"Content-type: $mimetype; charset=UTF-8" );
92 $exts = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()
93 ->getExtensionsForType( $mimetype );
94 $ext = $exts ? strtok( $exts,
' ' ) :
'xml';
95 header(
"Content-Disposition: inline; filename=\"feed.{$ext}\"" );
98 $wgOut->addVaryHeader(
'X-Forwarded-Proto' );
100 $wgOut->sendCacheControl();
111 $ctype =
$wgRequest->getVal(
'ctype',
'application/xml' );
115 'application/rss+xml',
116 'application/atom+xml'
119 return ( in_array( $ctype, $allowedctypes ) ? $ctype :
'application/xml' );
127 echo
'<?xml version="1.0"?>' .
"\n";
$wgVaryOnXFP
Add X-Forwarded-Proto to the Vary and Key headers for API requests and RSS/Atom feeds.
if(! $wgDBerrorLogTZ) $wgRequest
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='')
contentType()
Return an internet media type to be sent in the headers.
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.
if(!is_readable( $file)) $ext