r24697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24696‎ | r24697 | r24698 >
Date:12:39, 9 August 2007
Author:yurik
Status:old
Tags:
Comment:
API: Added site statistics (siprop=statistics for meta=siteinfo)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -60,6 +60,9 @@
6161 case 'dbrepllag' :
6262 $this->appendDbReplLagInfo($p, $params['showalldb']);
6363 break;
 64+ case 'statistics' :
 65+ $this->appendStatistics($p);
 66+ break;
6467 }
6568 }
6669 }
@@ -160,6 +163,19 @@
161164 $result->addValue('query', $property, $data);
162165 }
163166
 167+ protected function appendStatistics($property) {
 168+ $data = array ();
 169+ $data['pages'] = intval(SiteStats::pages());
 170+ $data['articles'] = intval(SiteStats::articles());
 171+ $data['views'] = intval(SiteStats::views());
 172+ $data['edits'] = intval(SiteStats::edits());
 173+ $data['images'] = intval(SiteStats::images());
 174+ $data['users'] = intval(SiteStats::users());
 175+ $data['admins'] = intval(SiteStats::admins());
 176+ $data['jobs'] = intval(SiteStats::jobs());
 177+ $this->getResult()->addValue('query', $property, $data);
 178+ }
 179+
164180 protected function getAllowedParams() {
165181 return array (
166182
@@ -171,6 +187,7 @@
172188 'namespaces',
173189 'interwikimap',
174190 'dbrepllag',
 191+ 'statistics',
175192 )),
176193
177194 'filteriw' => array (
Index: trunk/phase3/RELEASE-NOTES
@@ -420,6 +420,9 @@
421421 * Added full text search in titles and content (list=search)
422422 * (bug 10684) Expanded list=allusers functionality
423423 * Possible breaking change: prop=revisions no longer includes pageid for rvprop=ids
 424+* Added rvprop=size to prop=revisions (The size will not be shown if it is NULL in the database)
 425+* list=allpages now allows to filter by article min/max size and protection status
 426+* Added site statistics (siprop=statistics for meta=siteinfo)
424427
425428 == Maintenance script changes since 1.10 ==
426429

Follow-up revisions

RevisionCommit summaryAuthorDate
r24755Merged revisions 24694-24754 via svnmerge from...david19:48, 13 August 2007

Status & tagging log