5 * Created on Sep 7, 2006
7 * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
27 if ( !defined( 'MEDIAWIKI' ) ) {
28 // Eclipse helper - will be ignored in production
29 require_once( 'ApiQueryBase.php' );
33 * A query action to enumerate revisions of a given page, or show top revisions of multiple pages.
34 * Various pieces of information may be shown - flags, comments, and the actual wiki markup of the rev.
35 * In the enumeration mode, ranges of revisions may be requested and filtered.
39 class ApiQueryRevisions
extends ApiQueryBase
{
41 private $diffto, $difftotext, $expandTemplates, $generateXML, $section,
42 $token, $parseContent;
44 public function __construct( $query, $moduleName ) {
45 parent
::__construct( $query, $moduleName, 'rv' );
48 private $fld_ids = false, $fld_flags = false, $fld_timestamp = false, $fld_size = false,
49 $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
50 $fld_content = false, $fld_tags = false;
52 private $tokenFunctions;
54 protected function getTokenFunctions() {
55 // tokenname => function
56 // function prototype is func($pageid, $title, $rev)
57 // should return token or false
59 // Don't call the hooks twice
60 if ( isset( $this->tokenFunctions
) ) {
61 return $this->tokenFunctions
;
64 // If we're in JSON callback mode, no tokens can be obtained
65 if ( !is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) ) {
69 $this->tokenFunctions
= array(
70 'rollback' => array( 'ApiQueryRevisions', 'getRollbackToken' )
72 wfRunHooks( 'APIQueryRevisionsTokens', array( &$this->tokenFunctions
) );
73 return $this->tokenFunctions
;
79 * @param $rev Revision
82 public static function getRollbackToken( $pageid, $title, $rev ) {
84 if ( !$wgUser->isAllowed( 'rollback' ) ) {
87 return $wgUser->editToken( array( $title->getPrefixedText(),
88 $rev->getUserText() ) );
91 public function execute() {
92 $params = $this->extractRequestParams( false );
94 // If any of those parameters are used, work in 'enumeration' mode.
95 // Enum mode can only be used when exactly one page is provided.
96 // Enumerating revisions on multiple pages make it extremely
97 // difficult to manage continuations and require additional SQL indexes
98 $enumRevMode = ( !is_null( $params['user'] ) ||
!is_null( $params['excludeuser'] ) ||
99 !is_null( $params['limit'] ) ||
!is_null( $params['startid'] ) ||
100 !is_null( $params['endid'] ) ||
$params['dir'] === 'newer' ||
101 !is_null( $params['start'] ) ||
!is_null( $params['end'] ) );
104 $pageSet = $this->getPageSet();
105 $pageCount = $pageSet->getGoodTitleCount();
106 $revCount = $pageSet->getRevisionCount();
108 // Optimization -- nothing to do
109 if ( $revCount === 0 && $pageCount === 0 ) {
113 if ( $revCount > 0 && $enumRevMode ) {
114 $this->dieUsage( 'The revids= parameter may not be used with the list options (limit, startid, endid, dirNewer, start, end).', 'revids' );
117 if ( $pageCount > 1 && $enumRevMode ) {
118 $this->dieUsage( 'titles, pageids or a generator was used to supply multiple pages, but the limit, startid, endid, dirNewer, user, excludeuser, start and end parameters may only be used on a single page.', 'multpages' );
121 if ( !is_null( $params['difftotext'] ) ) {
122 $this->difftotext
= $params['difftotext'];
123 } elseif ( !is_null( $params['diffto'] ) ) {
124 if ( $params['diffto'] == 'cur' ) {
125 $params['diffto'] = 0;
127 if ( ( !ctype_digit( $params['diffto'] ) ||
$params['diffto'] < 0 )
128 && $params['diffto'] != 'prev' && $params['diffto'] != 'next' ) {
129 $this->dieUsage( 'rvdiffto must be set to a non-negative number, "prev", "next" or "cur"', 'diffto' );
131 // Check whether the revision exists and is readable,
132 // DifferenceEngine returns a rather ambiguous empty
133 // string if that's not the case
134 if ( $params['diffto'] != 0 ) {
135 $difftoRev = Revision
::newFromID( $params['diffto'] );
137 $this->dieUsageMsg( array( 'nosuchrevid', $params['diffto'] ) );
139 if ( !$difftoRev->userCan( Revision
::DELETED_TEXT
) ) {
140 $this->setWarning( "Couldn't diff to r{$difftoRev->getID()}: content is hidden" );
141 $params['diffto'] = null;
144 $this->diffto
= $params['diffto'];
147 $db = $this->getDB();
148 $this->addTables( 'page' );
149 $this->addFields( Revision
::selectFields() );
150 $this->addWhere( 'page_id = rev_page' );
152 $prop = array_flip( $params['prop'] );
155 $this->fld_ids
= isset ( $prop['ids'] );
156 // $this->addFieldsIf('rev_text_id', $this->fld_ids); // should this be exposed?
157 $this->fld_flags
= isset ( $prop['flags'] );
158 $this->fld_timestamp
= isset ( $prop['timestamp'] );
159 $this->fld_comment
= isset ( $prop['comment'] );
160 $this->fld_parsedcomment
= isset ( $prop['parsedcomment'] );
161 $this->fld_size
= isset ( $prop['size'] );
162 $this->fld_userid
= isset( $prop['userid'] );
163 $this->fld_user
= isset ( $prop['user'] );
164 $this->token
= $params['token'];
166 // Possible indexes used
169 $userMax = ( $this->fld_content ? ApiBase
::LIMIT_SML1
: ApiBase
::LIMIT_BIG1
);
170 $botMax = ( $this->fld_content ? ApiBase
::LIMIT_SML2
: ApiBase
::LIMIT_BIG2
);
171 $limit = $params['limit'];
172 if ( $limit == 'max' ) {
173 $limit = $this->getMain()->canApiHighLimits() ?
$botMax : $userMax;
174 $this->getResult()->setParsedLimit( $this->getModuleName(), $limit );
177 if ( !is_null( $this->token
) ||
$pageCount > 0 ) {
178 $this->addFields( Revision
::selectPageFields() );
181 if ( isset( $prop['tags'] ) ) {
182 $this->fld_tags
= true;
183 $this->addTables( 'tag_summary' );
184 $this->addJoinConds( array( 'tag_summary' => array( 'LEFT JOIN', array( 'rev_id=ts_rev_id' ) ) ) );
185 $this->addFields( 'ts_tags' );
188 if ( !is_null( $params['tag'] ) ) {
189 $this->addTables( 'change_tag' );
190 $this->addJoinConds( array( 'change_tag' => array( 'INNER JOIN', array( 'rev_id=ct_rev_id' ) ) ) );
191 $this->addWhereFld( 'ct_tag' , $params['tag'] );
192 global $wgOldChangeTagsIndex;
193 $index['change_tag'] = $wgOldChangeTagsIndex ?
'ct_tag' : 'change_tag_tag_id';
196 if ( isset( $prop['content'] ) ||
!is_null( $this->difftotext
) ) {
197 // For each page we will request, the user must have read rights for that page
198 foreach ( $pageSet->getGoodTitles() as $title ) {
199 if ( !$title->userCanRead() ) {
201 'The current user is not allowed to read ' . $title->getPrefixedText(),
206 $this->addTables( 'text' );
207 $this->addWhere( 'rev_text_id=old_id' );
208 $this->addFields( 'old_id' );
209 $this->addFields( Revision
::selectTextFields() );
211 $this->fld_content
= isset( $prop['content'] );
213 $this->expandTemplates
= $params['expandtemplates'];
214 $this->generateXML
= $params['generatexml'];
215 $this->parseContent
= $params['parse'];
216 if ( $this->parseContent
) {
217 // Must manually initialize unset limit
218 if ( is_null( $limit ) ) {
221 // We are only going to parse 1 revision per request
222 $this->validateLimit( 'limit', $limit, 1, 1, 1 );
224 if ( isset( $params['section'] ) ) {
225 $this->section
= $params['section'];
227 $this->section
= false;
231 // Bug 24166 - API error when using rvprop=tags
232 $this->addTables( 'revision' );
234 if ( $enumRevMode ) {
235 // This is mostly to prevent parameter errors (and optimize SQL?)
236 if ( !is_null( $params['startid'] ) && !is_null( $params['start'] ) ) {
237 $this->dieUsage( 'start and startid cannot be used together', 'badparams' );
240 if ( !is_null( $params['endid'] ) && !is_null( $params['end'] ) ) {
241 $this->dieUsage( 'end and endid cannot be used together', 'badparams' );
244 if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
245 $this->dieUsage( 'user and excludeuser cannot be used together', 'badparams' );
248 // This code makes an assumption that sorting by rev_id and rev_timestamp produces
249 // the same result. This way users may request revisions starting at a given time,
250 // but to page through results use the rev_id returned after each page.
251 // Switching to rev_id removes the potential problem of having more than
252 // one row with the same timestamp for the same page.
253 // The order needs to be the same as start parameter to avoid SQL filesort.
254 if ( is_null( $params['startid'] ) && is_null( $params['endid'] ) ) {
255 $this->addWhereRange( 'rev_timestamp', $params['dir'],
256 $params['start'], $params['end'] );
258 $this->addWhereRange( 'rev_id', $params['dir'],
259 $params['startid'], $params['endid'] );
260 // One of start and end can be set
261 // If neither is set, this does nothing
262 $this->addWhereRange( 'rev_timestamp', $params['dir'],
263 $params['start'], $params['end'], false );
266 // must manually initialize unset limit
267 if ( is_null( $limit ) ) {
270 $this->validateLimit( 'limit', $limit, 1, $userMax, $botMax );
272 // There is only one ID, use it
273 $ids = array_keys( $pageSet->getGoodTitles() );
274 $this->addWhereFld( 'rev_page', reset( $ids ) );
276 if ( !is_null( $params['user'] ) ) {
277 $this->addWhereFld( 'rev_user_text', $params['user'] );
278 } elseif ( !is_null( $params['excludeuser'] ) ) {
279 $this->addWhere( 'rev_user_text != ' .
280 $db->addQuotes( $params['excludeuser'] ) );
282 if ( !is_null( $params['user'] ) ||
!is_null( $params['excludeuser'] ) ) {
283 // Paranoia: avoid brute force searches (bug 17342)
284 $this->addWhere( $db->bitAnd( 'rev_deleted', Revision
::DELETED_USER
) . ' = 0' );
286 } elseif ( $revCount > 0 ) {
287 $max = $this->getMain()->canApiHighLimits() ?
$botMax : $userMax;
288 $revs = $pageSet->getRevisionIDs();
289 if ( self
::truncateArray( $revs, $max ) ) {
290 $this->setWarning( "Too many values supplied for parameter 'revids': the limit is $max" );
293 // Get all revision IDs
294 $this->addWhereFld( 'rev_id', array_keys( $revs ) );
296 if ( !is_null( $params['continue'] ) ) {
297 $this->addWhere( "rev_id >= '" . intval( $params['continue'] ) . "'" );
299 $this->addOption( 'ORDER BY', 'rev_id' );
301 // assumption testing -- we should never get more then $revCount rows.
303 } elseif ( $pageCount > 0 ) {
304 $max = $this->getMain()->canApiHighLimits() ?
$botMax : $userMax;
305 $titles = $pageSet->getGoodTitles();
306 if ( self
::truncateArray( $titles, $max ) ) {
307 $this->setWarning( "Too many values supplied for parameter 'titles': the limit is $max" );
310 // When working in multi-page non-enumeration mode,
311 // limit to the latest revision only
312 $this->addWhere( 'page_id=rev_page' );
313 $this->addWhere( 'page_latest=rev_id' );
316 $this->addWhereFld( 'page_id', array_keys( $titles ) );
317 // Every time someone relies on equality propagation, god kills a kitten :)
318 $this->addWhereFld( 'rev_page', array_keys( $titles ) );
320 if ( !is_null( $params['continue'] ) ) {
321 $cont = explode( '|', $params['continue'] );
322 if ( count( $cont ) != 2 ) {
323 $this->dieUsage( 'Invalid continue param. You should pass the original ' .
324 'value returned by the previous query', '_badcontinue' );
326 $pageid = intval( $cont[0] );
327 $revid = intval( $cont[1] );
329 "rev_page > '$pageid' OR " .
330 "(rev_page = '$pageid' AND " .
331 "rev_id >= '$revid')"
334 $this->addOption( 'ORDER BY', 'rev_page, rev_id' );
336 // assumption testing -- we should never get more then $pageCount rows.
339 ApiBase
::dieDebug( __METHOD__
, 'param validation?' );
342 $this->addOption( 'LIMIT', $limit +
1 );
343 $this->addOption( 'USE INDEX', $index );
346 $res = $this->select( __METHOD__
);
348 foreach ( $res as $row ) {
349 if ( ++
$count > $limit ) {
350 // We've reached the one extra which shows that there are additional pages to be had. Stop here...
351 if ( !$enumRevMode ) {
352 ApiBase
::dieDebug( __METHOD__
, 'Got more rows then expected' ); // bug report
354 $this->setContinueEnumParameter( 'startid', intval( $row->rev_id
) );
358 $fit = $this->addPageSubItem( $row->rev_page
, $this->extractRowInfo( $row ), 'rev' );
360 if ( $enumRevMode ) {
361 $this->setContinueEnumParameter( 'startid', intval( $row->rev_id
) );
362 } elseif ( $revCount > 0 ) {
363 $this->setContinueEnumParameter( 'continue', intval( $row->rev_id
) );
365 $this->setContinueEnumParameter( 'continue', intval( $row->rev_page
) .
366 '|' . intval( $row->rev_id
) );
373 private function extractRowInfo( $row ) {
374 $revision = new Revision( $row );
375 $title = $revision->getTitle();
378 if ( $this->fld_ids
) {
379 $vals['revid'] = intval( $revision->getId() );
380 // $vals['oldid'] = intval( $row->rev_text_id ); // todo: should this be exposed?
381 if ( !is_null( $revision->getParentId() ) ) {
382 $vals['parentid'] = intval( $revision->getParentId() );
386 if ( $this->fld_flags
&& $revision->isMinor() ) {
390 if ( $this->fld_user ||
$this->fld_userid
) {
391 if ( $revision->isDeleted( Revision
::DELETED_USER
) ) {
392 $vals['userhidden'] = '';
394 if ( $this->fld_user
) {
395 $vals['user'] = $revision->getUserText();
397 $userid = $revision->getUser();
402 if ( $this->fld_userid
) {
403 $vals['userid'] = $userid;
408 if ( $this->fld_timestamp
) {
409 $vals['timestamp'] = wfTimestamp( TS_ISO_8601
, $revision->getTimestamp() );
412 if ( $this->fld_size
&& !is_null( $revision->getSize() ) ) {
413 $vals['size'] = intval( $revision->getSize() );
416 if ( $this->fld_comment ||
$this->fld_parsedcomment
) {
417 if ( $revision->isDeleted( Revision
::DELETED_COMMENT
) ) {
418 $vals['commenthidden'] = '';
420 $comment = $revision->getComment();
422 if ( $this->fld_comment
) {
423 $vals['comment'] = $comment;
426 if ( $this->fld_parsedcomment
) {
428 $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $comment, $title );
433 if ( $this->fld_tags
) {
434 if ( $row->ts_tags
) {
435 $tags = explode( ',', $row->ts_tags
);
436 $this->getResult()->setIndexedTagName( $tags, 'tag' );
437 $vals['tags'] = $tags;
439 $vals['tags'] = array();
443 if ( !is_null( $this->token
) ) {
444 $tokenFunctions = $this->getTokenFunctions();
445 foreach ( $this->token
as $t ) {
446 $val = call_user_func( $tokenFunctions[$t], $title->getArticleID(), $title, $revision );
447 if ( $val === false ) {
448 $this->setWarning( "Action '$t' is not allowed for the current user" );
450 $vals[$t . 'token'] = $val;
457 if ( $this->fld_content ||
!is_null( $this->difftotext
) ) {
458 $text = $revision->getText();
459 // Expand templates after getting section content because
460 // template-added sections don't count and Parser::preprocess()
461 // will have less input
462 if ( $this->section
!== false ) {
463 $text = $wgParser->getSection( $text, $this->section
, false );
464 if ( $text === false ) {
465 $this->dieUsage( "There is no section {$this->section} in r" . $revision->getId(), 'nosuchsection' );
469 if ( $this->fld_content
&& !$revision->isDeleted( Revision
::DELETED_TEXT
) ) {
470 if ( $this->generateXML
) {
471 $wgParser->startExternalParse( $title, new ParserOptions(), OT_PREPROCESS
);
472 $dom = $wgParser->preprocessToDom( $text );
473 if ( is_callable( array( $dom, 'saveXML' ) ) ) {
474 $xml = $dom->saveXML();
476 $xml = $dom->__toString();
478 $vals['parsetree'] = $xml;
481 if ( $this->expandTemplates
&& !$this->parseContent
) {
482 $text = $wgParser->preprocess( $text, $title, new ParserOptions() );
484 if ( $this->parseContent
) {
485 $articleObj = new Article( $title );
487 $p_result = $articleObj->getParserOutput();
488 $text = $p_result->getText();
490 ApiResult
::setContent( $vals, $text );
491 } elseif ( $this->fld_content
) {
492 $vals['texthidden'] = '';
495 if ( !is_null( $this->diffto
) ||
!is_null( $this->difftotext
) ) {
496 global $wgAPIMaxUncachedDiffs;
497 static $n = 0; // Number of uncached diffs we've had
498 if ( $n < $wgAPIMaxUncachedDiffs ) {
499 $vals['diff'] = array();
500 if ( !is_null( $this->difftotext
) ) {
501 $engine = new DifferenceEngine( $title );
502 $engine->setText( $text, $this->difftotext
);
504 $engine = new DifferenceEngine( $title, $revision->getID(), $this->diffto
);
505 $vals['diff']['from'] = $engine->getOldid();
506 $vals['diff']['to'] = $engine->getNewid();
508 $difftext = $engine->getDiffBody();
509 ApiResult
::setContent( $vals['diff'], $difftext );
510 if ( !$engine->wasCacheHit() ) {
514 $vals['diff']['notcached'] = '';
520 public function getCacheMode( $params ) {
521 if ( isset( $params['token'] ) ) {
524 if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
525 // formatComment() calls wfMsg() among other things
526 return 'anon-public-user-private';
531 public function getAllowedParams() {
534 ApiBase
::PARAM_ISMULTI
=> true,
535 ApiBase
::PARAM_DFLT
=> 'ids|timestamp|flags|comment|user',
536 ApiBase
::PARAM_TYPE
=> array(
550 ApiBase
::PARAM_TYPE
=> 'limit',
551 ApiBase
::PARAM_MIN
=> 1,
552 ApiBase
::PARAM_MAX
=> ApiBase
::LIMIT_BIG1
,
553 ApiBase
::PARAM_MAX2
=> ApiBase
::LIMIT_BIG2
556 ApiBase
::PARAM_TYPE
=> 'integer'
559 ApiBase
::PARAM_TYPE
=> 'integer'
562 ApiBase
::PARAM_TYPE
=> 'timestamp'
565 ApiBase
::PARAM_TYPE
=> 'timestamp'
568 ApiBase
::PARAM_DFLT
=> 'older',
569 ApiBase
::PARAM_TYPE
=> array(
575 ApiBase
::PARAM_TYPE
=> 'user'
577 'excludeuser' => array(
578 ApiBase
::PARAM_TYPE
=> 'user'
581 'expandtemplates' => false,
582 'generatexml' => false,
586 ApiBase
::PARAM_TYPE
=> array_keys( $this->getTokenFunctions() ),
587 ApiBase
::PARAM_ISMULTI
=> true
591 'difftotext' => null,
595 public function getParamDescription() {
596 $p = $this->getModulePrefix();
599 'Which properties to get for each revision:',
600 ' ids - The ID of the revision',
601 ' flags - Revision flags (minor)',
602 ' timestamp - The timestamp of the revision',
603 ' user - User that made the revision',
604 ' userid - User id of revision creator',
605 ' size - Length of the revision',
606 ' comment - Comment by the user for revision',
607 ' parsedcomment - Parsed comment by the user for the revision',
608 ' content - Text of the revision',
609 ' tags - Tags for the revision',
611 'limit' => 'Limit how many revisions will be returned (enum)',
612 'startid' => 'From which revision id to start enumeration (enum)',
613 'endid' => 'Stop revision enumeration on this revid (enum)',
614 'start' => 'From which revision timestamp to start enumeration (enum)',
615 'end' => 'Enumerate up to this timestamp (enum)',
616 'dir' => $this->getDirectionDescription( $p ),
617 'user' => 'Only include revisions made by user',
618 'excludeuser' => 'Exclude revisions made by user',
619 'expandtemplates' => 'Expand templates in revision content',
620 'generatexml' => 'Generate XML parse tree for revision content',
621 'parse' => 'Parse revision content. For performance reasons if this option is used, rvlimit is enforced to 1.',
622 'section' => 'Only retrieve the content of this section number',
623 'token' => 'Which tokens to obtain for each revision',
624 'continue' => 'When more results are available, use this to continue',
625 'diffto' => array( 'Revision ID to diff each revision to.',
626 'Use "prev", "next" and "cur" for the previous, next and current revision respectively' ),
627 'difftotext' => array( 'Text to diff each revision to. Only diffs a limited number of revisions.',
628 "Overrides {$p}diffto. If {$p}section is set, only that section will be diffed against this text" ),
629 'tag' => 'Only list revisions tagged with this tag',
633 public function getDescription() {
635 'Get revision information',
636 'May be used in several ways:',
637 ' 1) Get data about a set of pages (last revision), by setting titles or pageids parameter',
638 ' 2) Get revisions for one given page, by using titles/pageids with start/end/limit params',
639 ' 3) Get data about a set of revisions by setting their IDs with revids parameter',
640 'All parameters marked as (enum) may only be used with a single page (#2)'
644 public function getPossibleErrors() {
645 return array_merge( parent
::getPossibleErrors(), array(
646 array( 'nosuchrevid', 'diffto' ),
647 array( 'code' => 'revids', 'info' => 'The revids= parameter may not be used with the list options (limit, startid, endid, dirNewer, start, end).' ),
648 array( 'code' => 'multpages', 'info' => 'titles, pageids or a generator was used to supply multiple pages, but the limit, startid, endid, dirNewer, user, excludeuser, start and end parameters may only be used on a single page.' ),
649 array( 'code' => 'diffto', 'info' => 'rvdiffto must be set to a non-negative number, "prev", "next" or "cur"' ),
650 array( 'code' => 'badparams', 'info' => 'start and startid cannot be used together' ),
651 array( 'code' => 'badparams', 'info' => 'end and endid cannot be used together' ),
652 array( 'code' => 'badparams', 'info' => 'user and excludeuser cannot be used together' ),
653 array( 'code' => 'nosuchsection', 'info' => 'There is no section section in rID' ),
657 protected function getExamples() {
659 'Get data with content for the last revision of titles "API" and "Main Page":',
660 ' api.php?action=query&prop=revisions&titles=API|Main%20Page&rvprop=timestamp|user|comment|content',
661 'Get last 5 revisions of the "Main Page":',
662 ' api.php?action=query&prop=revisions&titles=Main%20Page&rvlimit=5&rvprop=timestamp|user|comment',
663 'Get first 5 revisions of the "Main Page":',
664 ' api.php?action=query&prop=revisions&titles=Main%20Page&rvlimit=5&rvprop=timestamp|user|comment&rvdir=newer',
665 'Get first 5 revisions of the "Main Page" made after 2006-05-01:',
666 ' api.php?action=query&prop=revisions&titles=Main%20Page&rvlimit=5&rvprop=timestamp|user|comment&rvdir=newer&rvstart=20060501000000',
667 'Get first 5 revisions of the "Main Page" that were not made made by anonymous user "127.0.0.1"',
668 ' api.php?action=query&prop=revisions&titles=Main%20Page&rvlimit=5&rvprop=timestamp|user|comment&rvexcludeuser=127.0.0.1',
669 'Get first 5 revisions of the "Main Page" that were made by the user "MediaWiki default"',
670 ' api.php?action=query&prop=revisions&titles=Main%20Page&rvlimit=5&rvprop=timestamp|user|comment&rvuser=MediaWiki%20default',
674 public function getVersion() {
675 return __CLASS__
. ': $Id$';