diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2009-02-22 13:37:51 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2009-02-22 13:37:51 +0100 |
commit | b9b85843572bf283f48285001e276ba7e61b63f6 (patch) | |
tree | 4c6f4571552ada9ccfb4030481dcf77308f8b254 /maintenance/updateArticleCount.inc.php | |
parent | d9a20acc4e789cca747ad360d87ee3f3e7aa58c1 (diff) |
updated to MediaWiki 1.14.0
Diffstat (limited to 'maintenance/updateArticleCount.inc.php')
-rw-r--r-- | maintenance/updateArticleCount.inc.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/maintenance/updateArticleCount.inc.php b/maintenance/updateArticleCount.inc.php index de19191e..a847a2ed 100644 --- a/maintenance/updateArticleCount.inc.php +++ b/maintenance/updateArticleCount.inc.php @@ -38,7 +38,8 @@ class ArticleCounter { function makeSql() { list( $page, $pagelinks ) = $this->dbr->tableNamesN( 'page', 'pagelinks' ); $nsset = $this->makeNsSet(); - return "SELECT DISTINCT page_namespace,page_title FROM $page,$pagelinks " . + return "SELECT COUNT(DISTINCT page_namespace, page_title) AS pagecount " . + "FROM $page, $pagelinks " . "WHERE pl_from=page_id and page_namespace IN ( $nsset ) " . "AND page_is_redirect = 0 AND page_len > 0"; } @@ -50,15 +51,9 @@ class ArticleCounter { */ function count() { $res = $this->dbr->query( $this->makeSql(), __METHOD__ ); - if( $res ) { - $count = $this->dbr->numRows( $res ); - $this->dbr->freeResult( $res ); - return $count; - } else { - # Look out for this when handling the result - # - Actually it's unreachable, !$res throws an exception -- TS - return false; - } + $row = $this->dbr->fetchObject( $res ); + $this->dbr->freeResult( $res ); + return $row->pagecount; } } |