Go to the documentation of this file.
60 $this->format =
'atom';
63 $feedTitle =
"$wgSitename - {$title} [$wgLanguageCode]";
65 $feedTitle, htmlspecialchars( $description ), $url );
86 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
88 $timekey =
$cache->makeKey(
89 $this->
type, $this->
format, $wgLang->getCode(), $optionsHash,
'timestamp' );
90 $key =
$cache->makeKey( $this->
type, $this->
format, $wgLang->getCode(), $optionsHash );
99 $cachedFeed = $this->
loadFromCache( $lastmod, $timekey, $key );
100 if ( is_string( $cachedFeed ) ) {
101 wfDebug(
"RC: Outputting cached feed\n" );
102 $feed->httpHeaders();
105 wfDebug(
"RC: rendering new feed and caching it\n" );
108 $cachedFeed = ob_get_contents();
123 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
124 $cache->set( $key, $feed, $cache::TTL_DAY );
139 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
140 $feedLastmod =
$cache->get( $timekey );
150 $feedAge = time() -
wfTimestamp( TS_UNIX, $feedLastmod );
151 $feedLastmodUnix =
wfTimestamp( TS_UNIX, $feedLastmod );
154 if ( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix ) {
155 wfDebug(
"RC: loading feed from cache ($key; $feedLastmod; $lastmod)...\n" );
156 if ( $feedLastmodUnix < $lastmodUnix ) {
157 $wgOut->setLastModified( $feedLastmod );
159 return $cache->get( $key );
161 wfDebug(
"RC: cached feed timestamp check failed ($feedLastmod; $lastmod)\n" );
175 foreach ( $items
as $item ) {
176 $feed->outItem( $item );
189 # Merge adjacent edits by one user
199 $obj->rc_namespace >= 0 &&
200 $obj->rc_cur_id == $sorted[$n - 1]->rc_cur_id &&
201 $obj->rc_user_text == $sorted[$n - 1]->rc_user_text ) {
202 $sorted[$n - 1]->rc_last_oldid = $obj->rc_last_oldid;
209 foreach ( $sorted
as $obj ) {
212 ?
$title->getTalkPage()->getFullURL()
216 if ( $obj->rc_deleted ) {
220 if ( $obj->rc_this_oldid ) {
221 $url =
$title->getFullURL( [
222 'diff' => $obj->rc_this_oldid,
223 'oldid' => $obj->rc_last_oldid,
227 $url =
$title->getFullURL();
231 $title->getPrefixedText(),
236 ?
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.
__construct( $format, $type)
A base class for basic support for outputting syndication feeds in RSS and other formats.
$wgFeedCacheTimeout
Minimum timeout for cached Recentchanges feed, in seconds.
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 cache.
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
getFeedObject( $title, $description, $url)
Get a ChannelFeed subclass object to use.
namespace and then decline to actually register it file or subcat img or subcat $title
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static hasTalkNamespace( $index)
Does this namespace ever have a talk namespace?
static checkPurge( $timekey, $key)
Check whether feed's cache should be cleared; for changes feeds If the feed should be purged; $timeke...
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
$wgFeedClasses
Available feeds objects.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Feed to Special:RecentChanges and Special:RecentChangesLiked.
$wgLanguageCode
Site language code.
$wgSitename
Name of the site.
if the prop value should be in the metadata multi language array format
static formatDiff( $row)
Format a diff for the newsfeed.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
execute( $feed, $rows, $lastmod, $opts)
Generates feed's content.
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
$wgRenderHashAppend
Append a configured value to the parser cache and the sitenotice key so that they can be kept separat...
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 cache.
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 MediaWikiServices
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead 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 "<
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