MediaWiki REL1_37
ApiQueryWatchlist.php
Go to the documentation of this file.
1<?php
26
34
37
40
43
46
48 private $genderCache;
49
59 public function __construct(
60 ApiQuery $query,
61 $moduleName,
62 CommentStore $commentStore,
63 WatchedItemQueryService $watchedItemQueryService,
64 Language $contentLanguage,
65 NamespaceInfo $namespaceInfo,
66 GenderCache $genderCache
67 ) {
68 parent::__construct( $query, $moduleName, 'wl' );
69 $this->commentStore = $commentStore;
70 $this->watchedItemQueryService = $watchedItemQueryService;
71 $this->contentLanguage = $contentLanguage;
72 $this->namespaceInfo = $namespaceInfo;
73 $this->genderCache = $genderCache;
74 }
75
76 public function execute() {
77 $this->run();
78 }
79
80 public function executeGenerator( $resultPageSet ) {
81 $this->run( $resultPageSet );
82 }
83
84 private $fld_ids = false, $fld_title = false, $fld_patrol = false,
85 $fld_flags = false, $fld_timestamp = false, $fld_user = false,
86 $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
89
91 private $fld_expiry = false;
92
97 private function run( $resultPageSet = null ) {
98 $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
99
100 $params = $this->extractRequestParams();
101
102 $user = $this->getUser();
103 $wlowner = $this->getWatchlistUser( $params );
104
105 if ( $params['prop'] !== null && $resultPageSet === null ) {
106 $prop = array_fill_keys( $params['prop'], true );
107
108 $this->fld_ids = isset( $prop['ids'] );
109 $this->fld_title = isset( $prop['title'] );
110 $this->fld_flags = isset( $prop['flags'] );
111 $this->fld_user = isset( $prop['user'] );
112 $this->fld_userid = isset( $prop['userid'] );
113 $this->fld_comment = isset( $prop['comment'] );
114 $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
115 $this->fld_timestamp = isset( $prop['timestamp'] );
116 $this->fld_sizes = isset( $prop['sizes'] );
117 $this->fld_patrol = isset( $prop['patrol'] );
118 $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
119 $this->fld_loginfo = isset( $prop['loginfo'] );
120 $this->fld_tags = isset( $prop['tags'] );
121 $this->fld_expiry = isset( $prop['expiry'] );
122
123 if ( $this->fld_patrol && !$user->useRCPatrol() && !$user->useNPPatrol() ) {
124 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
125 }
126 }
127
128 $options = [
129 'dir' => $params['dir'] === 'older'
130 ? WatchedItemQueryService::DIR_OLDER
131 : WatchedItemQueryService::DIR_NEWER,
132 ];
133
134 if ( $resultPageSet === null ) {
135 $options['includeFields'] = $this->getFieldsToInclude();
136 } else {
137 $options['usedInGenerator'] = true;
138 }
139
140 if ( $params['start'] ) {
141 $options['start'] = $params['start'];
142 }
143 if ( $params['end'] ) {
144 $options['end'] = $params['end'];
145 }
146
147 $startFrom = null;
148 if ( $params['continue'] !== null ) {
149 $cont = explode( '|', $params['continue'] );
150 $this->dieContinueUsageIf( count( $cont ) != 2 );
151 $continueTimestamp = $cont[0];
152 $continueId = (int)$cont[1];
153 $this->dieContinueUsageIf( $continueId != $cont[1] );
154 $startFrom = [ $continueTimestamp, $continueId ];
155 }
156
157 if ( $wlowner !== $user ) {
158 $options['watchlistOwner'] = $wlowner;
159 $options['watchlistOwnerToken'] = $params['token'];
160 }
161
162 if ( $params['namespace'] !== null ) {
163 $options['namespaceIds'] = $params['namespace'];
164 }
165
166 if ( $params['allrev'] ) {
167 $options['allRevisions'] = true;
168 }
169
170 if ( $params['show'] !== null ) {
171 $show = array_fill_keys( $params['show'], true );
172
173 /* Check for conflicting parameters. */
174 if ( $this->showParamsConflicting( $show ) ) {
175 $this->dieWithError( 'apierror-show' );
176 }
177
178 // Check permissions.
179 if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
180 || isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] )
181 ) {
182 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
183 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
184 }
185 }
186
187 $options['filters'] = array_keys( $show );
188 }
189
190 if ( $params['type'] !== null ) {
191 try {
192 $rcTypes = RecentChange::parseToRCType( $params['type'] );
193 if ( $rcTypes ) {
194 $options['rcTypes'] = $rcTypes;
195 }
196 } catch ( Exception $e ) {
197 ApiBase::dieDebug( __METHOD__, $e->getMessage() );
198 }
199 }
200
201 $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
202 if ( $params['user'] !== null ) {
203 $options['onlyByUser'] = $params['user'];
204 }
205 if ( $params['excludeuser'] !== null ) {
206 $options['notByUser'] = $params['excludeuser'];
207 }
208
209 $options['limit'] = $params['limit'];
210
211 $this->getHookRunner()->onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions(
212 $this, $params, $options );
213
214 $ids = [];
215 $items = $this->watchedItemQueryService->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
216
217 // Get gender information
218 if ( $items !== [] && $resultPageSet === null && $this->fld_title &&
219 $this->contentLanguage->needsGenderDistinction()
220 ) {
221 $usernames = [];
222 foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
224 $linkTarget = $watchedItem->getTarget();
225 if ( $this->namespaceInfo->hasGenderDistinction( $linkTarget->getNamespace() ) ) {
226 $usernames[] = $linkTarget->getText();
227 }
228 }
229 if ( $usernames !== [] ) {
230 $this->genderCache->doQuery( $usernames, __METHOD__ );
231 }
232 }
233
234 foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
236 if ( $resultPageSet === null ) {
237 $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
238 $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
239 if ( !$fit ) {
240 $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
241 break;
242 }
243 } elseif ( $params['allrev'] ) {
244 $ids[] = (int)$recentChangeInfo['rc_this_oldid'];
245 } else {
246 $ids[] = (int)$recentChangeInfo['rc_cur_id'];
247 }
248 }
249
250 if ( $startFrom !== null ) {
251 $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
252 }
253
254 if ( $resultPageSet === null ) {
255 $this->getResult()->addIndexedTagName(
256 [ 'query', $this->getModuleName() ],
257 'item'
258 );
259 } elseif ( $params['allrev'] ) {
260 $resultPageSet->populateFromRevisionIDs( $ids );
261 } else {
262 $resultPageSet->populateFromPageIDs( $ids );
263 }
264 }
265
266 private function getFieldsToInclude() {
267 $includeFields = [];
268 if ( $this->fld_flags ) {
269 $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
270 }
271 if ( $this->fld_user || $this->fld_userid || $this->fld_loginfo ) {
272 $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
273 }
274 if ( $this->fld_user || $this->fld_loginfo ) {
275 $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
276 }
277 if ( $this->fld_comment || $this->fld_parsedcomment ) {
278 $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
279 }
280 if ( $this->fld_patrol ) {
281 $includeFields[] = WatchedItemQueryService::INCLUDE_PATROL_INFO;
282 $includeFields[] = WatchedItemQueryService::INCLUDE_AUTOPATROL_INFO;
283 }
284 if ( $this->fld_sizes ) {
285 $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
286 }
287 if ( $this->fld_loginfo ) {
288 $includeFields[] = WatchedItemQueryService::INCLUDE_LOG_INFO;
289 }
290 if ( $this->fld_tags ) {
291 $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
292 }
293 return $includeFields;
294 }
295
296 private function showParamsConflicting( array $show ) {
297 return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
298 && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
299 || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
300 && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
301 || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
302 && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
303 || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
304 && isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] ) )
305 || ( isset( $show[WatchedItemQueryService::FILTER_AUTOPATROLLED] )
306 && isset( $show[WatchedItemQueryService::FILTER_NOT_AUTOPATROLLED] ) )
307 || ( isset( $show[WatchedItemQueryService::FILTER_AUTOPATROLLED] )
308 && isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] ) )
309 || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
310 && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
311 }
312
313 private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
314 /* Determine the title of the page that has been changed. */
315 $target = $watchedItem->getTarget();
316 if ( $target instanceof LinkTarget ) {
317 $title = Title::newFromLinkTarget( $target );
318 } else {
319 $title = Title::castFromPageIdentity( $target );
320 }
321 $user = $this->getUser();
322
323 /* Our output data. */
324 $vals = [];
325 $type = (int)$recentChangeInfo['rc_type'];
326 $vals['type'] = RecentChange::parseFromRCType( $type );
327 $anyHidden = false;
328
329 /* Create a new entry in the result for the title. */
330 if ( $this->fld_title || $this->fld_ids ) {
331 // These should already have been filtered out of the query, but just in case.
332 if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
333 $vals['actionhidden'] = true;
334 $anyHidden = true;
335 }
336 if ( $type !== RC_LOG ||
337 LogEventsList::userCanBitfield(
338 $recentChangeInfo['rc_deleted'],
340 $user
341 )
342 ) {
343 if ( $this->fld_title ) {
345 }
346 if ( $this->fld_ids ) {
347 $vals['pageid'] = (int)$recentChangeInfo['rc_cur_id'];
348 $vals['revid'] = (int)$recentChangeInfo['rc_this_oldid'];
349 $vals['old_revid'] = (int)$recentChangeInfo['rc_last_oldid'];
350 }
351 }
352 }
353
354 /* Add user data and 'anon' flag, if user is anonymous. */
355 if ( $this->fld_user || $this->fld_userid ) {
356 if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
357 $vals['userhidden'] = true;
358 $anyHidden = true;
359 }
360 if ( RevisionRecord::userCanBitfield(
361 $recentChangeInfo['rc_deleted'],
362 RevisionRecord::DELETED_USER,
363 $user
364 ) ) {
365 if ( $this->fld_userid ) {
366 $vals['userid'] = (int)$recentChangeInfo['rc_user'];
367 // for backwards compatibility
368 $vals['user'] = (int)$recentChangeInfo['rc_user'];
369 }
370
371 if ( $this->fld_user ) {
372 $vals['user'] = $recentChangeInfo['rc_user_text'];
373 }
374
375 $vals['anon'] = !$recentChangeInfo['rc_user'];
376 }
377 }
378
379 /* Add flags, such as new, minor, bot. */
380 if ( $this->fld_flags ) {
381 $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
382 $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
383 $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
384 }
385
386 /* Add sizes of each revision. (Only available on 1.10+) */
387 if ( $this->fld_sizes ) {
388 $vals['oldlen'] = (int)$recentChangeInfo['rc_old_len'];
389 $vals['newlen'] = (int)$recentChangeInfo['rc_new_len'];
390 }
391
392 /* Add the timestamp. */
393 if ( $this->fld_timestamp ) {
394 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
395 }
396
397 if ( $this->fld_notificationtimestamp ) {
398 $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
399 ? ''
400 : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
401 }
402
403 /* Add edit summary / log summary. */
404 if ( $this->fld_comment || $this->fld_parsedcomment ) {
405 if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
406 $vals['commenthidden'] = true;
407 $anyHidden = true;
408 }
409 if ( RevisionRecord::userCanBitfield(
410 $recentChangeInfo['rc_deleted'],
411 RevisionRecord::DELETED_COMMENT,
412 $user
413 ) ) {
414 $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
415 if ( $this->fld_comment ) {
416 $vals['comment'] = $comment;
417 }
418
419 if ( $this->fld_parsedcomment ) {
420 $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
421 }
422 }
423 }
424
425 /* Add the patrolled flag */
426 if ( $this->fld_patrol ) {
427 $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
428 $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
429 $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
430 }
431
432 if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
433 if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
434 $vals['actionhidden'] = true;
435 $anyHidden = true;
436 }
437 if ( LogEventsList::userCanBitfield(
438 $recentChangeInfo['rc_deleted'],
440 $user
441 ) ) {
442 $vals['logid'] = (int)$recentChangeInfo['rc_logid'];
443 $vals['logtype'] = $recentChangeInfo['rc_log_type'];
444 $vals['logaction'] = $recentChangeInfo['rc_log_action'];
445
446 $logFormatter = LogFormatter::newFromRow( $recentChangeInfo );
447 $vals['logparams'] = $logFormatter->formatParametersForApi();
448 $vals['logdisplay'] = $logFormatter->getActionText();
449 }
450 }
451
452 if ( $this->fld_tags ) {
453 if ( $recentChangeInfo['rc_tags'] ) {
454 $tags = explode( ',', $recentChangeInfo['rc_tags'] );
455 ApiResult::setIndexedTagName( $tags, 'tag' );
456 $vals['tags'] = $tags;
457 } else {
458 $vals['tags'] = [];
459 }
460 }
461
462 if ( $this->fld_expiry ) {
463 // Add expiration, T263796
464 $expiry = $watchedItem->getExpiry( TS_ISO_8601 );
465 $vals['expiry'] = ( $expiry ?? false );
466 }
467
468 if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
469 $vals['suppressed'] = true;
470 }
471
472 $this->getHookRunner()->onApiQueryWatchlistExtractOutputData(
473 $this, $watchedItem, $recentChangeInfo, $vals );
474
475 return $vals;
476 }
477
478 public function getAllowedParams() {
479 return [
480 'allrev' => false,
481 'start' => [
482 ApiBase::PARAM_TYPE => 'timestamp'
483 ],
484 'end' => [
485 ApiBase::PARAM_TYPE => 'timestamp'
486 ],
487 'namespace' => [
489 ApiBase::PARAM_TYPE => 'namespace'
490 ],
491 'user' => [
492 ApiBase::PARAM_TYPE => 'user',
493 UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
494 ],
495 'excludeuser' => [
496 ApiBase::PARAM_TYPE => 'user',
497 UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
498 ],
499 'dir' => [
500 ApiBase::PARAM_DFLT => 'older',
502 'newer',
503 'older'
504 ],
505 ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
506 ],
507 'limit' => [
509 ApiBase::PARAM_TYPE => 'limit',
513 ],
514 'prop' => [
516 ApiBase::PARAM_DFLT => 'ids|title|flags',
519 'ids',
520 'title',
521 'flags',
522 'user',
523 'userid',
524 'comment',
525 'parsedcomment',
526 'timestamp',
527 'patrol',
528 'sizes',
529 'notificationtimestamp',
530 'loginfo',
531 'tags',
532 'expiry',
533 ]
534 ],
535 'show' => [
538 WatchedItemQueryService::FILTER_MINOR,
539 WatchedItemQueryService::FILTER_NOT_MINOR,
540 WatchedItemQueryService::FILTER_BOT,
541 WatchedItemQueryService::FILTER_NOT_BOT,
542 WatchedItemQueryService::FILTER_ANON,
543 WatchedItemQueryService::FILTER_NOT_ANON,
544 WatchedItemQueryService::FILTER_PATROLLED,
545 WatchedItemQueryService::FILTER_NOT_PATROLLED,
546 WatchedItemQueryService::FILTER_AUTOPATROLLED,
547 WatchedItemQueryService::FILTER_NOT_AUTOPATROLLED,
548 WatchedItemQueryService::FILTER_UNREAD,
549 WatchedItemQueryService::FILTER_NOT_UNREAD,
550 ]
551 ],
552 'type' => [
553 ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
556 ApiBase::PARAM_TYPE => RecentChange::getChangeTypes()
557 ],
558 'owner' => [
559 ApiBase::PARAM_TYPE => 'user',
560 UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name' ],
561 ],
562 'token' => [
563 ApiBase::PARAM_TYPE => 'string',
565 ],
566 'continue' => [
567 ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
568 ],
569 ];
570 }
571
572 protected function getExamplesMessages() {
573 return [
574 'action=query&list=watchlist'
575 => 'apihelp-query+watchlist-example-simple',
576 'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
577 => 'apihelp-query+watchlist-example-props',
578 'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment|expiry'
579 => 'apihelp-query+watchlist-example-expiry',
580 'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
581 => 'apihelp-query+watchlist-example-allrev',
582 'action=query&generator=watchlist&prop=info'
583 => 'apihelp-query+watchlist-example-generator',
584 'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
585 => 'apihelp-query+watchlist-example-generator-rev',
586 'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
587 => 'apihelp-query+watchlist-example-wlowner',
588 ];
589 }
590
591 public function getHelpUrls() {
592 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
593 }
594}
const RC_NEW
Definition Defines.php:116
const RC_LOG
Definition Defines.php:117
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
dieWithError( $msg, $code=null, $data=null, $httpCode=0)
Abort execution with an error.
Definition ApiBase.php:1436
const PARAM_MAX2
Definition ApiBase.php:89
const PARAM_MAX
Definition ApiBase.php:85
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition ApiBase.php:1180
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition ApiBase.php:1620
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition ApiBase.php:1633
const PARAM_TYPE
Definition ApiBase.php:81
const PARAM_SENSITIVE
Definition ApiBase.php:125
const PARAM_DFLT
Definition ApiBase.php:73
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:195
const PARAM_MIN
Definition ApiBase.php:93
const LIMIT_BIG1
Fast query, standard limit.
Definition ApiBase.php:220
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition ApiBase.php:936
getResult()
Get the result object.
Definition ApiBase.php:628
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition ApiBase.php:764
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition ApiBase.php:162
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition ApiBase.php:222
getModuleName()
Get the name of the module being executed by this instance.
Definition ApiBase.php:497
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition ApiBase.php:710
const PARAM_ISMULTI
Definition ApiBase.php:77
selectNamedDB( $name, $db, $groups)
Selects the query database connection with the given name.
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
__construct(ApiQuery $query, $moduleName, CommentStore $commentStore, WatchedItemQueryService $watchedItemQueryService, Language $contentLanguage, NamespaceInfo $namespaceInfo, GenderCache $genderCache)
run( $resultPageSet=null)
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
showParamsConflicting(array $show)
CommentStore $commentStore
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
NamespaceInfo $namespaceInfo
getExamplesMessages()
Returns usage examples for this module.
getHelpUrls()
Return links to more detailed help pages about the module.
executeGenerator( $resultPageSet)
Execute this module as a generator.
WatchedItemQueryService $watchedItemQueryService
This is the main query class.
Definition ApiQuery.php:37
Handle database storage of comments such as edit summaries and log reasons.
Caches user genders when needed to use correct namespace aliases.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition Language.php:42
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:1372
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
const DELETED_ACTION
Definition LogPage.php:39
Type definition for user types.
Definition UserDef.php:25
Page revision base class.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Representation of a pair of user and title for watchlist entries.
getExpiry(?int $style=TS_MW)
When the watched item will expire.
getNotificationTimestamp()
Get the notification timestamp of this entry.
const DB_REPLICA
Definition defines.php:25