MediaWiki  1.29.2
ApiQueryRevisions.php
Go to the documentation of this file.
1 <?php
36 
37  private $token = null;
38 
39  public function __construct( ApiQuery $query, $moduleName ) {
40  parent::__construct( $query, $moduleName, 'rv' );
41  }
42 
43  private $tokenFunctions;
44 
46  protected function getTokenFunctions() {
47  // tokenname => function
48  // function prototype is func($pageid, $title, $rev)
49  // should return token or false
50 
51  // Don't call the hooks twice
52  if ( isset( $this->tokenFunctions ) ) {
53  return $this->tokenFunctions;
54  }
55 
56  // If we're in a mode that breaks the same-origin policy, no tokens can
57  // be obtained
58  if ( $this->lacksSameOriginSecurity() ) {
59  return [];
60  }
61 
62  $this->tokenFunctions = [
63  'rollback' => [ 'ApiQueryRevisions', 'getRollbackToken' ]
64  ];
65  Hooks::run( 'APIQueryRevisionsTokens', [ &$this->tokenFunctions ] );
66 
67  return $this->tokenFunctions;
68  }
69 
77  public static function getRollbackToken( $pageid, $title, $rev ) {
79  if ( !$wgUser->isAllowed( 'rollback' ) ) {
80  return false;
81  }
82 
83  return $wgUser->getEditToken( 'rollback' );
84  }
85 
86  protected function run( ApiPageSet $resultPageSet = null ) {
87  $params = $this->extractRequestParams( false );
88 
89  // If any of those parameters are used, work in 'enumeration' mode.
90  // Enum mode can only be used when exactly one page is provided.
91  // Enumerating revisions on multiple pages make it extremely
92  // difficult to manage continuations and require additional SQL indexes
93  $enumRevMode = ( $params['user'] !== null || $params['excludeuser'] !== null ||
94  $params['limit'] !== null || $params['startid'] !== null ||
95  $params['endid'] !== null || $params['dir'] === 'newer' ||
96  $params['start'] !== null || $params['end'] !== null );
97 
98  $pageSet = $this->getPageSet();
99  $pageCount = $pageSet->getGoodTitleCount();
100  $revCount = $pageSet->getRevisionCount();
101 
102  // Optimization -- nothing to do
103  if ( $revCount === 0 && $pageCount === 0 ) {
104  // Nothing to do
105  return;
106  }
107  if ( $revCount > 0 && count( $pageSet->getLiveRevisionIDs() ) === 0 ) {
108  // We're in revisions mode but all given revisions are deleted
109  return;
110  }
111 
112  if ( $revCount > 0 && $enumRevMode ) {
113  $this->dieWithError(
114  [ 'apierror-revisions-nolist', $this->getModulePrefix() ], 'invalidparammix'
115  );
116  }
117 
118  if ( $pageCount > 1 && $enumRevMode ) {
119  $this->dieWithError(
120  [ 'apierror-revisions-singlepage', $this->getModulePrefix() ], 'invalidparammix'
121  );
122  }
123 
124  // In non-enum mode, rvlimit can't be directly used. Use the maximum
125  // allowed value.
126  if ( !$enumRevMode ) {
127  $this->setParsedLimit = false;
128  $params['limit'] = 'max';
129  }
130 
131  $db = $this->getDB();
132  $this->addTables( [ 'revision', 'page' ] );
133  $this->addJoinConds(
134  [ 'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ] ]
135  );
136 
137  if ( $resultPageSet === null ) {
138  $this->parseParameters( $params );
139  $this->token = $params['token'];
140  $this->addFields( Revision::selectFields() );
141  if ( $this->token !== null || $pageCount > 0 ) {
143  }
144  } else {
145  $this->limit = $this->getParameter( 'limit' ) ?: 10;
146  $this->addFields( [ 'rev_id', 'rev_timestamp', 'rev_page' ] );
147  }
148 
149  if ( $this->fld_tags ) {
150  $this->addTables( 'tag_summary' );
151  $this->addJoinConds(
152  [ 'tag_summary' => [ 'LEFT JOIN', [ 'rev_id=ts_rev_id' ] ] ]
153  );
154  $this->addFields( 'ts_tags' );
155  }
156 
157  if ( $params['tag'] !== null ) {
158  $this->addTables( 'change_tag' );
159  $this->addJoinConds(
160  [ 'change_tag' => [ 'INNER JOIN', [ 'rev_id=ct_rev_id' ] ] ]
161  );
162  $this->addWhereFld( 'ct_tag', $params['tag'] );
163  }
164 
165  if ( $this->fetchContent ) {
166  // For each page we will request, the user must have read rights for that page
167  $user = $this->getUser();
170  foreach ( $pageSet->getGoodTitles() as $title ) {
171  if ( !$title->userCan( 'read', $user ) ) {
172  $status->fatal( ApiMessage::create(
173  [ 'apierror-cannotviewtitle', wfEscapeWikiText( $title->getPrefixedText() ) ],
174  'accessdenied'
175  ) );
176  }
177  }
178  if ( !$status->isGood() ) {
179  $this->dieStatus( $status );
180  }
181 
182  $this->addTables( 'text' );
183  $this->addJoinConds(
184  [ 'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ] ]
185  );
186  $this->addFields( 'old_id' );
188  }
189 
190  // add user name, if needed
191  if ( $this->fld_user ) {
192  $this->addTables( 'user' );
193  $this->addJoinConds( [ 'user' => Revision::userJoinCond() ] );
195  }
196 
197  if ( $enumRevMode ) {
198  // Indexes targeted:
199  // page_timestamp if we don't have rvuser
200  // page_user_timestamp if we have a logged-in rvuser
201  // page_timestamp or usertext_timestamp if we have an IP rvuser
202 
203  // This is mostly to prevent parameter errors (and optimize SQL?)
204  $this->requireMaxOneParameter( $params, 'startid', 'start' );
205  $this->requireMaxOneParameter( $params, 'endid', 'end' );
206  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
207 
208  if ( $params['continue'] !== null ) {
209  $cont = explode( '|', $params['continue'] );
210  $this->dieContinueUsageIf( count( $cont ) != 2 );
211  $op = ( $params['dir'] === 'newer' ? '>' : '<' );
212  $continueTimestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
213  $continueId = (int)$cont[1];
214  $this->dieContinueUsageIf( $continueId != $cont[1] );
215  $this->addWhere( "rev_timestamp $op $continueTimestamp OR " .
216  "(rev_timestamp = $continueTimestamp AND " .
217  "rev_id $op= $continueId)"
218  );
219  }
220 
221  $this->addTimestampWhereRange( 'rev_timestamp', $params['dir'],
222  $params['start'], $params['end'] );
223  $this->addWhereRange( 'rev_id', $params['dir'],
224  $params['startid'], $params['endid'] );
225 
226  // There is only one ID, use it
227  $ids = array_keys( $pageSet->getGoodTitles() );
228  $this->addWhereFld( 'rev_page', reset( $ids ) );
229 
230  if ( $params['user'] !== null ) {
231  $user = User::newFromName( $params['user'] );
232  if ( $user && $user->getId() > 0 ) {
233  $this->addWhereFld( 'rev_user', $user->getId() );
234  } else {
235  $this->addWhereFld( 'rev_user_text', $params['user'] );
236  }
237  } elseif ( $params['excludeuser'] !== null ) {
238  $user = User::newFromName( $params['excludeuser'] );
239  if ( $user && $user->getId() > 0 ) {
240  $this->addWhere( 'rev_user != ' . $user->getId() );
241  } else {
242  $this->addWhere( 'rev_user_text != ' .
243  $db->addQuotes( $params['excludeuser'] ) );
244  }
245  }
246  if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
247  // Paranoia: avoid brute force searches (T19342)
248  if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) {
249  $bitmask = Revision::DELETED_USER;
250  } elseif ( !$this->getUser()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
252  } else {
253  $bitmask = 0;
254  }
255  if ( $bitmask ) {
256  $this->addWhere( $db->bitAnd( 'rev_deleted', $bitmask ) . " != $bitmask" );
257  }
258  }
259  } elseif ( $revCount > 0 ) {
260  // Always targets the PRIMARY index
261 
262  $revs = $pageSet->getLiveRevisionIDs();
263 
264  // Get all revision IDs
265  $this->addWhereFld( 'rev_id', array_keys( $revs ) );
266 
267  if ( $params['continue'] !== null ) {
268  $this->addWhere( 'rev_id >= ' . intval( $params['continue'] ) );
269  }
270  $this->addOption( 'ORDER BY', 'rev_id' );
271  } elseif ( $pageCount > 0 ) {
272  // Always targets the rev_page_id index
273 
274  $titles = $pageSet->getGoodTitles();
275 
276  // When working in multi-page non-enumeration mode,
277  // limit to the latest revision only
278  $this->addWhere( 'page_latest=rev_id' );
279 
280  // Get all page IDs
281  $this->addWhereFld( 'page_id', array_keys( $titles ) );
282  // Every time someone relies on equality propagation, god kills a kitten :)
283  $this->addWhereFld( 'rev_page', array_keys( $titles ) );
284 
285  if ( $params['continue'] !== null ) {
286  $cont = explode( '|', $params['continue'] );
287  $this->dieContinueUsageIf( count( $cont ) != 2 );
288  $pageid = intval( $cont[0] );
289  $revid = intval( $cont[1] );
290  $this->addWhere(
291  "rev_page > $pageid OR " .
292  "(rev_page = $pageid AND " .
293  "rev_id >= $revid)"
294  );
295  }
296  $this->addOption( 'ORDER BY', [
297  'rev_page',
298  'rev_id'
299  ] );
300  } else {
301  ApiBase::dieDebug( __METHOD__, 'param validation?' );
302  }
303 
304  $this->addOption( 'LIMIT', $this->limit + 1 );
305 
306  $count = 0;
307  $generated = [];
308  $hookData = [];
309  $res = $this->select( __METHOD__, [], $hookData );
310 
311  foreach ( $res as $row ) {
312  if ( ++$count > $this->limit ) {
313  // We've reached the one extra which shows that there are
314  // additional pages to be had. Stop here...
315  if ( $enumRevMode ) {
316  $this->setContinueEnumParameter( 'continue',
317  $row->rev_timestamp . '|' . intval( $row->rev_id ) );
318  } elseif ( $revCount > 0 ) {
319  $this->setContinueEnumParameter( 'continue', intval( $row->rev_id ) );
320  } else {
321  $this->setContinueEnumParameter( 'continue', intval( $row->rev_page ) .
322  '|' . intval( $row->rev_id ) );
323  }
324  break;
325  }
326 
327  if ( $resultPageSet !== null ) {
328  $generated[] = $row->rev_id;
329  } else {
330  $revision = new Revision( $row );
331  $rev = $this->extractRevisionInfo( $revision, $row );
332 
333  if ( $this->token !== null ) {
334  $title = $revision->getTitle();
336  foreach ( $this->token as $t ) {
337  $val = call_user_func( $tokenFunctions[$t], $title->getArticleID(), $title, $revision );
338  if ( $val === false ) {
339  $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
340  } else {
341  $rev[$t . 'token'] = $val;
342  }
343  }
344  }
345 
346  $fit = $this->processRow( $row, $rev, $hookData ) &&
347  $this->addPageSubItem( $row->rev_page, $rev, 'rev' );
348  if ( !$fit ) {
349  if ( $enumRevMode ) {
350  $this->setContinueEnumParameter( 'continue',
351  $row->rev_timestamp . '|' . intval( $row->rev_id ) );
352  } elseif ( $revCount > 0 ) {
353  $this->setContinueEnumParameter( 'continue', intval( $row->rev_id ) );
354  } else {
355  $this->setContinueEnumParameter( 'continue', intval( $row->rev_page ) .
356  '|' . intval( $row->rev_id ) );
357  }
358  break;
359  }
360  }
361  }
362 
363  if ( $resultPageSet !== null ) {
364  $resultPageSet->populateFromRevisionIDs( $generated );
365  }
366  }
367 
368  public function getCacheMode( $params ) {
369  if ( isset( $params['token'] ) ) {
370  return 'private';
371  }
372  return parent::getCacheMode( $params );
373  }
374 
375  public function getAllowedParams() {
376  $ret = parent::getAllowedParams() + [
377  'startid' => [
378  ApiBase::PARAM_TYPE => 'integer',
379  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
380  ],
381  'endid' => [
382  ApiBase::PARAM_TYPE => 'integer',
383  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
384  ],
385  'start' => [
386  ApiBase::PARAM_TYPE => 'timestamp',
387  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
388  ],
389  'end' => [
390  ApiBase::PARAM_TYPE => 'timestamp',
391  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
392  ],
393  'dir' => [
394  ApiBase::PARAM_DFLT => 'older',
396  'newer',
397  'older'
398  ],
399  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
400  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
401  ],
402  'user' => [
403  ApiBase::PARAM_TYPE => 'user',
404  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
405  ],
406  'excludeuser' => [
407  ApiBase::PARAM_TYPE => 'user',
408  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
409  ],
410  'tag' => null,
411  'token' => [
413  ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() ),
415  ],
416  'continue' => [
417  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
418  ],
419  ];
420 
421  $ret['limit'][ApiBase::PARAM_HELP_MSG_INFO] = [ [ 'singlepageonly' ] ];
422 
423  return $ret;
424  }
425 
426  protected function getExamplesMessages() {
427  return [
428  'action=query&prop=revisions&titles=API|Main%20Page&' .
429  'rvprop=timestamp|user|comment|content'
430  => 'apihelp-query+revisions-example-content',
431  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
432  'rvprop=timestamp|user|comment'
433  => 'apihelp-query+revisions-example-last5',
434  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
435  'rvprop=timestamp|user|comment&rvdir=newer'
436  => 'apihelp-query+revisions-example-first5',
437  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
438  'rvprop=timestamp|user|comment&rvdir=newer&rvstart=2006-05-01T00:00:00Z'
439  => 'apihelp-query+revisions-example-first5-after',
440  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
441  'rvprop=timestamp|user|comment&rvexcludeuser=127.0.0.1'
442  => 'apihelp-query+revisions-example-first5-not-localhost',
443  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
444  'rvprop=timestamp|user|comment&rvuser=MediaWiki%20default'
445  => 'apihelp-query+revisions-example-first5-user',
446  ];
447  }
448 
449  public function getHelpUrls() {
450  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Revisions';
451  }
452 }
ApiQueryRevisionsBase\parseParameters
parseParameters( $params)
Parse the parameters into the various instance fields.
Definition: ApiQueryRevisionsBase.php:61
Revision\DELETED_USER
const DELETED_USER
Definition: Revision.php:92
Revision\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: Revision.php:93
$wgUser
$wgUser
Definition: Setup.php:781
ApiQueryRevisions\$token
$token
Definition: ApiQueryRevisions.php:37
ApiQueryBase\processRow
processRow( $row, array &$data, array &$hookData)
Call the ApiQueryBaseProcessRow hook.
Definition: ApiQueryBase.php:409
ApiQueryBase\addFields
addFields( $value)
Add a set of fields to select to the internal array.
Definition: ApiQueryBase.php:198
ApiQuery
This is the main query class.
Definition: ApiQuery.php:40
ApiBase\addWarning
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
Definition: ApiBase.php:1720
ApiQueryRevisions\getRollbackToken
static getRollbackToken( $pageid, $title, $rev)
Definition: ApiQueryRevisions.php:77
captcha-old.count
count
Definition: captcha-old.py:225
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1796
ApiQueryBase\addTimestampWhereRange
addTimestampWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end t...
Definition: ApiQueryBase.php:321
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:128
ApiBase\PARAM_TYPE
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition: ApiBase.php:91
$status
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
Definition: hooks.txt:1049
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:246
ApiQueryRevisions\run
run(ApiPageSet $resultPageSet=null)
Definition: ApiQueryRevisions.php:86
$params
$params
Definition: styleTest.css.php:40
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:556
$res
$res
Definition: database.txt:21
ApiQueryBase\addOption
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
Definition: ApiQueryBase.php:333
ContextSource\getUser
getUser()
Get the User object.
Definition: ContextSource.php:133
ApiBase\lacksSameOriginSecurity
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
Definition: ApiBase.php:538
ApiPageSet
This class contains a list of pages that the client has requested.
Definition: ApiPageSet.php:44
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
Revision\selectTextFields
static selectTextFields()
Return the list of text fields that should be selected to read the revision text.
Definition: Revision.php:510
Revision
Definition: Revision.php:33
ApiQueryRevisionsBase
A base class for functions common to producing a list of revisions.
Definition: ApiQueryRevisionsBase.php:32
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:88
ApiBase\PARAM_DEPRECATED
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
Definition: ApiBase.php:109
$query
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1572
ApiQueryGeneratorBase\getPageSet
getPageSet()
Get the PageSet object to work on.
Definition: ApiQueryGeneratorBase.php:62
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:934
$titles
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
Definition: linkcache.txt:17
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:111
ApiQueryRevisions\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryRevisions.php:426
ApiQueryBase\addTables
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
Definition: ApiQueryBase.php:164
ApiQueryBase\select
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
Definition: ApiQueryBase.php:358
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
ApiMessage\create
static create( $msg, $code=null, array $data=null)
Create an IApiMessage for the message.
Definition: ApiMessage.php:212
ApiBase\getModulePrefix
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
Definition: ApiBase.php:498
ApiQueryBase\addWhereRange
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.
Definition: ApiQueryBase.php:286
Revision\selectPageFields
static selectPageFields()
Return the list of page fields that should be selected from page table.
Definition: Revision.php:521
ApiQueryRevisionsBase\extractRevisionInfo
extractRevisionInfo(Revision $revision, $row)
Extract information from the Revision.
Definition: ApiQueryRevisionsBase.php:157
ApiBase\extractRequestParams
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:718
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1950
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:76
ApiQueryBase\addJoinConds
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
Definition: ApiQueryBase.php:187
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:1657
ApiQueryRevisions\getCacheMode
getCacheMode( $params)
Get the cache mode for the data generated by this module.
Definition: ApiQueryRevisions.php:368
$ret
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition: hooks.txt:1956
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere(array($field => $value))
Definition: ApiQueryBase.php:266
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params, $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:792
ApiBase\PARAM_HELP_MSG_INFO
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Definition: ApiBase.php:145
ApiBase\PARAM_DFLT
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:52
$rev
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
Definition: hooks.txt:1741
ApiBase\getParameter
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:742
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
ApiQueryRevisions\getTokenFunctions
getTokenFunctions()
Definition: ApiQueryRevisions.php:46
Revision\userJoinCond
static userJoinCond()
Return the value of a select() JOIN conds array for the user table.
Definition: Revision.php:429
ApiBase\dieStatus
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
Definition: ApiBase.php:1861
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:55
ApiQueryRevisions\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryRevisions.php:449
ApiQueryRevisions\__construct
__construct(ApiQuery $query, $moduleName)
Definition: ApiQueryRevisions.php:39
true
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition: hooks.txt:1956
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:233
Revision\selectUserFields
static selectUserFields()
Return the list of user fields that should be selected from user table.
Definition: Revision.php:536
$t
$t
Definition: testCompression.php:67
ApiQueryRevisions\$tokenFunctions
$tokenFunctions
Definition: ApiQueryRevisions.php:43
ApiQueryRevisions\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryRevisions.php:375
Revision\selectFields
static selectFields()
Return the list of revision fields that should be selected to create a new revision.
Definition: Revision.php:448
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:131
ApiQueryBase\addPageSubItem
addPageSubItem( $pageId, $item, $elemname=null)
Same as addPageSubItems(), but one element of $data at a time.
Definition: ApiQueryBase.php:514
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1962
ApiQueryRevisions
A query action to enumerate revisions of a given page, or show top revisions of multiple pages.
Definition: ApiQueryRevisions.php:35