Index: trunk/phase3/includes/interwiki/Interwiki.php |
— | — | @@ -204,7 +204,6 @@ |
205 | 205 | * @param $local If set, limits output to local/non-local interwikis |
206 | 206 | * @return Array List of prefixes |
207 | 207 | * @since 1.19 |
208 | | - * @static |
209 | 208 | */ |
210 | 209 | protected static function getAllPrefixesCached( $local ) { |
211 | 210 | global $wgInterwikiCache, $wgInterwikiScopes, $wgInterwikiFallbackSite; |
— | — | @@ -269,34 +268,24 @@ |
270 | 269 | * @param $local If set, limits output to local/non-local interwikis |
271 | 270 | * @return Array List of prefixes |
272 | 271 | * @since 1.19 |
273 | | - * @static |
274 | 272 | */ |
275 | | - protected static function getAllPrefixesDb( $local ) { |
| 273 | + protected static function getAllPrefixesDB( $local ) { |
276 | 274 | $db = wfGetDB( DB_SLAVE ); |
277 | 275 | |
278 | 276 | $where = array(); |
279 | 277 | |
280 | | - if ( isset($local) ) { |
| 278 | + if ( isset( $local ) ) { |
281 | 279 | if ( $local == 1 ) { |
282 | 280 | $where['iw_local'] = 1; |
283 | | - } |
284 | | - elseif ( $local == 0 ) { |
| 281 | + } elseif ( $local == 0 ) { |
285 | 282 | $where['iw_local'] = 0; |
286 | 283 | } |
287 | 284 | } |
288 | 285 | |
289 | | - $res = $db->select( 'interwiki', |
| 286 | + return $db->select( 'interwiki', |
290 | 287 | array( 'iw_prefix', 'iw_url', 'iw_api', 'iw_wikiid', 'iw_local', 'iw_trans' ), |
291 | 288 | $where, __METHOD__, array( 'ORDER BY' => 'iw_prefix' ) |
292 | 289 | ); |
293 | | - |
294 | | - $data = array(); |
295 | | - while( $row = $db->fetchRow($res) ) { |
296 | | - $data[] = $row; |
297 | | - } |
298 | | - $db->freeResult( $res ); |
299 | | - |
300 | | - return $data; |
301 | 290 | } |
302 | 291 | |
303 | 292 | /** |
— | — | @@ -305,7 +294,6 @@ |
306 | 295 | * @param $local If set, limits output to local/non-local interwikis |
307 | 296 | * @return Array List of prefixes |
308 | 297 | * @since 1.19 |
309 | | - * @static |
310 | 298 | */ |
311 | 299 | public static function getAllPrefixes( $local ) { |
312 | 300 | global $wgInterwikiCache; |
— | — | @@ -313,7 +301,7 @@ |
314 | 302 | if ( $wgInterwikiCache ) { |
315 | 303 | return self::getAllPrefixesCached( $local ); |
316 | 304 | } else { |
317 | | - return self::getAllPrefixesDb( $local ); |
| 305 | + return self::getAllPrefixesDB( $local ); |
318 | 306 | } |
319 | 307 | } |
320 | 308 | |