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
24 * A query action to enumerate the recent changes that were done to the wiki.
25 * Various filters are supported.
29 class ApiQueryRecentChanges
extends ApiQueryGeneratorBase
{
31 public function __construct( ApiQuery
$query, $moduleName ) {
32 parent
::__construct( $query, $moduleName, 'rc' );
35 private $commentStore;
37 private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
38 $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false,
39 $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false,
40 $fld_tags = false, $fld_sha1 = false, $token = [];
42 private $tokenFunctions;
45 * Get an array mapping token names to their handler functions.
46 * The prototype for a token function is func($pageid, $title, $rc)
47 * it should return a token or false (permission denied)
48 * @deprecated since 1.24
49 * @return array [ tokenname => function ]
51 protected function getTokenFunctions() {
52 // Don't call the hooks twice
53 if ( isset( $this->tokenFunctions
) ) {
54 return $this->tokenFunctions
;
57 // If we're in a mode that breaks the same-origin policy, no tokens can
59 if ( $this->lacksSameOriginSecurity() ) {
63 $this->tokenFunctions
= [
64 'patrol' => [ self
::class, 'getPatrolToken' ]
66 Hooks
::run( 'APIQueryRecentChangesTokens', [ &$this->tokenFunctions
] );
68 return $this->tokenFunctions
;
72 * @deprecated since 1.24
75 * @param RecentChange|null $rc
78 public static function getPatrolToken( $pageid, $title, $rc = null ) {
81 $validTokenUser = false;
84 if ( ( $wgUser->useRCPatrol() && $rc->getAttribute( 'rc_type' ) == RC_EDIT
) ||
85 ( $wgUser->useNPPatrol() && $rc->getAttribute( 'rc_type' ) == RC_NEW
)
87 $validTokenUser = true;
89 } elseif ( $wgUser->useRCPatrol() ||
$wgUser->useNPPatrol() ) {
90 $validTokenUser = true;
93 if ( $validTokenUser ) {
94 // The patrol token is always the same, let's exploit that
95 static $cachedPatrolToken = null;
97 if ( is_null( $cachedPatrolToken ) ) {
98 $cachedPatrolToken = $wgUser->getEditToken( 'patrol' );
101 return $cachedPatrolToken;
108 * Sets internal state to include the desired properties in the output.
109 * @param array $prop Associative array of properties, only keys are used here
111 public function initProperties( $prop ) {
112 $this->fld_comment
= isset( $prop['comment'] );
113 $this->fld_parsedcomment
= isset( $prop['parsedcomment'] );
114 $this->fld_user
= isset( $prop['user'] );
115 $this->fld_userid
= isset( $prop['userid'] );
116 $this->fld_flags
= isset( $prop['flags'] );
117 $this->fld_timestamp
= isset( $prop['timestamp'] );
118 $this->fld_title
= isset( $prop['title'] );
119 $this->fld_ids
= isset( $prop['ids'] );
120 $this->fld_sizes
= isset( $prop['sizes'] );
121 $this->fld_redirect
= isset( $prop['redirect'] );
122 $this->fld_patrolled
= isset( $prop['patrolled'] );
123 $this->fld_loginfo
= isset( $prop['loginfo'] );
124 $this->fld_tags
= isset( $prop['tags'] );
125 $this->fld_sha1
= isset( $prop['sha1'] );
128 public function execute() {
132 public function executeGenerator( $resultPageSet ) {
133 $this->run( $resultPageSet );
137 * Generates and outputs the result of this query based upon the provided parameters.
139 * @param ApiPageSet $resultPageSet
141 public function run( $resultPageSet = null ) {
142 $user = $this->getUser();
143 /* Get the parameters of the request. */
144 $params = $this->extractRequestParams();
146 /* Build our basic query. Namely, something along the lines of:
147 * SELECT * FROM recentchanges WHERE rc_timestamp > $start
148 * AND rc_timestamp < $end AND rc_namespace = $namespace
150 $this->addTables( 'recentchanges' );
151 $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
153 if ( !is_null( $params['continue'] ) ) {
154 $cont = explode( '|', $params['continue'] );
155 $this->dieContinueUsageIf( count( $cont ) != 2 );
156 $db = $this->getDB();
157 $timestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
158 $id = intval( $cont[1] );
159 $this->dieContinueUsageIf( $id != $cont[1] );
160 $op = $params['dir'] === 'older' ?
'<' : '>';
162 "rc_timestamp $op $timestamp OR " .
163 "(rc_timestamp = $timestamp AND " .
168 $order = $params['dir'] === 'older' ?
'DESC' : 'ASC';
169 $this->addOption( 'ORDER BY', [
170 "rc_timestamp $order",
174 $this->addWhereFld( 'rc_namespace', $params['namespace'] );
176 if ( !is_null( $params['type'] ) ) {
178 $this->addWhereFld( 'rc_type', RecentChange
::parseToRCType( $params['type'] ) );
179 } catch ( Exception
$e ) {
180 ApiBase
::dieDebug( __METHOD__
, $e->getMessage() );
184 if ( !is_null( $params['show'] ) ) {
185 $show = array_flip( $params['show'] );
187 /* Check for conflicting parameters. */
188 if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
189 ||
( isset( $show['bot'] ) && isset( $show['!bot'] ) )
190 ||
( isset( $show['anon'] ) && isset( $show['!anon'] ) )
191 ||
( isset( $show['redirect'] ) && isset( $show['!redirect'] ) )
192 ||
( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
193 ||
( isset( $show['patrolled'] ) && isset( $show['unpatrolled'] ) )
194 ||
( isset( $show['!patrolled'] ) && isset( $show['unpatrolled'] ) )
195 ||
( isset( $show['autopatrolled'] ) && isset( $show['!autopatrolled'] ) )
196 ||
( isset( $show['autopatrolled'] ) && isset( $show['unpatrolled'] ) )
197 ||
( isset( $show['autopatrolled'] ) && isset( $show['!patrolled'] ) )
199 $this->dieWithError( 'apierror-show' );
203 if ( $this->includesPatrollingFlags( $show ) ) {
204 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
205 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
209 /* Add additional conditions to query depending upon parameters. */
210 $this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );
211 $this->addWhereIf( 'rc_minor != 0', isset( $show['minor'] ) );
212 $this->addWhereIf( 'rc_bot = 0', isset( $show['!bot'] ) );
213 $this->addWhereIf( 'rc_bot != 0', isset( $show['bot'] ) );
214 if ( isset( $show['anon'] ) ||
isset( $show['!anon'] ) ) {
215 $actorMigration = ActorMigration
::newMigration();
216 $actorQuery = $actorMigration->getJoin( 'rc_user' );
217 $this->addTables( $actorQuery['tables'] );
218 $this->addJoinConds( $actorQuery['joins'] );
220 $actorMigration->isAnon( $actorQuery['fields']['rc_user'] ), isset( $show['anon'] )
223 $actorMigration->isNotAnon( $actorQuery['fields']['rc_user'] ), isset( $show['!anon'] )
226 $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
227 $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
228 $this->addWhereIf( 'page_is_redirect = 1', isset( $show['redirect'] ) );
230 if ( isset( $show['unpatrolled'] ) ) {
231 // See ChangesList::isUnpatrolled
232 if ( $user->useRCPatrol() ) {
233 $this->addWhere( 'rc_patrolled = ' . RecentChange
::PRC_UNPATROLLED
);
234 } elseif ( $user->useNPPatrol() ) {
235 $this->addWhere( 'rc_patrolled = ' . RecentChange
::PRC_UNPATROLLED
);
236 $this->addWhereFld( 'rc_type', RC_NEW
);
241 'rc_patrolled != ' . RecentChange
::PRC_AUTOPATROLLED
,
242 isset( $show['!autopatrolled'] )
245 'rc_patrolled = ' . RecentChange
::PRC_AUTOPATROLLED
,
246 isset( $show['autopatrolled'] )
249 // Don't throw log entries out the window here
251 'page_is_redirect = 0 OR page_is_redirect IS NULL',
252 isset( $show['!redirect'] )
256 $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
258 if ( !is_null( $params['user'] ) ) {
259 // Don't query by user ID here, it might be able to use the rc_user_text index.
260 $actorQuery = ActorMigration
::newMigration()
261 ->getWhere( $this->getDB(), 'rc_user', User
::newFromName( $params['user'], false ), false );
262 $this->addTables( $actorQuery['tables'] );
263 $this->addJoinConds( $actorQuery['joins'] );
264 $this->addWhere( $actorQuery['conds'] );
267 if ( !is_null( $params['excludeuser'] ) ) {
268 // Here there's no chance to use the rc_user_text index, so allow ID to be used.
269 $actorQuery = ActorMigration
::newMigration()
270 ->getWhere( $this->getDB(), 'rc_user', User
::newFromName( $params['excludeuser'], false ) );
271 $this->addTables( $actorQuery['tables'] );
272 $this->addJoinConds( $actorQuery['joins'] );
273 $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' );
276 /* Add the fields we're concerned with to our query. */
287 $showRedirects = false;
288 /* Determine what properties we need to display. */
289 if ( !is_null( $params['prop'] ) ) {
290 $prop = array_flip( $params['prop'] );
292 /* Set up internal members based upon params. */
293 $this->initProperties( $prop );
295 if ( $this->fld_patrolled
&& !$user->useRCPatrol() && !$user->useNPPatrol() ) {
296 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
299 /* Add fields to our query if they are specified as a needed parameter. */
300 $this->addFieldsIf( [ 'rc_this_oldid', 'rc_last_oldid' ], $this->fld_ids
);
301 if ( $this->fld_user ||
$this->fld_userid
) {
302 $actorQuery = ActorMigration
::newMigration()->getJoin( 'rc_user' );
303 $this->addTables( $actorQuery['tables'] );
304 $this->addFields( $actorQuery['fields'] );
305 $this->addJoinConds( $actorQuery['joins'] );
307 $this->addFieldsIf( [ 'rc_minor', 'rc_type', 'rc_bot' ], $this->fld_flags
);
308 $this->addFieldsIf( [ 'rc_old_len', 'rc_new_len' ], $this->fld_sizes
);
309 $this->addFieldsIf( [ 'rc_patrolled', 'rc_log_type' ], $this->fld_patrolled
);
311 [ 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ],
314 $showRedirects = $this->fld_redirect ||
isset( $show['redirect'] )
315 ||
isset( $show['!redirect'] );
317 $this->addFieldsIf( [ 'rc_this_oldid' ],
318 $resultPageSet && $params['generaterevisions'] );
320 if ( $this->fld_tags
) {
321 $this->addTables( 'tag_summary' );
322 $this->addJoinConds( [ 'tag_summary' => [ 'LEFT JOIN', [ 'rc_id=ts_rc_id' ] ] ] );
323 $this->addFields( 'ts_tags' );
326 if ( $this->fld_sha1
) {
327 $this->addTables( 'revision' );
328 $this->addJoinConds( [ 'revision' => [ 'LEFT JOIN',
329 [ 'rc_this_oldid=rev_id' ] ] ] );
330 $this->addFields( [ 'rev_sha1', 'rev_deleted' ] );
333 if ( $params['toponly'] ||
$showRedirects ) {
334 $this->addTables( 'page' );
335 $this->addJoinConds( [ 'page' => [ 'LEFT JOIN',
336 [ 'rc_namespace=page_namespace', 'rc_title=page_title' ] ] ] );
337 $this->addFields( 'page_is_redirect' );
339 if ( $params['toponly'] ) {
340 $this->addWhere( 'rc_this_oldid = page_latest' );
344 if ( !is_null( $params['tag'] ) ) {
345 $this->addTables( 'change_tag' );
346 $this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN', [ 'rc_id=ct_rc_id' ] ] ] );
347 $this->addWhereFld( 'ct_tag', $params['tag'] );
350 // Paranoia: avoid brute force searches (T19342)
351 if ( !is_null( $params['user'] ) ||
!is_null( $params['excludeuser'] ) ) {
352 if ( !$user->isAllowed( 'deletedhistory' ) ) {
353 $bitmask = Revision
::DELETED_USER
;
354 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
355 $bitmask = Revision
::DELETED_USER | Revision
::DELETED_RESTRICTED
;
360 $this->addWhere( $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask" );
363 if ( $this->getRequest()->getCheck( 'namespace' ) ) {
364 // LogPage::DELETED_ACTION hides the affected page, too.
365 if ( !$user->isAllowed( 'deletedhistory' ) ) {
366 $bitmask = LogPage
::DELETED_ACTION
;
367 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
368 $bitmask = LogPage
::DELETED_ACTION | LogPage
::DELETED_RESTRICTED
;
373 $this->addWhere( $this->getDB()->makeList( [
374 'rc_type != ' . RC_LOG
,
375 $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask",
380 $this->token
= $params['token'];
382 if ( $this->fld_comment ||
$this->fld_parsedcomment ||
$this->token
) {
383 $this->commentStore
= CommentStore
::getStore();
384 $commentQuery = $this->commentStore
->getJoin( 'rc_comment' );
385 $this->addTables( $commentQuery['tables'] );
386 $this->addFields( $commentQuery['fields'] );
387 $this->addJoinConds( $commentQuery['joins'] );
390 $this->addOption( 'LIMIT', $params['limit'] +
1 );
394 /* Perform the actual query. */
395 $res = $this->select( __METHOD__
, [], $hookData );
400 $result = $this->getResult();
402 /* Iterate through the rows, adding data extracted from them to our query result. */
403 foreach ( $res as $row ) {
404 if ( $count === 0 && $resultPageSet !== null ) {
405 // Set the non-continue since the list of recentchanges is
406 // prone to having entries added at the start frequently.
407 $this->getContinuationManager()->addGeneratorNonContinueParam(
408 $this, 'continue', "$row->rc_timestamp|$row->rc_id"
411 if ( ++
$count > $params['limit'] ) {
412 // We've reached the one extra which shows that there are
413 // additional pages to be had. Stop here...
414 $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
418 if ( is_null( $resultPageSet ) ) {
419 /* Extract the data from a single row. */
420 $vals = $this->extractRowInfo( $row );
422 /* Add that row's data to our final output. */
423 $fit = $this->processRow( $row, $vals, $hookData ) &&
424 $result->addValue( [ 'query', $this->getModuleName() ], null, $vals );
426 $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
429 } elseif ( $params['generaterevisions'] ) {
430 $revid = (int)$row->rc_this_oldid
;
435 $titles[] = Title
::makeTitle( $row->rc_namespace
, $row->rc_title
);
439 if ( is_null( $resultPageSet ) ) {
440 /* Format the result */
441 $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'rc' );
442 } elseif ( $params['generaterevisions'] ) {
443 $resultPageSet->populateFromRevisionIDs( $revids );
445 $resultPageSet->populateFromTitles( $titles );
450 * Extracts from a single sql row the data needed to describe one recent change.
452 * @param stdClass $row The row from which to extract the data.
453 * @return array An array mapping strings (descriptors) to their respective string values.
456 public function extractRowInfo( $row ) {
457 /* Determine the title of the page that has been changed. */
458 $title = Title
::makeTitle( $row->rc_namespace
, $row->rc_title
);
459 $user = $this->getUser();
461 /* Our output data. */
464 $type = intval( $row->rc_type
);
465 $vals['type'] = RecentChange
::parseFromRCType( $type );
469 /* Create a new entry in the result for the title. */
470 if ( $this->fld_title ||
$this->fld_ids
) {
471 if ( $type === RC_LOG
&& ( $row->rc_deleted
& LogPage
::DELETED_ACTION
) ) {
472 $vals['actionhidden'] = true;
475 if ( $type !== RC_LOG ||
476 LogEventsList
::userCanBitfield( $row->rc_deleted
, LogPage
::DELETED_ACTION
, $user )
478 if ( $this->fld_title
) {
479 ApiQueryBase
::addTitleInfo( $vals, $title );
481 if ( $this->fld_ids
) {
482 $vals['pageid'] = intval( $row->rc_cur_id
);
483 $vals['revid'] = intval( $row->rc_this_oldid
);
484 $vals['old_revid'] = intval( $row->rc_last_oldid
);
489 if ( $this->fld_ids
) {
490 $vals['rcid'] = intval( $row->rc_id
);
493 /* Add user data and 'anon' flag, if user is anonymous. */
494 if ( $this->fld_user ||
$this->fld_userid
) {
495 if ( $row->rc_deleted
& Revision
::DELETED_USER
) {
496 $vals['userhidden'] = true;
499 if ( Revision
::userCanBitfield( $row->rc_deleted
, Revision
::DELETED_USER
, $user ) ) {
500 if ( $this->fld_user
) {
501 $vals['user'] = $row->rc_user_text
;
504 if ( $this->fld_userid
) {
505 $vals['userid'] = (int)$row->rc_user
;
508 if ( !$row->rc_user
) {
509 $vals['anon'] = true;
514 /* Add flags, such as new, minor, bot. */
515 if ( $this->fld_flags
) {
516 $vals['bot'] = (bool)$row->rc_bot
;
517 $vals['new'] = $row->rc_type
== RC_NEW
;
518 $vals['minor'] = (bool)$row->rc_minor
;
521 /* Add sizes of each revision. (Only available on 1.10+) */
522 if ( $this->fld_sizes
) {
523 $vals['oldlen'] = intval( $row->rc_old_len
);
524 $vals['newlen'] = intval( $row->rc_new_len
);
527 /* Add the timestamp. */
528 if ( $this->fld_timestamp
) {
529 $vals['timestamp'] = wfTimestamp( TS_ISO_8601
, $row->rc_timestamp
);
532 /* Add edit summary / log summary. */
533 if ( $this->fld_comment ||
$this->fld_parsedcomment
) {
534 if ( $row->rc_deleted
& Revision
::DELETED_COMMENT
) {
535 $vals['commenthidden'] = true;
538 if ( Revision
::userCanBitfield( $row->rc_deleted
, Revision
::DELETED_COMMENT
, $user ) ) {
539 $comment = $this->commentStore
->getComment( 'rc_comment', $row )->text
;
540 if ( $this->fld_comment
) {
541 $vals['comment'] = $comment;
544 if ( $this->fld_parsedcomment
) {
545 $vals['parsedcomment'] = Linker
::formatComment( $comment, $title );
550 if ( $this->fld_redirect
) {
551 $vals['redirect'] = (bool)$row->page_is_redirect
;
554 /* Add the patrolled flag */
555 if ( $this->fld_patrolled
) {
556 $vals['patrolled'] = $row->rc_patrolled
!= RecentChange
::PRC_UNPATROLLED
;
557 $vals['unpatrolled'] = ChangesList
::isUnpatrolled( $row, $user );
558 $vals['autopatrolled'] = $row->rc_patrolled
== RecentChange
::PRC_AUTOPATROLLED
;
561 if ( $this->fld_loginfo
&& $row->rc_type
== RC_LOG
) {
562 if ( $row->rc_deleted
& LogPage
::DELETED_ACTION
) {
563 $vals['actionhidden'] = true;
566 if ( LogEventsList
::userCanBitfield( $row->rc_deleted
, LogPage
::DELETED_ACTION
, $user ) ) {
567 $vals['logid'] = intval( $row->rc_logid
);
568 $vals['logtype'] = $row->rc_log_type
;
569 $vals['logaction'] = $row->rc_log_action
;
570 $vals['logparams'] = LogFormatter
::newFromRow( $row )->formatParametersForApi();
574 if ( $this->fld_tags
) {
575 if ( $row->ts_tags
) {
576 $tags = explode( ',', $row->ts_tags
);
577 ApiResult
::setIndexedTagName( $tags, 'tag' );
578 $vals['tags'] = $tags;
584 if ( $this->fld_sha1
&& $row->rev_sha1
!== null ) {
585 if ( $row->rev_deleted
& Revision
::DELETED_TEXT
) {
586 $vals['sha1hidden'] = true;
589 if ( Revision
::userCanBitfield( $row->rev_deleted
, Revision
::DELETED_TEXT
, $user ) ) {
590 if ( $row->rev_sha1
!== '' ) {
591 $vals['sha1'] = Wikimedia\base_convert
( $row->rev_sha1
, 36, 16, 40 );
598 if ( !is_null( $this->token
) ) {
599 $tokenFunctions = $this->getTokenFunctions();
600 foreach ( $this->token
as $t ) {
601 $val = call_user_func( $tokenFunctions[$t], $row->rc_cur_id
,
602 $title, RecentChange
::newFromRow( $row ) );
603 if ( $val === false ) {
604 $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
606 $vals[$t . 'token'] = $val;
611 if ( $anyHidden && ( $row->rc_deleted
& Revision
::DELETED_RESTRICTED
) ) {
612 $vals['suppressed'] = true;
619 * @param array $flagsArray flipped array (string flags are keys)
622 private function includesPatrollingFlags( array $flagsArray ) {
623 return isset( $flagsArray['patrolled'] ) ||
624 isset( $flagsArray['!patrolled'] ) ||
625 isset( $flagsArray['unpatrolled'] ) ||
626 isset( $flagsArray['autopatrolled'] ) ||
627 isset( $flagsArray['!autopatrolled'] );
630 public function getCacheMode( $params ) {
631 if ( isset( $params['show'] ) &&
632 $this->includesPatrollingFlags( array_flip( $params['show'] ) )
636 if ( isset( $params['token'] ) ) {
639 if ( $this->userCanSeeRevDel() ) {
642 if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
643 // formatComment() calls wfMessage() among other things
644 return 'anon-public-user-private';
650 public function getAllowedParams() {
653 ApiBase
::PARAM_TYPE
=> 'timestamp'
656 ApiBase
::PARAM_TYPE
=> 'timestamp'
659 ApiBase
::PARAM_DFLT
=> 'older',
660 ApiBase
::PARAM_TYPE
=> [
664 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-direction',
667 ApiBase
::PARAM_ISMULTI
=> true,
668 ApiBase
::PARAM_TYPE
=> 'namespace',
669 ApiBase
::PARAM_EXTRA_NAMESPACES
=> [ NS_MEDIA
, NS_SPECIAL
],
672 ApiBase
::PARAM_TYPE
=> 'user'
675 ApiBase
::PARAM_TYPE
=> 'user'
679 ApiBase
::PARAM_ISMULTI
=> true,
680 ApiBase
::PARAM_DFLT
=> 'title|timestamp|ids',
681 ApiBase
::PARAM_TYPE
=> [
697 ApiBase
::PARAM_HELP_MSG_PER_VALUE
=> [],
700 ApiBase
::PARAM_DEPRECATED
=> true,
701 ApiBase
::PARAM_TYPE
=> array_keys( $this->getTokenFunctions() ),
702 ApiBase
::PARAM_ISMULTI
=> true
705 ApiBase
::PARAM_ISMULTI
=> true,
706 ApiBase
::PARAM_TYPE
=> [
723 ApiBase
::PARAM_DFLT
=> 10,
724 ApiBase
::PARAM_TYPE
=> 'limit',
725 ApiBase
::PARAM_MIN
=> 1,
726 ApiBase
::PARAM_MAX
=> ApiBase
::LIMIT_BIG1
,
727 ApiBase
::PARAM_MAX2
=> ApiBase
::LIMIT_BIG2
730 ApiBase
::PARAM_DFLT
=> 'edit|new|log|categorize',
731 ApiBase
::PARAM_ISMULTI
=> true,
732 ApiBase
::PARAM_TYPE
=> RecentChange
::getChangeTypes()
736 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-continue',
738 'generaterevisions' => false,
742 protected function getExamplesMessages() {
744 'action=query&list=recentchanges'
745 => 'apihelp-query+recentchanges-example-simple',
746 'action=query&generator=recentchanges&grcshow=!patrolled&prop=info'
747 => 'apihelp-query+recentchanges-example-generator',
751 public function getHelpUrls() {
752 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Recentchanges';