Go to the documentation of this file.
68 $this->uniqueId =
$url;
81 $string = str_replace(
"\r\n",
"\n", $string );
82 $string = preg_replace(
'/[\x00-\x08\x0b\x0c\x0e-\x1f]/',
'', $string );
83 return htmlspecialchars( $string );
92 if ( $this->uniqueId ) {
132 return $this->
xmlEncode( $this->description );
160 return $this->
xmlEncode( $this->author );
169 return $this->
xmlEncode( $this->comments );
179 return preg_replace(
'/\[\[([^]]*\|)?([^]]+)\]\]/',
'\2', $text );
189 abstract class ChannelFeed
extends FeedItem {
207 abstract public function outItem( $item );
229 # We take over from $wgOut, excepting its cache header info
232 header(
"Content-type: $mimetype; charset=UTF-8" );
236 $ext = $exts ? strtok( $exts,
' ' ) :
'xml';
237 header(
"Content-Disposition: inline; filename=\"feed.{$ext}\"" );
240 $wgOut->addVaryHeader(
'X-Forwarded-Proto' );
242 $wgOut->sendCacheControl();
253 $ctype =
$wgRequest->getVal(
'ctype',
'application/xml' );
257 'application/rss+xml',
258 'application/atom+xml'
261 return ( in_array( $ctype, $allowedctypes ) ? $ctype :
'application/xml' );
269 echo
'<?xml version="1.0"?>' .
"\n";
278 class RSSFeed
extends ChannelFeed {
286 function formatTime( $ts ) {
287 return gmdate(
'D, d M Y H:i:s \G\M\T',
wfTimestamp( TS_UNIX, $ts ) );
297 ?><
rss version=
"2.0" xmlns:dc=
"http://purl.org/dc/elements/1.1/">
301 <description><?
php print $this->getDescription() ?></description>
304 <lastBuildDate><?
php print $this->formatTime(
wfTimestampNow() ) ?></lastBuildDate>
318 <guid<?
php if ( !$item->rssIsPermalink ) { print
' isPermaLink="false"'; } ?>><?
php print $item->getUniqueId(); ?></guid>
319 <description><?
php print $item->getDescription() ?></description>
320 <?
php if ( $item->getDate() ) { ?><pubDate><?
php print $this->formatTime( $item->getDate() ); ?></pubDate><?
php } ?>
321 <?
php if ( $item->getAuthor() ) { ?><dc:creator><?
php print $item->getAuthor(); ?></dc:creator><?
php }?>
352 return gmdate(
'Y-m-d\TH:i:s',
wfTimestamp( TS_UNIX, $timestamp ) );
363 ?><feed xmlns=
"http://www.w3.org/2005/Atom" xml:lang=
"<?php print $this->getLanguage() ?>">
366 <
link rel=
"self" type=
"application/atom+xml" href=
"<?php print wfExpandUrl( $this->getSelfUrl(), PROTO_CURRENT ) ?>"/>
367 <
link rel=
"alternate" type=
"text/html" href=
"<?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?>"/>
369 <subtitle><?
php print $this->getDescription() ?></subtitle>
394 return htmlspecialchars(
$wgRequest->getFullRequestURL() );
406 <
id><?
php print $item->getUniqueId(); ?></
id>
408 <
link rel=
"alternate" type=
"<?php print $wgMimeType ?>" href=
"<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ); ?>"/>
409 <?
php if ( $item->getDate() ) { ?>
410 <updated><?
php print $this->
formatTime( $item->getDate() ); ?>Z</updated>
413 <summary
type=
"html"><?
php print $item->getDescription() ?></summary>
414 <?
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.
wfBCP47( $code)
Get the normalised IETF language tag See unit test for examples.
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
outHeader()
Outputs a basic header for Atom 1.0 feeds.
$wgMimeType
The default Content-Type header.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
$wgVersion
MediaWiki version number.
Allows to change the fields on the form that will be generated rss
getLanguage()
Get the language of this item.
static stripComment( $text)
Quickie hack...
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template to be included in the link
getTitle()
Get the title of this item; already xml-encoded.
ChannelFeed FeedItem print $this getTitle() print wfExpandUrl($this->getUrl(), PROTO_CURRENT) print $this getDescription() print $this getLanguage() print $wgVersion print $this formatTime(wfTimestampNow()) outItem( $item)
Class to support the outputting of syndication feeds in Atom and RSS format.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
contentType()
Return an internet media type to be sent in the headers.
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.
outXmlHeader()
Output the initial XML headers.
getDate()
Get the date of this item.
$wgVaryOnXFP
Add X-Forwarded-Proto to the Vary and Key headers for API requests and RSS/Atom feeds.
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.
static singleton()
Get an instance of this class.
formatTime( $timestamp)
Format a date given timestamp.
outHeader()
Generate Header of the feed.
setUniqueId( $uniqueId, $rssIsPermalink=false)
Set the unique id of an item.
getDescription()
Get the description of this item; already xml-encoded.
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of either verbatim or with modifications and or translated into another language(Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying
getUrl()
Get the URL of this item; already xml-encoded.
$wgLanguageCode
Site language code.
__construct( $title, $description, $url, $date='', $author='', $comments='')
if( $item->getDate()) print $item getDescription() if( $item->getAuthor()) outFooter()
Outputs the footer for Atom 1.0 feed (basically '</feed>').
httpHeaders()
Setup and send HTTP headers.
Represents a title within MediaWiki.
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
if(! $wgDBerrorLogTZ) $wgRequest
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.