Go to the documentation of this file.
66 $this->uniqueId =
$url;
79 $string = str_replace(
"\r\n",
"\n", $string );
80 $string = preg_replace(
'/[\x00-\x08\x0b\x0c\x0e-\x1f]/',
'', $string );
81 return htmlspecialchars( $string );
90 if ( $this->uniqueId ) {
91 return $this->
xmlEncode( $this->uniqueId );
120 public function getUrl() {
130 return $this->
xmlEncode( $this->description );
140 return $wgLanguageCode;
158 return $this->
xmlEncode( $this->author );
167 return $this->
xmlEncode( $this->comments );
177 return preg_replace(
'/\[\[([^]]*\|)?([^]]+)\]\]/',
'\2', $text );
186 abstract class ChannelFeed
extends FeedItem {
205 abstract public function outItem( $item );
227 # We take over from $wgOut, excepting its cache header info
230 header(
"Content-type: $mimetype; charset=UTF-8" );
231 if ( $wgVaryOnXFP ) {
232 $wgOut->addVaryHeader(
'X-Forwarded-Proto' );
234 $wgOut->sendCacheControl();
246 $ctype = $wgRequest->getVal(
'ctype',
'application/xml' );
247 $allowedctypes =
array(
'application/xml',
'text/xml',
'application/rss+xml',
'application/atom+xml' );
248 return ( in_array( $ctype, $allowedctypes ) ? $ctype :
'application/xml' );
257 global $wgStylePath, $wgStyleVersion;
260 echo
'<?xml version="1.0"?>' .
"\n";
261 echo
'<?xml-stylesheet type="text/css" href="' .
272 class RSSFeed
extends ChannelFeed {
280 function formatTime( $ts ) {
291 ?><rss
version=
"2.0" xmlns:dc=
"http://purl.org/dc/elements/1.1/">
295 <description><?
php print $this->getDescription() ?></description>
296 <language><?
php print $this->getLanguage() ?></language>
311 <guid<?
php if ( !$item->rssIsPermalink ) { print
' isPermaLink="false"'; } ?>><?
php print $item->getUniqueId(); ?></guid>
312 <description><?
php print $item->getDescription() ?></description>
313 <?
php if ( $item->getDate() ) { ?><pubDate><?
php print $this->formatTime( $item->getDate() ); ?></pubDate><?
php } ?>
314 <?
php if ( $item->getAuthor() ) { ?><dc:creator><?
php print $item->getAuthor(); ?></dc:creator><?
php }?>
335 class AtomFeed extends ChannelFeed {
352 ?><feed xmlns=
"http://www.w3.org/2005/Atom" xml:lang=
"<?php print $this->getLanguage() ?>">
355 <link rel=
"self" type=
"application/atom+xml" href=
"<?php print wfExpandUrl( $this->getSelfUrl(), PROTO_CURRENT ) ?>"/>
356 <link rel=
"alternate" type=
"text/html" href=
"<?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?>"/>
358 <subtitle><?
php print $this->getDescription() ?></subtitle>
384 return htmlspecialchars( $wgRequest->getFullRequestURL() );
395 <
id><?
php print $item->getUniqueId(); ?></
id>
397 <link rel=
"alternate" type=
"<?php print $wgMimeType ?>" href=
"<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ); ?>"/>
398 <?
php if ( $item->getDate() ) { ?>
399 <updated><?
php print $this->
formatTime( $item->getDate() ); ?>Z</updated>
402 <summary
type=
"html"><?
php print $item->getDescription() ?></summary>
403 <?
php if ( $item->getAuthor() ) { ?><author><
name><?
php print $item->getAuthor(); ?></
name></author><?
php }?>
A base class for basic support for outputting syndication feeds in RSS and other formats.
getUniqueId()
Get the unique id of this item.
print $this getFeedId() print $this getTitle() print wfExpandUrl($this->getSelfUrl(), PROTO_CURRENT) print wfExpandUrl($this->getUrl(), PROTO_CURRENT) print $this formatTime(wfTimestampNow()) print $this getDescription() print $wgVersion getFeedId()
Atom 1.0 requires a unique, opaque IRI as a unique identifier for every feed we create.
outHeader()
Outputs a basic header for Atom 1.0 feeds.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getLanguage()
Get the language of this item.
static stripComment( $text)
Quickie hack...
outXmlHeader()
Output the initial XML headers with a stylesheet for legibility if someone finds it in a browser.
getTitle()
Get the title of this item; already xml-encoded.
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
getAuthor()
Get the author of this item; already xml-encoded.
contentType()
Return an internet media type to be sent in the headers.
getDate()
Get the title of this item.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
getSelfUrl()
Atom 1.0 requests a self-reference to the feed.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
outHeader()
Generate Header of the feed.
outItem( $item)
Generate an item.
setUniqueId( $uniqueId, $rssIsPermalink=false)
set the unique id of an item
getDescription()
Get the description of this item; already xml-encoded.
httpHeaders()
Setup and send HTTP headers.
getUrl()
Get the URL of this item; already xml-encoded.
ChannelFeed FeedItem xml stylesheet type
__construct( $title, $description, $url, $date='', $author='', $comments='')
Constructor.
if( $item->getDate()) print $item getDescription() if( $item->getAuthor()) outFooter()
Outputs the footer for Atom 1.0 feed (basically '</feed>').
Represents a title within MediaWiki.
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
xmlEncode( $string)
Encode $string so that it can be safely embedded in a XML document.
outFooter()
Generate Footer of the feed.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
getComments()
Get the comment of this item; already xml-encoded.
outItem( $item)
Output a given item.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.