ClassicInterwikiLookup: Call static function selectFields statically
[lhc/web/wiklou.git] / includes / interwiki / ClassicInterwikiLookup.php
index 6ac165a..883b5fa 100644 (file)
@@ -37,7 +37,7 @@ use WANObjectCache;
  * and tree storage backends (SQL, CDB, and plain PHP arrays).
  *
  * All information is loaded on creation when called by $this->fetch( $prefix ).
- * All work is done on slave, because this should *never* change (except during
+ * All work is done on replica DB, because this should *never* change (except during
  * schema updates etc, which aren't wiki-related)
  *
  * @since 1.28
@@ -187,7 +187,7 @@ class ClassicInterwikiLookup implements InterwikiLookup {
         * @note More logic is explained in DefaultSettings.
         *
         * @param string $prefix Interwiki prefix
-        * @return Interwiki
+        * @return Interwiki|false
         */
        private function getInterwikiCached( $prefix ) {
                $value = $this->getInterwikiCacheEntry( $prefix );
@@ -282,13 +282,13 @@ class ClassicInterwikiLookup implements InterwikiLookup {
                        $this->objectCache->makeKey( 'interwiki', $prefix ),
                        $this->objectCacheExpiry,
                        function ( $oldValue, &$ttl, array &$setOpts ) use ( $prefix ) {
-                               $dbr = wfGetDB( DB_SLAVE ); // TODO: inject LoadBalancer
+                               $dbr = wfGetDB( DB_REPLICA ); // TODO: inject LoadBalancer
 
                                $setOpts += Database::getCacheSetOptions( $dbr );
 
                                $row = $dbr->selectRow(
                                        'interwiki',
-                                       ClassicInterwikiLookup::selectFields(),
+                                       self::selectFields(),
                                        [ 'iw_prefix' => $prefix ],
                                        __METHOD__
                                );
@@ -395,7 +395,7 @@ class ClassicInterwikiLookup implements InterwikiLookup {
         * @return array[] Interwiki rows
         */
        private function getAllPrefixesDB( $local ) {
-               $db = wfGetDB( DB_SLAVE ); // TODO: inject DB LoadBalancer
+               $db = wfGetDB( DB_REPLICA ); // TODO: inject DB LoadBalancer
 
                $where = [];
 
@@ -408,7 +408,7 @@ class ClassicInterwikiLookup implements InterwikiLookup {
                }
 
                $res = $db->select( 'interwiki',
-                       $this->selectFields(),
+                       self::selectFields(),
                        $where, __METHOD__, [ 'ORDER BY' => 'iw_prefix' ]
                );