MediaWiki  master
ApiQueryDeletedrevs.php
Go to the documentation of this file.
1 <?php
26 
34 
35  public function __construct( ApiQuery $query, $moduleName ) {
36  parent::__construct( $query, $moduleName, 'dr' );
37  }
38 
39  public function execute() {
40  // Before doing anything at all, let's check permissions
41  $this->checkUserRightsAny( 'deletedhistory' );
42 
43  $this->addDeprecation( 'apiwarn-deprecation-deletedrevs', 'action=query&list=deletedrevs' );
44 
45  $user = $this->getUser();
46  $db = $this->getDB();
47  $commentStore = CommentStore::getStore();
48  $params = $this->extractRequestParams( false );
49  $prop = array_flip( $params['prop'] );
50  $fld_parentid = isset( $prop['parentid'] );
51  $fld_revid = isset( $prop['revid'] );
52  $fld_user = isset( $prop['user'] );
53  $fld_userid = isset( $prop['userid'] );
54  $fld_comment = isset( $prop['comment'] );
55  $fld_parsedcomment = isset( $prop['parsedcomment'] );
56  $fld_minor = isset( $prop['minor'] );
57  $fld_len = isset( $prop['len'] );
58  $fld_sha1 = isset( $prop['sha1'] );
59  $fld_content = isset( $prop['content'] );
60  $fld_token = isset( $prop['token'] );
61  $fld_tags = isset( $prop['tags'] );
62 
63  // If we're in a mode that breaks the same-origin policy, no tokens can
64  // be obtained
65  if ( $this->lacksSameOriginSecurity() ) {
66  $fld_token = false;
67  }
68 
69  // If user can't undelete, no tokens
70  if ( !$this->getPermissionManager()->userHasRight( $user, 'undelete' ) ) {
71  $fld_token = false;
72  }
73 
74  $result = $this->getResult();
75  $pageSet = $this->getPageSet();
76  $titles = $pageSet->getTitles();
77 
78  // This module operates in three modes:
79  // 'revs': List deleted revs for certain titles (1)
80  // 'user': List deleted revs by a certain user (2)
81  // 'all': List all deleted revs in NS (3)
82  $mode = 'all';
83  if ( count( $titles ) > 0 ) {
84  $mode = 'revs';
85  } elseif ( !is_null( $params['user'] ) ) {
86  $mode = 'user';
87  }
88 
89  if ( $mode == 'revs' || $mode == 'user' ) {
90  // Ignore namespace and unique due to inability to know whether they were purposely set
91  foreach ( [ 'from', 'to', 'prefix', /*'namespace', 'unique'*/ ] as $p ) {
92  if ( !is_null( $params[$p] ) ) {
93  $this->dieWithError( [ 'apierror-deletedrevs-param-not-1-2', $p ], 'badparams' );
94  }
95  }
96  } else {
97  foreach ( [ 'start', 'end' ] as $p ) {
98  if ( !is_null( $params[$p] ) ) {
99  $this->dieWithError( [ 'apierror-deletedrevs-param-not-3', $p ], 'badparams' );
100  }
101  }
102  }
103 
104  if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
105  $this->dieWithError( 'user and excludeuser cannot be used together', 'badparams' );
106  }
107 
108  $revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
109  $arQuery = $revisionStore->getArchiveQueryInfo();
110  $this->addTables( $arQuery['tables'] );
111  $this->addFields( $arQuery['fields'] );
112  $this->addJoinConds( $arQuery['joins'] );
113  $this->addFields( [ 'ar_title', 'ar_namespace' ] );
114 
115  if ( $fld_tags ) {
116  $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'archive' ) ] );
117  }
118 
119  if ( !is_null( $params['tag'] ) ) {
120  $this->addTables( 'change_tag' );
121  $this->addJoinConds(
122  [ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
123  );
124  $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
125  try {
126  $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
127  } catch ( NameTableAccessException $exception ) {
128  // Return nothing.
129  $this->addWhere( '1=0' );
130  }
131  }
132 
133  // This means stricter restrictions
134  if ( $fld_content ) {
135  $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] );
136  }
137  // Check limits
138  $userMax = $fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1;
139  $botMax = $fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2;
140 
141  $limit = $params['limit'];
142 
143  if ( $limit == 'max' ) {
144  $limit = $this->getMain()->canApiHighLimits() ? $botMax : $userMax;
145  $this->getResult()->addParsedLimit( $this->getModuleName(), $limit );
146  }
147 
148  $this->validateLimit( 'limit', $limit, 1, $userMax, $botMax );
149 
150  if ( $fld_token ) {
151  // Undelete tokens are identical for all pages, so we cache one here
152  $token = $user->getEditToken( '', $this->getMain()->getRequest() );
153  }
154 
155  $dir = $params['dir'];
156 
157  // We need a custom WHERE clause that matches all titles.
158  if ( $mode == 'revs' ) {
159  $lb = new LinkBatch( $titles );
160  $where = $lb->constructSet( 'ar', $db );
161  $this->addWhere( $where );
162  } elseif ( $mode == 'all' ) {
163  $this->addWhereFld( 'ar_namespace', $params['namespace'] );
164 
165  $from = $params['from'] === null
166  ? null
167  : $this->titlePartToKey( $params['from'], $params['namespace'] );
168  $to = $params['to'] === null
169  ? null
170  : $this->titlePartToKey( $params['to'], $params['namespace'] );
171  $this->addWhereRange( 'ar_title', $dir, $from, $to );
172 
173  if ( isset( $params['prefix'] ) ) {
174  $this->addWhere( 'ar_title' . $db->buildLike(
175  $this->titlePartToKey( $params['prefix'], $params['namespace'] ),
176  $db->anyString() ) );
177  }
178  }
179 
180  if ( !is_null( $params['user'] ) ) {
181  // Don't query by user ID here, it might be able to use the ar_usertext_timestamp index.
182  $actorQuery = ActorMigration::newMigration()
183  ->getWhere( $db, 'ar_user', User::newFromName( $params['user'], false ), false );
184  $this->addTables( $actorQuery['tables'] );
185  $this->addJoinConds( $actorQuery['joins'] );
186  $this->addWhere( $actorQuery['conds'] );
187  } elseif ( !is_null( $params['excludeuser'] ) ) {
188  // Here there's no chance of using ar_usertext_timestamp.
189  $actorQuery = ActorMigration::newMigration()
190  ->getWhere( $db, 'ar_user', User::newFromName( $params['excludeuser'], false ) );
191  $this->addTables( $actorQuery['tables'] );
192  $this->addJoinConds( $actorQuery['joins'] );
193  $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' );
194  }
195 
196  if ( !is_null( $params['user'] ) || !is_null( $params['excludeuser'] ) ) {
197  // Paranoia: avoid brute force searches (T19342)
198  // (shouldn't be able to get here without 'deletedhistory', but
199  // check it again just in case)
200  if ( !$this->getPermissionManager()->userHasRight( $user, 'deletedhistory' ) ) {
201  $bitmask = RevisionRecord::DELETED_USER;
202  } elseif ( !$this->getPermissionManager()
203  ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
204  ) {
205  $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
206  } else {
207  $bitmask = 0;
208  }
209  if ( $bitmask ) {
210  $this->addWhere( $db->bitAnd( 'ar_deleted', $bitmask ) . " != $bitmask" );
211  }
212  }
213 
214  if ( !is_null( $params['continue'] ) ) {
215  $cont = explode( '|', $params['continue'] );
216  $op = ( $dir == 'newer' ? '>' : '<' );
217  if ( $mode == 'all' || $mode == 'revs' ) {
218  $this->dieContinueUsageIf( count( $cont ) != 4 );
219  $ns = (int)$cont[0];
220  $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] );
221  $title = $db->addQuotes( $cont[1] );
222  $ts = $db->addQuotes( $db->timestamp( $cont[2] ) );
223  $ar_id = (int)$cont[3];
224  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[3] );
225  $this->addWhere( "ar_namespace $op $ns OR " .
226  "(ar_namespace = $ns AND " .
227  "(ar_title $op $title OR " .
228  "(ar_title = $title AND " .
229  "(ar_timestamp $op $ts OR " .
230  "(ar_timestamp = $ts AND " .
231  "ar_id $op= $ar_id)))))" );
232  } else {
233  $this->dieContinueUsageIf( count( $cont ) != 2 );
234  $ts = $db->addQuotes( $db->timestamp( $cont[0] ) );
235  $ar_id = (int)$cont[1];
236  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[1] );
237  $this->addWhere( "ar_timestamp $op $ts OR " .
238  "(ar_timestamp = $ts AND " .
239  "ar_id $op= $ar_id)" );
240  }
241  }
242 
243  $this->addOption( 'LIMIT', $limit + 1 );
244  if ( $mode == 'all' ) {
245  if ( $params['unique'] ) {
246  // @todo Does this work on non-MySQL?
247  $this->addOption( 'GROUP BY', 'ar_title' );
248  } else {
249  $sort = ( $dir == 'newer' ? '' : ' DESC' );
250  $this->addOption( 'ORDER BY', [
251  'ar_title' . $sort,
252  'ar_timestamp' . $sort,
253  'ar_id' . $sort,
254  ] );
255  }
256  } else {
257  if ( $mode == 'revs' ) {
258  // Sort by ns and title in the same order as timestamp for efficiency
259  $this->addWhereRange( 'ar_namespace', $dir, null, null );
260  $this->addWhereRange( 'ar_title', $dir, null, null );
261  }
262  $this->addTimestampWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
263  // Include in ORDER BY for uniqueness
264  $this->addWhereRange( 'ar_id', $dir, null, null );
265  }
266  $res = $this->select( __METHOD__ );
267  $pageMap = []; // Maps ns&title to (fake) pageid
268  $count = 0;
269  $newPageID = 0;
270  foreach ( $res as $row ) {
271  if ( ++$count > $limit ) {
272  // We've had enough
273  if ( $mode == 'all' || $mode == 'revs' ) {
274  $this->setContinueEnumParameter( 'continue',
275  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
276  );
277  } else {
278  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
279  }
280  break;
281  }
282 
283  $rev = [];
284  $anyHidden = false;
285 
286  $rev['timestamp'] = wfTimestamp( TS_ISO_8601, $row->ar_timestamp );
287  if ( $fld_revid ) {
288  $rev['revid'] = (int)$row->ar_rev_id;
289  }
290  if ( $fld_parentid && !is_null( $row->ar_parent_id ) ) {
291  $rev['parentid'] = (int)$row->ar_parent_id;
292  }
293  if ( $fld_user || $fld_userid ) {
294  if ( $row->ar_deleted & RevisionRecord::DELETED_USER ) {
295  $rev['userhidden'] = true;
296  $anyHidden = true;
297  }
298  if ( Revision::userCanBitfield( $row->ar_deleted, RevisionRecord::DELETED_USER, $user ) ) {
299  if ( $fld_user ) {
300  $rev['user'] = $row->ar_user_text;
301  }
302  if ( $fld_userid ) {
303  $rev['userid'] = (int)$row->ar_user;
304  }
305  }
306  }
307 
308  if ( $fld_comment || $fld_parsedcomment ) {
309  if ( $row->ar_deleted & RevisionRecord::DELETED_COMMENT ) {
310  $rev['commenthidden'] = true;
311  $anyHidden = true;
312  }
313  if ( Revision::userCanBitfield( $row->ar_deleted, RevisionRecord::DELETED_COMMENT, $user ) ) {
314  $comment = $commentStore->getComment( 'ar_comment', $row )->text;
315  if ( $fld_comment ) {
316  $rev['comment'] = $comment;
317  }
318  if ( $fld_parsedcomment ) {
319  $title = Title::makeTitle( $row->ar_namespace, $row->ar_title );
320  $rev['parsedcomment'] = Linker::formatComment( $comment, $title );
321  }
322  }
323  }
324 
325  if ( $fld_minor ) {
326  $rev['minor'] = $row->ar_minor_edit == 1;
327  }
328  if ( $fld_len ) {
329  $rev['len'] = $row->ar_len;
330  }
331  if ( $fld_sha1 ) {
332  if ( $row->ar_deleted & RevisionRecord::DELETED_TEXT ) {
333  $rev['sha1hidden'] = true;
334  $anyHidden = true;
335  }
336  if ( Revision::userCanBitfield( $row->ar_deleted, RevisionRecord::DELETED_TEXT, $user ) ) {
337  if ( $row->ar_sha1 != '' ) {
338  $rev['sha1'] = Wikimedia\base_convert( $row->ar_sha1, 36, 16, 40 );
339  } else {
340  $rev['sha1'] = '';
341  }
342  }
343  }
344  if ( $fld_content ) {
345  if ( $row->ar_deleted & RevisionRecord::DELETED_TEXT ) {
346  $rev['texthidden'] = true;
347  $anyHidden = true;
348  }
349  if ( Revision::userCanBitfield( $row->ar_deleted, RevisionRecord::DELETED_TEXT, $user ) ) {
350  ApiResult::setContentValue( $rev, 'text', Revision::getRevisionText( $row, 'ar_' ) );
351  }
352  }
353 
354  if ( $fld_tags ) {
355  if ( $row->ts_tags ) {
356  $tags = explode( ',', $row->ts_tags );
357  ApiResult::setIndexedTagName( $tags, 'tag' );
358  $rev['tags'] = $tags;
359  } else {
360  $rev['tags'] = [];
361  }
362  }
363 
364  if ( $anyHidden && ( $row->ar_deleted & RevisionRecord::DELETED_RESTRICTED ) ) {
365  $rev['suppressed'] = true;
366  }
367 
368  if ( !isset( $pageMap[$row->ar_namespace][$row->ar_title] ) ) {
369  $pageID = $newPageID++;
370  $pageMap[$row->ar_namespace][$row->ar_title] = $pageID;
371  $a = [ 'revisions' => [ $rev ] ];
372  ApiResult::setIndexedTagName( $a['revisions'], 'rev' );
373  $title = Title::makeTitle( $row->ar_namespace, $row->ar_title );
375  if ( $fld_token ) {
376  $a['token'] = $token;
377  }
378  $fit = $result->addValue( [ 'query', $this->getModuleName() ], $pageID, $a );
379  } else {
380  $pageID = $pageMap[$row->ar_namespace][$row->ar_title];
381  $fit = $result->addValue(
382  [ 'query', $this->getModuleName(), $pageID, 'revisions' ],
383  null, $rev );
384  }
385  if ( !$fit ) {
386  if ( $mode == 'all' || $mode == 'revs' ) {
387  $this->setContinueEnumParameter( 'continue',
388  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
389  );
390  } else {
391  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
392  }
393  break;
394  }
395  }
396  $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'page' );
397  }
398 
399  public function isDeprecated() {
400  return true;
401  }
402 
403  public function getAllowedParams() {
404  return [
405  'start' => [
406  ApiBase::PARAM_TYPE => 'timestamp',
407  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 1, 2 ] ],
408  ],
409  'end' => [
410  ApiBase::PARAM_TYPE => 'timestamp',
411  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 1, 2 ] ],
412  ],
413  'dir' => [
415  'newer',
416  'older'
417  ],
418  ApiBase::PARAM_DFLT => 'older',
419  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
420  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 1, 3 ] ],
421  ],
422  'from' => [
423  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
424  ],
425  'to' => [
426  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
427  ],
428  'prefix' => [
429  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
430  ],
431  'unique' => [
432  ApiBase::PARAM_DFLT => false,
433  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
434  ],
435  'namespace' => [
436  ApiBase::PARAM_TYPE => 'namespace',
438  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
439  ],
440  'tag' => null,
441  'user' => [
442  ApiBase::PARAM_TYPE => 'user'
443  ],
444  'excludeuser' => [
445  ApiBase::PARAM_TYPE => 'user'
446  ],
447  'prop' => [
448  ApiBase::PARAM_DFLT => 'user|comment',
450  'revid',
451  'parentid',
452  'user',
453  'userid',
454  'comment',
455  'parsedcomment',
456  'minor',
457  'len',
458  'sha1',
459  'content',
460  'token',
461  'tags'
462  ],
464  ],
465  'limit' => [
466  ApiBase::PARAM_DFLT => 10,
467  ApiBase::PARAM_TYPE => 'limit',
468  ApiBase::PARAM_MIN => 1,
471  ],
472  'continue' => [
473  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
474  ],
475  ];
476  }
477 
478  protected function getExamplesMessages() {
479  return [
480  'action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&' .
481  'drprop=user|comment|content'
482  => 'apihelp-query+deletedrevs-example-mode1',
483  'action=query&list=deletedrevs&druser=Bob&drlimit=50'
484  => 'apihelp-query+deletedrevs-example-mode2',
485  'action=query&list=deletedrevs&drdir=newer&drlimit=50'
486  => 'apihelp-query+deletedrevs-example-mode3-main',
487  'action=query&list=deletedrevs&drdir=newer&drlimit=50&drnamespace=1&drunique='
488  => 'apihelp-query+deletedrevs-example-mode3-talk',
489  ];
490  }
491 
492  public function getHelpUrls() {
493  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Deletedrevs';
494  }
495 }
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
Definition: ApiBase.php:94
getDB()
Get the Query database connection (read-only)
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:261
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
getResult()
Get the result object.
Definition: ApiBase.php:640
const NS_MAIN
Definition: Defines.php:60
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
addDeprecation( $msg, $feature, $data=[])
Add a deprecation warning for this module.
Definition: ApiBase.php:1944
validateLimit( $paramName, &$value, $min, $max, $botMax=null, $enforceLimits=false)
Validate the value against the minimum and user/bot maximum limits.
Definition: ApiBase.php:1578
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:55
getMain()
Get the main module.
Definition: ApiBase.php:536
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:259
Exception representing a failure to look up a row from a name table.
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE &#39;integer&#39; and &#39;limit&#39;.
Definition: ApiBase.php:97
This is a base class for all Query modules.
$sort
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Definition: ApiBase.php:148
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
Definition: ApiBase.php:568
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:2011
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user...
Definition: ApiBase.php:761
getPageSet()
Get the PageSet object to work on.
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
Definition: ApiResult.php:478
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:616
static getRevisionText( $row, $prefix='old_', $wiki=false)
Get revision text associated with an old or archive row.
Definition: Revision.php:850
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:34
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static newMigration()
Static constructor.
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition: Linker.php:1165
titlePartToKey( $titlePart, $namespace=NS_MAIN)
Convert an input title or title prefix into a dbkey.
static userCanBitfield( $bitfield, $field, User $user=null, Title $title=null)
Determine if the current user is allowed to view a particular field of this revision, if it&#39;s marked as deleted.
Definition: Revision.php:1046
dieContinueUsageIf( $condition)
Die with the &#39;badcontinue&#39; error.
Definition: ApiBase.php:2204
const LIMIT_SML2
Slow query, apihighlimits limit.
Definition: ApiBase.php:265
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:520
addFields( $value)
Add a set of fields to select to the internal array.
__construct(ApiQuery $query, $moduleName)
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right, for PARAM_TYPE &#39;limit&#39;.
Definition: ApiBase.php:103
This is the main query class.
Definition: ApiQuery.php:37
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter...
Definition: ApiBase.php:131
Query module to enumerate all deleted revisions.
const LIMIT_SML1
Slow query, standard limit.
Definition: ApiBase.php:263
addTimestampWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end t...
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:586
static getStore()
addWhere( $value)
Add a set of WHERE clauses to the internal array.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:58
getPermissionManager()
Obtain a PermissionManager instance that subclasses may use in their authorization checks...
Definition: ApiBase.php:710
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE &#39;integer&#39; and &#39;limit&#39;.
Definition: ApiBase.php:106
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:515
static makeTagSummarySubquery( $tables)
Make the tag summary subquery based on the given tables and return it.
Definition: ChangeTags.php:837
checkUserRightsAny( $rights, $user=null)
Helper function for permission-denied errors.
Definition: ApiBase.php:2126
return true
Definition: router.php:82
addWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, and an ORDER BY clause to sort in the right direction...
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.