41 $purge =
$wgRequest->getVal(
'action' ) ===
'purge';
43 if ( $purge &&
$wgUser->isAllowed(
'purge' ) ) {
44 $cache = ObjectCache::getMainWANInstance();
45 $cache->delete( $timekey, 1 );
60 $wgOut->addWikiMsg(
'feed-unavailable' );
65 $wgOut->addWikiMsg(
'feed-invalid' );
80 $titleObj = Title::makeTitle( $row->rc_namespace, $row->rc_title );
81 $timestamp =
wfTimestamp( TS_MW, $row->rc_timestamp );
83 if ( $row->rc_type ==
RC_LOG ) {
88 $row->rc_last_oldid, $row->rc_this_oldid,
90 $row->rc_deleted & Revision::DELETED_COMMENT
91 ?
wfMessage(
'rev-deleted-comment' )->escaped()
92 : CommentStore::getStore()->getComment(
'rc_comment', $row )->text,
109 $comment, $actiontext =
''
114 $completeText =
'<p>' . implode(
' ',
124 $accErrors = $title->getUserPermissionsErrors(
'read', $anon,
true );
128 if ( $title->getNamespace() < 0 || $accErrors || !$newid ) {
129 return $completeText;
136 $rev = Revision::newFromId( $oldid );
144 $contentHandler =
$rev->getContentHandler();
145 $de = $contentHandler->createDifferenceEngine(
$context, $oldid, $newid );
146 $diffText = $de->getDiff(
149 $wgLang->timeanddate( $timestamp ),
151 $wgLang->time( $timestamp ) )->text() );
158 } elseif ( $diffText ===
false ) {
160 $diffText =
"<p>Can't load revision $newid</p>";
163 $diffText = UtfNormal\Validator::cleanUp( $diffText );
167 $rev = Revision::newFromId( $newid );
169 $newContent = ContentHandler::getForTitle( $title )->makeEmptyContent();
171 $newContent =
$rev->getContent();
176 $text = $newContent->getNativeData();
181 $html = nl2br( htmlspecialchars( $text ) );
191 if (
$html ===
null ) {
196 $diffText =
'<p><b>' .
wfMessage(
'newpage' )->text() .
'</b></p>' .
197 '<div>' .
$html .
'</div>';
200 $completeText .= $diffText;
202 return $completeText;
215 $queryParameters = [
'diff' => $newid ];
216 if ( $oldid !=
null ) {
217 $queryParameters[
'oldid'] = $oldid;
219 $diffUrl = $title->getFullURL( $queryParameters );
221 $diffLink = Html::element(
'a', [
'href' => $diffUrl ],
237 'diff' =>
'background-color: #fff; color: #222;',
238 'diff-otitle' =>
'background-color: #fff; color: #222; text-align: center;',
239 'diff-ntitle' =>
'background-color: #fff; color: #222; text-align: center;',
240 'diff-addedline' =>
'color: #222; font-size: 88%; border-style: solid; '
241 .
'border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; '
242 .
'vertical-align: top; white-space: pre-wrap;',
243 'diff-deletedline' =>
'color: #222; font-size: 88%; border-style: solid; '
244 .
'border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; '
245 .
'vertical-align: top; white-space: pre-wrap;',
246 'diff-context' =>
'background-color: #f8f9fa; color: #222; font-size: 88%; '
247 .
'border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; '
248 .
'border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;',
249 'diffchange' =>
'font-weight: bold; text-decoration: none;',
252 foreach ( $styles as $class => $style ) {
253 $text = preg_replace(
"/(<[^>]+)class=(['\"])$class\\2([^>]*>)/",
254 "\\1style=\"$style\"\\3", $text );
$wgFeedDiffCutoff
When generating Recentchanges RSS/Atom feed, diffs will not be generated for pages larger than this s...
$wgFeedClasses
Available feeds objects.
$wgFeed
Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
if(! $wgDBerrorLogTZ) $wgRequest
Helper functions for feeds.
static formatDiff( $row)
Format a diff for the newsfeed.
static checkFeedOutput( $type)
Check whether feeds can be used and that $type is a valid feed type.
static formatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext='')
Really format a diff for the newsfeed.
static checkPurge( $timekey, $key)
Check whether feed's cache should be cleared; for changes feeds If the feed should be purged; $timeke...
static applyDiffStyle( $text)
Hacky application of diff styles for the feeds.
static getDiffLink(Title $title, $newid, $oldid=null)
Generates a diff link.
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
static getMain()
Get the RequestContext object associated with the main request.
Content object implementation for representing flat text.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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 etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
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
the array() calling protocol came about after MediaWiki 1.4rc1.
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 you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
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 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 "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
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 & $html
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev