Go to the documentation of this file.
51 global $wgSitename, $wgLanguageCode, $wgFeedClasses;
53 if ( !isset( $wgFeedClasses[$this->
format] ) ) {
57 if ( !array_key_exists( $this->format, $wgFeedClasses ) ) {
59 $this->format =
'atom';
62 $feedTitle =
"$wgSitename - {$title} [$wgLanguageCode]";
64 $feedTitle, htmlspecialchars( $description ), $url );
78 public function execute( $feed, $rows, $lastmod, $opts ) {
85 $optionsHash = md5( serialize( $opts->getAllValues() ) ) . $wgRenderHashAppend;
86 $timekey =
wfMemcKey( $this->
type, $this->
format, $wgLang->getCode(), $optionsHash,
'timestamp' );
96 $cachedFeed = $this->
loadFromCache( $lastmod, $timekey, $key );
97 if ( is_string( $cachedFeed ) ) {
98 wfDebug(
"RC: Outputting cached feed\n" );
102 wfDebug(
"RC: rendering new feed and caching it\n" );
105 $cachedFeed = ob_get_contents();
121 $expire = 3600 * 24; # One day
139 if ( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) {
151 if ( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix ) {
152 wfDebug(
"RC: loading feed from cache ($key; $feedLastmod; $lastmod)...\n" );
153 if ( $feedLastmodUnix < $lastmodUnix ) {
154 $wgOut->setLastModified( $feedLastmod );
158 wfDebug(
"RC: cached feed timestamp check failed ($feedLastmod; $lastmod)\n" );
173 foreach ( $items
as $item ) {
174 $feed->outItem( $item );
188 # Merge adjacent edits by one user
191 foreach ( $rows
as $obj ) {
194 $obj->rc_namespace >= 0 &&
195 $obj->rc_cur_id == $sorted[
$n - 1]->rc_cur_id &&
196 $obj->rc_user_text == $sorted[
$n - 1]->rc_user_text ) {
197 $sorted[
$n - 1]->rc_last_oldid = $obj->rc_last_oldid;
204 foreach ( $sorted
as $obj ) {
207 ?
$title->getTalkPage()->getFullURL()
211 if ( $obj->rc_deleted ) {
215 if ( $obj->rc_this_oldid ) {
217 'diff' => $obj->rc_this_oldid,
218 'oldid' => $obj->rc_last_oldid,
222 $url =
$title->getFullURL();
226 $title->getPrefixedText(),
231 ?
wfMessage(
'rev-deleted-user' )->escaped() : $obj->rc_user_text,
static generateFeed( $rows, &$feed)
Generate the feed items given a row from the database, printing the feed.
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
__construct( $format, $type)
Constructor.
A base class for basic support for outputting syndication feeds in RSS and other formats.
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.
loadFromCache( $lastmod, $timekey, $key)
Try to load the feed result from $messageMemc.
wfProfileIn( $functionname)
Begin profiling of a function.
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $messageMemc
getFeedObject( $title, $description, $url)
Get a ChannelFeed subclass object to use.
wfMemcKey()
Get a cache key.
static canTalk( $index)
Can this namespace ever have a talk namespace?
wfProfileOut( $functionname='missing')
Stop profiling of a function.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
static checkPurge( $timekey, $key)
Check whether feed's cache should be cleared; for changes feeds If the feed should be purged; $timeke...
when a variable name is used in a it is silently declared as a new masking the global
Feed to Special:RecentChanges and Special:RecentChangesLiked.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
presenting them properly to the user as errors is done by the caller $title
static formatDiff( $row)
Format a diff for the newsfeed.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
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
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
execute( $feed, $rows, $lastmod, $opts)
Generates feed's content.
if the prop value should be in the metadata multi language array format
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static buildItems( $rows)
Generate the feed items given a row from the database.
static checkFeedOutput( $type)
Check whether feeds can be used and that $type is a valid feed type.
saveToCache( $feed, $timekey, $key)
Save to feed result to $messageMemc.