MediaWiki REL1_32
ApiQueryWatchlist.php
Go to the documentation of this file.
1<?php
25
33
36
37 public function __construct( ApiQuery $query, $moduleName ) {
38 parent::__construct( $query, $moduleName, 'wl' );
39 }
40
41 public function execute() {
42 $this->run();
43 }
44
45 public function executeGenerator( $resultPageSet ) {
46 $this->run( $resultPageSet );
47 }
48
49 private $fld_ids = false, $fld_title = false, $fld_patrol = false,
50 $fld_flags = false, $fld_timestamp = false, $fld_user = false,
51 $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
54
59 private function run( $resultPageSet = null ) {
60 $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
61
63
64 $user = $this->getUser();
65 $wlowner = $this->getWatchlistUser( $params );
66
67 if ( !is_null( $params['prop'] ) && is_null( $resultPageSet ) ) {
68 $prop = array_flip( $params['prop'] );
69
70 $this->fld_ids = isset( $prop['ids'] );
71 $this->fld_title = isset( $prop['title'] );
72 $this->fld_flags = isset( $prop['flags'] );
73 $this->fld_user = isset( $prop['user'] );
74 $this->fld_userid = isset( $prop['userid'] );
75 $this->fld_comment = isset( $prop['comment'] );
76 $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
77 $this->fld_timestamp = isset( $prop['timestamp'] );
78 $this->fld_sizes = isset( $prop['sizes'] );
79 $this->fld_patrol = isset( $prop['patrol'] );
80 $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
81 $this->fld_loginfo = isset( $prop['loginfo'] );
82 $this->fld_tags = isset( $prop['tags'] );
83
84 if ( $this->fld_patrol ) {
85 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
86 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
87 }
88 }
89
90 if ( $this->fld_comment || $this->fld_parsedcomment ) {
91 $this->commentStore = CommentStore::getStore();
92 }
93 }
94
95 $options = [
96 'dir' => $params['dir'] === 'older'
97 ? WatchedItemQueryService::DIR_OLDER
98 : WatchedItemQueryService::DIR_NEWER,
99 ];
100
101 if ( is_null( $resultPageSet ) ) {
102 $options['includeFields'] = $this->getFieldsToInclude();
103 } else {
104 $options['usedInGenerator'] = true;
105 }
106
107 if ( $params['start'] ) {
108 $options['start'] = $params['start'];
109 }
110 if ( $params['end'] ) {
111 $options['end'] = $params['end'];
112 }
113
114 $startFrom = null;
115 if ( !is_null( $params['continue'] ) ) {
116 $cont = explode( '|', $params['continue'] );
117 $this->dieContinueUsageIf( count( $cont ) != 2 );
118 $continueTimestamp = $cont[0];
119 $continueId = (int)$cont[1];
120 $this->dieContinueUsageIf( $continueId != $cont[1] );
121 $startFrom = [ $continueTimestamp, $continueId ];
122 }
123
124 if ( $wlowner !== $user ) {
125 $options['watchlistOwner'] = $wlowner;
126 $options['watchlistOwnerToken'] = $params['token'];
127 }
128
129 if ( !is_null( $params['namespace'] ) ) {
130 $options['namespaceIds'] = $params['namespace'];
131 }
132
133 if ( $params['allrev'] ) {
134 $options['allRevisions'] = true;
135 }
136
137 if ( !is_null( $params['show'] ) ) {
138 $show = array_flip( $params['show'] );
139
140 /* Check for conflicting parameters. */
141 if ( $this->showParamsConflicting( $show ) ) {
142 $this->dieWithError( 'apierror-show' );
143 }
144
145 // Check permissions.
146 if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
147 || isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] )
148 ) {
149 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
150 $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
151 }
152 }
153
154 $options['filters'] = array_keys( $show );
155 }
156
157 if ( !is_null( $params['type'] ) ) {
158 try {
159 $rcTypes = RecentChange::parseToRCType( $params['type'] );
160 if ( $rcTypes ) {
161 $options['rcTypes'] = $rcTypes;
162 }
163 } catch ( Exception $e ) {
164 ApiBase::dieDebug( __METHOD__, $e->getMessage() );
165 }
166 }
167
168 $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
169 if ( !is_null( $params['user'] ) ) {
170 $options['onlyByUser'] = $params['user'];
171 }
172 if ( !is_null( $params['excludeuser'] ) ) {
173 $options['notByUser'] = $params['excludeuser'];
174 }
175
176 $options['limit'] = $params['limit'];
177
178 Hooks::run( 'ApiQueryWatchlistPrepareWatchedItemQueryServiceOptions', [
179 $this, $params, &$options
180 ] );
181
182 $ids = [];
183 $count = 0;
184 $watchedItemQuery = MediaWikiServices::getInstance()->getWatchedItemQueryService();
185 $items = $watchedItemQuery->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
186
187 foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
189 if ( is_null( $resultPageSet ) ) {
190 $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
191 $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
192 if ( !$fit ) {
193 $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
194 break;
195 }
196 } else {
197 if ( $params['allrev'] ) {
198 $ids[] = intval( $recentChangeInfo['rc_this_oldid'] );
199 } else {
200 $ids[] = intval( $recentChangeInfo['rc_cur_id'] );
201 }
202 }
203 }
204
205 if ( $startFrom !== null ) {
206 $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
207 }
208
209 if ( is_null( $resultPageSet ) ) {
210 $this->getResult()->addIndexedTagName(
211 [ 'query', $this->getModuleName() ],
212 'item'
213 );
214 } elseif ( $params['allrev'] ) {
215 $resultPageSet->populateFromRevisionIDs( $ids );
216 } else {
217 $resultPageSet->populateFromPageIDs( $ids );
218 }
219 }
220
221 private function getFieldsToInclude() {
222 $includeFields = [];
223 if ( $this->fld_flags ) {
224 $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
225 }
226 if ( $this->fld_user || $this->fld_userid ) {
227 $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
228 }
229 if ( $this->fld_user ) {
230 $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
231 }
232 if ( $this->fld_comment || $this->fld_parsedcomment ) {
233 $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
234 }
235 if ( $this->fld_patrol ) {
236 $includeFields[] = WatchedItemQueryService::INCLUDE_PATROL_INFO;
237 $includeFields[] = WatchedItemQueryService::INCLUDE_AUTOPATROL_INFO;
238 }
239 if ( $this->fld_sizes ) {
240 $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
241 }
242 if ( $this->fld_loginfo ) {
243 $includeFields[] = WatchedItemQueryService::INCLUDE_LOG_INFO;
244 }
245 if ( $this->fld_tags ) {
246 $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
247 }
248 return $includeFields;
249 }
250
251 private function showParamsConflicting( array $show ) {
252 return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
253 && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
254 || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
255 && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
256 || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
257 && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
258 || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
259 && isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] ) )
260 || ( isset( $show[WatchedItemQueryService::FILTER_AUTOPATROLLED] )
261 && isset( $show[WatchedItemQueryService::FILTER_NOT_AUTOPATROLLED] ) )
262 || ( isset( $show[WatchedItemQueryService::FILTER_AUTOPATROLLED] )
263 && isset( $show[WatchedItemQueryService::FILTER_NOT_PATROLLED] ) )
264 || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
265 && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
266 }
267
268 private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
269 /* Determine the title of the page that has been changed. */
270 $title = Title::newFromLinkTarget( $watchedItem->getLinkTarget() );
271 $user = $this->getUser();
272
273 /* Our output data. */
274 $vals = [];
275 $type = intval( $recentChangeInfo['rc_type'] );
276 $vals['type'] = RecentChange::parseFromRCType( $type );
277 $anyHidden = false;
278
279 /* Create a new entry in the result for the title. */
280 if ( $this->fld_title || $this->fld_ids ) {
281 // These should already have been filtered out of the query, but just in case.
282 if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
283 $vals['actionhidden'] = true;
284 $anyHidden = true;
285 }
286 if ( $type !== RC_LOG ||
288 $recentChangeInfo['rc_deleted'],
290 $user
291 )
292 ) {
293 if ( $this->fld_title ) {
295 }
296 if ( $this->fld_ids ) {
297 $vals['pageid'] = intval( $recentChangeInfo['rc_cur_id'] );
298 $vals['revid'] = intval( $recentChangeInfo['rc_this_oldid'] );
299 $vals['old_revid'] = intval( $recentChangeInfo['rc_last_oldid'] );
300 }
301 }
302 }
303
304 /* Add user data and 'anon' flag, if user is anonymous. */
305 if ( $this->fld_user || $this->fld_userid ) {
306 if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
307 $vals['userhidden'] = true;
308 $anyHidden = true;
309 }
310 if ( RevisionRecord::userCanBitfield(
311 $recentChangeInfo['rc_deleted'],
312 RevisionRecord::DELETED_USER,
313 $user
314 ) ) {
315 if ( $this->fld_userid ) {
316 $vals['userid'] = (int)$recentChangeInfo['rc_user'];
317 // for backwards compatibility
318 $vals['user'] = (int)$recentChangeInfo['rc_user'];
319 }
320
321 if ( $this->fld_user ) {
322 $vals['user'] = $recentChangeInfo['rc_user_text'];
323 }
324
325 if ( !$recentChangeInfo['rc_user'] ) {
326 $vals['anon'] = true;
327 }
328 }
329 }
330
331 /* Add flags, such as new, minor, bot. */
332 if ( $this->fld_flags ) {
333 $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
334 $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
335 $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
336 }
337
338 /* Add sizes of each revision. (Only available on 1.10+) */
339 if ( $this->fld_sizes ) {
340 $vals['oldlen'] = intval( $recentChangeInfo['rc_old_len'] );
341 $vals['newlen'] = intval( $recentChangeInfo['rc_new_len'] );
342 }
343
344 /* Add the timestamp. */
345 if ( $this->fld_timestamp ) {
346 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
347 }
348
349 if ( $this->fld_notificationtimestamp ) {
350 $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
351 ? ''
352 : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
353 }
354
355 /* Add edit summary / log summary. */
356 if ( $this->fld_comment || $this->fld_parsedcomment ) {
357 if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
358 $vals['commenthidden'] = true;
359 $anyHidden = true;
360 }
361 if ( RevisionRecord::userCanBitfield(
362 $recentChangeInfo['rc_deleted'],
363 RevisionRecord::DELETED_COMMENT,
364 $user
365 ) ) {
366 $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
367 if ( $this->fld_comment ) {
368 $vals['comment'] = $comment;
369 }
370
371 if ( $this->fld_parsedcomment ) {
372 $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
373 }
374 }
375 }
376
377 /* Add the patrolled flag */
378 if ( $this->fld_patrol ) {
379 $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
380 $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
381 $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
382 }
383
384 if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
385 if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
386 $vals['actionhidden'] = true;
387 $anyHidden = true;
388 }
390 $recentChangeInfo['rc_deleted'],
392 $user
393 ) ) {
394 $vals['logid'] = intval( $recentChangeInfo['rc_logid'] );
395 $vals['logtype'] = $recentChangeInfo['rc_log_type'];
396 $vals['logaction'] = $recentChangeInfo['rc_log_action'];
397 $vals['logparams'] = LogFormatter::newFromRow( $recentChangeInfo )->formatParametersForApi();
398 }
399 }
400
401 if ( $this->fld_tags ) {
402 if ( $recentChangeInfo['rc_tags'] ) {
403 $tags = explode( ',', $recentChangeInfo['rc_tags'] );
404 ApiResult::setIndexedTagName( $tags, 'tag' );
405 $vals['tags'] = $tags;
406 } else {
407 $vals['tags'] = [];
408 }
409 }
410
411 if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
412 $vals['suppressed'] = true;
413 }
414
415 Hooks::run( 'ApiQueryWatchlistExtractOutputData', [
416 $this, $watchedItem, $recentChangeInfo, &$vals
417 ] );
418
419 return $vals;
420 }
421
422 public function getAllowedParams() {
423 return [
424 'allrev' => false,
425 'start' => [
426 ApiBase::PARAM_TYPE => 'timestamp'
427 ],
428 'end' => [
429 ApiBase::PARAM_TYPE => 'timestamp'
430 ],
431 'namespace' => [
433 ApiBase::PARAM_TYPE => 'namespace'
434 ],
435 'user' => [
436 ApiBase::PARAM_TYPE => 'user',
437 ],
438 'excludeuser' => [
439 ApiBase::PARAM_TYPE => 'user',
440 ],
441 'dir' => [
442 ApiBase::PARAM_DFLT => 'older',
444 'newer',
445 'older'
446 ],
447 ApiHelp::PARAM_HELP_MSG => 'api-help-param-direction',
448 ],
449 'limit' => [
451 ApiBase::PARAM_TYPE => 'limit',
455 ],
456 'prop' => [
458 ApiBase::PARAM_DFLT => 'ids|title|flags',
461 'ids',
462 'title',
463 'flags',
464 'user',
465 'userid',
466 'comment',
467 'parsedcomment',
468 'timestamp',
469 'patrol',
470 'sizes',
471 'notificationtimestamp',
472 'loginfo',
473 'tags',
474 ]
475 ],
476 'show' => [
479 WatchedItemQueryService::FILTER_MINOR,
480 WatchedItemQueryService::FILTER_NOT_MINOR,
481 WatchedItemQueryService::FILTER_BOT,
482 WatchedItemQueryService::FILTER_NOT_BOT,
483 WatchedItemQueryService::FILTER_ANON,
484 WatchedItemQueryService::FILTER_NOT_ANON,
485 WatchedItemQueryService::FILTER_PATROLLED,
486 WatchedItemQueryService::FILTER_NOT_PATROLLED,
487 WatchedItemQueryService::FILTER_AUTOPATROLLED,
488 WatchedItemQueryService::FILTER_NOT_AUTOPATROLLED,
489 WatchedItemQueryService::FILTER_UNREAD,
490 WatchedItemQueryService::FILTER_NOT_UNREAD,
491 ]
492 ],
493 'type' => [
494 ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
497 ApiBase::PARAM_TYPE => RecentChange::getChangeTypes()
498 ],
499 'owner' => [
500 ApiBase::PARAM_TYPE => 'user'
501 ],
502 'token' => [
503 ApiBase::PARAM_TYPE => 'string',
505 ],
506 'continue' => [
507 ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
508 ],
509 ];
510 }
511
512 protected function getExamplesMessages() {
513 return [
514 'action=query&list=watchlist'
515 => 'apihelp-query+watchlist-example-simple',
516 'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
517 => 'apihelp-query+watchlist-example-props',
518 'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
519 => 'apihelp-query+watchlist-example-allrev',
520 'action=query&generator=watchlist&prop=info'
521 => 'apihelp-query+watchlist-example-generator',
522 'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
523 => 'apihelp-query+watchlist-example-generator-rev',
524 'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
525 => 'apihelp-query+watchlist-example-wlowner',
526 ];
527 }
528
529 public function getHelpUrls() {
530 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
531 }
532}
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
Definition ApiBase.php:96
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition ApiBase.php:90
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition ApiBase.php:1987
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition ApiBase.php:1764
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition ApiBase.php:2155
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition ApiBase.php:2167
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition ApiBase.php:87
const PARAM_SENSITIVE
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of ...
Definition ApiBase.php:193
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition ApiBase.php:48
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:157
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition ApiBase.php:99
const LIMIT_BIG1
Fast query, standard limit.
Definition ApiBase.php:252
getResult()
Get the result object.
Definition ApiBase.php:659
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition ApiBase.php:770
requireMaxOneParameter( $params, $required)
Die if more than one of a certain set of parameters is set and not false.
Definition ApiBase.php:939
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition ApiBase.php:124
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition ApiBase.php:254
getModuleName()
Get the name of the module being executed by this instance.
Definition ApiBase.php:539
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition ApiBase.php:51
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...
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...
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.
__construct(ApiQuery $query, $moduleName)
This is the main query class.
Definition ApiQuery.php:36
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static isUnpatrolled( $rc, User $user)
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
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:1088
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
const DELETED_ACTION
Definition LogPage.php:34
MediaWikiServices is the service locator for the application scope of MediaWiki.
Page revision base class.
Representation of a pair of user and title for watchlist entries.
getNotificationTimestamp()
Get the notification timestamp of this entry.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition deferred.txt:11
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
const RC_NEW
Definition Defines.php:143
const RC_LOG
Definition Defines.php:144
namespace and then decline to actually register it file or subcat img or subcat $title
Definition hooks.txt:994
null for the local 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:1656
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 local account $user
Definition hooks.txt:247
returning false will NOT prevent logging $e
Definition hooks.txt:2226
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:37
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
const DB_REPLICA
Definition defines.php:25
$params