36 parent::__construct(
$query, $moduleName,
'rc' );
57 if ( isset( $this->tokenFunctions ) ) {
67 $this->tokenFunctions = [
68 'patrol' => [ self::class,
'getPatrolToken' ]
70 Hooks::run(
'APIQueryRecentChangesTokens', [ &$this->tokenFunctions ] );
85 $validTokenUser =
false;
88 if ( ( $wgUser->useRCPatrol() && $rc->getAttribute(
'rc_type' ) ==
RC_EDIT ) ||
89 ( $wgUser->useNPPatrol() && $rc->getAttribute(
'rc_type' ) ==
RC_NEW )
91 $validTokenUser =
true;
93 } elseif ( $wgUser->useRCPatrol() || $wgUser->useNPPatrol() ) {
94 $validTokenUser =
true;
97 if ( $validTokenUser ) {
99 static $cachedPatrolToken =
null;
101 if ( is_null( $cachedPatrolToken ) ) {
102 $cachedPatrolToken = $wgUser->getEditToken(
'patrol' );
105 return $cachedPatrolToken;
116 $this->fld_comment = isset( $prop[
'comment'] );
117 $this->fld_parsedcomment = isset( $prop[
'parsedcomment'] );
118 $this->fld_user = isset( $prop[
'user'] );
119 $this->fld_userid = isset( $prop[
'userid'] );
120 $this->fld_flags = isset( $prop[
'flags'] );
121 $this->fld_timestamp = isset( $prop[
'timestamp'] );
122 $this->fld_title = isset( $prop[
'title'] );
123 $this->fld_ids = isset( $prop[
'ids'] );
124 $this->fld_sizes = isset( $prop[
'sizes'] );
125 $this->fld_redirect = isset( $prop[
'redirect'] );
126 $this->fld_patrolled = isset( $prop[
'patrolled'] );
127 $this->fld_loginfo = isset( $prop[
'loginfo'] );
128 $this->fld_tags = isset( $prop[
'tags'] );
129 $this->fld_sha1 = isset( $prop[
'sha1'] );
137 $this->
run( $resultPageSet );
145 public function run( $resultPageSet =
null ) {
157 if ( !is_null(
$params[
'continue'] ) ) {
158 $cont = explode(
'|',
$params[
'continue'] );
160 $db = $this->
getDB();
161 $timestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
164 $op =
$params[
'dir'] ===
'older' ?
'<' :
'>';
166 "rc_timestamp $op $timestamp OR " .
167 "(rc_timestamp = $timestamp AND " .
172 $order =
$params[
'dir'] ===
'older' ?
'DESC' :
'ASC';
174 "rc_timestamp $order",
180 if ( !is_null(
$params[
'type'] ) ) {
183 }
catch ( Exception
$e ) {
189 if ( !is_null(
$title ) ) {
190 $titleObj = Title::newFromText(
$title );
191 if ( is_null( $titleObj ) ) {
194 $this->
addWhereFld(
'rc_namespace', $titleObj->getNamespace() );
195 $this->
addWhereFld(
'rc_title', $titleObj->getDBkey() );
198 if ( !is_null(
$params[
'show'] ) ) {
199 $show = array_flip(
$params[
'show'] );
202 if ( ( isset( $show[
'minor'] ) && isset( $show[
'!minor'] ) )
203 || ( isset( $show[
'bot'] ) && isset( $show[
'!bot'] ) )
204 || ( isset( $show[
'anon'] ) && isset( $show[
'!anon'] ) )
205 || ( isset( $show[
'redirect'] ) && isset( $show[
'!redirect'] ) )
206 || ( isset( $show[
'patrolled'] ) && isset( $show[
'!patrolled'] ) )
207 || ( isset( $show[
'patrolled'] ) && isset( $show[
'unpatrolled'] ) )
208 || ( isset( $show[
'!patrolled'] ) && isset( $show[
'unpatrolled'] ) )
209 || ( isset( $show[
'autopatrolled'] ) && isset( $show[
'!autopatrolled'] ) )
210 || ( isset( $show[
'autopatrolled'] ) && isset( $show[
'unpatrolled'] ) )
211 || ( isset( $show[
'autopatrolled'] ) && isset( $show[
'!patrolled'] ) )
218 if ( !
$user->useRCPatrol() && !
$user->useNPPatrol() ) {
219 $this->
dieWithError(
'apierror-permissiondenied-patrolflag',
'permissiondenied' );
224 $this->
addWhereIf(
'rc_minor = 0', isset( $show[
'!minor'] ) );
225 $this->
addWhereIf(
'rc_minor != 0', isset( $show[
'minor'] ) );
226 $this->
addWhereIf(
'rc_bot = 0', isset( $show[
'!bot'] ) );
227 $this->
addWhereIf(
'rc_bot != 0', isset( $show[
'bot'] ) );
228 if ( isset( $show[
'anon'] ) || isset( $show[
'!anon'] ) ) {
229 $actorMigration = ActorMigration::newMigration();
230 $actorQuery = $actorMigration->getJoin(
'rc_user' );
231 $this->
addTables( $actorQuery[
'tables'] );
234 $actorMigration->isAnon( $actorQuery[
'fields'][
'rc_user'] ), isset( $show[
'anon'] )
237 $actorMigration->isNotAnon( $actorQuery[
'fields'][
'rc_user'] ), isset( $show[
'!anon'] )
240 $this->
addWhereIf(
'rc_patrolled = 0', isset( $show[
'!patrolled'] ) );
241 $this->
addWhereIf(
'rc_patrolled != 0', isset( $show[
'patrolled'] ) );
242 $this->
addWhereIf(
'page_is_redirect = 1', isset( $show[
'redirect'] ) );
244 if ( isset( $show[
'unpatrolled'] ) ) {
246 if (
$user->useRCPatrol() ) {
247 $this->
addWhere(
'rc_patrolled = ' . RecentChange::PRC_UNPATROLLED );
248 } elseif (
$user->useNPPatrol() ) {
249 $this->
addWhere(
'rc_patrolled = ' . RecentChange::PRC_UNPATROLLED );
255 'rc_patrolled != ' . RecentChange::PRC_AUTOPATROLLED,
256 isset( $show[
'!autopatrolled'] )
259 'rc_patrolled = ' . RecentChange::PRC_AUTOPATROLLED,
260 isset( $show[
'autopatrolled'] )
265 'page_is_redirect = 0 OR page_is_redirect IS NULL',
266 isset( $show[
'!redirect'] )
272 if ( !is_null(
$params[
'user'] ) ) {
274 $actorQuery = ActorMigration::newMigration()
276 $this->
addTables( $actorQuery[
'tables'] );
278 $this->
addWhere( $actorQuery[
'conds'] );
281 if ( !is_null(
$params[
'excludeuser'] ) ) {
283 $actorQuery = ActorMigration::newMigration()
285 $this->
addTables( $actorQuery[
'tables'] );
287 $this->
addWhere(
'NOT(' . $actorQuery[
'conds'] .
')' );
301 $showRedirects =
false;
303 if ( !is_null(
$params[
'prop'] ) ) {
304 $prop = array_flip(
$params[
'prop'] );
309 if ( $this->fld_patrolled && !
$user->useRCPatrol() && !
$user->useNPPatrol() ) {
310 $this->
dieWithError(
'apierror-permissiondenied-patrolflag',
'permissiondenied' );
314 $this->
addFieldsIf( [
'rc_this_oldid',
'rc_last_oldid' ], $this->fld_ids );
315 if ( $this->fld_user || $this->fld_userid ) {
316 $actorQuery = ActorMigration::newMigration()->getJoin(
'rc_user' );
317 $this->
addTables( $actorQuery[
'tables'] );
318 $this->
addFields( $actorQuery[
'fields'] );
321 $this->
addFieldsIf( [
'rc_minor',
'rc_type',
'rc_bot' ], $this->fld_flags );
322 $this->
addFieldsIf( [
'rc_old_len',
'rc_new_len' ], $this->fld_sizes );
323 $this->
addFieldsIf( [
'rc_patrolled',
'rc_log_type' ], $this->fld_patrolled );
325 [
'rc_logid',
'rc_log_type',
'rc_log_action',
'rc_params' ],
328 $showRedirects = $this->fld_redirect || isset( $show[
'redirect'] )
329 || isset( $show[
'!redirect'] );
332 $resultPageSet &&
$params[
'generaterevisions'] );
334 if ( $this->fld_tags ) {
338 if ( $this->fld_sha1 ) {
341 [
'rc_this_oldid=rev_id' ] ] ] );
342 $this->
addFields( [
'rev_sha1',
'rev_deleted' ] );
345 if (
$params[
'toponly'] || $showRedirects ) {
348 [
'rc_namespace=page_namespace',
'rc_title=page_title' ] ] ] );
352 $this->
addWhere(
'rc_this_oldid = page_latest' );
356 if ( !is_null(
$params[
'tag'] ) ) {
358 $this->
addJoinConds( [
'change_tag' => [
'JOIN', [
'rc_id=ct_rc_id' ] ] ] );
359 $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
369 if ( !is_null(
$params[
'user'] ) || !is_null(
$params[
'excludeuser'] ) ) {
370 if ( !
$user->isAllowed(
'deletedhistory' ) ) {
371 $bitmask = RevisionRecord::DELETED_USER;
372 } elseif ( !
$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
373 $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
378 $this->
addWhere( $this->
getDB()->bitAnd(
'rc_deleted', $bitmask ) .
" != $bitmask" );
381 if ( $this->
getRequest()->getCheck(
'namespace' ) ) {
383 if ( !
$user->isAllowed(
'deletedhistory' ) ) {
385 } elseif ( !
$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
393 $this->
getDB()->bitAnd(
'rc_deleted', $bitmask ) .
" != $bitmask",
398 $this->token =
$params[
'token'];
400 if ( $this->fld_comment || $this->fld_parsedcomment || $this->token ) {
401 $this->commentStore = CommentStore::getStore();
402 $commentQuery = $this->commentStore->getJoin(
'rc_comment' );
403 $this->
addTables( $commentQuery[
'tables'] );
404 $this->
addFields( $commentQuery[
'fields'] );
413 $res = $this->
select( __METHOD__, [], $hookData );
421 foreach (
$res as $row ) {
422 if ( $count === 0 && $resultPageSet !==
null ) {
426 $this,
'continue',
"$row->rc_timestamp|$row->rc_id"
429 if ( ++$count >
$params[
'limit'] ) {
436 if ( is_null( $resultPageSet ) ) {
441 $fit = $this->
processRow( $row, $vals, $hookData ) &&
447 } elseif (
$params[
'generaterevisions'] ) {
448 $revid = (int)$row->rc_this_oldid;
453 $titles[] = Title::makeTitle( $row->rc_namespace, $row->rc_title );
457 if ( is_null( $resultPageSet ) ) {
460 } elseif (
$params[
'generaterevisions'] ) {
461 $resultPageSet->populateFromRevisionIDs( $revids );
463 $resultPageSet->populateFromTitles(
$titles );
475 $title = Title::makeTitle( $row->rc_namespace, $row->rc_title );
481 $type = (int)$row->rc_type;
482 $vals[
'type'] = RecentChange::parseFromRCType(
$type );
487 if ( $this->fld_title || $this->fld_ids ) {
489 $vals[
'actionhidden'] =
true;
495 if ( $this->fld_title ) {
498 if ( $this->fld_ids ) {
499 $vals[
'pageid'] = (int)$row->rc_cur_id;
500 $vals[
'revid'] = (int)$row->rc_this_oldid;
501 $vals[
'old_revid'] = (int)$row->rc_last_oldid;
506 if ( $this->fld_ids ) {
507 $vals[
'rcid'] = (int)$row->rc_id;
511 if ( $this->fld_user || $this->fld_userid ) {
512 if ( $row->rc_deleted & RevisionRecord::DELETED_USER ) {
513 $vals[
'userhidden'] =
true;
516 if ( RevisionRecord::userCanBitfield( $row->rc_deleted, RevisionRecord::DELETED_USER,
$user ) ) {
517 if ( $this->fld_user ) {
518 $vals[
'user'] = $row->rc_user_text;
521 if ( $this->fld_userid ) {
522 $vals[
'userid'] = (int)$row->rc_user;
525 if ( !$row->rc_user ) {
526 $vals[
'anon'] =
true;
532 if ( $this->fld_flags ) {
533 $vals[
'bot'] = (bool)$row->rc_bot;
534 $vals[
'new'] = $row->rc_type ==
RC_NEW;
535 $vals[
'minor'] = (bool)$row->rc_minor;
539 if ( $this->fld_sizes ) {
540 $vals[
'oldlen'] = (int)$row->rc_old_len;
541 $vals[
'newlen'] = (int)$row->rc_new_len;
545 if ( $this->fld_timestamp ) {
546 $vals[
'timestamp'] =
wfTimestamp( TS_ISO_8601, $row->rc_timestamp );
550 if ( $this->fld_comment || $this->fld_parsedcomment ) {
551 if ( $row->rc_deleted & RevisionRecord::DELETED_COMMENT ) {
552 $vals[
'commenthidden'] =
true;
555 if ( RevisionRecord::userCanBitfield(
556 $row->rc_deleted, RevisionRecord::DELETED_COMMENT,
$user
558 $comment = $this->commentStore->getComment(
'rc_comment', $row )->text;
559 if ( $this->fld_comment ) {
560 $vals[
'comment'] = $comment;
563 if ( $this->fld_parsedcomment ) {
569 if ( $this->fld_redirect ) {
570 $vals[
'redirect'] = (bool)$row->page_is_redirect;
574 if ( $this->fld_patrolled ) {
575 $vals[
'patrolled'] = $row->rc_patrolled != RecentChange::PRC_UNPATROLLED;
577 $vals[
'autopatrolled'] = $row->rc_patrolled == RecentChange::PRC_AUTOPATROLLED;
580 if ( $this->fld_loginfo && $row->rc_type ==
RC_LOG ) {
582 $vals[
'actionhidden'] =
true;
586 $vals[
'logid'] = (int)$row->rc_logid;
587 $vals[
'logtype'] = $row->rc_log_type;
588 $vals[
'logaction'] = $row->rc_log_action;
593 if ( $this->fld_tags ) {
594 if ( $row->ts_tags ) {
595 $tags = explode(
',', $row->ts_tags );
597 $vals[
'tags'] = $tags;
603 if ( $this->fld_sha1 && $row->rev_sha1 !==
null ) {
604 if ( $row->rev_deleted & RevisionRecord::DELETED_TEXT ) {
605 $vals[
'sha1hidden'] =
true;
608 if ( RevisionRecord::userCanBitfield(
609 $row->rev_deleted, RevisionRecord::DELETED_TEXT,
$user
611 if ( $row->rev_sha1 !==
'' ) {
612 $vals[
'sha1'] = Wikimedia\base_convert( $row->rev_sha1, 36, 16, 40 );
619 if ( !is_null( $this->token ) ) {
621 foreach ( $this->token
as $t ) {
623 $title, RecentChange::newFromRow( $row ) );
624 if ( $val ===
false ) {
625 $this->
addWarning( [
'apiwarn-tokennotallowed', $t ] );
627 $vals[
$t .
'token'] = $val;
632 if ( $anyHidden && ( $row->rc_deleted & RevisionRecord::DELETED_RESTRICTED ) ) {
633 $vals[
'suppressed'] =
true;
644 return isset( $flagsArray[
'patrolled'] ) ||
645 isset( $flagsArray[
'!patrolled'] ) ||
646 isset( $flagsArray[
'unpatrolled'] ) ||
647 isset( $flagsArray[
'autopatrolled'] ) ||
648 isset( $flagsArray[
'!autopatrolled'] );
652 if ( isset(
$params[
'show'] ) &&
657 if ( isset(
$params[
'token'] ) ) {
663 if ( !is_null(
$params[
'prop'] ) && in_array(
'parsedcomment',
$params[
'prop'] ) ) {
665 return 'anon-public-user-private';
760 'generaterevisions' =>
false,
766 'action=query&list=recentchanges'
767 =>
'apihelp-query+recentchanges-example-simple',
768 'action=query&generator=recentchanges&grcshow=!patrolled&prop=info'
769 =>
'apihelp-query+recentchanges-example-generator',
774 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Recentchanges';
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.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
const LIMIT_BIG1
Fast query, standard limit.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
requireMaxOneParameter( $params, $required)
Die if more than one of a certain set of parameters is set and not false.
const PARAM_EXTRA_NAMESPACES
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values.
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
const LIMIT_BIG2
Fast query, apihighlimits limit.
getModuleName()
Get the name of the module being executed by this instance.
getContinuationManager()
Get the continuation manager.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
processRow( $row, array &$data, array &$hookData)
Call the ApiQueryBaseProcessRow hook.
addWhereIf( $value, $condition)
Same as addWhere(), but add the WHERE clauses only if a condition is met.
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.
userCanSeeRevDel()
Check whether the current user has permission to view revision-deleted fields.
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
A query action to enumerate the recent changes that were done to the wiki.
includesPatrollingFlags(array $flagsArray)
__construct(ApiQuery $query, $moduleName)
static getPatrolToken( $pageid, $title, $rc=null)
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
initProperties( $prop)
Sets internal state to include the desired properties in the output.
getExamplesMessages()
Returns usage examples for this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
executeGenerator( $resultPageSet)
Execute this module as a generator.
run( $resultPageSet=null)
Generates and outputs the result of this query based upon the provided parameters.
getHelpUrls()
Return links to more detailed help pages about the module.
getCacheMode( $params)
Get the cache mode for the data generated by this module.
extractRowInfo( $row)
Extracts from a single sql row the data needed to describe one recent change.
getTokenFunctions()
Get an array mapping token names to their handler functions.
This is the main query class.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static isUnpatrolled( $rc, User $user)
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...
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
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
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
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImgAuthModifyHeaders':Executed just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand. $title:LinkTarget object & $headers:HTTP headers(name=> value, names are case insensitive). Two headers get special handling:If-Modified-Since(value must be a valid HTTP date) and Range(must be of the form "bytes=(\d*-\d*)") will be honored when streaming the file. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
namespace and then decline to actually register it file or subcat img or subcat $title
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
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
return true to allow those checks to and false if checking is done & $user
returning false will NOT prevent logging $e
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
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
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))