70 $this->uniqueId =
$url;
83 $string = str_replace(
"\r\n",
"\n", $string );
84 $string = preg_replace(
'/[\x00-\x08\x0b\x0c\x0e-\x1f]/',
'', $string );
85 return htmlspecialchars( $string );
94 if ( $this->uniqueId ) {
134 return $this->
xmlEncode( $this->description );
144 return wfBCP47( $wgLanguageCode );
171 return $this->
xmlEncode( $this->comments );
181 return preg_replace(
'/\[\[([^]]*\|)?([^]]+)\]\]/',
'\2', $text );
209 abstract public function outItem( $item );
231 # We take over from $wgOut, excepting its cache header info
234 header(
"Content-type: $mimetype; charset=UTF-8" );
235 if ( $wgVaryOnXFP ) {
236 $wgOut->addVaryHeader(
'X-Forwarded-Proto' );
238 $wgOut->sendCacheControl();
250 $ctype = $wgRequest->getVal(
'ctype',
'application/xml' );
254 'application/rss+xml',
255 'application/atom+xml'
258 return ( in_array( $ctype, $allowedctypes ) ? $ctype :
'application/xml' );
266 echo
'<?xml version="1.0"?>' .
"\n";
294 ?><
rss version=
"2.0" xmlns:dc=
"http://purl.org/dc/elements/1.1/">
315 <guid<?
php if ( !$item->rssIsPermalink ) {
print ' isPermaLink="false"'; } ?>><?
php print $item->getUniqueId(); ?></guid>
316 <description><?
php print $item->getDescription() ?></description>
317 <?
php if ( $item->getDate() ) { ?><pubDate><?
php print $this->
formatTime( $item->getDate() ); ?></pubDate><?
php } ?>
318 <?
php if ( $item->getAuthor() ) { ?><dc:creator><?
php print $item->getAuthor(); ?></dc:creator><?
php }?>
360 ?><feed xmlns=
"http://www.w3.org/2005/Atom" xml:lang=
"<?php print $this->getLanguage() ?>">
363 <
link rel=
"self" type=
"application/atom+xml" href=
"<?php print wfExpandUrl( $this->getSelfUrl(), PROTO_CURRENT ) ?>"/>
364 <
link rel=
"alternate" type=
"text/html" href=
"<?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?>"/>
391 return htmlspecialchars( $wgRequest->getFullRequestURL() );
403 <
id><?
php print $item->getUniqueId(); ?></
id>
405 <
link rel=
"alternate" type=
"<?php print $wgMimeType ?>" href=
"<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ); ?>"/>
406 <?
php if ( $item->getDate() ) { ?>
410 <summary
type=
"html"><?
php print $item->getDescription() ?></summary>
outXmlHeader()
Output the initial XML headers.
outFooter()
Outputs the footer for Atom 1.0 feed (basically '\').
Class to support the outputting of syndication feeds in Atom and RSS format.
contentType()
Return an internet media type to be sent in the headers.
$wgVersion
MediaWiki version number.
httpHeaders()
Setup and send HTTP headers.
xmlEncode($string)
Encode $string so that it can be safely embedded in a XML document.
getDate()
Get the date of this item.
if(!$wgDBerrorLogTZ) $wgRequest
$wgMimeType
The default Content-Type header.
formatTime($timestamp)
Format a date given timestamp.
getComments()
Get the comment of this item; already xml-encoded.
getSelfUrl()
Atom 1.0 requests a self-reference to the feed.
when a variable name is used in a it is silently declared as a new local masking the global
wfExpandUrl($url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Allows to change the fields on the form that will be generated rss
static stripComment($text)
Quickie hack...
$wgVaryOnXFP
Add X-Forwarded-Proto to the Vary and Key headers for API requests and RSS/Atom feeds.
setUniqueId($uniqueId, $rssIsPermalink=false)
Set the unique id of an item.
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
$wgLanguageCode
Site language code.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive false for true for descending in case the handler function wants to provide a converted Content object Note that $result getContentModel() must return $toModel. 'CustomEditor'$rcid is used in generating this variable which contains information about the new such as the revision s author
getAuthor()
Get the author of this item; already xml-encoded.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
__construct($title, $description, $url, $date= '', $author= '', $comments= '')
Constructor.
wfBCP47($code)
Get the normalised IETF language tag See unit test for examples.
A base class for basic support for outputting syndication feeds in RSS and other formats.
outFooter()
Generate Footer of the feed.
getLanguage()
Get the language of this item.
outItem($item)
Generate an item.
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
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.
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
outHeader()
Generate Header of the feed.
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.
getUniqueId()
Get the unique id of this item.
getFeedId()
Atom 1.0 requires a unique, opaque IRI as a unique identifier for every feed we create.
outItem($item)
Output a given item.
getUrl()
Get the URL of this item; already xml-encoded.
getDescription()
Get the description of this item; already xml-encoded.