Remove leading backslashes from "use \…" tags
[lhc/web/wiklou.git] / includes / interwiki / ClassicInterwikiLookup.php
index 4ccca97..d5103da 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-namespace MediaWiki\Interwiki;
-
 /**
  * InterwikiLookup implementing the "classic" interwiki storage (hardcoded up to MW 1.26).
  *
@@ -21,14 +19,17 @@ namespace MediaWiki\Interwiki;
  *
  * @file
  */
-use \Cdb\Exception as CdbException;
-use \Cdb\Reader as CdbReader;
-use Database;
+
+namespace MediaWiki\Interwiki;
+
+use Cdb\Exception as CdbException;
+use Cdb\Reader as CdbReader;
 use Hooks;
 use Interwiki;
 use Language;
 use MapCacheLRU;
 use WANObjectCache;
+use Wikimedia\Rdbms\Database;
 
 /**
  * InterwikiLookup implementing the "classic" interwiki storage (hardcoded up to MW 1.26).
@@ -221,7 +222,7 @@ class ClassicInterwikiLookup implements InterwikiLookup {
                                }
                        }
 
-                       $value = $this->getCacheValue( wfMemcKey( $prefix ) );
+                       $value = $this->getCacheValue( wfWikiID() . ':' . $prefix );
                        // Site level
                        if ( $value == '' && $this->interwikiScopes >= 3 ) {
                                $value = $this->getCacheValue( "_{$this->thisSite}:{$prefix}" );
@@ -288,7 +289,7 @@ class ClassicInterwikiLookup implements InterwikiLookup {
 
                                $row = $dbr->selectRow(
                                        'interwiki',
-                                       ClassicInterwikiLookup::selectFields(),
+                                       self::selectFields(),
                                        [ 'iw_prefix' => $prefix ],
                                        __METHOD__
                                );
@@ -383,8 +384,6 @@ class ClassicInterwikiLookup implements InterwikiLookup {
                                . $e->getMessage() );
                }
 
-               ksort( $data );
-
                return array_values( $data );
        }
 
@@ -408,7 +407,7 @@ class ClassicInterwikiLookup implements InterwikiLookup {
                }
 
                $res = $db->select( 'interwiki',
-                       $this->selectFields(),
+                       self::selectFields(),
                        $where, __METHOD__, [ 'ORDER BY' => 'iw_prefix' ]
                );