summaryrefslogtreecommitdiff
path: root/maintenance/updateArticleCount.inc.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
commita58285fd06c8113c45377c655dd43cef6337e815 (patch)
treedfe31d3d12652352fe44890b4811eda0728faefb /maintenance/updateArticleCount.inc.php
parent20194986f6638233732ba1fc3e838f117d3cc9ea (diff)
Aktualisierung auf MediaWiki 1.9.0
Diffstat (limited to 'maintenance/updateArticleCount.inc.php')
-rw-r--r--maintenance/updateArticleCount.inc.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/maintenance/updateArticleCount.inc.php b/maintenance/updateArticleCount.inc.php
index 20546a78..7eaea749 100644
--- a/maintenance/updateArticleCount.inc.php
+++ b/maintenance/updateArticleCount.inc.php
@@ -39,12 +39,9 @@ class ArticleCounter {
function makeSql() {
extract( $this->dbr->tableNames( 'page', 'pagelinks' ) );
$nsset = $this->makeNsSet();
- return "SELECT COUNT(*) AS count FROM {$page}
- LEFT JOIN {$pagelinks} ON pl_from = page_id
- WHERE page_namespace IN ( $nsset )
- AND page_is_redirect = 0
- AND page_len > 0
- AND pl_namespace IS NOT NULL";
+ return "SELECT DISTINCT page_namespace,page_title FROM $page,$pagelinks " .
+ "WHERE pl_from=page_id and page_namespace IN ( $nsset ) " .
+ "AND page_is_redirect = 0 AND page_len > 0";
}
/**
@@ -55,14 +52,16 @@ class ArticleCounter {
function count() {
$res = $this->dbr->query( $this->makeSql(), __METHOD__ );
if( $res ) {
- $row = $this->dbr->fetchObject( $res );
+ $count = $this->dbr->numRows( $res );
$this->dbr->freeResult( $res );
- return (int)$row->count;
+ return $count;
} else {
- return false; # Look out for this when handling the result
+ # Look out for this when handling the result
+ # - Actually it's unreachable, !$res throws an exception -- TS
+ return false;
}
}
}
-?> \ No newline at end of file
+?>