47 $mainConfig = MediaWikiServices::getInstance()->getMainConfig();
48 $useRCPatrol = $mainConfig->get( MainConfigNames::UseRCPatrol );
49 $useNPPatrol = $mainConfig->get( MainConfigNames::UseNPPatrol );
50 $localInterwikis = $mainConfig->get( MainConfigNames::LocalInterwikis );
51 $canonicalServer = $mainConfig->get( MainConfigNames::CanonicalServer );
52 $script = $mainConfig->get( MainConfigNames::Script );
59 if ( $attribs[
'rc_type'] ==
RC_LOG ) {
66 $title = $titleObj->getPrefixedText();
69 if ( $attribs[
'rc_type'] ==
RC_LOG ) {
72 $url = $canonicalServer . $script;
73 if ( $attribs[
'rc_type'] ==
RC_NEW ) {
74 $query =
'?oldid=' . $attribs[
'rc_this_oldid'];
76 $query =
'?diff=' . $attribs[
'rc_this_oldid'] .
'&oldid=' . $attribs[
'rc_last_oldid'];
78 if ( $useRCPatrol || ( $attribs[
'rc_type'] ==
RC_NEW && $useNPPatrol ) ) {
79 $query .=
'&rcid=' . $attribs[
'rc_id'];
86 if ( $attribs[
'rc_old_len'] !==
null && $attribs[
'rc_new_len'] !==
null ) {
87 $szdiff = $attribs[
'rc_new_len'] - $attribs[
'rc_old_len'];
88 if ( $szdiff < -500 ) {
89 $szdiff =
"\002$szdiff\002";
90 } elseif ( $szdiff >= 0 ) {
91 $szdiff =
'+' . $szdiff;
94 $szdiff =
'(' . $szdiff .
')';
101 if ( $attribs[
'rc_type'] ==
RC_LOG ) {
102 $targetText = $rc->
getTitle()->getPrefixedText();
105 "[[\00302$targetText\00310]]",
108 $flag = $attribs[
'rc_log_action'];
110 $store = MediaWikiServices::getInstance()->getCommentStore();
113 if ( !$attribs[
'rc_patrolled']
114 && ( $useRCPatrol || $attribs[
'rc_type'] ==
RC_NEW && $useNPPatrol )
118 $flag .= ( $attribs[
'rc_type'] ==
RC_NEW ?
"N" :
"" )
119 . ( $attribs[
'rc_minor'] ?
"M" :
"" ) . ( $attribs[
'rc_bot'] ?
"B" :
"" );
122 if ( $feed[
'add_interwiki_prefix'] ===
true && $localInterwikis ) {
124 $prefix = $localInterwikis[0];
125 } elseif ( $feed[
'add_interwiki_prefix'] ) {
126 $prefix = $feed[
'add_interwiki_prefix'];
130 if ( $prefix !==
false ) {
131 $titleString =
"\00314[[\00303$prefix:\00307$title\00314]]";
133 $titleString =
"\00314[[\00307$title\00314]]";
137 # no colour (\003) switches back to the term default
138 $fullString =
"$titleString\0034 $flag\00310 " .
139 "\00302$url\003 \0035*\003 \00303$user\003 \0035*\003 $szdiff \00310$comment\003\n";
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
A class containing constants representing the names of configuration variables.
Utility class for creating new RC entries.
static decodeCharReferences( $text)
Decode any character references, numeric or named entities, in the text and return a UTF-8 string.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.