r24693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24692‎ | r24693 | r24694 >
Date:06:38, 9 August 2007
Author:yurik
Status:old
Tags:
Comment:
API: Added size property (rev_len)
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -41,7 +41,7 @@
4242 parent :: __construct($query, $moduleName, 'rv');
4343 }
4444
45 - private $fld_ids = false, $fld_flags = false, $fld_timestamp = false,
 45+ private $fld_ids = false, $fld_flags = false, $fld_timestamp = false, $fld_size = false,
4646 $fld_comment = false, $fld_user = false, $fld_content = false;
4747
4848 public function execute() {
@@ -83,6 +83,7 @@
8484 $this->fld_flags = $this->addFieldsIf('rev_minor_edit', isset ($prop['flags']));
8585 $this->fld_timestamp = $this->addFieldsIf('rev_timestamp', isset ($prop['timestamp']));
8686 $this->fld_comment = $this->addFieldsIf('rev_comment', isset ($prop['comment']));
 87+ $this->fld_size = $this->addFieldsIf('rev_len', isset ($prop['size']));
8788
8889 if (isset ($prop['user'])) {
8990 $this->addFields('rev_user');
@@ -235,6 +236,10 @@
236237 $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rev_timestamp);
237238 }
238239
 240+ if ($this->fld_len && !is_null($row->rev_len)) {
 241+ $vals['size'] = intval($row->rev_len);
 242+ }
 243+
239244 if ($this->fld_comment && !empty ($row->rev_comment)) {
240245 $vals['comment'] = $row->rev_comment;
241246 }
@@ -256,8 +261,9 @@
257262 'flags',
258263 'timestamp',
259264 'user',
 265+ 'size',
260266 'comment',
261 - 'content'
 267+ 'content',
262268 )
263269 ),
264270 'limit' => array (

Follow-up revisions

RevisionCommit summaryAuthorDate
r24705Merged revisions 24632-24693 via svnmerge from...david19:15, 9 August 2007

Status & tagging log