r23864 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23863‎ | r23864 | r23865 >
Date:12:31, 8 July 2007
Author:yurik
Status:old
Tags:
Comment:
API: added wlprop=sizes to get article size before and after the change.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -49,7 +49,7 @@
5050 }
5151
5252 private $fld_ids = false, $fld_title = false, $fld_patrol = false, $fld_flags = false,
53 - $fld_timestamp = false, $fld_user = false, $fld_comment = false;
 53+ $fld_timestamp = false, $fld_user = false, $fld_comment = false, $fld_sizes = false;
5454
5555 private function run($resultPageSet = null) {
5656 global $wgUser, $wgDBtype;
@@ -72,6 +72,7 @@
7373 $this->fld_user = isset($prop['user']);
7474 $this->fld_comment = isset($prop['comment']);
7575 $this->fld_timestamp = isset($prop['timestamp']);
 76+ $this->fld_sizes = isset($prop['sizes']);
7677 $this->fld_patrol = isset($prop['patrol']);
7778
7879 if ($this->fld_patrol) {
@@ -96,6 +97,8 @@
9798 $this->addFieldsIf('rc_user_text', $this->fld_user);
9899 $this->addFieldsIf('rc_comment', $this->fld_comment);
99100 $this->addFieldsIf('rc_patrolled', $this->fld_patrol);
 101+ $this->addFieldsIf('rc_old_len', $this->fld_sizes);
 102+ $this->addFieldsIf('rc_new_len', $this->fld_sizes);
100103 }
101104 elseif ($allrev) {
102105 $this->addFields(array (
@@ -214,6 +217,13 @@
215218 if ($this->fld_timestamp)
216219 $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
217220
 221+ $this->addFieldsIf('rc_new_len', $this->fld_sizes);
 222+
 223+ if ($this->fld_sizes) {
 224+ $vals['oldlen'] = intval($row->rc_old_len);
 225+ $vals['newlen'] = intval($row->rc_new_len);
 226+ }
 227+
218228 if ($this->fld_comment && !empty ($row->rc_comment))
219229 $vals['comment'] = $row->rc_comment;
220230
@@ -257,7 +267,8 @@
258268 'user',
259269 'comment',
260270 'timestamp',
261 - 'patrol'
 271+ 'patrol',
 272+ 'sizes',
262273 )
263274 )
264275 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r23912Merged revisions 23662-23909 via svnmerge from...david18:11, 9 July 2007

Status & tagging log