3 * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
23 use MediaWiki\MediaWikiServices
;
24 use MediaWiki\Revision\RevisionRecord
;
25 use MediaWiki\Storage\NameTableAccessException
;
28 * This query action adds a list of a specified user's contributions to the output.
32 class ApiQueryUserContribs
extends ApiQueryBase
{
34 public function __construct( ApiQuery
$query, $moduleName ) {
35 parent
::__construct( $query, $moduleName, 'uc' );
38 private $params, $multiUserMode, $orderBy, $parentLens, $commentStore;
40 private $fld_ids = false, $fld_title = false, $fld_timestamp = false,
41 $fld_comment = false, $fld_parsedcomment = false, $fld_flags = false,
42 $fld_patrolled = false, $fld_tags = false, $fld_size = false, $fld_sizediff = false;
44 public function execute() {
45 global $wgActorTableSchemaMigrationStage;
47 // Parse some parameters
48 $this->params
= $this->extractRequestParams();
50 $this->commentStore
= CommentStore
::getStore();
52 $prop = array_flip( $this->params
['prop'] );
53 $this->fld_ids
= isset( $prop['ids'] );
54 $this->fld_title
= isset( $prop['title'] );
55 $this->fld_comment
= isset( $prop['comment'] );
56 $this->fld_parsedcomment
= isset( $prop['parsedcomment'] );
57 $this->fld_size
= isset( $prop['size'] );
58 $this->fld_sizediff
= isset( $prop['sizediff'] );
59 $this->fld_flags
= isset( $prop['flags'] );
60 $this->fld_timestamp
= isset( $prop['timestamp'] );
61 $this->fld_patrolled
= isset( $prop['patrolled'] );
62 $this->fld_tags
= isset( $prop['tags'] );
64 // Most of this code will use the 'contributions' group DB, which can map to replica DBs
65 // with extra user based indexes or partioning by user. The additional metadata
66 // queries should use a regular replica DB since the lookup pattern is not all by user.
67 $dbSecondary = $this->getDB(); // any random replica DB
69 // TODO: if the query is going only against the revision table, should this be done?
70 $this->selectNamedDB( 'contributions', DB_REPLICA
, 'contributions' );
72 $sort = ( $this->params
['dir'] == 'newer' ?
'' : ' DESC' );
73 $op = ( $this->params
['dir'] == 'older' ?
'<' : '>' );
75 // Create an Iterator that produces the UserIdentity objects we need, depending
76 // on which of the 'userprefix', 'userids', or 'user' params was
78 $this->requireOnlyOneParameter( $this->params
, 'userprefix', 'userids', 'user' );
79 if ( isset( $this->params
['userprefix'] ) ) {
80 $this->multiUserMode
= true;
81 $this->orderBy
= 'name';
84 // Because 'userprefix' might produce a huge number of users (e.g.
85 // a wiki with users "Test00000001" to "Test99999999"), use a
86 // generator with batched lookup and continuation.
87 $userIter = call_user_func( function () use ( $dbSecondary, $sort, $op, $fname ) {
88 global $wgActorTableSchemaMigrationStage;
91 if ( !is_null( $this->params
['continue'] ) ) {
92 $continue = explode( '|', $this->params
['continue'] );
93 $this->dieContinueUsageIf( count( $continue ) != 4 );
94 $this->dieContinueUsageIf( $continue[0] !== 'name' );
95 $fromName = $continue[1];
97 $like = $dbSecondary->buildLike( $this->params
['userprefix'], $dbSecondary->anyString() );
102 $from = $fromName ?
"$op= " . $dbSecondary->addQuotes( $fromName ) : false;
104 // For the new schema, pull from the actor table. For the
105 // old, pull from rev_user.
106 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
107 $res = $dbSecondary->select(
109 [ 'actor_id', 'user_id' => 'COALESCE(actor_user,0)', 'user_name' => 'actor_name' ],
110 array_merge( [ "actor_name$like" ], $from ?
[ "actor_name $from" ] : [] ),
112 [ 'ORDER BY' => [ "user_name $sort" ], 'LIMIT' => $limit ]
115 $res = $dbSecondary->select(
117 [ 'actor_id' => 'NULL', 'user_id' => 'rev_user', 'user_name' => 'rev_user_text' ],
118 array_merge( [ "rev_user_text$like" ], $from ?
[ "rev_user_text $from" ] : [] ),
120 [ 'DISTINCT', 'ORDER BY' => [ "rev_user_text $sort" ], 'LIMIT' => $limit ]
126 foreach ( $res as $row ) {
127 if ( ++
$count >= $limit ) {
128 $fromName = $row->user_name
;
131 yield User
::newFromRow( $row );
133 } while ( $fromName !== false );
135 // Do the actual sorting client-side, because otherwise
136 // prepareQuery might try to sort by actor and confuse everything.
138 } elseif ( isset( $this->params
['userids'] ) ) {
139 if ( !count( $this->params
['userids'] ) ) {
140 $encParamName = $this->encodeParamName( 'userids' );
141 $this->dieWithError( [ 'apierror-paramempty', $encParamName ], "paramempty_$encParamName" );
145 foreach ( $this->params
['userids'] as $uid ) {
147 $this->dieWithError( [ 'apierror-invaliduserid', $uid ], 'invaliduserid' );
152 $this->orderBy
= 'id';
153 $this->multiUserMode
= count( $ids ) > 1;
155 $from = $fromId = false;
156 if ( $this->multiUserMode
&& !is_null( $this->params
['continue'] ) ) {
157 $continue = explode( '|', $this->params
['continue'] );
158 $this->dieContinueUsageIf( count( $continue ) != 4 );
159 $this->dieContinueUsageIf( $continue[0] !== 'id' && $continue[0] !== 'actor' );
160 $fromId = (int)$continue[1];
161 $this->dieContinueUsageIf( $continue[1] !== (string)$fromId );
162 $from = "$op= $fromId";
165 // For the new schema, just select from the actor table. For the
166 // old, select from user.
167 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
168 $res = $dbSecondary->select(
170 [ 'actor_id', 'user_id' => 'actor_user', 'user_name' => 'actor_name' ],
171 array_merge( [ 'actor_user' => $ids ], $from ?
[ "actor_id $from" ] : [] ),
173 [ 'ORDER BY' => "user_id $sort" ]
176 $res = $dbSecondary->select(
178 [ 'actor_id' => 'NULL', 'user_id' => 'user_id', 'user_name' => 'user_name' ],
179 array_merge( [ 'user_id' => $ids ], $from ?
[ "user_id $from" ] : [] ),
181 [ 'ORDER BY' => "user_id $sort" ]
184 $userIter = UserArray
::newFromResult( $res );
185 $batchSize = count( $ids );
188 if ( !count( $this->params
['user'] ) ) {
189 $encParamName = $this->encodeParamName( 'user' );
191 [ 'apierror-paramempty', $encParamName ], "paramempty_$encParamName"
194 foreach ( $this->params
['user'] as $u ) {
196 $encParamName = $this->encodeParamName( 'user' );
198 [ 'apierror-paramempty', $encParamName ], "paramempty_$encParamName"
202 if ( User
::isIP( $u ) || ExternalUserNames
::isExternal( $u ) ) {
205 $name = User
::getCanonicalName( $u, 'valid' );
206 if ( $name === false ) {
207 $encParamName = $this->encodeParamName( 'user' );
209 [ 'apierror-baduser', $encParamName, wfEscapeWikiText( $u ) ], "baduser_$encParamName"
212 $names[$name] = null;
216 $this->orderBy
= 'name';
217 $this->multiUserMode
= count( $names ) > 1;
219 $from = $fromName = false;
220 if ( $this->multiUserMode
&& !is_null( $this->params
['continue'] ) ) {
221 $continue = explode( '|', $this->params
['continue'] );
222 $this->dieContinueUsageIf( count( $continue ) != 4 );
223 $this->dieContinueUsageIf( $continue[0] !== 'name' && $continue[0] !== 'actor' );
224 $fromName = $continue[1];
225 $from = "$op= " . $dbSecondary->addQuotes( $fromName );
228 // For the new schema, just select from the actor table. For the
229 // old, select from user then merge in any unknown users (IPs and imports).
230 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
231 $res = $dbSecondary->select(
233 [ 'actor_id', 'user_id' => 'actor_user', 'user_name' => 'actor_name' ],
234 array_merge( [ 'actor_name' => array_keys( $names ) ], $from ?
[ "actor_id $from" ] : [] ),
236 [ 'ORDER BY' => "actor_name $sort" ]
238 $userIter = UserArray
::newFromResult( $res );
240 $res = $dbSecondary->select(
242 [ 'actor_id' => 'NULL', 'user_id', 'user_name' ],
243 array_merge( [ 'user_name' => array_keys( $names ) ], $from ?
[ "user_name $from" ] : [] ),
246 foreach ( $res as $row ) {
247 $names[$row->user_name
] = $row;
249 if ( $this->params
['dir'] == 'newer' ) {
250 ksort( $names, SORT_STRING
);
252 krsort( $names, SORT_STRING
);
254 $neg = $op === '>' ?
-1 : 1;
255 $userIter = call_user_func( function () use ( $names, $fromName, $neg ) {
256 foreach ( $names as $name => $row ) {
257 if ( $fromName === false ||
$neg * strcmp( $name, $fromName ) <= 0 ) {
258 $user = $row ? User
::newFromRow( $row ) : User
::newFromName( $name, false );
264 $batchSize = count( $names );
267 // With the new schema, the DB query will order by actor so update $this->orderBy to match.
268 if ( $batchSize > 1 && ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) ) {
269 $this->orderBy
= 'actor';
273 $limit = $this->params
['limit'];
275 while ( $userIter->valid() ) {
277 while ( count( $users ) < $batchSize && $userIter->valid() ) {
278 $users[] = $userIter->current();
283 $this->prepareQuery( $users, $limit - $count );
284 $res = $this->select( __METHOD__
, [], $hookData );
286 if ( $this->fld_sizediff
) {
288 foreach ( $res as $row ) {
289 if ( $row->rev_parent_id
) {
290 $revIds[] = $row->rev_parent_id
;
293 $this->parentLens
= MediaWikiServices
::getInstance()->getRevisionStore()
294 ->listRevisionSizes( $dbSecondary, $revIds );
297 foreach ( $res as $row ) {
298 if ( ++
$count > $limit ) {
299 // We've reached the one extra which shows that there are
300 // additional pages to be had. Stop here...
301 $this->setContinueEnumParameter( 'continue', $this->continueStr( $row ) );
305 $vals = $this->extractRowInfo( $row );
306 $fit = $this->processRow( $row, $vals, $hookData ) &&
307 $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
309 $this->setContinueEnumParameter( 'continue', $this->continueStr( $row ) );
315 $this->getResult()->addIndexedTagName( [ 'query', $this->getModuleName() ], 'item' );
319 * Prepares the query and returns the limit of rows requested
320 * @param User[] $users
323 private function prepareQuery( array $users, $limit ) {
324 global $wgActorTableSchemaMigrationStage;
326 $this->resetQueryParams();
327 $db = $this->getDB();
329 $revQuery = MediaWikiServices
::getInstance()->getRevisionStore()->getQueryInfo( [ 'page' ] );
330 $this->addTables( $revQuery['tables'] );
331 $this->addJoinConds( $revQuery['joins'] );
332 $this->addFields( $revQuery['fields'] );
334 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
335 $revWhere = ActorMigration
::newMigration()->getWhere( $db, 'rev_user', $users );
336 $orderUserField = 'rev_actor';
337 $userField = $this->orderBy
=== 'actor' ?
'revactor_actor' : 'actor_name';
338 $tsField = 'revactor_timestamp';
339 $idField = 'revactor_rev';
341 // If we're dealing with user names (rather than IDs) in read-old mode,
342 // pass false for ActorMigration::getWhere()'s $useId parameter so
343 // $revWhere['conds'] isn't an OR.
344 $revWhere = ActorMigration
::newMigration()
345 ->getWhere( $db, 'rev_user', $users, $this->orderBy
=== 'id' );
346 $orderUserField = $this->orderBy
=== 'id' ?
'rev_user' : 'rev_user_text';
347 $userField = $revQuery['fields'][$orderUserField];
348 $tsField = 'rev_timestamp';
352 $this->addWhere( $revWhere['conds'] );
354 // Handle continue parameter
355 if ( !is_null( $this->params
['continue'] ) ) {
356 $continue = explode( '|', $this->params
['continue'] );
357 if ( $this->multiUserMode
) {
358 $this->dieContinueUsageIf( count( $continue ) != 4 );
359 $modeFlag = array_shift( $continue );
360 $this->dieContinueUsageIf( $modeFlag !== $this->orderBy
);
361 $encUser = $db->addQuotes( array_shift( $continue ) );
363 $this->dieContinueUsageIf( count( $continue ) != 2 );
365 $encTS = $db->addQuotes( $db->timestamp( $continue[0] ) );
366 $encId = (int)$continue[1];
367 $this->dieContinueUsageIf( $encId != $continue[1] );
368 $op = ( $this->params
['dir'] == 'older' ?
'<' : '>' );
369 if ( $this->multiUserMode
) {
371 "$userField $op $encUser OR " .
372 "($userField = $encUser AND " .
373 "($tsField $op $encTS OR " .
374 "($tsField = $encTS AND " .
375 "$idField $op= $encId)))"
379 "$tsField $op $encTS OR " .
380 "($tsField = $encTS AND " .
381 "$idField $op= $encId)"
386 // Don't include any revisions where we're not supposed to be able to
388 $user = $this->getUser();
389 if ( !$user->isAllowed( 'deletedhistory' ) ) {
390 $bitmask = RevisionRecord
::DELETED_USER
;
391 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
392 $bitmask = RevisionRecord
::DELETED_USER | RevisionRecord
::DELETED_RESTRICTED
;
397 $this->addWhere( $db->bitAnd( 'rev_deleted', $bitmask ) . " != $bitmask" );
400 // Add the user field to ORDER BY if there are multiple users
401 if ( count( $users ) > 1 ) {
402 $this->addWhereRange( $orderUserField, $this->params
['dir'], null, null );
406 $this->addTimestampWhereRange( $tsField,
407 $this->params
['dir'], $this->params
['start'], $this->params
['end'] );
409 // Then rev_id for a total ordering
410 $this->addWhereRange( $idField, $this->params
['dir'], null, null );
412 $this->addWhereFld( 'page_namespace', $this->params
['namespace'] );
414 $show = $this->params
['show'];
415 if ( $this->params
['toponly'] ) { // deprecated/old param
418 if ( !is_null( $show ) ) {
419 $show = array_flip( $show );
421 if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
422 ||
( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
423 ||
( isset( $show['autopatrolled'] ) && isset( $show['!autopatrolled'] ) )
424 ||
( isset( $show['autopatrolled'] ) && isset( $show['!patrolled'] ) )
425 ||
( isset( $show['top'] ) && isset( $show['!top'] ) )
426 ||
( isset( $show['new'] ) && isset( $show['!new'] ) )
428 $this->dieWithError( 'apierror-show' );
431 $this->addWhereIf( 'rev_minor_edit = 0', isset( $show['!minor'] ) );
432 $this->addWhereIf( 'rev_minor_edit != 0', isset( $show['minor'] ) );
434 'rc_patrolled = ' . RecentChange
::PRC_UNPATROLLED
,
435 isset( $show['!patrolled'] )
438 'rc_patrolled != ' . RecentChange
::PRC_UNPATROLLED
,
439 isset( $show['patrolled'] )
442 'rc_patrolled != ' . RecentChange
::PRC_AUTOPATROLLED
,
443 isset( $show['!autopatrolled'] )
446 'rc_patrolled = ' . RecentChange
::PRC_AUTOPATROLLED
,
447 isset( $show['autopatrolled'] )
449 $this->addWhereIf( $idField . ' != page_latest', isset( $show['!top'] ) );
450 $this->addWhereIf( $idField . ' = page_latest', isset( $show['top'] ) );
451 $this->addWhereIf( 'rev_parent_id != 0', isset( $show['!new'] ) );
452 $this->addWhereIf( 'rev_parent_id = 0', isset( $show['new'] ) );
454 $this->addOption( 'LIMIT', $limit +
1 );
456 if ( isset( $show['patrolled'] ) ||
isset( $show['!patrolled'] ) ||
457 isset( $show['autopatrolled'] ) ||
isset( $show['!autopatrolled'] ) ||
$this->fld_patrolled
459 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
460 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
463 $isFilterset = isset( $show['patrolled'] ) ||
isset( $show['!patrolled'] ) ||
464 isset( $show['autopatrolled'] ) ||
isset( $show['!autopatrolled'] );
465 $this->addTables( 'recentchanges' );
466 $this->addJoinConds( [ 'recentchanges' => [
467 $isFilterset ?
'JOIN' : 'LEFT JOIN',
469 // This is a crazy hack. recentchanges has no index on rc_this_oldid, so instead of adding
470 // one T19237 did a join using rc_user_text and rc_timestamp instead. Now rc_user_text is
471 // probably unavailable, so just do rc_timestamp.
472 'rc_timestamp = ' . $tsField,
473 'rc_this_oldid = ' . $idField,
478 $this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled
);
480 if ( $this->fld_tags
) {
481 $this->addTables( 'tag_summary' );
483 [ 'tag_summary' => [ 'LEFT JOIN', [ $idField . ' = ts_rev_id' ] ] ]
485 $this->addFields( 'ts_tags' );
488 if ( isset( $this->params
['tag'] ) ) {
489 $this->addTables( 'change_tag' );
491 [ 'change_tag' => [ 'INNER JOIN', [ $idField . ' = ct_rev_id' ] ] ]
493 $changeTagDefStore = MediaWikiServices
::getInstance()->getChangeTagDefStore();
495 $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $this->params
['tag'] ) );
496 } catch ( NameTableAccessException
$exception ) {
498 $this->addWhere( '1=0' );
504 * Extract fields from the database row and append them to a result array
506 * @param stdClass $row
509 private function extractRowInfo( $row ) {
513 if ( $row->rev_deleted
& RevisionRecord
::DELETED_TEXT
) {
514 $vals['texthidden'] = true;
518 // Any rows where we can't view the user were filtered out in the query.
519 $vals['userid'] = (int)$row->rev_user
;
520 $vals['user'] = $row->rev_user_text
;
521 if ( $row->rev_deleted
& RevisionRecord
::DELETED_USER
) {
522 $vals['userhidden'] = true;
525 if ( $this->fld_ids
) {
526 $vals['pageid'] = intval( $row->rev_page
);
527 $vals['revid'] = intval( $row->rev_id
);
528 // $vals['textid'] = intval( $row->rev_text_id ); // todo: Should this field be exposed?
530 if ( !is_null( $row->rev_parent_id
) ) {
531 $vals['parentid'] = intval( $row->rev_parent_id
);
535 $title = Title
::makeTitle( $row->page_namespace
, $row->page_title
);
537 if ( $this->fld_title
) {
538 ApiQueryBase
::addTitleInfo( $vals, $title );
541 if ( $this->fld_timestamp
) {
542 $vals['timestamp'] = wfTimestamp( TS_ISO_8601
, $row->rev_timestamp
);
545 if ( $this->fld_flags
) {
546 $vals['new'] = $row->rev_parent_id
== 0 && !is_null( $row->rev_parent_id
);
547 $vals['minor'] = (bool)$row->rev_minor_edit
;
548 $vals['top'] = $row->page_latest
== $row->rev_id
;
551 if ( $this->fld_comment ||
$this->fld_parsedcomment
) {
552 if ( $row->rev_deleted
& RevisionRecord
::DELETED_COMMENT
) {
553 $vals['commenthidden'] = true;
557 $userCanView = RevisionRecord
::userCanBitfield(
559 RevisionRecord
::DELETED_COMMENT
, $this->getUser()
562 if ( $userCanView ) {
563 $comment = $this->commentStore
->getComment( 'rev_comment', $row )->text
;
564 if ( $this->fld_comment
) {
565 $vals['comment'] = $comment;
568 if ( $this->fld_parsedcomment
) {
569 $vals['parsedcomment'] = Linker
::formatComment( $comment, $title );
574 if ( $this->fld_patrolled
) {
575 $vals['patrolled'] = $row->rc_patrolled
!= RecentChange
::PRC_UNPATROLLED
;
576 $vals['autopatrolled'] = $row->rc_patrolled
== RecentChange
::PRC_AUTOPATROLLED
;
579 if ( $this->fld_size
&& !is_null( $row->rev_len
) ) {
580 $vals['size'] = intval( $row->rev_len
);
583 if ( $this->fld_sizediff
584 && !is_null( $row->rev_len
)
585 && !is_null( $row->rev_parent_id
)
587 $parentLen = $this->parentLens
[$row->rev_parent_id
] ??
0;
588 $vals['sizediff'] = intval( $row->rev_len
- $parentLen );
591 if ( $this->fld_tags
) {
592 if ( $row->ts_tags
) {
593 $tags = explode( ',', $row->ts_tags
);
594 ApiResult
::setIndexedTagName( $tags, 'tag' );
595 $vals['tags'] = $tags;
601 if ( $anyHidden && ( $row->rev_deleted
& RevisionRecord
::DELETED_RESTRICTED
) ) {
602 $vals['suppressed'] = true;
608 private function continueStr( $row ) {
609 if ( $this->multiUserMode
) {
610 switch ( $this->orderBy
) {
612 return "id|$row->rev_user|$row->rev_timestamp|$row->rev_id";
614 return "name|$row->rev_user_text|$row->rev_timestamp|$row->rev_id";
616 return "actor|$row->rev_actor|$row->rev_timestamp|$row->rev_id";
619 return "$row->rev_timestamp|$row->rev_id";
623 public function getCacheMode( $params ) {
624 // This module provides access to deleted revisions and patrol flags if
625 // the requester is logged in
626 return 'anon-public-user-private';
629 public function getAllowedParams() {
632 ApiBase
::PARAM_DFLT
=> 10,
633 ApiBase
::PARAM_TYPE
=> 'limit',
634 ApiBase
::PARAM_MIN
=> 1,
635 ApiBase
::PARAM_MAX
=> ApiBase
::LIMIT_BIG1
,
636 ApiBase
::PARAM_MAX2
=> ApiBase
::LIMIT_BIG2
639 ApiBase
::PARAM_TYPE
=> 'timestamp'
642 ApiBase
::PARAM_TYPE
=> 'timestamp'
645 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-continue',
648 ApiBase
::PARAM_TYPE
=> 'user',
649 ApiBase
::PARAM_ISMULTI
=> true
652 ApiBase
::PARAM_TYPE
=> 'integer',
653 ApiBase
::PARAM_ISMULTI
=> true
655 'userprefix' => null,
657 ApiBase
::PARAM_DFLT
=> 'older',
658 ApiBase
::PARAM_TYPE
=> [
662 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-direction',
665 ApiBase
::PARAM_ISMULTI
=> true,
666 ApiBase
::PARAM_TYPE
=> 'namespace'
669 ApiBase
::PARAM_ISMULTI
=> true,
670 ApiBase
::PARAM_DFLT
=> 'ids|title|timestamp|comment|size|flags',
671 ApiBase
::PARAM_TYPE
=> [
683 ApiBase
::PARAM_HELP_MSG_PER_VALUE
=> [],
686 ApiBase
::PARAM_ISMULTI
=> true,
687 ApiBase
::PARAM_TYPE
=> [
699 ApiBase
::PARAM_HELP_MSG
=> [
700 'apihelp-query+usercontribs-param-show',
701 $this->getConfig()->get( 'RCMaxAge' )
706 ApiBase
::PARAM_DFLT
=> false,
707 ApiBase
::PARAM_DEPRECATED
=> true,
712 protected function getExamplesMessages() {
714 'action=query&list=usercontribs&ucuser=Example'
715 => 'apihelp-query+usercontribs-example-user',
716 'action=query&list=usercontribs&ucuserprefix=192.0.2.'
717 => 'apihelp-query+usercontribs-example-ipprefix',
721 public function getHelpUrls() {
722 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Usercontribs';
728 * @deprecated since 1.32
730 class_alias( ApiQueryUserContribs
::class, 'ApiQueryContributions' );