MediaWiki  master
ApiQueryLogEvents.php
Go to the documentation of this file.
1 <?php
26 
33 
35  private $commentStore;
36 
37  public function __construct( ApiQuery $query, $moduleName ) {
38  parent::__construct( $query, $moduleName, 'le' );
39  }
40 
41  private $fld_ids = false, $fld_title = false, $fld_type = false,
42  $fld_user = false, $fld_userid = false,
43  $fld_timestamp = false, $fld_comment = false, $fld_parsedcomment = false,
44  $fld_details = false, $fld_tags = false;
45 
46  public function execute() {
47  $params = $this->extractRequestParams();
48  $db = $this->getDB();
49  $this->commentStore = CommentStore::getStore();
50  $this->requireMaxOneParameter( $params, 'title', 'prefix', 'namespace' );
51 
52  $prop = array_flip( $params['prop'] );
53 
54  $this->fld_ids = isset( $prop['ids'] );
55  $this->fld_title = isset( $prop['title'] );
56  $this->fld_type = isset( $prop['type'] );
57  $this->fld_user = isset( $prop['user'] );
58  $this->fld_userid = isset( $prop['userid'] );
59  $this->fld_timestamp = isset( $prop['timestamp'] );
60  $this->fld_comment = isset( $prop['comment'] );
61  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
62  $this->fld_details = isset( $prop['details'] );
63  $this->fld_tags = isset( $prop['tags'] );
64 
65  $hideLogs = LogEventsList::getExcludeClause( $db, 'user', $this->getUser() );
66  if ( $hideLogs !== false ) {
67  $this->addWhere( $hideLogs );
68  }
69 
70  $actorMigration = ActorMigration::newMigration();
71  $actorQuery = $actorMigration->getJoin( 'log_user' );
72  $this->addTables( 'logging' );
73  $this->addTables( $actorQuery['tables'] );
74  $this->addTables( [ 'user', 'page' ] );
75  $this->addJoinConds( $actorQuery['joins'] );
76  $this->addJoinConds( [
77  'user' => [ 'LEFT JOIN',
78  'user_id=' . $actorQuery['fields']['log_user'] ],
79  'page' => [ 'LEFT JOIN',
80  [ 'log_namespace=page_namespace',
81  'log_title=page_title' ] ] ] );
82 
83  $this->addFields( [
84  'log_id',
85  'log_type',
86  'log_action',
87  'log_timestamp',
88  'log_deleted',
89  ] );
90 
91  $this->addFieldsIf( 'page_id', $this->fld_ids );
92  // log_page is the page_id saved at log time, whereas page_id is from a
93  // join at query time. This leads to different results in various
94  // scenarios, e.g. deletion, recreation.
95  $this->addFieldsIf( 'log_page', $this->fld_ids );
96  $this->addFieldsIf( $actorQuery['fields'] + [ 'user_name' ], $this->fld_user );
97  $this->addFieldsIf( $actorQuery['fields'], $this->fld_userid );
98  $this->addFieldsIf(
99  [ 'log_namespace', 'log_title' ],
100  $this->fld_title || $this->fld_parsedcomment
101  );
102  $this->addFieldsIf( 'log_params', $this->fld_details );
103 
104  if ( $this->fld_comment || $this->fld_parsedcomment ) {
105  $commentQuery = $this->commentStore->getJoin( 'log_comment' );
106  $this->addTables( $commentQuery['tables'] );
107  $this->addFields( $commentQuery['fields'] );
108  $this->addJoinConds( $commentQuery['joins'] );
109  }
110 
111  if ( $this->fld_tags ) {
112  $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'logging' ) ] );
113  }
114 
115  if ( $params['tag'] !== null ) {
116  $this->addTables( 'change_tag' );
117  $this->addJoinConds( [ 'change_tag' => [ 'JOIN',
118  [ 'log_id=ct_log_id' ] ] ] );
119  $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
120  try {
121  $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
122  } catch ( NameTableAccessException $exception ) {
123  // Return nothing.
124  $this->addWhere( '1=0' );
125  }
126  }
127 
128  if ( $params['action'] !== null ) {
129  // Do validation of action param, list of allowed actions can contains wildcards
130  // Allow the param, when the actions is in the list or a wildcard version is listed.
131  $logAction = $params['action'];
132  if ( strpos( $logAction, '/' ) === false ) {
133  // all items in the list have a slash
134  $valid = false;
135  } else {
136  $logActions = array_flip( $this->getAllowedLogActions() );
137  list( $type, $action ) = explode( '/', $logAction, 2 );
138  $valid = isset( $logActions[$logAction] ) || isset( $logActions[$type . '/*'] );
139  }
140 
141  if ( !$valid ) {
142  $encParamName = $this->encodeParamName( 'action' );
143  $this->dieWithError(
144  [ 'apierror-unrecognizedvalue', $encParamName, wfEscapeWikiText( $logAction ) ],
145  "unknown_$encParamName"
146  );
147  }
148 
149  $this->addWhereFld( 'log_type', $type );
150  $this->addWhereFld( 'log_action', $action );
151  } elseif ( $params['type'] !== null ) {
152  $this->addWhereFld( 'log_type', $params['type'] );
153  }
154 
155  $this->addTimestampWhereRange(
156  'log_timestamp',
157  $params['dir'],
158  $params['start'],
159  $params['end']
160  );
161  // Include in ORDER BY for uniqueness
162  $this->addWhereRange( 'log_id', $params['dir'], null, null );
163 
164  if ( $params['continue'] !== null ) {
165  $cont = explode( '|', $params['continue'] );
166  $this->dieContinueUsageIf( count( $cont ) != 2 );
167  $op = ( $params['dir'] === 'newer' ? '>' : '<' );
168  $continueTimestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
169  $continueId = (int)$cont[1];
170  $this->dieContinueUsageIf( $continueId != $cont[1] );
171  $this->addWhere( "log_timestamp $op $continueTimestamp OR " .
172  "(log_timestamp = $continueTimestamp AND " .
173  "log_id $op= $continueId)"
174  );
175  }
176 
177  $limit = $params['limit'];
178  $this->addOption( 'LIMIT', $limit + 1 );
179 
180  $user = $params['user'];
181  if ( $user !== null ) {
182  // Note the joins in $q are the same as those from ->getJoin() above
183  // so we only need to add 'conds' here.
184  $q = $actorMigration->getWhere( $db, 'log_user', $params['user'] );
185  $this->addWhere( $q['conds'] );
186 
187  // T71222: MariaDB's optimizer, at least 10.1.37 and .38, likes to choose a wildly bad plan for
188  // some reason for this code path. Tell it not to use the wrong index it wants to pick.
189  // @phan-suppress-next-line PhanTypeMismatchArgument
190  $this->addOption( 'IGNORE INDEX', [ 'logging' => [ 'times' ] ] );
191  }
192 
193  $title = $params['title'];
194  if ( $title !== null ) {
195  $titleObj = Title::newFromText( $title );
196  if ( $titleObj === null ) {
197  $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $title ) ] );
198  }
199  $this->addWhereFld( 'log_namespace', $titleObj->getNamespace() );
200  $this->addWhereFld( 'log_title', $titleObj->getDBkey() );
201  }
202 
203  if ( $params['namespace'] !== null ) {
204  $this->addWhereFld( 'log_namespace', $params['namespace'] );
205  }
206 
207  $prefix = $params['prefix'];
208 
209  if ( $prefix !== null ) {
210  if ( $this->getConfig()->get( 'MiserMode' ) ) {
211  $this->dieWithError( 'apierror-prefixsearchdisabled' );
212  }
213 
214  $title = Title::newFromText( $prefix );
215  if ( $title === null ) {
216  $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $prefix ) ] );
217  }
218  $this->addWhereFld( 'log_namespace', $title->getNamespace() );
219  $this->addWhere( 'log_title ' . $db->buildLike( $title->getDBkey(), $db->anyString() ) );
220  }
221 
222  // Paranoia: avoid brute force searches (T19342)
223  if ( $params['namespace'] !== null || $title !== null || $user !== null ) {
224  if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'deletedhistory' ) ) {
225  $titleBits = LogPage::DELETED_ACTION;
226  $userBits = LogPage::DELETED_USER;
227  } elseif ( !$this->getPermissionManager()
228  ->userHasAnyRight( $this->getUser(), 'suppressrevision', 'viewsuppressed' )
229  ) {
232  } else {
233  $titleBits = 0;
234  $userBits = 0;
235  }
236  if ( ( $params['namespace'] !== null || $title !== null ) && $titleBits ) {
237  $this->addWhere( $db->bitAnd( 'log_deleted', $titleBits ) . " != $titleBits" );
238  }
239  if ( $user !== null && $userBits ) {
240  $this->addWhere( $db->bitAnd( 'log_deleted', $userBits ) . " != $userBits" );
241  }
242  }
243 
244  // T220999: MySQL/MariaDB (10.1.37) can sometimes irrationally decide that querying `actor` before
245  // `logging` and filesorting is somehow better than querying $limit+1 rows from `logging`.
246  // Tell it not to reorder the query. But not when `letag` was used, as it seems as likely
247  // to be harmed as helped in that case.
248  if ( $params['tag'] === null ) {
249  $this->addOption( 'STRAIGHT_JOIN' );
250  }
251 
252  $count = 0;
253  $res = $this->select( __METHOD__ );
254 
255  if ( $this->fld_title ) {
256  $this->executeGenderCacheFromResultWrapper( $res, __METHOD__, 'log' );
257  }
258 
259  $result = $this->getResult();
260  foreach ( $res as $row ) {
261  if ( ++$count > $limit ) {
262  // We've reached the one extra which shows that there are
263  // additional pages to be had. Stop here...
264  $this->setContinueEnumParameter( 'continue', "$row->log_timestamp|$row->log_id" );
265  break;
266  }
267 
268  $vals = $this->extractRowInfo( $row );
269  $fit = $result->addValue( [ 'query', $this->getModuleName() ], null, $vals );
270  if ( !$fit ) {
271  $this->setContinueEnumParameter( 'continue', "$row->log_timestamp|$row->log_id" );
272  break;
273  }
274  }
275  $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'item' );
276  }
277 
278  private function extractRowInfo( $row ) {
279  $logEntry = DatabaseLogEntry::newFromRow( $row );
280  $vals = [
281  ApiResult::META_TYPE => 'assoc',
282  ];
283  $anyHidden = false;
284  $user = $this->getUser();
285 
286  if ( $this->fld_ids ) {
287  $vals['logid'] = (int)$row->log_id;
288  }
289 
290  if ( $this->fld_title || $this->fld_parsedcomment ) {
291  $title = Title::makeTitle( $row->log_namespace, $row->log_title );
292  }
293 
294  if ( $this->fld_title || $this->fld_ids || $this->fld_details && $row->log_params !== '' ) {
296  $vals['actionhidden'] = true;
297  $anyHidden = true;
298  }
299  if ( LogEventsList::userCan( $row, LogPage::DELETED_ACTION, $user ) ) {
300  if ( $this->fld_title ) {
302  }
303  if ( $this->fld_ids ) {
304  $vals['pageid'] = (int)$row->page_id;
305  $vals['logpage'] = (int)$row->log_page;
306  }
307  if ( $this->fld_details ) {
308  $vals['params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi();
309  }
310  }
311  }
312 
313  if ( $this->fld_type ) {
314  $vals['type'] = $row->log_type;
315  $vals['action'] = $row->log_action;
316  }
317 
318  if ( $this->fld_user || $this->fld_userid ) {
320  $vals['userhidden'] = true;
321  $anyHidden = true;
322  }
323  if ( LogEventsList::userCan( $row, LogPage::DELETED_USER, $user ) ) {
324  if ( $this->fld_user ) {
325  $vals['user'] = $row->user_name ?? $row->log_user_text;
326  }
327  if ( $this->fld_userid ) {
328  $vals['userid'] = (int)$row->log_user;
329  }
330 
331  if ( !$row->log_user ) {
332  $vals['anon'] = true;
333  }
334  }
335  }
336  if ( $this->fld_timestamp ) {
337  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->log_timestamp );
338  }
339 
340  if ( $this->fld_comment || $this->fld_parsedcomment ) {
342  $vals['commenthidden'] = true;
343  $anyHidden = true;
344  }
345  if ( LogEventsList::userCan( $row, LogPage::DELETED_COMMENT, $user ) ) {
346  $comment = $this->commentStore->getComment( 'log_comment', $row )->text;
347  if ( $this->fld_comment ) {
348  $vals['comment'] = $comment;
349  }
350 
351  if ( $this->fld_parsedcomment ) {
352  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
353  }
354  }
355  }
356 
357  if ( $this->fld_tags ) {
358  if ( $row->ts_tags ) {
359  $tags = explode( ',', $row->ts_tags );
360  ApiResult::setIndexedTagName( $tags, 'tag' );
361  $vals['tags'] = $tags;
362  } else {
363  $vals['tags'] = [];
364  }
365  }
366 
367  if ( $anyHidden && LogEventsList::isDeleted( $row, LogPage::DELETED_RESTRICTED ) ) {
368  $vals['suppressed'] = true;
369  }
370 
371  return $vals;
372  }
373 
377  private function getAllowedLogActions() {
378  $config = $this->getConfig();
379  return array_keys( array_merge(
380  $config->get( 'LogActions' ),
381  $config->get( 'LogActionsHandlers' )
382  ) );
383  }
384 
385  public function getCacheMode( $params ) {
386  if ( $this->userCanSeeRevDel() ) {
387  return 'private';
388  }
389  if ( $params['prop'] !== null && in_array( 'parsedcomment', $params['prop'] ) ) {
390  // formatComment() calls wfMessage() among other things
391  return 'anon-public-user-private';
392  } elseif ( LogEventsList::getExcludeClause( $this->getDB(), 'user', $this->getUser() )
393  === LogEventsList::getExcludeClause( $this->getDB(), 'public' )
394  ) { // Output can only contain public data.
395  return 'public';
396  } else {
397  return 'anon-public-user-private';
398  }
399  }
400 
401  public function getAllowedParams( $flags = 0 ) {
402  $config = $this->getConfig();
403  if ( $flags & ApiBase::GET_VALUES_FOR_HELP ) {
404  $logActions = $this->getAllowedLogActions();
405  sort( $logActions );
406  } else {
407  $logActions = null;
408  }
409  $ret = [
410  'prop' => [
411  ApiBase::PARAM_ISMULTI => true,
412  ApiBase::PARAM_DFLT => 'ids|title|type|user|timestamp|comment|details',
414  'ids',
415  'title',
416  'type',
417  'user',
418  'userid',
419  'timestamp',
420  'comment',
421  'parsedcomment',
422  'details',
423  'tags'
424  ],
426  ],
427  'type' => [
429  ],
430  'action' => [
431  // validation on request is done in execute()
432  ApiBase::PARAM_TYPE => $logActions
433  ],
434  'start' => [
435  ApiBase::PARAM_TYPE => 'timestamp'
436  ],
437  'end' => [
438  ApiBase::PARAM_TYPE => 'timestamp'
439  ],
440  'dir' => [
441  ApiBase::PARAM_DFLT => 'older',
443  'newer',
444  'older'
445  ],
446  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
447  ],
448  'user' => [
449  ApiBase::PARAM_TYPE => 'user',
450  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
451  UserDef::PARAM_RETURN_OBJECT => true,
452  ],
453  'title' => null,
454  'namespace' => [
455  ApiBase::PARAM_TYPE => 'namespace',
457  ],
458  'prefix' => [],
459  'tag' => null,
460  'limit' => [
461  ApiBase::PARAM_DFLT => 10,
462  ApiBase::PARAM_TYPE => 'limit',
463  ApiBase::PARAM_MIN => 1,
466  ],
467  'continue' => [
468  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
469  ],
470  ];
471 
472  if ( $config->get( 'MiserMode' ) ) {
473  $ret['prefix'][ApiBase::PARAM_HELP_MSG] = 'api-help-param-disabled-in-miser-mode';
474  }
475 
476  return $ret;
477  }
478 
479  protected function getExamplesMessages() {
480  return [
481  'action=query&list=logevents'
482  => 'apihelp-query+logevents-example-simple',
483  ];
484  }
485 
486  public function getHelpUrls() {
487  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Logevents';
488  }
489 }
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:63
ChangeTags\makeTagSummarySubquery
static makeTagSummarySubquery( $tables)
Make the tag summary subquery based on the given tables and return it.
Definition: ChangeTags.php:844
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:332
ApiQueryBase\addFields
addFields( $value)
Add a set of fields to select to the internal array.
Definition: ApiQueryBase.php:193
LogPage\validTypes
static validTypes()
Get the list of valid log types.
Definition: LogPage.php:198
ApiQuery
This is the main query class.
Definition: ApiQuery.php:37
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:137
ApiQueryLogEvents\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryLogEvents.php:479
ApiResult\META_TYPE
const META_TYPE
Key for the 'type' metadata item.
Definition: ApiResult.php:110
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1379
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:357
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:96
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1809
ApiBase\PARAM_TYPE
const PARAM_TYPE
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:60
ApiQueryLogEvents\$fld_comment
$fld_comment
Definition: ApiQueryLogEvents.php:43
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:538
CommentStore
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Definition: CommentStore.php:31
ApiQueryLogEvents\$fld_userid
$fld_userid
Definition: ApiQueryLogEvents.php:42
ApiQueryBase\addOption
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
Definition: ApiQueryBase.php:369
$res
$res
Definition: testCompression.php:57
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ApiQueryLogEvents\$fld_timestamp
$fld_timestamp
Definition: ApiQueryLogEvents.php:43
ApiQueryLogEvents\__construct
__construct(ApiQuery $query, $moduleName)
Definition: ApiQueryLogEvents.php:37
ActorMigration\newMigration
static newMigration()
Static constructor.
Definition: ActorMigration.php:139
ApiQueryLogEvents
Query action to List the log events, with optional filtering by various parameters.
Definition: ApiQueryLogEvents.php:32
ApiQueryBase\addFieldsIf
addFieldsIf( $value, $condition)
Same as addFields(), but add the fields only if a condition is met.
Definition: ApiQueryBase.php:207
Wikimedia\ParamValidator\ParamValidator::TypeDef\UserDef
Type definition for user types.
Definition: UserDef.php:23
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:58
ApiBase\PARAM_MIN
const PARAM_MIN
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:63
ApiQueryLogEvents\$fld_details
$fld_details
Definition: ApiQueryLogEvents.php:44
ApiQueryBase\executeGenderCacheFromResultWrapper
executeGenderCacheFromResultWrapper(IResultWrapper $res, $fname=__METHOD__, $fieldPrefix='page')
Preprocess the result set to fill the GenderCache with the necessary information before using self::a...
Definition: ApiQueryBase.php:622
DatabaseLogEntry\newFromRow
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition: DatabaseLogEntry.php:78
LogPage\DELETED_COMMENT
const DELETED_COMMENT
Definition: LogPage.php:35
ApiQueryLogEvents\getAllowedParams
getAllowedParams( $flags=0)
Definition: ApiQueryLogEvents.php:401
LogPage\DELETED_USER
const DELETED_USER
Definition: LogPage.php:36
ApiQueryBase
This is a base class for all Query modules.
Definition: ApiQueryBase.php:34
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:154
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:107
ApiBase\PARAM_MAX
const PARAM_MAX
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:61
ApiQueryBase\addTables
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
Definition: ApiQueryBase.php:161
ApiQueryBase\select
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
Definition: ApiQueryBase.php:394
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:659
$title
$title
Definition: testCompression.php:38
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:595
ApiQueryLogEvents\$fld_type
$fld_type
Definition: ApiQueryLogEvents.php:41
ApiBase\PARAM_EXTRA_NAMESPACES
const PARAM_EXTRA_NAMESPACES
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:70
ApiQueryLogEvents\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryLogEvents.php:486
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:34
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:322
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:604
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:831
ApiQueryLogEvents\$fld_title
$fld_title
Definition: ApiQueryLogEvents.php:41
NS_MEDIA
const NS_MEDIA
Definition: Defines.php:57
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1559
ApiBase\encodeParamName
encodeParamName( $paramName)
This method mangles parameter name based on the prefix supplied to the constructor.
Definition: ApiBase.php:637
ApiBase\GET_VALUES_FOR_HELP
const GET_VALUES_FOR_HELP
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thoro...
Definition: ApiBase.php:167
ApiQueryLogEvents\$fld_parsedcomment
$fld_parsedcomment
Definition: ApiQueryLogEvents.php:43
ApiBase\getPermissionManager
getPermissionManager()
Obtain a PermissionManager instance that subclasses may use in their authorization checks.
Definition: ApiBase.php:608
LogEventsList\getExcludeClause
static getExcludeClause( $db, $audience='public', User $user=null)
SQL clause to skip forbidden log types for this user.
Definition: LogEventsList.php:792
ApiQueryBase\addJoinConds
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
Definition: ApiQueryBase.php:182
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:1488
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
Definition: ApiQueryBase.php:267
Linker\formatComment
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:1183
ApiQueryLogEvents\extractRowInfo
extractRowInfo( $row)
Definition: ApiQueryLogEvents.php:278
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:156
ApiQueryLogEvents\$fld_user
$fld_user
Definition: ApiQueryLogEvents.php:42
ApiBase\PARAM_DFLT
const PARAM_DFLT
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:58
LogEventsList\userCan
static userCan( $row, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:536
LogEventsList\isDeleted
static isDeleted( $row, $field)
Definition: LogEventsList.php:605
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:418
MediaWiki\Storage\NameTableAccessException
Exception representing a failure to look up a row from a name table.
Definition: NameTableAccessException.php:32
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:59
ApiQueryLogEvents\getCacheMode
getCacheMode( $params)
Get the cache mode for the data generated by this module.
Definition: ApiQueryLogEvents.php:385
ApiBase\PARAM_MAX2
const PARAM_MAX2
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:62
ApiQueryLogEvents\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQueryLogEvents.php:46
LogPage\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: LogPage.php:37
ApiQueryLogEvents\$commentStore
CommentStore $commentStore
Definition: ApiQueryLogEvents.php:35
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:230
ApiQueryBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.
Definition: ApiQueryBase.php:511
ApiQueryLogEvents\$fld_tags
$fld_tags
Definition: ApiQueryLogEvents.php:44
ApiBase\PARAM_HELP_MSG_PER_VALUE
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
Definition: ApiBase.php:129
CommentStore\getStore
static getStore()
Definition: CommentStore.php:116
ApiQueryBase\userCanSeeRevDel
userCanSeeRevDel()
Check whether the current user has permission to view revision-deleted fields.
Definition: ApiQueryBase.php:603
ApiQueryLogEvents\$fld_ids
$fld_ids
Definition: ApiQueryLogEvents.php:41
ApiQueryLogEvents\getAllowedLogActions
getAllowedLogActions()
Definition: ApiQueryLogEvents.php:377
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:462
LogFormatter\newFromEntry
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
Definition: LogFormatter.php:50
$type
$type
Definition: testCompression.php:52