26use Wikimedia\ScopedCallback;
122 parent::__construct();
128 $this->mId =
$title->getArticleID( Title::GAID_FOR_UPDATE );
132 throw new InvalidArgumentException(
133 "The Title object yields no ID. Perhaps the page doesn't exist?"
137 $this->mParserOutput = $parserOutput;
139 $this->mLinks = $parserOutput->
getLinks();
140 $this->mImages = $parserOutput->
getImages();
147 # Convert the format of the interlanguage links
148 # I didn't want to change it in the ParserOutput, because that array is passed all
149 # the way back to the skin, so either a skin API break would be required, or an
150 # inefficient back-conversion.
152 $this->mInterlangs = [];
155 $this->mInterlangs[$key] =
$title;
158 foreach ( $this->mCategories
as &$sortkey ) {
159 # If the sortkey is longer then 255 bytes, it is truncated by DB, and then doesn't match
160 # when comparing existing vs current categories, causing T27254.
161 $sortkey = mb_strcut( $sortkey, 0, 255 );
164 $this->mRecursive = $recursive;
168 Hooks::run(
'LinksUpdateConstructed', [ &
$linksUpdate ] );
177 if ( $this->ticket ) {
180 $scopedLock = self::acquirePageLock( $this->
getDB(), $this->mId );
181 if ( !$scopedLock ) {
182 throw new RuntimeException(
"Could not acquire lock for page ID '{$this->mId}'." );
192 ScopedCallback::consume( $scopedLock );
200 Hooks::run(
'LinksUpdateComplete', [ &
$linksUpdate, $this->ticket ] );
215 $key =
"LinksUpdate:$why:pageid:$pageId";
217 if ( !$scopedLock ) {
218 $logger = LoggerFactory::getInstance(
'SecondaryDataUpdate' );
219 $logger->info(
"Could not acquire lock '{key}' for page ID '{page_id}'.", [
221 'page_id' => $pageId,
234 $this->
incrTableUpdate(
'pagelinks',
'pl', $this->linkDeletions, $this->linkInsertions );
245 # Invalidate all image description pages which had links added or removed
246 $imageUpdates = $imageDeletes + array_diff_key( $this->mImages, $existingIL );
257 $this->externalLinkDeletions,
258 $this->externalLinkInsertions );
268 # Inline interwiki links
292 $categoryInserts = array_diff_assoc( $this->mCategories, $existingCL );
293 $categoryUpdates = $categoryInserts + $categoryDeletes;
301 $this->propertyDeletions,
304 # Invalidate the necessary pages
305 $this->propertyInsertions = array_diff_assoc( $this->mProperties, $existingPP );
306 $changed = $this->propertyDeletions + $this->propertyInsertions;
309 # Invalidate all categories which were added, deleted or changed (set symmetric difference)
313 # Refresh links of all pages including this page
314 # This will be in a separate transaction
315 if ( $this->mRecursive ) {
319 # Update the links table freshness for this title
333 self::queueRecursiveJobsForTable( $this->mTitle,
'templatelinks', $action, $agent );
334 if ( $this->mTitle->getNamespace() ==
NS_FILE ) {
336 self::queueRecursiveJobsForTable( $this->mTitle,
'imagelinks', $action, $agent );
339 $bc = $this->mTitle->getBacklinkCache();
346 foreach ( $bc->getCascadeProtectedLinks()
as $title ) {
350 'causeAction' => $action,
351 'causeAgent' => $agent
355 JobQueueGroup::singleton()->push( $jobs );
367 Title $title, $table, $action =
'unknown', $userName =
'unknown'
369 if (
$title->getBacklinkCache()->hasLinks( $table ) ) {
376 "refreshlinks:{$table}:{$title->getPrefixedText()}"
377 ) + [
'causeAction' => $action,
'causeAgent' => $userName ]
380 JobQueueGroup::singleton()->push(
$job );
399 if ( !$added && !$deleted ) {
403 $domainId = $this->
getDB()->getDomainID();
404 $wp = WikiPage::factory( $this->mTitle );
405 $lbf = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
407 $lbf->commitAndWaitForReplication( __METHOD__, $this->ticket, [
'domain' => $domainId ] );
410 $wp->updateCategoryCounts( $addBatch, [], $this->mId );
411 $lbf->commitAndWaitForReplication(
412 __METHOD__, $this->ticket, [
'domain' => $domainId ] );
416 $wp->updateCategoryCounts( [], $deleteBatch, $this->mId );
417 $lbf->commitAndWaitForReplication(
418 __METHOD__, $this->ticket, [
'domain' => $domainId ] );
437 $services = MediaWikiServices::getInstance();
438 $bSize =
$services->getMainConfig()->get(
'UpdateRowsPerQuery' );
439 $lbf =
$services->getDBLoadBalancerFactory();
441 if ( $table ===
'page_props' ) {
442 $fromField =
'pp_page';
444 $fromField =
"{$prefix}_from";
448 if ( $table ===
'pagelinks' || $table ===
'templatelinks' || $table ===
'iwlinks' ) {
449 $baseKey = ( $table ===
'iwlinks' ) ?
'iwl_prefix' :
"{$prefix}_namespace";
452 $curDeletionBatch = [];
453 $deletionBatches = [];
454 foreach ( $deletions
as $ns => $dbKeys ) {
455 foreach ( $dbKeys
as $dbKey => $unused ) {
456 $curDeletionBatch[$ns][$dbKey] = 1;
457 if ( ++$curBatchSize >= $bSize ) {
458 $deletionBatches[] = $curDeletionBatch;
459 $curDeletionBatch = [];
464 if ( $curDeletionBatch ) {
465 $deletionBatches[] = $curDeletionBatch;
468 foreach ( $deletionBatches
as $deletionBatch ) {
470 $fromField => $this->mId,
471 $this->
getDB()->makeWhereFrom2d( $deletionBatch, $baseKey,
"{$prefix}_title" )
475 if ( $table ===
'langlinks' ) {
476 $toField =
'll_lang';
477 } elseif ( $table ===
'page_props' ) {
478 $toField =
'pp_propname';
480 $toField = $prefix .
'_to';
483 $deletionBatches = array_chunk( array_keys( $deletions ), $bSize );
484 foreach ( $deletionBatches
as $deletionBatch ) {
485 $deleteWheres[] = [ $fromField => $this->mId, $toField => $deletionBatch ];
489 $domainId = $this->
getDB()->getDomainID();
491 foreach ( $deleteWheres
as $deleteWhere ) {
492 $this->
getDB()->delete( $table, $deleteWhere, __METHOD__ );
493 $lbf->commitAndWaitForReplication(
494 __METHOD__, $this->ticket, [
'domain' => $domainId ]
498 $insertBatches = array_chunk( $insertions, $bSize );
499 foreach ( $insertBatches
as $insertBatch ) {
500 $this->
getDB()->insert( $table, $insertBatch, __METHOD__,
'IGNORE' );
501 $lbf->commitAndWaitForReplication(
502 __METHOD__, $this->ticket, [
'domain' => $domainId ]
506 if ( count( $insertions ) ) {
507 Hooks::run(
'LinksUpdateAfterInsert', [ $this, $table, $insertions ] );
519 foreach ( $this->mLinks
as $ns => $dbkeys ) {
520 $diffs = isset( $existing[$ns] )
521 ? array_diff_key( $dbkeys, $existing[$ns] )
523 foreach ( $diffs
as $dbk => $id ) {
525 'pl_from' => $this->mId,
526 'pl_from_namespace' => $this->mTitle->getNamespace(),
527 'pl_namespace' => $ns,
543 foreach ( $this->mTemplates
as $ns => $dbkeys ) {
544 $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
545 foreach ( $diffs
as $dbk => $id ) {
547 'tl_from' => $this->mId,
548 'tl_from_namespace' => $this->mTitle->getNamespace(),
549 'tl_namespace' => $ns,
566 $diffs = array_diff_key( $this->mImages, $existing );
567 foreach ( $diffs
as $iname => $dummy ) {
569 'il_from' => $this->mId,
570 'il_from_namespace' => $this->mTitle->getNamespace(),
585 $diffs = array_diff_key( $this->mExternals, $existing );
586 foreach ( $diffs
as $url => $dummy ) {
589 'el_from' => $this->mId,
591 'el_index' => $index,
592 'el_index_60' => substr( $index, 0, 60 ),
610 $diffs = array_diff_assoc( $this->mCategories, $existing );
612 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
614 foreach ( $diffs
as $name => $prefix ) {
616 $contLang->findVariantLink(
$name, $nt,
true );
618 $type = MWNamespace::getCategoryLinkType( $this->mTitle->getNamespace() );
620 # Treat custom sortkeys as a prefix, so that if multiple
621 # things are forced to sort as '*' or something, they'll
622 # sort properly in the category rather than in page_id
624 $sortkey = $collation->getSortKey( $this->mTitle->getCategorySortkey( $prefix ) );
627 'cl_from' => $this->mId,
629 'cl_sortkey' => $sortkey,
630 'cl_timestamp' => $this->
getDB()->timestamp(),
631 'cl_sortkey_prefix' => $prefix,
648 $diffs = array_diff_assoc( $this->mInterlangs, $existing );
652 'll_from' => $this->mId,
667 $diffs = array_diff_assoc( $this->mProperties, $existing );
670 foreach ( array_keys( $diffs )
as $name ) {
696 $value = $this->mProperties[$prop];
699 'pp_page' => $this->mId,
700 'pp_propname' => $prop,
725 return floatval(
$value );
739 foreach ( $this->mInterwikis
as $prefix => $dbkeys ) {
740 $diffs = isset( $existing[$prefix] )
741 ? array_diff_key( $dbkeys, $existing[$prefix] )
744 foreach ( $diffs
as $dbk => $id ) {
746 'iwl_from' => $this->mId,
747 'iwl_prefix' => $prefix,
764 foreach ( $existing
as $ns => $dbkeys ) {
765 if ( isset( $this->mLinks[$ns] ) ) {
766 $del[$ns] = array_diff_key( $existing[$ns], $this->mLinks[$ns] );
768 $del[$ns] = $existing[$ns];
783 foreach ( $existing
as $ns => $dbkeys ) {
784 if ( isset( $this->mTemplates[$ns] ) ) {
785 $del[$ns] = array_diff_key( $existing[$ns], $this->mTemplates[$ns] );
787 $del[$ns] = $existing[$ns];
801 return array_diff_key( $existing, $this->mImages );
811 return array_diff_key( $existing, $this->mExternals );
821 return array_diff_assoc( $existing, $this->mCategories );
831 return array_diff_assoc( $existing, $this->mInterlangs );
840 return array_diff_assoc( $existing, $this->mProperties );
851 foreach ( $existing
as $prefix => $dbkeys ) {
852 if ( isset( $this->mInterwikis[$prefix] ) ) {
853 $del[$prefix] = array_diff_key( $existing[$prefix], $this->mInterwikis[$prefix] );
855 $del[$prefix] = $existing[$prefix];
868 $res = $this->
getDB()->select(
'pagelinks', [
'pl_namespace',
'pl_title' ],
869 [
'pl_from' => $this->mId ], __METHOD__ );
871 foreach (
$res as $row ) {
872 if ( !isset( $arr[$row->pl_namespace] ) ) {
873 $arr[$row->pl_namespace] = [];
875 $arr[$row->pl_namespace][$row->pl_title] = 1;
887 $res = $this->
getDB()->select(
'templatelinks', [
'tl_namespace',
'tl_title' ],
888 [
'tl_from' => $this->mId ], __METHOD__ );
890 foreach (
$res as $row ) {
891 if ( !isset( $arr[$row->tl_namespace] ) ) {
892 $arr[$row->tl_namespace] = [];
894 $arr[$row->tl_namespace][$row->tl_title] = 1;
906 $res = $this->
getDB()->select(
'imagelinks', [
'il_to' ],
907 [
'il_from' => $this->mId ], __METHOD__ );
909 foreach (
$res as $row ) {
910 $arr[$row->il_to] = 1;
922 $res = $this->
getDB()->select(
'externallinks', [
'el_to' ],
923 [
'el_from' => $this->mId ], __METHOD__ );
925 foreach (
$res as $row ) {
926 $arr[$row->el_to] = 1;
938 $res = $this->
getDB()->select(
'categorylinks', [
'cl_to',
'cl_sortkey_prefix' ],
939 [
'cl_from' => $this->mId ], __METHOD__ );
941 foreach (
$res as $row ) {
942 $arr[$row->cl_to] = $row->cl_sortkey_prefix;
955 $res = $this->
getDB()->select(
'langlinks', [
'll_lang',
'll_title' ],
956 [
'll_from' => $this->mId ], __METHOD__ );
958 foreach (
$res as $row ) {
959 $arr[$row->ll_lang] = $row->ll_title;
970 $res = $this->
getDB()->select(
'iwlinks', [
'iwl_prefix',
'iwl_title' ],
971 [
'iwl_from' => $this->mId ], __METHOD__ );
973 foreach (
$res as $row ) {
974 if ( !isset( $arr[$row->iwl_prefix] ) ) {
975 $arr[$row->iwl_prefix] = [];
977 $arr[$row->iwl_prefix][$row->iwl_title] = 1;
989 $res = $this->
getDB()->select(
'page_props', [
'pp_propname',
'pp_value' ],
990 [
'pp_page' => $this->mId ], __METHOD__ );
992 foreach (
$res as $row ) {
993 $arr[$row->pp_propname] = $row->pp_value;
1004 return $this->mTitle;
1013 return $this->mParserOutput;
1021 return $this->mImages;
1032 $this->mRevision = $revision;
1040 return $this->mRevision;
1071 if ( !is_array( $inv ) ) {
1074 foreach ( $inv
as $table ) {
1075 DeferredUpdates::addUpdate(
1089 if ( $this->linkInsertions ===
null ) {
1093 foreach ( $this->linkInsertions
as $insertion ) {
1094 $result[] = Title::makeTitle( $insertion[
'pl_namespace'], $insertion[
'pl_title'] );
1106 if ( $this->linkDeletions ===
null ) {
1110 foreach ( $this->linkDeletions
as $ns =>
$titles ) {
1126 if ( $this->externalLinkInsertions ===
null ) {
1130 foreach ( $this->externalLinkInsertions
as $key =>
$value ) {
1143 if ( $this->externalLinkDeletions ===
null ) {
1146 return array_keys( $this->externalLinkDeletions );
1156 return $this->propertyInsertions;
1166 return $this->propertyDeletions;
1175 $timestamp = $this->mParserOutput->getCacheTime();
1176 $this->
getDB()->update(
'page',
1177 [
'page_links_updated' => $this->
getDB()->timestamp( $timestamp ) ],
1178 [
'page_id' => $this->mId ],
1196 if ( $this->
user ) {
1198 'userId' => $this->
user->getId(),
1199 'userName' => $this->
user->getName(),
1205 if ( $this->mRevision ) {
1206 $triggeringRevisionId = $this->mRevision->getId();
1208 $triggeringRevisionId =
false;
1212 'domain' => $this->
getDB()->getDomainID(),
1214 'refreshLinksPrioritized',
1217 'rootJobTimestamp' => $this->mParserOutput->getCacheTime(),
1218 'useRecursiveLinksUpdate' => $this->mRecursive,
1219 'triggeringUser' => $userInfo,
1220 'triggeringRevisionId' => $triggeringRevisionId,
1221 'causeAction' => $this->getCauseAction(),
1222 'causeAgent' => $this->getCauseAgent()
1224 [
'removeDuplicates' =>
true ],
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgPagePropLinkInvalidations
Page property link table invalidation lists.
$wgCategoryCollation
Specify how category names should be sorted, when listed on a category page.
$wgUpdateRowsPerQuery
Number of rows to update per query.
$wgPagePropsHaveSortkey
Whether the page_props table has a pp_sortkey column.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Deferrable Update for closure/callback updates that should use auto-commit mode.
Abstract base class for update jobs that do something with some secondary data extracted from article...
Class to invalidate the HTML cache of all the pages linking to a given title.
Job queue task description base code.
static newRootJobParams( $key)
Get "root job" parameters for a task.
static makeIndexes( $url)
Converts a URL into a format for el_index.
Class the manages updates of *_link tables as well as similar extension-managed tables.
updateCategoryCounts(array $added, array $deleted)
Update all the appropriate counts in the category table.
array $mTemplates
Map of title strings to IDs for the template references, including broken ones.
updateLinksTimestamp()
Update links table freshness.
getTitle()
Return the title object of the page being updated.
getExistingLinks()
Get an array of existing links, as a 2-D array.
getExistingProperties()
Get an array of existing categories, with the name in the key and sort key in the value.
getImageInsertions( $existing=[])
Get an array of image insertions Skips the names specified in $existing.
null array $externalLinkInsertions
Added external links if calculated.
getInterlangInsertions( $existing=[])
Get an array of interlanguage link insertions.
getExternalInsertions( $existing=[])
Get an array of externallinks insertions.
__construct(Title $title, ParserOutput $parserOutput, $recursive=true)
getPropertyInsertions( $existing=[])
Get an array of page property insertions.
array $mLinks
Map of title strings to IDs for the links in the document.
array $mInterwikis
2-D map of (prefix => DBK => 1)
getAddedExternalLinks()
Fetch external links added by this LinksUpdate.
setTriggeringUser(User $user)
Set the User who triggered this LinksUpdate.
getTemplateDeletions( $existing)
Given an array of existing templates, returns those templates which are not in $this and thus should ...
invalidateCategories( $cats)
null array $propertyInsertions
Added properties if calculated.
doUpdate()
Update link tables with outgoing links from an updated article.
Title $mTitle
Title object of the article linked from.
getPropertySortKeyValue( $value)
Determines the sort key for the given property value.
int $mId
Page ID of the article linked from.
getAddedProperties()
Fetch page properties added by this LinksUpdate.
static queueRecursiveJobsForTable(Title $title, $table, $action='unknown', $userName='unknown')
Queue a RefreshLinks job for any table.
getLinkInsertions( $existing=[])
Get an array of pagelinks insertions for passing to the DB Skips the titles specified by the 2-D arra...
getExistingImages()
Get an array of existing images, image names in the keys.
getRemovedLinks()
Fetch page links removed by this LinksUpdate.
Revision $mRevision
Revision for which this update has been triggered.
setRevision(Revision $revision)
Set the revision corresponding to this LinksUpdate.
getTemplateInsertions( $existing=[])
Get an array of template insertions.
getRemovedExternalLinks()
Fetch external links removed by this LinksUpdate.
invalidateImageDescriptions(array $images)
getCategoryDeletions( $existing)
Given an array of existing categories, returns those categories which are not in $this and thus shoul...
getInterwikiInsertions( $existing=[])
Get an array of interwiki insertions for passing to the DB Skips the titles specified by the 2-D arra...
ParserOutput $mParserOutput
null array $linkInsertions
Added links if calculated.
getImages()
Return the list of images used as generated by the parser.
array $mProperties
Map of arbitrary name to value.
getExistingInterlangs()
Get an array of existing interlanguage links, with the language code in the key and the title in the ...
getExistingExternals()
Get an array of existing external links, URLs in the keys.
getParserOutput()
Returns parser output.
getPropertyDeletions( $existing)
Get array of properties which should be deleted.
null array $externalLinkDeletions
Deleted external links if calculated.
invalidateProperties( $changed)
Invalidate any necessary link lists related to page property changes.
null array $linkDeletions
Deleted links if calculated.
null array $propertyDeletions
Deleted properties if calculated.
getInterlangDeletions( $existing)
Given an array of existing interlanguage links, returns those links which are not in $this and thus s...
getPagePropRowData( $prop)
Returns an associative array to be used for inserting a row into the page_props table.
getExistingCategories()
Get an array of existing categories, with the name in the key and sort key in the value.
getAddedLinks()
Fetch page links added by this LinksUpdate.
queueRecursiveJobs()
Queue recursive jobs for this page.
array $mImages
DB keys of the images used, in the array key only.
getImageDeletions( $existing)
Given an array of existing images, returns those images which are not in $this and thus should be del...
array $mInterlangs
Map of language codes to titles.
getLinkDeletions( $existing)
Given an array of existing links, returns those links which are not in $this and thus should be delet...
array $mCategories
Map of category names to sort keys.
bool $mRecursive
Whether to queue jobs for recursive updates.
getCategoryInsertions( $existing=[])
Get an array of category insertions.
getRemovedProperties()
Fetch page properties removed by this LinksUpdate.
getExistingTemplates()
Get an array of existing templates, as a 2-D array.
getExternalDeletions( $existing)
Given an array of existing external links, returns those links which are not in $this and thus should...
static acquirePageLock(IDatabase $dbw, $pageId, $why='atomicity')
Acquire a lock for performing link table updates for a page on a DB.
getInterwikiDeletions( $existing)
Given an array of existing interwiki links, returns those links which are not in $this and thus shoul...
array $mExternals
URLs of external links, array key only.
incrTableUpdate( $table, $prefix, $deletions, $insertions)
Update a table by doing a delete query then an insert query.
getExistingInterwikis()
Get an array of existing inline interwiki links, as a 2-D array.
static invalidatePages(IDatabase $dbw, $namespace, array $dbkeys)
Invalidate the cache of a list of pages from a single namespace.
Job to update link tables for pages.
static newPrioritized(Title $title, array $params)
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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
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
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 and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Wikitext formatted, in the key only.
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
either a unescaped string or a HtmlArmor object after in associative array form externallinks $linksUpdate
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Allows to change the fields on the form that will be generated $name
return true to allow those checks to and false if checking is done & $user
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
Interface that marks a DataUpdate as enqueuable via the JobQueue.
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))
if(count( $args)< 1) $job
if(!isset( $args[0])) $lang