From 64546878068970afd67e9bff3aafd540b1f83539 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 2 Feb 2012 20:19:20 +0000 Subject: [PATCH] Improve documentation Simplify if Fix whitespace --- includes/interwiki/Interwiki.php | 12 ++++++------ maintenance/getSlaveServer.php | 14 ++++++-------- tests/parser/parserTest.inc | 1 - 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/includes/interwiki/Interwiki.php b/includes/interwiki/Interwiki.php index e6469a1b09..3aaa1c52db 100644 --- a/includes/interwiki/Interwiki.php +++ b/includes/interwiki/Interwiki.php @@ -136,7 +136,7 @@ class Interwiki { /** * Load the interwiki, trying first memcached then the DB * - * @param $prefix The interwiki prefix + * @param $prefix string The interwiki prefix * @return Boolean: the prefix is valid */ protected static function load( $prefix ) { @@ -186,8 +186,8 @@ class Interwiki { /** * Fill in member variables from an array (e.g. memcached result, Database::fetchRow, etc) * - * @param $mc Associative array: row from the interwiki table - * @return Boolean: whether everything was there + * @param $mc array Associative array: row from the interwiki table + * @return Boolean|Interwiki whether everything was there */ protected static function loadFromArray( $mc ) { if( isset( $mc['iw_url'] ) ) { @@ -206,7 +206,7 @@ class Interwiki { /** * Fetch all interwiki prefixes from interwiki cache * - * @param $local If not null, limits output to local/non-local interwikis + * @param $local null|string If not null, limits output to local/non-local interwikis * @return Array List of prefixes * @since 1.19 */ @@ -270,7 +270,7 @@ class Interwiki { /** * Fetch all interwiki prefixes from DB * - * @param $local If not null, limits output to local/non-local interwikis + * @param $local string|null If not null, limits output to local/non-local interwikis * @return Array List of prefixes * @since 1.19 */ @@ -301,7 +301,7 @@ class Interwiki { /** * Returns all interwiki prefixes * - * @param $local If set, limits output to local/non-local interwikis + * @param $local string|null If set, limits output to local/non-local interwikis * @return Array List of prefixes * @since 1.19 */ diff --git a/maintenance/getSlaveServer.php b/maintenance/getSlaveServer.php index a9d93f1dc1..3d13bc4e59 100644 --- a/maintenance/getSlaveServer.php +++ b/maintenance/getSlaveServer.php @@ -32,15 +32,13 @@ class GetSlaveServer extends Maintenance { global $wgAllDBsAreLocalhost; if ( $wgAllDBsAreLocalhost ) { $host = 'localhost'; + } elseif ( $this->hasOption( 'group' ) ) { + $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) ); + $host = $db->getServer(); } else { - if ( $this->hasOption( 'group' ) ) { - $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) ); - $host = $db->getServer(); - } else { - $lb = wfGetLB(); - $i = $lb->getReaderIndex(); - $host = $lb->getServerName( $i ); - } + $lb = wfGetLB(); + $i = $lb->getReaderIndex(); + $host = $lb->getServerName( $i ); } $this->output( "$host\n" ); } diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index ac557a35fd..30e451b321 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -837,7 +837,6 @@ class ParserTest { 'iw_local' => 1 ), ) ); - # Update certain things in site_stats $this->db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ) ); -- 2.20.1