Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git] / includes / pager / IndexPager.php
index a96ca87..4694890 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup Pager
  */
 
+use Wikimedia\Rdbms\ResultWrapper;
+
 /**
  * IndexPager is an efficient pager which uses a (roughly unique) index in the
  * data set to implement paging, rather than a "LIMIT offset,limit" clause.
@@ -145,8 +147,8 @@ abstract class IndexPager extends ContextSource implements Pager {
                }
 
                $this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) == 'prev' );
-               # Let the subclass set the DB here; otherwise use a slave DB for the current wiki
-               $this->mDb = $this->mDb ?: wfGetDB( DB_SLAVE );
+               # Let the subclass set the DB here; otherwise use a replica DB for the current wiki
+               $this->mDb = $this->mDb ?: wfGetDB( DB_REPLICA );
 
                $index = $this->getIndexField(); // column to sort on
                $extraSort = $this->getExtraSortFields(); // extra columns to sort on for query planning
@@ -195,7 +197,7 @@ abstract class IndexPager extends ContextSource implements Pager {
         */
        public function doQuery() {
                # Use the child class name for profiling
-               $fname = __METHOD__ . ' (' . get_class( $this ) . ')';
+               $fname = __METHOD__ . ' (' . static::class . ')';
                $section = Profiler::instance()->scopedProfileIn( $fname );
 
                // @todo This should probably compare to DIR_DESCENDING and DIR_ASCENDING constants
@@ -346,7 +348,7 @@ abstract class IndexPager extends ContextSource implements Pager {
         * @return string
         */
        function getSqlComment() {
-               return get_class( $this );
+               return static::class;
        }
 
        /**