Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php |
— | — | @@ -41,9 +41,9 @@ |
42 | 42 | parent::__construct( $query, $moduleName, 'rc' ); |
43 | 43 | } |
44 | 44 | |
45 | | - private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_flags = false, |
46 | | - $fld_timestamp = false, $fld_title = false, $fld_ids = false, |
47 | | - $fld_sizes = false; |
| 45 | + private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false, |
| 46 | + $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false, |
| 47 | + $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false, $fld_tags = false; |
48 | 48 | /** |
49 | 49 | * Get an array mapping token names to their handler functions. |
50 | 50 | * The prototype for a token function is func($pageid, $title, $rc) |
— | — | @@ -94,6 +94,7 @@ |
95 | 95 | $this->fld_comment = isset( $prop['comment'] ); |
96 | 96 | $this->fld_parsedcomment = isset( $prop['parsedcomment'] ); |
97 | 97 | $this->fld_user = isset( $prop['user'] ); |
| 98 | + $this->fld_userid = isset( $prop['userid'] ); |
98 | 99 | $this->fld_flags = isset( $prop['flags'] ); |
99 | 100 | $this->fld_timestamp = isset( $prop['timestamp'] ); |
100 | 101 | $this->fld_title = isset( $prop['title'] ); |
— | — | @@ -208,7 +209,7 @@ |
209 | 210 | $this->addFieldsIf( 'rc_last_oldid', $this->fld_ids ); |
210 | 211 | $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment ); |
211 | 212 | $this->addFieldsIf( 'rc_user', $this->fld_user ); |
212 | | - $this->addFieldsIf( 'rc_user_text', $this->fld_user ); |
| 213 | + $this->addFieldsIf( 'rc_user_text', $this->fld_user || $this->fld_userid ); |
213 | 214 | $this->addFieldsIf( 'rc_minor', $this->fld_flags ); |
214 | 215 | $this->addFieldsIf( 'rc_bot', $this->fld_flags ); |
215 | 216 | $this->addFieldsIf( 'rc_new', $this->fld_flags ); |
— | — | @@ -335,8 +336,16 @@ |
336 | 337 | } |
337 | 338 | |
338 | 339 | /* Add user data and 'anon' flag, if use is anonymous. */ |
339 | | - if ( $this->fld_user ) { |
340 | | - $vals['user'] = $row->rc_user_text; |
| 340 | + if ( $this->fld_user || $this->fld_userid ) { |
| 341 | + |
| 342 | + if ( $this->fld_user ) { |
| 343 | + $vals['user'] = $row->rc_user_text; |
| 344 | + } |
| 345 | + |
| 346 | + if ( $this->fld_userid ) { |
| 347 | + $vals['userid'] = $row->rc_user; |
| 348 | + } |
| 349 | + |
341 | 350 | if ( !$row->rc_user ) { |
342 | 351 | $vals['anon'] = ''; |
343 | 352 | } |
— | — | @@ -491,6 +500,7 @@ |
492 | 501 | ApiBase::PARAM_DFLT => 'title|timestamp|ids', |
493 | 502 | ApiBase::PARAM_TYPE => array( |
494 | 503 | 'user', |
| 504 | + 'userid', |
495 | 505 | 'comment', |
496 | 506 | 'parsedcomment', |
497 | 507 | 'flags', |
— | — | @@ -552,6 +562,7 @@ |
553 | 563 | 'prop' => array( |
554 | 564 | 'Include additional pieces of information', |
555 | 565 | ' user - Adds the user responsible for the edit and tags if they are an IP', |
| 566 | + ' userid - Adds the user id responsible for the edit', |
556 | 567 | ' comment - Adds the comment for the edit', |
557 | 568 | ' parsedcomment - Adds the parsed comment for the edit', |
558 | 569 | ' flags - Adds flags for the edit', |
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | |
53 | 53 | private $fld_ids = false, $fld_title = false, $fld_patrol = false, $fld_flags = false, |
54 | 54 | $fld_timestamp = false, $fld_user = false, $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false, |
55 | | - $fld_notificationtimestamp = false; |
| 55 | + $fld_notificationtimestamp = false, $fld_userid = false; |
56 | 56 | |
57 | 57 | private function run( $resultPageSet = null ) { |
58 | 58 | $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' ); |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | $this->fld_title = isset( $prop['title'] ); |
69 | 69 | $this->fld_flags = isset( $prop['flags'] ); |
70 | 70 | $this->fld_user = isset( $prop['user'] ); |
| 71 | + $this->fld_userid = isset( $prop['userid'] ); |
71 | 72 | $this->fld_comment = isset( $prop['comment'] ); |
72 | 73 | $this->fld_parsedcomment = isset ( $prop['parsedcomment'] ); |
73 | 74 | $this->fld_timestamp = isset( $prop['timestamp'] ); |
— | — | @@ -96,7 +97,7 @@ |
97 | 98 | $this->addFieldsIf( 'rc_new', $this->fld_flags ); |
98 | 99 | $this->addFieldsIf( 'rc_minor', $this->fld_flags ); |
99 | 100 | $this->addFieldsIf( 'rc_bot', $this->fld_flags ); |
100 | | - $this->addFieldsIf( 'rc_user', $this->fld_user ); |
| 101 | + $this->addFieldsIf( 'rc_user', $this->fld_user || $this->fld_userid ); |
101 | 102 | $this->addFieldsIf( 'rc_user_text', $this->fld_user ); |
102 | 103 | $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment ); |
103 | 104 | $this->addFieldsIf( 'rc_patrolled', $this->fld_patrol ); |
— | — | @@ -228,8 +229,16 @@ |
229 | 230 | ApiQueryBase::addTitleInfo( $vals, $title ); |
230 | 231 | } |
231 | 232 | |
232 | | - if ( $this->fld_user ) { |
233 | | - $vals['user'] = $row->rc_user_text; |
| 233 | + if ( $this->fld_user || $this->fld_userid ) { |
| 234 | + |
| 235 | + if ( $this->fld_user ) { |
| 236 | + $vals['user'] = $row->rc_user_text; |
| 237 | + } |
| 238 | + |
| 239 | + if ( $this->fld_userid ) { |
| 240 | + $vals['user'] = $row->rc_user; |
| 241 | + } |
| 242 | + |
234 | 243 | if ( !$row->rc_user ) { |
235 | 244 | $vals['anon'] = ''; |
236 | 245 | } |
— | — | @@ -319,6 +328,7 @@ |
320 | 329 | 'title', |
321 | 330 | 'flags', |
322 | 331 | 'user', |
| 332 | + 'userid', |
323 | 333 | 'comment', |
324 | 334 | 'parsedcomment', |
325 | 335 | 'timestamp', |
— | — | @@ -364,7 +374,8 @@ |
365 | 375 | ' ids - Adds revision ids and page ids', |
366 | 376 | ' title - Adds title of the page', |
367 | 377 | ' flags - Adds flags for the edit', |
368 | | - ' user - Adds user who made the edit', |
| 378 | + ' user - Adds the user who made the edit', |
| 379 | + ' userid - Adds user id of whom made the edit', |
369 | 380 | ' comment - Adds comment of the edit', |
370 | 381 | ' parsedcomment - Adds parsed comment of the edit', |
371 | 382 | ' timestamp - Adds timestamp of the edit', |
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | private $params; |
45 | 45 | private $fld_ids = false, $fld_title = false, $fld_timestamp = false, |
46 | 46 | $fld_comment = false, $fld_parsedcomment = false, $fld_flags = false, |
47 | | - $fld_patrolled = false, $fld_tags = false; |
| 47 | + $fld_patrolled = false, $fld_tags = false, $fld_size = false; |
48 | 48 | |
49 | 49 | public function execute() { |
50 | 50 | // Parse some parameters |
— | — | @@ -206,6 +206,7 @@ |
207 | 207 | 'rev_timestamp', |
208 | 208 | 'page_namespace', |
209 | 209 | 'page_title', |
| 210 | + 'rev_user', |
210 | 211 | 'rev_user_text', |
211 | 212 | 'rev_deleted' |
212 | 213 | ) ); |
— | — | @@ -272,6 +273,7 @@ |
273 | 274 | private function extractRowInfo( $row ) { |
274 | 275 | $vals = array(); |
275 | 276 | |
| 277 | + $vals['userid'] = $row->rev_user; |
276 | 278 | $vals['user'] = $row->rev_user_text; |
277 | 279 | if ( $row->rev_deleted & Revision::DELETED_USER ) { |
278 | 280 | $vals['userhidden'] = ''; |