== Configuration changes since 1.10 ==
-
== New features since 1.10 ==
* (bug 8868) Separate "blocked" message for autoblocks
* Adding expiry of block to block messages
* Bulk mail options ($wgEnotifImpersonal, $wgEnotifUseJobQ) for large sites
-* Links to redirect pages in categories are wrapped in <span
- class="redirect-in-category"></span>
-* New hook "ImageOpenShowImageInlineBefore" in ImagePage.php in openShowImage()
+* Links to redirect pages in categories are wrapped in
+ <span class="redirect-in-category"></span>
+* Introduced 'ImageOpenShowImageInlineBefore' hook; see docs/hooks.txt for
+ more information
+* (bug 9628) Show warnings about slave lag on Special:Contributions,
+ Special:Watchlist
== Bugfixes since 1.10 ==
* to ensure that client-side caches don't keep obsolete copies of global
* styles.
*/
-$wgStyleVersion = '71';
+$wgStyleVersion = '72';
# Server-side caching:
public function showNewSectionLink() {
return $this->mNewSectionLink;
}
+
+ /**
+ * Show a warning about slave lag
+ *
+ * If the lag is higher than 30 seconds, then the warning is
+ * a bit more obvious
+ *
+ * @param int $lag Slave lag
+ */
+ public function showLagWarning( $lag ) {
+ $message = $lag >= 30 ? 'lag-warn-high' : 'lag-warn-normal';
+ $warning = wfMsgHtml( $message, htmlspecialchars( $lag ) );
+ $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
+ }
+
}
-?>
+
+?>
\ No newline at end of file
wfProfileOut( __METHOD__ );
return $ret;
}
+
+ /**
+ * Get the Database object in use
+ *
+ * @return Database
+ */
+ public function getDatabase() {
+ return $this->mDb;
+ }
+
}
/**
$wgOut->addWikiText( wfMsg( 'nocontribs' ) );
return;
}
+
+ # Show a message about slave lag, if applicable
+ if( ( $lag = $pager->getDatabase()->getLag() ) > 0 )
+ $wgOut->showLagWarning( $lag );
+
$wgOut->addHTML(
'<p>' . $pager->getNavigationBar() . '</p>' .
$pager->getBody() .
$wgLang->formatNum( $npages ), '',
$specialTitle->getFullUrl( 'edit=yes' ) );
$wgOut->addWikiText( $header );
+
+ # Show a message about slave lag, if applicable
+ if( ( $lag = $dbr->getLag() ) > 0 )
+ $wgOut->showLagWarning( $lag );
if ( $wgEnotifWatchlist && $wgShowUpdatedMarker ) {
$wgOut->addHTML( '<form action="' .
'livepreview-failed' => "Live preview failed!\nTry normal preview.",
'livepreview-error' => "Failed to connect: $1 \"$2\"\nTry normal preview.",
+# Friendlier slave lag warnings
+'lag-warn-normal' => 'Changes newer than $1 seconds may not be shown in this list.',
+'lag-warn-high' => 'Due to high database server lag, changes newer than $1 seconds
+may not be shown in this list.',
+
);
?>
float: right;
}
+/* Friendlier slave lag warnings */
+div.mw-lag-warn-normal,
+div.mw-lag-warn-high {
+ width: 75%;
+ padding: 3px;
+ text-align: center;
+ margin: 3px auto;
+}
+div.mw-lag-warn-normal {
+ border: 1px solid #FFCC66;
+ background-color: #FFFFCC;
+}
+div.mw-lag-warn-high {
+ font-weight: bold;
+ border: 2px solid #CC3333;
+ background-color: #CC9999;
+}
+
/**
* Here is some stuff that's ACTUALLY COMMON TO ALL SKINS.
* When the day comes, it can be moved to a *real* common.css.