MediaWiki REL1_27
ApiQueryWatchlist.php
Go to the documentation of this file.
1<?php
34
35 public function __construct( ApiQuery $query, $moduleName ) {
36 parent::__construct( $query, $moduleName, 'wl' );
37 }
38
39 public function execute() {
40 $this->run();
41 }
42
43 public function executeGenerator( $resultPageSet ) {
44 $this->run( $resultPageSet );
45 }
46
47 private $fld_ids = false, $fld_title = false, $fld_patrol = false,
48 $fld_flags = false, $fld_timestamp = false, $fld_user = false,
49 $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
51 $fld_loginfo = false;
52
57 private function run( $resultPageSet = null ) {
58 $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
59
61
62 $user = $this->getUser();
63 $wlowner = $this->getWatchlistUser( $params );
64
65 if ( !is_null( $params['prop'] ) && is_null( $resultPageSet ) ) {
66 $prop = array_flip( $params['prop'] );
67
68 $this->fld_ids = isset( $prop['ids'] );
69 $this->fld_title = isset( $prop['title'] );
70 $this->fld_flags = isset( $prop['flags'] );
71 $this->fld_user = isset( $prop['user'] );
72 $this->fld_userid = isset( $prop['userid'] );
73 $this->fld_comment = isset( $prop['comment'] );
74 $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
75 $this->fld_timestamp = isset( $prop['timestamp'] );
76 $this->fld_sizes = isset( $prop['sizes'] );
77 $this->fld_patrol = isset( $prop['patrol'] );
78 $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
79 $this->fld_loginfo = isset( $prop['loginfo'] );
80
81 if ( $this->fld_patrol ) {
82 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
83 $this->dieUsage( 'patrol property is not available', 'patrol' );
84 }
85 }
86 }
87
88 $this->addFields( [
89 'rc_id',
90 'rc_namespace',
91 'rc_title',
92 'rc_timestamp',
93 'rc_type',
94 'rc_deleted',
95 ] );
96
97 if ( is_null( $resultPageSet ) ) {
98 $this->addFields( [
99 'rc_cur_id',
100 'rc_this_oldid',
101 'rc_last_oldid',
102 ] );
103
104 $this->addFieldsIf( [ 'rc_type', 'rc_minor', 'rc_bot' ], $this->fld_flags );
105 $this->addFieldsIf( 'rc_user', $this->fld_user || $this->fld_userid );
106 $this->addFieldsIf( 'rc_user_text', $this->fld_user );
107 $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment );
108 $this->addFieldsIf( [ 'rc_patrolled', 'rc_log_type' ], $this->fld_patrol );
109 $this->addFieldsIf( [ 'rc_old_len', 'rc_new_len' ], $this->fld_sizes );
110 $this->addFieldsIf( 'wl_notificationtimestamp', $this->fld_notificationtimestamp );
111 $this->addFieldsIf(
112 [ 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ],
113 $this->fld_loginfo
114 );
115 } elseif ( $params['allrev'] ) {
116 $this->addFields( 'rc_this_oldid' );
117 } else {
118 $this->addFields( 'rc_cur_id' );
119 }
120
121 $this->addTables( [
122 'recentchanges',
123 'watchlist',
124 ] );
125
126 $userId = $wlowner->getId();
127 $this->addJoinConds( [ 'watchlist' => [ 'INNER JOIN',
128 [
129 'wl_user' => $userId,
130 'wl_namespace=rc_namespace',
131 'wl_title=rc_title'
132 ]
133 ] ] );
134
135 $db = $this->getDB();
136
137 $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'],
138 $params['start'], $params['end'] );
139 // Include in ORDER BY for uniqueness
140 $this->addWhereRange( 'rc_id', $params['dir'], null, null );
141
142 if ( !is_null( $params['continue'] ) ) {
143 $cont = explode( '|', $params['continue'] );
144 $this->dieContinueUsageIf( count( $cont ) != 2 );
145 $op = ( $params['dir'] === 'newer' ? '>' : '<' );
146 $continueTimestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
147 $continueId = (int)$cont[1];
148 $this->dieContinueUsageIf( $continueId != $cont[1] );
149 $this->addWhere( "rc_timestamp $op $continueTimestamp OR " .
150 "(rc_timestamp = $continueTimestamp AND " .
151 "rc_id $op= $continueId)"
152 );
153 }
154
155 $this->addWhereFld( 'wl_namespace', $params['namespace'] );
156
157 if ( !$params['allrev'] ) {
158 $this->addTables( 'page' );
159 $this->addJoinConds( [ 'page' => [ 'LEFT JOIN', 'rc_cur_id=page_id' ] ] );
160 $this->addWhere( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG );
161 }
162
163 if ( !is_null( $params['show'] ) ) {
164 $show = array_flip( $params['show'] );
165
166 /* Check for conflicting parameters. */
167 if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
168 || ( isset( $show['bot'] ) && isset( $show['!bot'] ) )
169 || ( isset( $show['anon'] ) && isset( $show['!anon'] ) )
170 || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
171 || ( isset( $show['unread'] ) && isset( $show['!unread'] ) )
172 ) {
173 $this->dieUsageMsg( 'show' );
174 }
175
176 // Check permissions.
177 if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) {
178 if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
179 $this->dieUsage(
180 'You need the patrol right to request the patrolled flag',
181 'permissiondenied'
182 );
183 }
184 }
185
186 /* Add additional conditions to query depending upon parameters. */
187 $this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );
188 $this->addWhereIf( 'rc_minor != 0', isset( $show['minor'] ) );
189 $this->addWhereIf( 'rc_bot = 0', isset( $show['!bot'] ) );
190 $this->addWhereIf( 'rc_bot != 0', isset( $show['bot'] ) );
191 $this->addWhereIf( 'rc_user = 0', isset( $show['anon'] ) );
192 $this->addWhereIf( 'rc_user != 0', isset( $show['!anon'] ) );
193 $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
194 $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
195 $this->addWhereIf( 'rc_timestamp >= wl_notificationtimestamp', isset( $show['unread'] ) );
196 $this->addWhereIf(
197 'wl_notificationtimestamp IS NULL OR rc_timestamp < wl_notificationtimestamp',
198 isset( $show['!unread'] )
199 );
200 }
201
202 if ( !is_null( $params['type'] ) ) {
203 try {
204 $this->addWhereFld( 'rc_type', RecentChange::parseToRCType( $params['type'] ) );
205 } catch ( Exception $e ) {
206 ApiBase::dieDebug( __METHOD__, $e->getMessage() );
207 }
208 }
209
210 if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
211 $this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
212 }
213 if ( !is_null( $params['user'] ) ) {
214 $this->addWhereFld( 'rc_user_text', $params['user'] );
215 }
216 if ( !is_null( $params['excludeuser'] ) ) {
217 $this->addWhere( 'rc_user_text != ' . $db->addQuotes( $params['excludeuser'] ) );
218 }
219
220 // This is an index optimization for mysql, as done in the Special:Watchlist page
221 $this->addWhereIf(
222 "rc_timestamp > ''",
223 !isset( $params['start'] ) && !isset( $params['end'] ) && $db->getType() == 'mysql'
224 );
225
226 // Paranoia: avoid brute force searches (bug 17342)
227 if ( !is_null( $params['user'] ) || !is_null( $params['excludeuser'] ) ) {
228 if ( !$user->isAllowed( 'deletedhistory' ) ) {
229 $bitmask = Revision::DELETED_USER;
230 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
232 } else {
233 $bitmask = 0;
234 }
235 if ( $bitmask ) {
236 $this->addWhere( $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask" );
237 }
238 }
239
240 // LogPage::DELETED_ACTION hides the affected page, too. So hide those
241 // entirely from the watchlist, or someone could guess the title.
242 if ( !$user->isAllowed( 'deletedhistory' ) ) {
243 $bitmask = LogPage::DELETED_ACTION;
244 } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
246 } else {
247 $bitmask = 0;
248 }
249 if ( $bitmask ) {
250 $this->addWhere( $this->getDB()->makeList( [
251 'rc_type != ' . RC_LOG,
252 $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask",
253 ], LIST_OR ) );
254 }
255
256 $this->addOption( 'LIMIT', $params['limit'] + 1 );
257
258 $ids = [];
259 $count = 0;
260 $res = $this->select( __METHOD__ );
261
262 foreach ( $res as $row ) {
263 if ( ++$count > $params['limit'] ) {
264 // We've reached the one extra which shows that there are
265 // additional pages to be had. Stop here...
266 $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
267 break;
268 }
269
270 if ( is_null( $resultPageSet ) ) {
271 $vals = $this->extractRowInfo( $row );
272 $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
273 if ( !$fit ) {
274 $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
275 break;
276 }
277 } else {
278 if ( $params['allrev'] ) {
279 $ids[] = intval( $row->rc_this_oldid );
280 } else {
281 $ids[] = intval( $row->rc_cur_id );
282 }
283 }
284 }
285
286 if ( is_null( $resultPageSet ) ) {
287 $this->getResult()->addIndexedTagName(
288 [ 'query', $this->getModuleName() ],
289 'item'
290 );
291 } elseif ( $params['allrev'] ) {
292 $resultPageSet->populateFromRevisionIDs( $ids );
293 } else {
294 $resultPageSet->populateFromPageIDs( $ids );
295 }
296 }
297
298 private function extractRowInfo( $row ) {
299 /* Determine the title of the page that has been changed. */
300 $title = Title::makeTitle( $row->rc_namespace, $row->rc_title );
301 $user = $this->getUser();
302
303 /* Our output data. */
304 $vals = [];
305 $type = intval( $row->rc_type );
306 $vals['type'] = RecentChange::parseFromRCType( $type );
307 $anyHidden = false;
308
309 /* Create a new entry in the result for the title. */
310 if ( $this->fld_title || $this->fld_ids ) {
311 // These should already have been filtered out of the query, but just in case.
312 if ( $type === RC_LOG && ( $row->rc_deleted & LogPage::DELETED_ACTION ) ) {
313 $vals['actionhidden'] = true;
314 $anyHidden = true;
315 }
316 if ( $type !== RC_LOG ||
318 ) {
319 if ( $this->fld_title ) {
321 }
322 if ( $this->fld_ids ) {
323 $vals['pageid'] = intval( $row->rc_cur_id );
324 $vals['revid'] = intval( $row->rc_this_oldid );
325 $vals['old_revid'] = intval( $row->rc_last_oldid );
326 }
327 }
328 }
329
330 /* Add user data and 'anon' flag, if user is anonymous. */
331 if ( $this->fld_user || $this->fld_userid ) {
332 if ( $row->rc_deleted & Revision::DELETED_USER ) {
333 $vals['userhidden'] = true;
334 $anyHidden = true;
335 }
336 if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_USER, $user ) ) {
337 if ( $this->fld_userid ) {
338 $vals['userid'] = (int)$row->rc_user;
339 // for backwards compatibility
340 $vals['user'] = (int)$row->rc_user;
341 }
342
343 if ( $this->fld_user ) {
344 $vals['user'] = $row->rc_user_text;
345 }
346
347 if ( !$row->rc_user ) {
348 $vals['anon'] = true;
349 }
350 }
351 }
352
353 /* Add flags, such as new, minor, bot. */
354 if ( $this->fld_flags ) {
355 $vals['bot'] = (bool)$row->rc_bot;
356 $vals['new'] = $row->rc_type == RC_NEW;
357 $vals['minor'] = (bool)$row->rc_minor;
358 }
359
360 /* Add sizes of each revision. (Only available on 1.10+) */
361 if ( $this->fld_sizes ) {
362 $vals['oldlen'] = intval( $row->rc_old_len );
363 $vals['newlen'] = intval( $row->rc_new_len );
364 }
365
366 /* Add the timestamp. */
367 if ( $this->fld_timestamp ) {
368 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->rc_timestamp );
369 }
370
371 if ( $this->fld_notificationtimestamp ) {
372 $vals['notificationtimestamp'] = ( $row->wl_notificationtimestamp == null )
373 ? ''
374 : wfTimestamp( TS_ISO_8601, $row->wl_notificationtimestamp );
375 }
376
377 /* Add edit summary / log summary. */
378 if ( $this->fld_comment || $this->fld_parsedcomment ) {
379 if ( $row->rc_deleted & Revision::DELETED_COMMENT ) {
380 $vals['commenthidden'] = true;
381 $anyHidden = true;
382 }
383 if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_COMMENT, $user ) ) {
384 if ( $this->fld_comment && isset( $row->rc_comment ) ) {
385 $vals['comment'] = $row->rc_comment;
386 }
387
388 if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
389 $vals['parsedcomment'] = Linker::formatComment( $row->rc_comment, $title );
390 }
391 }
392 }
393
394 /* Add the patrolled flag */
395 if ( $this->fld_patrol ) {
396 $vals['patrolled'] = $row->rc_patrolled == 1;
397 $vals['unpatrolled'] = ChangesList::isUnpatrolled( $row, $user );
398 }
399
400 if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {
401 if ( $row->rc_deleted & LogPage::DELETED_ACTION ) {
402 $vals['actionhidden'] = true;
403 $anyHidden = true;
404 }
406 $vals['logid'] = intval( $row->rc_logid );
407 $vals['logtype'] = $row->rc_log_type;
408 $vals['logaction'] = $row->rc_log_action;
409 $vals['logparams'] = LogFormatter::newFromRow( $row )->formatParametersForApi();
410 }
411 }
412
413 if ( $anyHidden && ( $row->rc_deleted & Revision::DELETED_RESTRICTED ) ) {
414 $vals['suppressed'] = true;
415 }
416
417 return $vals;
418 }
419
420 public function getAllowedParams() {
421 return [
422 'allrev' => false,
423 'start' => [
424 ApiBase::PARAM_TYPE => 'timestamp'
425 ],
426 'end' => [
427 ApiBase::PARAM_TYPE => 'timestamp'
428 ],
429 'namespace' => [
431 ApiBase::PARAM_TYPE => 'namespace'
432 ],
433 'user' => [
434 ApiBase::PARAM_TYPE => 'user',
435 ],
436 'excludeuser' => [
437 ApiBase::PARAM_TYPE => 'user',
438 ],
439 'dir' => [
440 ApiBase::PARAM_DFLT => 'older',
442 'newer',
443 'older'
444 ],
445 ApiHelp::PARAM_HELP_MSG => 'api-help-param-direction',
446 ],
447 'limit' => [
449 ApiBase::PARAM_TYPE => 'limit',
453 ],
454 'prop' => [
456 ApiBase::PARAM_DFLT => 'ids|title|flags',
459 'ids',
460 'title',
461 'flags',
462 'user',
463 'userid',
464 'comment',
465 'parsedcomment',
466 'timestamp',
467 'patrol',
468 'sizes',
469 'notificationtimestamp',
470 'loginfo',
471 ]
472 ],
473 'show' => [
476 'minor',
477 '!minor',
478 'bot',
479 '!bot',
480 'anon',
481 '!anon',
482 'patrolled',
483 '!patrolled',
484 'unread',
485 '!unread',
486 ]
487 ],
488 'type' => [
489 ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
493 ],
494 'owner' => [
495 ApiBase::PARAM_TYPE => 'user'
496 ],
497 'token' => [
498 ApiBase::PARAM_TYPE => 'string',
500 ],
501 'continue' => [
502 ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
503 ],
504 ];
505 }
506
507 protected function getExamplesMessages() {
508 return [
509 'action=query&list=watchlist'
510 => 'apihelp-query+watchlist-example-simple',
511 'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
512 => 'apihelp-query+watchlist-example-props',
513 'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
514 => 'apihelp-query+watchlist-example-allrev',
515 'action=query&generator=watchlist&prop=info'
516 => 'apihelp-query+watchlist-example-generator',
517 'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
518 => 'apihelp-query+watchlist-example-generator-rev',
519 'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
520 => 'apihelp-query+watchlist-example-wlowner',
521 ];
522 }
523
524 public function getHelpUrls() {
525 return 'https://www.mediawiki.org/wiki/API:Watchlist';
526 }
527}
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
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:97
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition ApiBase.php:91
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition ApiBase.php:1406
dieContinueUsageIf( $condition)
Die with the $prefix.
Definition ApiBase.php:2181
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition ApiBase.php:2230
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition ApiBase.php:88
const PARAM_SENSITIVE
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of ...
Definition ApiBase.php:179
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition ApiBase.php:50
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition ApiBase.php:685
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
dieUsageMsg( $error)
Output the error message related to a certain array.
Definition ApiBase.php:2144
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition ApiBase.php:100
const LIMIT_BIG1
Fast query, standard limit.
Definition ApiBase.php:184
getResult()
Get the result object.
Definition ApiBase.php:584
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition ApiBase.php:125
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition ApiBase.php:186
getModuleName()
Get the name of the module being executed by this instance.
Definition ApiBase.php:464
dieUsage( $description, $errorCode, $httpRespCode=0, $extradata=null)
Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an...
Definition ApiBase.php:1526
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition ApiBase.php:53
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.
addWhereIf( $value, $condition)
Same as addWhere(), but add the WHERE clauses only if a condition is met.
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.
addFields( $value)
Add a set of fields to select to the internal array.
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
addTimestampWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end t...
getDB()
Get the Query database connection (read-only)
addFieldsIf( $value, $condition)
Same as addFields(), but add the fields only if a condition is met.
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
addWhereFld( $field, $value)
Equivalent to addWhere(array($field => $value))
addWhere( $value)
Add a set of WHERE clauses to the internal 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.
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:38
static isUnpatrolled( $rc, User $user)
getUser()
Get the User object.
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:1290
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_RESTRICTED
Definition LogPage.php:36
const DELETED_ACTION
Definition LogPage.php:33
static parseToRCType( $type)
Parsing text to RC_* constants.
static getChangeTypes()
Get an array of all change types.
static parseFromRCType( $rcType)
Parsing RC_* constants to human-readable test.
const DELETED_USER
Definition Revision.php:78
const DELETED_RESTRICTED
Definition Revision.php:79
static userCanBitfield( $bitfield, $field, User $user=null, Title $title=null)
Determine if the current user is allowed to view a particular field of this revision,...
const DELETED_COMMENT
Definition Revision.php:77
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition Title.php:524
We use the convention $dbr for read and $dbw for write to help you keep track of whether the database object is a the world will explode Or to be a subsequent write query which succeeded on the master may fail when replicated to the slave due to a unique key collision Replication on the slave will stop and it may take hours to repair the database and get it back online Setting read_only in my cnf on the slave will avoid this but given the dire we prefer to have as many checks as possible We provide a but the wrapper functions like select() and insert() are usually more convenient. They take care of things like table prefixes and escaping for you. If you really need to make your own SQL
$res
Definition database.txt:21
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:171
const LIST_OR
Definition Defines.php:197
const RC_LOG
Definition Defines.php:172
const DB_SLAVE
Definition Defines.php:47
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:249
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
Definition hooks.txt:2413
namespace and then decline to actually register it file or subcat img or subcat $title
Definition hooks.txt:944
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:1458
returning false will NOT prevent logging $e
Definition hooks.txt:1940
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
$params