From 9a9db531677e07ee601caa4f089844f178ea0862 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 10 Jul 2007 14:19:22 +0000 Subject: [PATCH] * Code conventions * Tweak release notes --- RELEASE-NOTES | 2 +- includes/DefaultSettings.php | 12 +++++------- includes/GlobalFunctions.php | 8 +++----- includes/Wiki.php | 3 +-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d962d81736..c5adac0ca3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -25,7 +25,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * $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 +* $wgShowHostnames - Expose server host names through the API and HTML comments == New features since 1.10 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 74ffbe4605..542a726a5a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -921,12 +921,12 @@ $wgColorErrors = true; $wgShowExceptionDetails = false; /** - * If set to true, exposes host names through API and HTML comments. + * Expose server host names through the API and various HTML comments */ $wgShowHostnames = false; - -/** * disable experimental dmoz-like category browsing. Output things like: - * Encyclopedia > Music > Style of Music > Jazz + +/** + * Use experimental, DMOZ-like category browser */ $wgUseCategoryBrowser = false; @@ -2690,6 +2690,4 @@ $wgDisableOutputCompression = false; * show a more obvious warning. */ $wgSlaveLagWarning = 10; -$wgSlaveLagCritical = 30; - - +$wgSlaveLagCritical = 30; \ No newline at end of file diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a1db8f83da..f06cd47c13 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -706,11 +706,9 @@ function wfHostname() { $now = wfTime(); $elapsed = $now - $wgRequestTime; - if ($wgShowHostnames) { - return sprintf( "", wfHostname(), $elapsed ); - } else { - return sprintf( "", $elapsed ); - } + return $wgShowHostnames + ? sprintf( "", wfHostname(), $elapsed ) + : sprintf( "", $elapsed ); } /** diff --git a/includes/Wiki.php b/includes/Wiki.php index 9593033615..897a2d4258 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -58,14 +58,13 @@ class MediaWiki { function checkMaxLag( $maxLag ) { 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' ); - if ($wgShowHostnames) { + if( $wgShowHostnames ) { echo "Waiting for $host: $lag seconds lagged\n"; } else { echo "Waiting for a database server: $lag seconds lagged\n"; -- 2.20.1