summaryrefslogtreecommitdiff
path: root/maintenance/updateArticleCount.inc.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /maintenance/updateArticleCount.inc.php
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'maintenance/updateArticleCount.inc.php')
-rw-r--r--maintenance/updateArticleCount.inc.php61
1 files changed, 0 insertions, 61 deletions
diff --git a/maintenance/updateArticleCount.inc.php b/maintenance/updateArticleCount.inc.php
deleted file mode 100644
index a847a2ed..00000000
--- a/maintenance/updateArticleCount.inc.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * Support class for the updateArticleCount.php maintenance script
- *
- * @file
- * @ingroup Maintenance
- * @author Rob Church <robchur@gmail.com>
- */
-
-class ArticleCounter {
-
- var $dbr;
- var $namespaces;
-
- function ArticleCounter() {
- global $wgContentNamespaces;
- $this->namespaces = $wgContentNamespaces;
- $this->dbr = wfGetDB( DB_SLAVE );
- }
-
- /**
- * Produce a comma-delimited set of namespaces
- * Includes paranoia
- *
- * @return string
- */
- function makeNsSet() {
- foreach( $this->namespaces as $namespace )
- $namespaces[] = intval( $namespace );
- return implode( ', ', $namespaces );
- }
-
- /**
- * Produce SQL for the query
- *
- * @return string
- */
- function makeSql() {
- list( $page, $pagelinks ) = $this->dbr->tableNamesN( 'page', 'pagelinks' );
- $nsset = $this->makeNsSet();
- 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";
- }
-
- /**
- * Count the number of valid content pages in the wiki
- *
- * @return mixed Integer, or false if there's a problem
- */
- function count() {
- $res = $this->dbr->query( $this->makeSql(), __METHOD__ );
- $row = $this->dbr->fetchObject( $res );
- $this->dbr->freeResult( $res );
- return $row->pagecount;
- }
-
-}
-
-