r110609 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110608‎ | r110609 | r110610 >
Date:20:19, 2 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Improve documentation

Simplify if

Fix whitespace
Modified paths:
  • /trunk/phase3/includes/interwiki/Interwiki.php (modified) (history)
  • /trunk/phase3/maintenance/getSlaveServer.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/getSlaveServer.php
@@ -32,15 +32,13 @@
3333 global $wgAllDBsAreLocalhost;
3434 if ( $wgAllDBsAreLocalhost ) {
3535 $host = 'localhost';
 36+ } elseif ( $this->hasOption( 'group' ) ) {
 37+ $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) );
 38+ $host = $db->getServer();
3639 } else {
37 - if ( $this->hasOption( 'group' ) ) {
38 - $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) );
39 - $host = $db->getServer();
40 - } else {
41 - $lb = wfGetLB();
42 - $i = $lb->getReaderIndex();
43 - $host = $lb->getServerName( $i );
44 - }
 40+ $lb = wfGetLB();
 41+ $i = $lb->getReaderIndex();
 42+ $host = $lb->getServerName( $i );
4543 }
4644 $this->output( "$host\n" );
4745 }
Index: trunk/phase3/tests/parser/parserTest.inc
@@ -837,7 +837,6 @@
838838 'iw_local' => 1 ),
839839 ) );
840840
841 -
842841 # Update certain things in site_stats
843842 $this->db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ) );
844843
Index: trunk/phase3/includes/interwiki/Interwiki.php
@@ -136,7 +136,7 @@
137137 /**
138138 * Load the interwiki, trying first memcached then the DB
139139 *
140 - * @param $prefix The interwiki prefix
 140+ * @param $prefix string The interwiki prefix
141141 * @return Boolean: the prefix is valid
142142 */
143143 protected static function load( $prefix ) {
@@ -186,8 +186,8 @@
187187 /**
188188 * Fill in member variables from an array (e.g. memcached result, Database::fetchRow, etc)
189189 *
190 - * @param $mc Associative array: row from the interwiki table
191 - * @return Boolean: whether everything was there
 190+ * @param $mc array Associative array: row from the interwiki table
 191+ * @return Boolean|Interwiki whether everything was there
192192 */
193193 protected static function loadFromArray( $mc ) {
194194 if( isset( $mc['iw_url'] ) ) {
@@ -206,7 +206,7 @@
207207 /**
208208 * Fetch all interwiki prefixes from interwiki cache
209209 *
210 - * @param $local If not null, limits output to local/non-local interwikis
 210+ * @param $local null|string If not null, limits output to local/non-local interwikis
211211 * @return Array List of prefixes
212212 * @since 1.19
213213 */
@@ -270,7 +270,7 @@
271271 /**
272272 * Fetch all interwiki prefixes from DB
273273 *
274 - * @param $local If not null, limits output to local/non-local interwikis
 274+ * @param $local string|null If not null, limits output to local/non-local interwikis
275275 * @return Array List of prefixes
276276 * @since 1.19
277277 */
@@ -301,7 +301,7 @@
302302 /**
303303 * Returns all interwiki prefixes
304304 *
305 - * @param $local If set, limits output to local/non-local interwikis
 305+ * @param $local string|null If set, limits output to local/non-local interwikis
306306 * @return Array List of prefixes
307307 * @since 1.19
308308 */

Status & tagging log