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 // The main query may 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 $sort = ( $this->params
['dir'] == 'newer' ?
'' : ' DESC' );
70 $op = ( $this->params
['dir'] == 'older' ?
'<' : '>' );
72 // Create an Iterator that produces the UserIdentity objects we need, depending
73 // on which of the 'userprefix', 'userids', or 'user' params was
75 $this->requireOnlyOneParameter( $this->params
, 'userprefix', 'userids', 'user' );
76 if ( isset( $this->params
['userprefix'] ) ) {
77 $this->multiUserMode
= true;
78 $this->orderBy
= 'name';
81 // Because 'userprefix' might produce a huge number of users (e.g.
82 // a wiki with users "Test00000001" to "Test99999999"), use a
83 // generator with batched lookup and continuation.
84 $userIter = call_user_func( function () use ( $dbSecondary, $sort, $op, $fname ) {
85 global $wgActorTableSchemaMigrationStage;
88 if ( !is_null( $this->params
['continue'] ) ) {
89 $continue = explode( '|', $this->params
['continue'] );
90 $this->dieContinueUsageIf( count( $continue ) != 4 );
91 $this->dieContinueUsageIf( $continue[0] !== 'name' );
92 $fromName = $continue[1];
94 $like = $dbSecondary->buildLike( $this->params
['userprefix'], $dbSecondary->anyString() );
99 $from = $fromName ?
"$op= " . $dbSecondary->addQuotes( $fromName ) : false;
101 // For the new schema, pull from the actor table. For the
102 // old, pull from rev_user.
103 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
104 $res = $dbSecondary->select(
106 [ 'actor_id', 'user_id' => 'COALESCE(actor_user,0)', 'user_name' => 'actor_name' ],
107 array_merge( [ "actor_name$like" ], $from ?
[ "actor_name $from" ] : [] ),
109 [ 'ORDER BY' => [ "user_name $sort" ], 'LIMIT' => $limit ]
112 $res = $dbSecondary->select(
114 [ 'actor_id' => 'NULL', 'user_id' => 'rev_user', 'user_name' => 'rev_user_text' ],
115 array_merge( [ "rev_user_text$like" ], $from ?
[ "rev_user_text $from" ] : [] ),
117 [ 'DISTINCT', 'ORDER BY' => [ "rev_user_text $sort" ], 'LIMIT' => $limit ]
123 foreach ( $res as $row ) {
124 if ( ++
$count >= $limit ) {
125 $fromName = $row->user_name
;
128 yield User
::newFromRow( $row );
130 } while ( $fromName !== false );
132 // Do the actual sorting client-side, because otherwise
133 // prepareQuery might try to sort by actor and confuse everything.
135 } elseif ( isset( $this->params
['userids'] ) ) {
136 if ( $this->params
['userids'] === [] ) {
137 $encParamName = $this->encodeParamName( 'userids' );
138 $this->dieWithError( [ 'apierror-paramempty', $encParamName ], "paramempty_$encParamName" );
142 foreach ( $this->params
['userids'] as $uid ) {
144 $this->dieWithError( [ 'apierror-invaliduserid', $uid ], 'invaliduserid' );
149 $this->orderBy
= 'id';
150 $this->multiUserMode
= count( $ids ) > 1;
152 $from = $fromId = false;
153 if ( $this->multiUserMode
&& !is_null( $this->params
['continue'] ) ) {
154 $continue = explode( '|', $this->params
['continue'] );
155 $this->dieContinueUsageIf( count( $continue ) != 4 );
156 $this->dieContinueUsageIf( $continue[0] !== 'id' && $continue[0] !== 'actor' );
157 $fromId = (int)$continue[1];
158 $this->dieContinueUsageIf( $continue[1] !== (string)$fromId );
159 $from = "$op= $fromId";
162 // For the new schema, just select from the actor table. For the
163 // old, select from user.
164 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
165 $res = $dbSecondary->select(
167 [ 'actor_id', 'user_id' => 'actor_user', 'user_name' => 'actor_name' ],
168 array_merge( [ 'actor_user' => $ids ], $from ?
[ "actor_id $from" ] : [] ),
170 [ 'ORDER BY' => "user_id $sort" ]
173 $res = $dbSecondary->select(
175 [ 'actor_id' => 'NULL', 'user_id' => 'user_id', 'user_name' => 'user_name' ],
176 array_merge( [ 'user_id' => $ids ], $from ?
[ "user_id $from" ] : [] ),
178 [ 'ORDER BY' => "user_id $sort" ]
181 $userIter = UserArray
::newFromResult( $res );
182 $batchSize = count( $ids );
185 if ( !count( $this->params
['user'] ) ) {
186 $encParamName = $this->encodeParamName( 'user' );
188 [ 'apierror-paramempty', $encParamName ], "paramempty_$encParamName"
191 foreach ( $this->params
['user'] as $u ) {
193 $encParamName = $this->encodeParamName( 'user' );
195 [ 'apierror-paramempty', $encParamName ], "paramempty_$encParamName"
199 if ( User
::isIP( $u ) || ExternalUserNames
::isExternal( $u ) ) {
202 $name = User
::getCanonicalName( $u, 'valid' );
203 if ( $name === false ) {
204 $encParamName = $this->encodeParamName( 'user' );
206 [ 'apierror-baduser', $encParamName, wfEscapeWikiText( $u ) ], "baduser_$encParamName"
209 $names[$name] = null;
213 $this->orderBy
= 'name';
214 $this->multiUserMode
= count( $names ) > 1;
216 $from = $fromName = false;
217 if ( $this->multiUserMode
&& !is_null( $this->params
['continue'] ) ) {
218 $continue = explode( '|', $this->params
['continue'] );
219 $this->dieContinueUsageIf( count( $continue ) != 4 );
220 $this->dieContinueUsageIf( $continue[0] !== 'name' && $continue[0] !== 'actor' );
221 $fromName = $continue[1];
222 $from = "$op= " . $dbSecondary->addQuotes( $fromName );
225 // For the new schema, just select from the actor table. For the
226 // old, select from user then merge in any unknown users (IPs and imports).
227 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
228 $res = $dbSecondary->select(
230 [ 'actor_id', 'user_id' => 'actor_user', 'user_name' => 'actor_name' ],
231 array_merge( [ 'actor_name' => array_keys( $names ) ], $from ?
[ "actor_id $from" ] : [] ),
233 [ 'ORDER BY' => "actor_name $sort" ]
235 $userIter = UserArray
::newFromResult( $res );
237 $res = $dbSecondary->select(
239 [ 'actor_id' => 'NULL', 'user_id', 'user_name' ],
240 array_merge( [ 'user_name' => array_keys( $names ) ], $from ?
[ "user_name $from" ] : [] ),
243 foreach ( $res as $row ) {
244 $names[$row->user_name
] = $row;
246 if ( $this->params
['dir'] == 'newer' ) {
247 ksort( $names, SORT_STRING
);
249 krsort( $names, SORT_STRING
);
251 $neg = $op === '>' ?
-1 : 1;
252 $userIter = call_user_func( function () use ( $names, $fromName, $neg ) {
253 foreach ( $names as $name => $row ) {
254 if ( $fromName === false ||
$neg * strcmp( $name, $fromName ) <= 0 ) {
255 $user = $row ? User
::newFromRow( $row ) : User
::newFromName( $name, false );
261 $batchSize = count( $names );
264 // With the new schema, the DB query will order by actor so update $this->orderBy to match.
265 if ( $batchSize > 1 && ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) ) {
266 $this->orderBy
= 'actor';
269 // Use the 'contributions' replica, but only if we're querying by user ID (T216656).
270 if ( $this->orderBy
=== 'id' &&
271 !( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
)
273 $this->selectNamedDB( 'contributions', DB_REPLICA
, 'contributions' );
277 $limit = $this->params
['limit'];
279 while ( $userIter->valid() ) {
281 while ( count( $users ) < $batchSize && $userIter->valid() ) {
282 $users[] = $userIter->current();
287 $this->prepareQuery( $users, $limit - $count );
288 $res = $this->select( __METHOD__
, [], $hookData );
290 if ( $this->fld_sizediff
) {
292 foreach ( $res as $row ) {
293 if ( $row->rev_parent_id
) {
294 $revIds[] = $row->rev_parent_id
;
297 $this->parentLens
= MediaWikiServices
::getInstance()->getRevisionStore()
298 ->listRevisionSizes( $dbSecondary, $revIds );
301 foreach ( $res as $row ) {
302 if ( ++
$count > $limit ) {
303 // We've reached the one extra which shows that there are
304 // additional pages to be had. Stop here...
305 $this->setContinueEnumParameter( 'continue', $this->continueStr( $row ) );
309 $vals = $this->extractRowInfo( $row );
310 $fit = $this->processRow( $row, $vals, $hookData ) &&
311 $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
313 $this->setContinueEnumParameter( 'continue', $this->continueStr( $row ) );
319 $this->getResult()->addIndexedTagName( [ 'query', $this->getModuleName() ], 'item' );
323 * Prepares the query and returns the limit of rows requested
324 * @param User[] $users
327 private function prepareQuery( array $users, $limit ) {
328 global $wgActorTableSchemaMigrationStage;
330 $this->resetQueryParams();
331 $db = $this->getDB();
333 $revQuery = MediaWikiServices
::getInstance()->getRevisionStore()->getQueryInfo( [ 'page' ] );
334 $this->addTables( $revQuery['tables'] );
335 $this->addJoinConds( $revQuery['joins'] );
336 $this->addFields( $revQuery['fields'] );
338 if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW
) {
339 $revWhere = ActorMigration
::newMigration()->getWhere( $db, 'rev_user', $users );
340 $orderUserField = 'rev_actor';
341 $userField = $this->orderBy
=== 'actor' ?
'revactor_actor' : 'actor_name';
342 $tsField = 'revactor_timestamp';
343 $idField = 'revactor_rev';
345 // If we're dealing with user names (rather than IDs) in read-old mode,
346 // pass false for ActorMigration::getWhere()'s $useId parameter so
347 // $revWhere['conds'] isn't an OR.
348 $revWhere = ActorMigration
::newMigration()
349 ->getWhere( $db, 'rev_user', $users, $this->orderBy
=== 'id' );
350 $orderUserField = $this->orderBy
=== 'id' ?
'rev_user' : 'rev_user_text';
351 $userField = $revQuery['fields'][$orderUserField];
352 $tsField = 'rev_timestamp';
356 $this->addWhere( $revWhere['conds'] );
358 // Handle continue parameter
359 if ( !is_null( $this->params
['continue'] ) ) {
360 $continue = explode( '|', $this->params
['continue'] );
361 if ( $this->multiUserMode
) {
362 $this->dieContinueUsageIf( count( $continue ) != 4 );
363 $modeFlag = array_shift( $continue );
364 $this->dieContinueUsageIf( $modeFlag !== $this->orderBy
);
365 $encUser = $db->addQuotes( array_shift( $continue ) );
367 $this->dieContinueUsageIf( count( $continue ) != 2 );
369 $encTS = $db->addQuotes( $db->timestamp( $continue[0] ) );
370 $encId = (int)$continue[1];
371 $this->dieContinueUsageIf( $encId != $continue[1] );
372 $op = ( $this->params
['dir'] == 'older' ?
'<' : '>' );
373 if ( $this->multiUserMode
) {
375 "$userField $op $encUser OR " .
376 "($userField = $encUser AND " .
377 "($tsField $op $encTS OR " .
378 "($tsField = $encTS AND " .
379 "$idField $op= $encId)))"
383 "$tsField $op $encTS OR " .
384 "($tsField = $encTS AND " .
385 "$idField $op= $encId)"
390 // Don't include any revisions where we're not supposed to be able to
392 $user = $this->getUser();
393 if ( !$user->isAllowed( 'deletedhistory' ) ) {
394 $bitmask = RevisionRecord
::DELETED_USER
;
395 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
396 $bitmask = RevisionRecord
::DELETED_USER | RevisionRecord
::DELETED_RESTRICTED
;
401 $this->addWhere( $db->bitAnd( 'rev_deleted', $bitmask ) . " != $bitmask" );
404 // Add the user field to ORDER BY if there are multiple users
405 if ( count( $users ) > 1 ) {
406 $this->addWhereRange( $orderUserField, $this->params
['dir'], null, null );
410 $this->addTimestampWhereRange( $tsField,
411 $this->params
['dir'], $this->params
['start'], $this->params
['end'] );
413 // Then rev_id for a total ordering
414 $this->addWhereRange( $idField, $this->params
['dir'], null, null );
416 $this->addWhereFld( 'page_namespace', $this->params
['namespace'] );
418 $show = $this->params
['show'];
419 if ( $this->params
['toponly'] ) { // deprecated/old param
422 if ( !is_null( $show ) ) {
423 $show = array_flip( $show );
425 if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
426 ||
( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
427 ||
( isset( $show['autopatrolled'] ) && isset( $show['!autopatrolled'] ) )
428 ||
( isset( $show['autopatrolled'] ) && isset( $show['!patrolled'] ) )
429 ||
( isset( $show['top'] ) && isset( $show['!top'] ) )
430 ||
( isset( $show['new'] ) && isset( $show['!new'] ) )
432 $this->dieWithError( 'apierror-show' );
435 $this->addWhereIf( 'rev_minor_edit = 0', isset( $show['!minor'] ) );
436 $this->addWhereIf( 'rev_minor_edit != 0', isset( $show['minor'] ) );
438 'rc_patrolled = ' . RecentChange
::PRC_UNPATROLLED
,
439 isset( $show['!patrolled'] )
442 'rc_patrolled != ' . RecentChange
::PRC_UNPATROLLED
,
443 isset( $show['patrolled'] )
446 'rc_patrolled != ' . RecentChange
::PRC_AUTOPATROLLED
,
447 isset( $show['!autopatrolled'] )
450 'rc_patrolled = ' . RecentChange
::PRC_AUTOPATROLLED
,
451 isset( $show['autopatrolled'] )
453 $this->addWhereIf( $idField . ' != page_latest', isset( $show['!top'] ) );
454 $this->addWhereIf( $idField . ' = page_latest', isset( $show['top'] ) );
455 $this->addWhereIf( 'rev_parent_id != 0', isset( $show['!new'] ) );
456 $this->addWhereIf( 'rev_parent_id = 0', isset( $show['new'] ) );
458 $this->addOption( 'LIMIT', $limit +
1 );
460 if ( isset( $show['patrolled'] ) ||
isset( $show['!patrolled'] ) ||
461 isset( $show['autopatrolled'] ) ||
isset( $show['!autopatrolled'] ) ||
$this->fld_patrolled
463 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
464 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
467 $isFilterset = isset( $show['patrolled'] ) ||
isset( $show['!patrolled'] ) ||
468 isset( $show['autopatrolled'] ) ||
isset( $show['!autopatrolled'] );
469 $this->addTables( 'recentchanges' );
470 $this->addJoinConds( [ 'recentchanges' => [
471 $isFilterset ?
'JOIN' : 'LEFT JOIN',
473 // This is a crazy hack. recentchanges has no index on rc_this_oldid, so instead of adding
474 // one T19237 did a join using rc_user_text and rc_timestamp instead. Now rc_user_text is
475 // probably unavailable, so just do rc_timestamp.
476 'rc_timestamp = ' . $tsField,
477 'rc_this_oldid = ' . $idField,
482 $this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled
);
484 if ( $this->fld_tags
) {
485 $this->addFields( [ 'ts_tags' => ChangeTags
::makeTagSummarySubquery( 'revision' ) ] );
488 if ( isset( $this->params
['tag'] ) ) {
489 $this->addTables( 'change_tag' );
491 [ 'change_tag' => [ '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'] = (int)$row->rev_page
;
527 $vals['revid'] = (int)$row->rev_id
;
529 if ( !is_null( $row->rev_parent_id
) ) {
530 $vals['parentid'] = (int)$row->rev_parent_id
;
534 $title = Title
::makeTitle( $row->page_namespace
, $row->page_title
);
536 if ( $this->fld_title
) {
537 ApiQueryBase
::addTitleInfo( $vals, $title );
540 if ( $this->fld_timestamp
) {
541 $vals['timestamp'] = wfTimestamp( TS_ISO_8601
, $row->rev_timestamp
);
544 if ( $this->fld_flags
) {
545 $vals['new'] = $row->rev_parent_id
== 0 && !is_null( $row->rev_parent_id
);
546 $vals['minor'] = (bool)$row->rev_minor_edit
;
547 $vals['top'] = $row->page_latest
== $row->rev_id
;
550 if ( $this->fld_comment ||
$this->fld_parsedcomment
) {
551 if ( $row->rev_deleted
& RevisionRecord
::DELETED_COMMENT
) {
552 $vals['commenthidden'] = true;
556 $userCanView = RevisionRecord
::userCanBitfield(
558 RevisionRecord
::DELETED_COMMENT
, $this->getUser()
561 if ( $userCanView ) {
562 $comment = $this->commentStore
->getComment( 'rev_comment', $row )->text
;
563 if ( $this->fld_comment
) {
564 $vals['comment'] = $comment;
567 if ( $this->fld_parsedcomment
) {
568 $vals['parsedcomment'] = Linker
::formatComment( $comment, $title );
573 if ( $this->fld_patrolled
) {
574 $vals['patrolled'] = $row->rc_patrolled
!= RecentChange
::PRC_UNPATROLLED
;
575 $vals['autopatrolled'] = $row->rc_patrolled
== RecentChange
::PRC_AUTOPATROLLED
;
578 if ( $this->fld_size
&& !is_null( $row->rev_len
) ) {
579 $vals['size'] = (int)$row->rev_len
;
582 if ( $this->fld_sizediff
583 && !is_null( $row->rev_len
)
584 && !is_null( $row->rev_parent_id
)
586 $parentLen = $this->parentLens
[$row->rev_parent_id
] ??
0;
587 $vals['sizediff'] = (int)$row->rev_len
- $parentLen;
590 if ( $this->fld_tags
) {
591 if ( $row->ts_tags
) {
592 $tags = explode( ',', $row->ts_tags
);
593 ApiResult
::setIndexedTagName( $tags, 'tag' );
594 $vals['tags'] = $tags;
600 if ( $anyHidden && ( $row->rev_deleted
& RevisionRecord
::DELETED_RESTRICTED
) ) {
601 $vals['suppressed'] = true;
607 private function continueStr( $row ) {
608 if ( $this->multiUserMode
) {
609 switch ( $this->orderBy
) {
611 return "id|$row->rev_user|$row->rev_timestamp|$row->rev_id";
613 return "name|$row->rev_user_text|$row->rev_timestamp|$row->rev_id";
615 return "actor|$row->rev_actor|$row->rev_timestamp|$row->rev_id";
618 return "$row->rev_timestamp|$row->rev_id";
622 public function getCacheMode( $params ) {
623 // This module provides access to deleted revisions and patrol flags if
624 // the requester is logged in
625 return 'anon-public-user-private';
628 public function getAllowedParams() {
631 ApiBase
::PARAM_DFLT
=> 10,
632 ApiBase
::PARAM_TYPE
=> 'limit',
633 ApiBase
::PARAM_MIN
=> 1,
634 ApiBase
::PARAM_MAX
=> ApiBase
::LIMIT_BIG1
,
635 ApiBase
::PARAM_MAX2
=> ApiBase
::LIMIT_BIG2
638 ApiBase
::PARAM_TYPE
=> 'timestamp'
641 ApiBase
::PARAM_TYPE
=> 'timestamp'
644 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-continue',
647 ApiBase
::PARAM_TYPE
=> 'user',
648 ApiBase
::PARAM_ISMULTI
=> true
651 ApiBase
::PARAM_TYPE
=> 'integer',
652 ApiBase
::PARAM_ISMULTI
=> true
654 'userprefix' => null,
656 ApiBase
::PARAM_DFLT
=> 'older',
657 ApiBase
::PARAM_TYPE
=> [
661 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-direction',
664 ApiBase
::PARAM_ISMULTI
=> true,
665 ApiBase
::PARAM_TYPE
=> 'namespace'
668 ApiBase
::PARAM_ISMULTI
=> true,
669 ApiBase
::PARAM_DFLT
=> 'ids|title|timestamp|comment|size|flags',
670 ApiBase
::PARAM_TYPE
=> [
682 ApiBase
::PARAM_HELP_MSG_PER_VALUE
=> [],
685 ApiBase
::PARAM_ISMULTI
=> true,
686 ApiBase
::PARAM_TYPE
=> [
698 ApiBase
::PARAM_HELP_MSG
=> [
699 'apihelp-query+usercontribs-param-show',
700 $this->getConfig()->get( 'RCMaxAge' )
705 ApiBase
::PARAM_DFLT
=> false,
706 ApiBase
::PARAM_DEPRECATED
=> true,
711 protected function getExamplesMessages() {
713 'action=query&list=usercontribs&ucuser=Example'
714 => 'apihelp-query+usercontribs-example-user',
715 'action=query&list=usercontribs&ucuserprefix=192.0.2.'
716 => 'apihelp-query+usercontribs-example-ipprefix',
720 public function getHelpUrls() {
721 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Usercontribs';
727 * @deprecated since 1.32
729 class_alias( ApiQueryUserContribs
::class, 'ApiQueryContributions' );