X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSiteStatsInit.php;h=e97db2db04fb64b5fb9225a0eb1b1dcf95da6d3b;hb=447574ceb746c2f4026a8bf77632bdc4604314bb;hp=f527cb226b41fe06afcbb45613e40cdc568a146f;hpb=b4e9b1ba621d77b580cfd5b19e927ccaec54831a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SiteStatsInit.php b/includes/SiteStatsInit.php index f527cb226b..e97db2db04 100644 --- a/includes/SiteStatsInit.php +++ b/includes/SiteStatsInit.php @@ -68,24 +68,17 @@ class SiteStatsInit { * @return int */ public function articles() { - $config = MediaWikiServices::getInstance()->getMainConfig(); + $services = MediaWikiServices::getInstance(); $tables = [ 'page' ]; $conds = [ - 'page_namespace' => MWNamespace::getContentNamespaces(), + 'page_namespace' => $services->getNamespaceInfo()->getContentNamespaces(), 'page_is_redirect' => 0, ]; - if ( $config->get( 'ArticleCountMethod' ) == 'link' ) { + if ( $services->getMainConfig()->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(