* $wgAddGroups, $wgRemoveGroups - Finer control over who can assign which
usergroups
* $wgEnotifImpersonal, $wgEnotifUseJobQ - Bulk mail options for large sites
+* $wgShowHostnames - Shows host names in API results and HTML comments
== New features since 1.10 ==
$wgShowExceptionDetails = false;
/**
- * disable experimental dmoz-like category browsing. Output things like:
+ * If set to true, exposes host names through API and HTML comments.
+ */
+$wgShowHostnames = false;
+
+/** * disable experimental dmoz-like category browsing. Output things like:
* Encyclopedia > Music > Style of Music > Jazz
*/
$wgUseCategoryBrowser = false;
* @return string
*/
function wfReportTime() {
- global $wgRequestTime;
+ global $wgRequestTime, $wgShowHostnames;
$now = wfTime();
$elapsed = $now - $wgRequestTime;
- $com = sprintf( "<!-- Served by %s in %01.3f secs. -->",
- wfHostname(), $elapsed );
- return $com;
+ if ($wgShowHostnames) {
+ return sprintf( "<!-- Served by %s in %01.3f secs. -->", wfHostname(), $elapsed );
+ } else {
+ return sprintf( "<!-- Served in %01.3f secs. -->", $elapsed );
+ }
}
/**
}
function checkMaxLag( $maxLag ) {
- global $wgLoadBalancer;
+ global $wgLoadBalancer, $wgShowHostnames;
+
list( $host, $lag ) = $wgLoadBalancer->getMaxLag();
if ( $lag > $maxLag ) {
header( 'HTTP/1.1 503 Service Unavailable' );
header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
header( 'X-Database-Lag: ' . intval( $lag ) );
header( 'Content-Type: text/plain' );
- echo "Waiting for $host: $lag seconds lagged\n";
+ if ($wgShowHostnames) {
+ echo "Waiting for $host: $lag seconds lagged\n";
+ } else {
+ echo "Waiting for a database server: $lag seconds lagged\n";
+ }
return false;
} else {
return true;
}
protected function appendDbReplLagInfo($property, $includeAll) {
- global $wgLoadBalancer;
+ global $wgLoadBalancer, $wgShowHostnames;
$data = array();
if ($includeAll) {
+ if (!$wgShowHostnames)
+ $this->dieUsage('Cannot view all servers info unless $wgShowHostnames is true', 'includeAllDenied');
+
global $wgDBservers;
$lags = $wgLoadBalancer->getLagTimes();
foreach( $lags as $i => $lag ) {
} else {
list( $host, $lag ) = $wgLoadBalancer->getMaxLag();
$data[] = array (
- 'host' => $host,
+ 'host' => $wgShowHostnames ? $host : '',
'lag' => $lag);
}