Index: trunk/phase3/maintenance/getSlaveServer.php |
— | — | @@ -32,15 +32,13 @@ |
33 | 33 | global $wgAllDBsAreLocalhost; |
34 | 34 | if ( $wgAllDBsAreLocalhost ) { |
35 | 35 | $host = 'localhost'; |
| 36 | + } elseif ( $this->hasOption( 'group' ) ) { |
| 37 | + $db = wfGetDB( DB_SLAVE, $this->getOption( 'group' ) ); |
| 38 | + $host = $db->getServer(); |
36 | 39 | } 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 ); |
45 | 43 | } |
46 | 44 | $this->output( "$host\n" ); |
47 | 45 | } |
Index: trunk/phase3/tests/parser/parserTest.inc |
— | — | @@ -837,7 +837,6 @@ |
838 | 838 | 'iw_local' => 1 ), |
839 | 839 | ) ); |
840 | 840 | |
841 | | - |
842 | 841 | # Update certain things in site_stats |
843 | 842 | $this->db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ) ); |
844 | 843 | |
Index: trunk/phase3/includes/interwiki/Interwiki.php |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | /** |
138 | 138 | * Load the interwiki, trying first memcached then the DB |
139 | 139 | * |
140 | | - * @param $prefix The interwiki prefix |
| 140 | + * @param $prefix string The interwiki prefix |
141 | 141 | * @return Boolean: the prefix is valid |
142 | 142 | */ |
143 | 143 | protected static function load( $prefix ) { |
— | — | @@ -186,8 +186,8 @@ |
187 | 187 | /** |
188 | 188 | * Fill in member variables from an array (e.g. memcached result, Database::fetchRow, etc) |
189 | 189 | * |
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 |
192 | 192 | */ |
193 | 193 | protected static function loadFromArray( $mc ) { |
194 | 194 | if( isset( $mc['iw_url'] ) ) { |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | /** |
208 | 208 | * Fetch all interwiki prefixes from interwiki cache |
209 | 209 | * |
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 |
211 | 211 | * @return Array List of prefixes |
212 | 212 | * @since 1.19 |
213 | 213 | */ |
— | — | @@ -270,7 +270,7 @@ |
271 | 271 | /** |
272 | 272 | * Fetch all interwiki prefixes from DB |
273 | 273 | * |
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 |
275 | 275 | * @return Array List of prefixes |
276 | 276 | * @since 1.19 |
277 | 277 | */ |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | /** |
303 | 303 | * Returns all interwiki prefixes |
304 | 304 | * |
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 |
306 | 306 | * @return Array List of prefixes |
307 | 307 | * @since 1.19 |
308 | 308 | */ |