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 * A query action to enumerate the recent changes that were done to the wiki.
29 * Various filters are supported.
33 class ApiQueryRecentChanges
extends ApiQueryGeneratorBase
{
35 public function __construct( ApiQuery
$query, $moduleName ) {
36 parent
::__construct( $query, $moduleName, 'rc' );
39 private $commentStore;
41 private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
42 $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false,
43 $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false,
44 $fld_tags = false, $fld_sha1 = false, $token = [];
46 private $tokenFunctions;
49 * Get an array mapping token names to their handler functions.
50 * The prototype for a token function is func($pageid, $title, $rc)
51 * it should return a token or false (permission denied)
52 * @deprecated since 1.24
53 * @return array [ tokenname => function ]
55 protected function getTokenFunctions() {
56 // Don't call the hooks twice
57 if ( isset( $this->tokenFunctions
) ) {
58 return $this->tokenFunctions
;
61 // If we're in a mode that breaks the same-origin policy, no tokens can
63 if ( $this->lacksSameOriginSecurity() ) {
67 $this->tokenFunctions
= [
68 'patrol' => [ self
::class, 'getPatrolToken' ]
70 Hooks
::run( 'APIQueryRecentChangesTokens', [ &$this->tokenFunctions
] );
72 return $this->tokenFunctions
;
76 * @deprecated since 1.24
79 * @param RecentChange|null $rc
82 public static function getPatrolToken( $pageid, $title, $rc = null ) {
85 $validTokenUser = false;
88 if ( ( $wgUser->useRCPatrol() && $rc->getAttribute( 'rc_type' ) == RC_EDIT
) ||
89 ( $wgUser->useNPPatrol() && $rc->getAttribute( 'rc_type' ) == RC_NEW
)
91 $validTokenUser = true;
93 } elseif ( $wgUser->useRCPatrol() ||
$wgUser->useNPPatrol() ) {
94 $validTokenUser = true;
97 if ( $validTokenUser ) {
98 // The patrol token is always the same, let's exploit that
99 static $cachedPatrolToken = null;
101 if ( is_null( $cachedPatrolToken ) ) {
102 $cachedPatrolToken = $wgUser->getEditToken( 'patrol' );
105 return $cachedPatrolToken;
112 * Sets internal state to include the desired properties in the output.
113 * @param array $prop Associative array of properties, only keys are used here
115 public function initProperties( $prop ) {
116 $this->fld_comment
= isset( $prop['comment'] );
117 $this->fld_parsedcomment
= isset( $prop['parsedcomment'] );
118 $this->fld_user
= isset( $prop['user'] );
119 $this->fld_userid
= isset( $prop['userid'] );
120 $this->fld_flags
= isset( $prop['flags'] );
121 $this->fld_timestamp
= isset( $prop['timestamp'] );
122 $this->fld_title
= isset( $prop['title'] );
123 $this->fld_ids
= isset( $prop['ids'] );
124 $this->fld_sizes
= isset( $prop['sizes'] );
125 $this->fld_redirect
= isset( $prop['redirect'] );
126 $this->fld_patrolled
= isset( $prop['patrolled'] );
127 $this->fld_loginfo
= isset( $prop['loginfo'] );
128 $this->fld_tags
= isset( $prop['tags'] );
129 $this->fld_sha1
= isset( $prop['sha1'] );
132 public function execute() {
136 public function executeGenerator( $resultPageSet ) {
137 $this->run( $resultPageSet );
141 * Generates and outputs the result of this query based upon the provided parameters.
143 * @param ApiPageSet|null $resultPageSet
145 public function run( $resultPageSet = null ) {
146 $user = $this->getUser();
147 /* Get the parameters of the request. */
148 $params = $this->extractRequestParams();
150 /* Build our basic query. Namely, something along the lines of:
151 * SELECT * FROM recentchanges WHERE rc_timestamp > $start
152 * AND rc_timestamp < $end AND rc_namespace = $namespace
154 $this->addTables( 'recentchanges' );
155 $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
157 if ( !is_null( $params['continue'] ) ) {
158 $cont = explode( '|', $params['continue'] );
159 $this->dieContinueUsageIf( count( $cont ) != 2 );
160 $db = $this->getDB();
161 $timestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
163 $this->dieContinueUsageIf( $id != $cont[1] );
164 $op = $params['dir'] === 'older' ?
'<' : '>';
166 "rc_timestamp $op $timestamp OR " .
167 "(rc_timestamp = $timestamp AND " .
172 $order = $params['dir'] === 'older' ?
'DESC' : 'ASC';
173 $this->addOption( 'ORDER BY', [
174 "rc_timestamp $order",
178 $this->addWhereFld( 'rc_namespace', $params['namespace'] );
180 if ( !is_null( $params['type'] ) ) {
182 $this->addWhereFld( 'rc_type', RecentChange
::parseToRCType( $params['type'] ) );
183 } catch ( Exception
$e ) {
184 ApiBase
::dieDebug( __METHOD__
, $e->getMessage() );
188 $title = $params['title'];
189 if ( !is_null( $title ) ) {
190 $titleObj = Title
::newFromText( $title );
191 if ( is_null( $titleObj ) ) {
192 $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $title ) ] );
194 $this->addWhereFld( 'rc_namespace', $titleObj->getNamespace() );
195 $this->addWhereFld( 'rc_title', $titleObj->getDBkey() );
198 if ( !is_null( $params['show'] ) ) {
199 $show = array_flip( $params['show'] );
201 /* Check for conflicting parameters. */
202 if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
203 ||
( isset( $show['bot'] ) && isset( $show['!bot'] ) )
204 ||
( isset( $show['anon'] ) && isset( $show['!anon'] ) )
205 ||
( isset( $show['redirect'] ) && isset( $show['!redirect'] ) )
206 ||
( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
207 ||
( isset( $show['patrolled'] ) && isset( $show['unpatrolled'] ) )
208 ||
( isset( $show['!patrolled'] ) && isset( $show['unpatrolled'] ) )
209 ||
( isset( $show['autopatrolled'] ) && isset( $show['!autopatrolled'] ) )
210 ||
( isset( $show['autopatrolled'] ) && isset( $show['unpatrolled'] ) )
211 ||
( isset( $show['autopatrolled'] ) && isset( $show['!patrolled'] ) )
213 $this->dieWithError( 'apierror-show' );
217 if ( isset( $show['patrolled'] )
218 ||
isset( $show['!patrolled'] )
219 ||
isset( $show['unpatrolled'] )
220 ||
isset( $show['autopatrolled'] )
221 ||
isset( $show['!autopatrolled'] )
223 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
224 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
228 /* Add additional conditions to query depending upon parameters. */
229 $this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );
230 $this->addWhereIf( 'rc_minor != 0', isset( $show['minor'] ) );
231 $this->addWhereIf( 'rc_bot = 0', isset( $show['!bot'] ) );
232 $this->addWhereIf( 'rc_bot != 0', isset( $show['bot'] ) );
233 if ( isset( $show['anon'] ) ||
isset( $show['!anon'] ) ) {
234 $actorMigration = ActorMigration
::newMigration();
235 $actorQuery = $actorMigration->getJoin( 'rc_user' );
236 $this->addTables( $actorQuery['tables'] );
237 $this->addJoinConds( $actorQuery['joins'] );
239 $actorMigration->isAnon( $actorQuery['fields']['rc_user'] ), isset( $show['anon'] )
242 $actorMigration->isNotAnon( $actorQuery['fields']['rc_user'] ), isset( $show['!anon'] )
245 $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
246 $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
247 $this->addWhereIf( 'page_is_redirect = 1', isset( $show['redirect'] ) );
249 if ( isset( $show['unpatrolled'] ) ) {
250 // See ChangesList::isUnpatrolled
251 if ( $user->useRCPatrol() ) {
252 $this->addWhere( 'rc_patrolled = ' . RecentChange
::PRC_UNPATROLLED
);
253 } elseif ( $user->useNPPatrol() ) {
254 $this->addWhere( 'rc_patrolled = ' . RecentChange
::PRC_UNPATROLLED
);
255 $this->addWhereFld( 'rc_type', RC_NEW
);
260 'rc_patrolled != ' . RecentChange
::PRC_AUTOPATROLLED
,
261 isset( $show['!autopatrolled'] )
264 'rc_patrolled = ' . RecentChange
::PRC_AUTOPATROLLED
,
265 isset( $show['autopatrolled'] )
268 // Don't throw log entries out the window here
270 'page_is_redirect = 0 OR page_is_redirect IS NULL',
271 isset( $show['!redirect'] )
275 $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
277 if ( !is_null( $params['user'] ) ) {
278 // Don't query by user ID here, it might be able to use the rc_user_text index.
279 $actorQuery = ActorMigration
::newMigration()
280 ->getWhere( $this->getDB(), 'rc_user', User
::newFromName( $params['user'], false ), false );
281 $this->addTables( $actorQuery['tables'] );
282 $this->addJoinConds( $actorQuery['joins'] );
283 $this->addWhere( $actorQuery['conds'] );
286 if ( !is_null( $params['excludeuser'] ) ) {
287 // Here there's no chance to use the rc_user_text index, so allow ID to be used.
288 $actorQuery = ActorMigration
::newMigration()
289 ->getWhere( $this->getDB(), 'rc_user', User
::newFromName( $params['excludeuser'], false ) );
290 $this->addTables( $actorQuery['tables'] );
291 $this->addJoinConds( $actorQuery['joins'] );
292 $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' );
295 /* Add the fields we're concerned with to our query. */
306 $showRedirects = false;
307 /* Determine what properties we need to display. */
308 if ( !is_null( $params['prop'] ) ) {
309 $prop = array_flip( $params['prop'] );
311 /* Set up internal members based upon params. */
312 $this->initProperties( $prop );
314 if ( $this->fld_patrolled
&& !$user->useRCPatrol() && !$user->useNPPatrol() ) {
315 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
318 /* Add fields to our query if they are specified as a needed parameter. */
319 $this->addFieldsIf( [ 'rc_this_oldid', 'rc_last_oldid' ], $this->fld_ids
);
320 if ( $this->fld_user ||
$this->fld_userid
) {
321 $actorQuery = ActorMigration
::newMigration()->getJoin( 'rc_user' );
322 $this->addTables( $actorQuery['tables'] );
323 $this->addFields( $actorQuery['fields'] );
324 $this->addJoinConds( $actorQuery['joins'] );
326 $this->addFieldsIf( [ 'rc_minor', 'rc_type', 'rc_bot' ], $this->fld_flags
);
327 $this->addFieldsIf( [ 'rc_old_len', 'rc_new_len' ], $this->fld_sizes
);
328 $this->addFieldsIf( [ 'rc_patrolled', 'rc_log_type' ], $this->fld_patrolled
);
330 [ 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ],
333 $showRedirects = $this->fld_redirect ||
isset( $show['redirect'] )
334 ||
isset( $show['!redirect'] );
336 $this->addFieldsIf( [ 'rc_this_oldid' ],
337 $resultPageSet && $params['generaterevisions'] );
339 if ( $this->fld_tags
) {
340 $this->addFields( [ 'ts_tags' => ChangeTags
::makeTagSummarySubquery( 'recentchanges' ) ] );
343 if ( $this->fld_sha1
) {
344 $this->addTables( 'revision' );
345 $this->addJoinConds( [ 'revision' => [ 'LEFT JOIN',
346 [ 'rc_this_oldid=rev_id' ] ] ] );
347 $this->addFields( [ 'rev_sha1', 'rev_deleted' ] );
350 if ( $params['toponly'] ||
$showRedirects ) {
351 $this->addTables( 'page' );
352 $this->addJoinConds( [ 'page' => [ 'LEFT JOIN',
353 [ 'rc_namespace=page_namespace', 'rc_title=page_title' ] ] ] );
354 $this->addFields( 'page_is_redirect' );
356 if ( $params['toponly'] ) {
357 $this->addWhere( 'rc_this_oldid = page_latest' );
361 if ( !is_null( $params['tag'] ) ) {
362 $this->addTables( 'change_tag' );
363 $this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN', [ 'rc_id=ct_rc_id' ] ] ] );
364 $changeTagDefStore = MediaWikiServices
::getInstance()->getChangeTagDefStore();
366 $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
367 } catch ( NameTableAccessException
$exception ) {
369 $this->addWhere( '1=0' );
373 // Paranoia: avoid brute force searches (T19342)
374 if ( !is_null( $params['user'] ) ||
!is_null( $params['excludeuser'] ) ) {
375 if ( !$user->isAllowed( 'deletedhistory' ) ) {
376 $bitmask = RevisionRecord
::DELETED_USER
;
377 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
378 $bitmask = RevisionRecord
::DELETED_USER | RevisionRecord
::DELETED_RESTRICTED
;
383 $this->addWhere( $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask" );
386 if ( $this->getRequest()->getCheck( 'namespace' ) ) {
387 // LogPage::DELETED_ACTION hides the affected page, too.
388 if ( !$user->isAllowed( 'deletedhistory' ) ) {
389 $bitmask = LogPage
::DELETED_ACTION
;
390 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
391 $bitmask = LogPage
::DELETED_ACTION | LogPage
::DELETED_RESTRICTED
;
396 $this->addWhere( $this->getDB()->makeList( [
397 'rc_type != ' . RC_LOG
,
398 $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask",
403 $this->token
= $params['token'];
405 if ( $this->fld_comment ||
$this->fld_parsedcomment ||
$this->token
) {
406 $this->commentStore
= CommentStore
::getStore();
407 $commentQuery = $this->commentStore
->getJoin( 'rc_comment' );
408 $this->addTables( $commentQuery['tables'] );
409 $this->addFields( $commentQuery['fields'] );
410 $this->addJoinConds( $commentQuery['joins'] );
413 $this->addOption( 'LIMIT', $params['limit'] +
1 );
417 /* Perform the actual query. */
418 $res = $this->select( __METHOD__
, [], $hookData );
423 $result = $this->getResult();
425 /* Iterate through the rows, adding data extracted from them to our query result. */
426 foreach ( $res as $row ) {
427 if ( $count === 0 && $resultPageSet !== null ) {
428 // Set the non-continue since the list of recentchanges is
429 // prone to having entries added at the start frequently.
430 $this->getContinuationManager()->addGeneratorNonContinueParam(
431 $this, 'continue', "$row->rc_timestamp|$row->rc_id"
434 if ( ++
$count > $params['limit'] ) {
435 // We've reached the one extra which shows that there are
436 // additional pages to be had. Stop here...
437 $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
441 if ( is_null( $resultPageSet ) ) {
442 /* Extract the data from a single row. */
443 $vals = $this->extractRowInfo( $row );
445 /* Add that row's data to our final output. */
446 $fit = $this->processRow( $row, $vals, $hookData ) &&
447 $result->addValue( [ 'query', $this->getModuleName() ], null, $vals );
449 $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
452 } elseif ( $params['generaterevisions'] ) {
453 $revid = (int)$row->rc_this_oldid
;
458 $titles[] = Title
::makeTitle( $row->rc_namespace
, $row->rc_title
);
462 if ( is_null( $resultPageSet ) ) {
463 /* Format the result */
464 $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'rc' );
465 } elseif ( $params['generaterevisions'] ) {
466 $resultPageSet->populateFromRevisionIDs( $revids );
468 $resultPageSet->populateFromTitles( $titles );
473 * Extracts from a single sql row the data needed to describe one recent change.
475 * @param stdClass $row The row from which to extract the data.
476 * @return array An array mapping strings (descriptors) to their respective string values.
478 public function extractRowInfo( $row ) {
479 /* Determine the title of the page that has been changed. */
480 $title = Title
::makeTitle( $row->rc_namespace
, $row->rc_title
);
481 $user = $this->getUser();
483 /* Our output data. */
486 $type = (int)$row->rc_type
;
487 $vals['type'] = RecentChange
::parseFromRCType( $type );
491 /* Create a new entry in the result for the title. */
492 if ( $this->fld_title ||
$this->fld_ids
) {
493 if ( $type === RC_LOG
&& ( $row->rc_deleted
& LogPage
::DELETED_ACTION
) ) {
494 $vals['actionhidden'] = true;
497 if ( $type !== RC_LOG ||
498 LogEventsList
::userCanBitfield( $row->rc_deleted
, LogPage
::DELETED_ACTION
, $user )
500 if ( $this->fld_title
) {
501 ApiQueryBase
::addTitleInfo( $vals, $title );
503 if ( $this->fld_ids
) {
504 $vals['pageid'] = (int)$row->rc_cur_id
;
505 $vals['revid'] = (int)$row->rc_this_oldid
;
506 $vals['old_revid'] = (int)$row->rc_last_oldid
;
511 if ( $this->fld_ids
) {
512 $vals['rcid'] = (int)$row->rc_id
;
515 /* Add user data and 'anon' flag, if user is anonymous. */
516 if ( $this->fld_user ||
$this->fld_userid
) {
517 if ( $row->rc_deleted
& RevisionRecord
::DELETED_USER
) {
518 $vals['userhidden'] = true;
521 if ( RevisionRecord
::userCanBitfield( $row->rc_deleted
, RevisionRecord
::DELETED_USER
, $user ) ) {
522 if ( $this->fld_user
) {
523 $vals['user'] = $row->rc_user_text
;
526 if ( $this->fld_userid
) {
527 $vals['userid'] = (int)$row->rc_user
;
530 if ( !$row->rc_user
) {
531 $vals['anon'] = true;
536 /* Add flags, such as new, minor, bot. */
537 if ( $this->fld_flags
) {
538 $vals['bot'] = (bool)$row->rc_bot
;
539 $vals['new'] = $row->rc_type
== RC_NEW
;
540 $vals['minor'] = (bool)$row->rc_minor
;
543 /* Add sizes of each revision. (Only available on 1.10+) */
544 if ( $this->fld_sizes
) {
545 $vals['oldlen'] = (int)$row->rc_old_len
;
546 $vals['newlen'] = (int)$row->rc_new_len
;
549 /* Add the timestamp. */
550 if ( $this->fld_timestamp
) {
551 $vals['timestamp'] = wfTimestamp( TS_ISO_8601
, $row->rc_timestamp
);
554 /* Add edit summary / log summary. */
555 if ( $this->fld_comment ||
$this->fld_parsedcomment
) {
556 if ( $row->rc_deleted
& RevisionRecord
::DELETED_COMMENT
) {
557 $vals['commenthidden'] = true;
560 if ( RevisionRecord
::userCanBitfield(
561 $row->rc_deleted
, RevisionRecord
::DELETED_COMMENT
, $user
563 $comment = $this->commentStore
->getComment( 'rc_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_redirect
) {
575 $vals['redirect'] = (bool)$row->page_is_redirect
;
578 /* Add the patrolled flag */
579 if ( $this->fld_patrolled
) {
580 $vals['patrolled'] = $row->rc_patrolled
!= RecentChange
::PRC_UNPATROLLED
;
581 $vals['unpatrolled'] = ChangesList
::isUnpatrolled( $row, $user );
582 $vals['autopatrolled'] = $row->rc_patrolled
== RecentChange
::PRC_AUTOPATROLLED
;
585 if ( $this->fld_loginfo
&& $row->rc_type
== RC_LOG
) {
586 if ( $row->rc_deleted
& LogPage
::DELETED_ACTION
) {
587 $vals['actionhidden'] = true;
590 if ( LogEventsList
::userCanBitfield( $row->rc_deleted
, LogPage
::DELETED_ACTION
, $user ) ) {
591 $vals['logid'] = (int)$row->rc_logid
;
592 $vals['logtype'] = $row->rc_log_type
;
593 $vals['logaction'] = $row->rc_log_action
;
594 $vals['logparams'] = LogFormatter
::newFromRow( $row )->formatParametersForApi();
598 if ( $this->fld_tags
) {
599 if ( $row->ts_tags
) {
600 $tags = explode( ',', $row->ts_tags
);
601 ApiResult
::setIndexedTagName( $tags, 'tag' );
602 $vals['tags'] = $tags;
608 if ( $this->fld_sha1
&& $row->rev_sha1
!== null ) {
609 if ( $row->rev_deleted
& RevisionRecord
::DELETED_TEXT
) {
610 $vals['sha1hidden'] = true;
613 if ( RevisionRecord
::userCanBitfield(
614 $row->rev_deleted
, RevisionRecord
::DELETED_TEXT
, $user
616 if ( $row->rev_sha1
!== '' ) {
617 $vals['sha1'] = Wikimedia\base_convert
( $row->rev_sha1
, 36, 16, 40 );
624 if ( !is_null( $this->token
) ) {
625 $tokenFunctions = $this->getTokenFunctions();
626 foreach ( $this->token
as $t ) {
627 $val = call_user_func( $tokenFunctions[$t], $row->rc_cur_id
,
628 $title, RecentChange
::newFromRow( $row ) );
629 if ( $val === false ) {
630 $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
632 $vals[$t . 'token'] = $val;
637 if ( $anyHidden && ( $row->rc_deleted
& RevisionRecord
::DELETED_RESTRICTED
) ) {
638 $vals['suppressed'] = true;
644 public function getCacheMode( $params ) {
645 if ( isset( $params['show'] ) ) {
646 foreach ( $params['show'] as $show ) {
647 if ( $show === 'patrolled' ||
$show === '!patrolled' ) {
652 if ( isset( $params['token'] ) ) {
655 if ( $this->userCanSeeRevDel() ) {
658 if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
659 // formatComment() calls wfMessage() among other things
660 return 'anon-public-user-private';
666 public function getAllowedParams() {
669 ApiBase
::PARAM_TYPE
=> 'timestamp'
672 ApiBase
::PARAM_TYPE
=> 'timestamp'
675 ApiBase
::PARAM_DFLT
=> 'older',
676 ApiBase
::PARAM_TYPE
=> [
680 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-direction',
683 ApiBase
::PARAM_ISMULTI
=> true,
684 ApiBase
::PARAM_TYPE
=> 'namespace',
685 ApiBase
::PARAM_EXTRA_NAMESPACES
=> [ NS_MEDIA
, NS_SPECIAL
],
688 ApiBase
::PARAM_TYPE
=> 'user'
691 ApiBase
::PARAM_TYPE
=> 'user'
695 ApiBase
::PARAM_ISMULTI
=> true,
696 ApiBase
::PARAM_DFLT
=> 'title|timestamp|ids',
697 ApiBase
::PARAM_TYPE
=> [
713 ApiBase
::PARAM_HELP_MSG_PER_VALUE
=> [],
716 ApiBase
::PARAM_DEPRECATED
=> true,
717 ApiBase
::PARAM_TYPE
=> array_keys( $this->getTokenFunctions() ),
718 ApiBase
::PARAM_ISMULTI
=> true
721 ApiBase
::PARAM_ISMULTI
=> true,
722 ApiBase
::PARAM_TYPE
=> [
739 ApiBase
::PARAM_DFLT
=> 10,
740 ApiBase
::PARAM_TYPE
=> 'limit',
741 ApiBase
::PARAM_MIN
=> 1,
742 ApiBase
::PARAM_MAX
=> ApiBase
::LIMIT_BIG1
,
743 ApiBase
::PARAM_MAX2
=> ApiBase
::LIMIT_BIG2
746 ApiBase
::PARAM_DFLT
=> 'edit|new|log|categorize',
747 ApiBase
::PARAM_ISMULTI
=> true,
748 ApiBase
::PARAM_TYPE
=> RecentChange
::getChangeTypes()
753 ApiBase
::PARAM_HELP_MSG
=> 'api-help-param-continue',
755 'generaterevisions' => false,
759 protected function getExamplesMessages() {
761 'action=query&list=recentchanges'
762 => 'apihelp-query+recentchanges-example-simple',
763 'action=query&generator=recentchanges&grcshow=!patrolled&prop=info'
764 => 'apihelp-query+recentchanges-example-generator',
768 public function getHelpUrls() {
769 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Recentchanges';