X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FSiteStatsInit.php;h=8adb2181eaaa1e293a911e111f3a2399bbf1e5d2;hp=f8886909a927a1b26f72a7ad59e53702ca85f6ac;hb=24ae4318b36f88f2dd43db5989074b65776e2cf8;hpb=963bff8cce84a627fd68f415b99ce6760e3748b8 diff --git a/includes/SiteStatsInit.php b/includes/SiteStatsInit.php index f8886909a9..8adb2181ea 100644 --- a/includes/SiteStatsInit.php +++ b/includes/SiteStatsInit.php @@ -79,13 +79,6 @@ class SiteStatsInit { if ( $config->get( 'ArticleCountMethod' ) == 'link' ) { $tables[] = 'pagelinks'; $conds[] = 'pl_from=page_id'; - } elseif ( $config->get( 'ArticleCountMethod' ) == 'comma' ) { - // To make a correct check for this, we would need, for each page, - // to load the text, maybe uncompress it, maybe decode it and then - // check if there's one comma. - // But one thing we are sure is that if the page is empty, it can't - // contain a comma :) - $conds[] = 'page_len > 0'; } $this->articles = $this->dbr->selectField( @@ -198,9 +191,12 @@ class SiteStatsInit { /** * @param int $index + * @param string[] $groups * @return IDatabase */ - private static function getDB( $index ) { - return MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( $index ); + private static function getDB( $index, $groups = [] ) { + $lb = MediaWikiServices::getInstance()->getDBLoadBalancer(); + + return $lb->getConnection( $index, $groups ); } }