Go to the documentation of this file.
25 use Wikimedia\ScopedCallback;
113 parent::__construct();
119 throw new InvalidArgumentException(
120 "The Title object yields no ID. Perhaps the page doesn't exist?"
134 # Convert the format of the interlanguage links
135 # I didn't want to change it in the ParserOutput, because that array is passed all
136 # the way back to the skin, so either a skin API break would be required, or an
137 # inefficient back-conversion.
139 $this->mInterlangs = [];
142 $this->mInterlangs[$key] =
$title;
145 foreach ( $this->mCategories
as &$sortkey ) {
146 # If the sortkey is longer then 255 bytes,
147 # it truncated by DB, and then doesn't get
148 # matched when comparing existing vs current
149 # categories, causing T27254.
150 # Also. substr behaves weird when given "".
151 if ( $sortkey !==
'' ) {
152 $sortkey = substr( $sortkey, 0, 255 );
156 $this->mRecursive = $recursive;
169 if ( $this->ticket ) {
181 ScopedCallback::consume( $scopedLock );
183 $this->
getDB()->onTransactionIdle(
204 $key =
"LinksUpdate:$why:pageid:$pageId";
206 if ( !$scopedLock ) {
207 throw new RuntimeException(
"Could not acquire lock '$key'." );
218 $this->
incrTableUpdate(
'pagelinks',
'pl', $this->linkDeletions, $this->linkInsertions );
229 # Invalidate all image description pages which had links added or removed
230 $imageUpdates = $imageDeletes + array_diff_key( $this->mImages, $existingIL );
249 # Inline interwiki links
273 $categoryInserts = array_diff_assoc( $this->mCategories, $existingCL );
274 $categoryUpdates = $categoryInserts + $categoryDeletes;
282 $this->propertyDeletions,
285 # Invalidate the necessary pages
286 $this->propertyInsertions = array_diff_assoc( $this->mProperties, $existingPP );
290 # Invalidate all categories which were added, deleted or changed (set symmetric difference)
294 # Refresh links of all pages including this page
295 # This will be in a separate transaction
296 if ( $this->mRecursive ) {
300 # Update the links table freshness for this title
312 if ( $this->mTitle->getNamespace() ==
NS_FILE ) {
317 $bc = $this->mTitle->getBacklinkCache();
324 foreach ( $bc->getCascadeProtectedLinks()
as $title ) {
337 if (
$title->getBacklinkCache()->hasLinks( $table ) ) {
344 "refreshlinks:{$table}:{$title->getPrefixedText()}"
365 global $wgUpdateRowsPerQuery;
368 $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
370 foreach ( array_chunk( array_keys( $added ), $wgUpdateRowsPerQuery )
as $addBatch ) {
371 $wp->updateCategoryCounts( $addBatch, [], $this->mId );
372 $factory->commitAndWaitForReplication(
373 __METHOD__, $this->ticket, [
'wiki' => $this->
getDB()->getWikiID() ]
377 foreach ( array_chunk( array_keys( $deleted ), $wgUpdateRowsPerQuery )
as $deleteBatch ) {
378 $wp->updateCategoryCounts( [], $deleteBatch, $this->mId );
379 $factory->commitAndWaitForReplication(
380 __METHOD__, $this->ticket, [
'wiki' => $this->
getDB()->getWikiID() ]
400 $services = MediaWikiServices::getInstance();
401 $bSize =
$services->getMainConfig()->get(
'UpdateRowsPerQuery' );
402 $factory =
$services->getDBLoadBalancerFactory();
404 if ( $table ===
'page_props' ) {
405 $fromField =
'pp_page';
407 $fromField =
"{$prefix}_from";
411 if ( $table ===
'pagelinks' || $table ===
'templatelinks' || $table ===
'iwlinks' ) {
412 $baseKey = ( $table ===
'iwlinks' ) ?
'iwl_prefix' :
"{$prefix}_namespace";
415 $curDeletionBatch = [];
416 $deletionBatches = [];
417 foreach ( $deletions
as $ns => $dbKeys ) {
418 foreach ( $dbKeys
as $dbKey => $unused ) {
419 $curDeletionBatch[$ns][$dbKey] = 1;
420 if ( ++$curBatchSize >= $bSize ) {
421 $deletionBatches[] = $curDeletionBatch;
422 $curDeletionBatch = [];
427 if ( $curDeletionBatch ) {
428 $deletionBatches[] = $curDeletionBatch;
431 foreach ( $deletionBatches
as $deletionBatch ) {
434 $this->
getDB()->makeWhereFrom2d( $deletionBatch, $baseKey,
"{$prefix}_title" )
438 if ( $table ===
'langlinks' ) {
439 $toField =
'll_lang';
440 } elseif ( $table ===
'page_props' ) {
441 $toField =
'pp_propname';
443 $toField = $prefix .
'_to';
446 $deletionBatches = array_chunk( array_keys( $deletions ), $bSize );
447 foreach ( $deletionBatches
as $deletionBatch ) {
448 $deleteWheres[] = [ $fromField =>
$this->mId, $toField => $deletionBatch ];
452 foreach ( $deleteWheres
as $deleteWhere ) {
453 $this->
getDB()->delete( $table, $deleteWhere, __METHOD__ );
454 $factory->commitAndWaitForReplication(
455 __METHOD__, $this->ticket, [
'wiki' => $this->
getDB()->getWikiID() ]
459 $insertBatches = array_chunk( $insertions, $bSize );
460 foreach ( $insertBatches
as $insertBatch ) {
461 $this->
getDB()->insert( $table, $insertBatch, __METHOD__,
'IGNORE' );
462 $factory->commitAndWaitForReplication(
463 __METHOD__, $this->ticket, [
'wiki' => $this->
getDB()->getWikiID() ]
467 if (
count( $insertions ) ) {
468 Hooks::run(
'LinksUpdateAfterInsert', [ $this, $table, $insertions ] );
480 foreach ( $this->mLinks
as $ns => $dbkeys ) {
481 $diffs = isset( $existing[$ns] )
482 ? array_diff_key( $dbkeys, $existing[$ns] )
484 foreach ( $diffs
as $dbk => $id ) {
487 'pl_from_namespace' => $this->mTitle->getNamespace(),
488 'pl_namespace' => $ns,
504 foreach ( $this->mTemplates
as $ns => $dbkeys ) {
505 $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
506 foreach ( $diffs
as $dbk => $id ) {
509 'tl_from_namespace' => $this->mTitle->getNamespace(),
510 'tl_namespace' => $ns,
527 $diffs = array_diff_key( $this->mImages, $existing );
528 foreach ( $diffs
as $iname => $dummy ) {
531 'il_from_namespace' => $this->mTitle->getNamespace(),
546 $diffs = array_diff_key( $this->mExternals, $existing );
547 foreach ( $diffs
as $url => $dummy ) {
550 'el_id' => $this->
getDB()->nextSequenceValue(
'externallinks_el_id_seq' ),
553 'el_index' => $index,
571 $diffs = array_diff_assoc( $this->mCategories, $existing );
573 foreach ( $diffs
as $name => $prefix ) {
577 if ( $this->mTitle->getNamespace() ==
NS_CATEGORY ) {
579 } elseif ( $this->mTitle->getNamespace() ==
NS_FILE ) {
585 # Treat custom sortkeys as a prefix, so that if multiple
586 # things are forced to sort as '*' or something, they'll
587 # sort properly in the category rather than in page_id
590 $this->mTitle->getCategorySortkey( $prefix ) );
595 'cl_sortkey' => $sortkey,
596 'cl_timestamp' => $this->
getDB()->timestamp(),
597 'cl_sortkey_prefix' => $prefix,
598 'cl_collation' => $wgCategoryCollation,
614 $diffs = array_diff_assoc( $this->mInterlangs, $existing );
633 $diffs = array_diff_assoc( $this->mProperties, $existing );
636 foreach ( array_keys( $diffs )
as $name ) {
660 global $wgPagePropsHaveSortkey;
662 $value = $this->mProperties[$prop];
666 'pp_propname' => $prop,
670 if ( $wgPagePropsHaveSortkey ) {
691 return floatval(
$value );
705 foreach ( $this->mInterwikis
as $prefix => $dbkeys ) {
706 $diffs = isset( $existing[$prefix] )
707 ? array_diff_key( $dbkeys, $existing[$prefix] )
710 foreach ( $diffs
as $dbk => $id ) {
713 'iwl_prefix' => $prefix,
730 foreach ( $existing
as $ns => $dbkeys ) {
731 if ( isset( $this->mLinks[$ns] ) ) {
732 $del[$ns] = array_diff_key( $existing[$ns], $this->mLinks[$ns] );
734 $del[$ns] = $existing[$ns];
749 foreach ( $existing
as $ns => $dbkeys ) {
750 if ( isset( $this->mTemplates[$ns] ) ) {
751 $del[$ns] = array_diff_key( $existing[$ns], $this->mTemplates[$ns] );
753 $del[$ns] = $existing[$ns];
767 return array_diff_key( $existing, $this->mImages );
777 return array_diff_key( $existing, $this->mExternals );
787 return array_diff_assoc( $existing, $this->mCategories );
797 return array_diff_assoc( $existing, $this->mInterlangs );
806 return array_diff_assoc( $existing, $this->mProperties );
817 foreach ( $existing
as $prefix => $dbkeys ) {
818 if ( isset( $this->mInterwikis[$prefix] ) ) {
819 $del[$prefix] = array_diff_key( $existing[$prefix], $this->mInterwikis[$prefix] );
821 $del[$prefix] = $existing[$prefix];
834 $res = $this->
getDB()->select(
'pagelinks', [
'pl_namespace',
'pl_title' ],
835 [
'pl_from' => $this->mId ], __METHOD__ );
837 foreach (
$res as $row ) {
838 if ( !isset( $arr[$row->pl_namespace] ) ) {
839 $arr[$row->pl_namespace] = [];
841 $arr[$row->pl_namespace][$row->pl_title] = 1;
853 $res = $this->
getDB()->select(
'templatelinks', [
'tl_namespace',
'tl_title' ],
854 [
'tl_from' => $this->mId ], __METHOD__ );
856 foreach (
$res as $row ) {
857 if ( !isset( $arr[$row->tl_namespace] ) ) {
858 $arr[$row->tl_namespace] = [];
860 $arr[$row->tl_namespace][$row->tl_title] = 1;
872 $res = $this->
getDB()->select(
'imagelinks', [
'il_to' ],
873 [
'il_from' => $this->mId ], __METHOD__ );
875 foreach (
$res as $row ) {
876 $arr[$row->il_to] = 1;
888 $res = $this->
getDB()->select(
'externallinks', [
'el_to' ],
889 [
'el_from' => $this->mId ], __METHOD__ );
891 foreach (
$res as $row ) {
892 $arr[$row->el_to] = 1;
904 $res = $this->
getDB()->select(
'categorylinks', [
'cl_to',
'cl_sortkey_prefix' ],
905 [
'cl_from' => $this->mId ], __METHOD__ );
907 foreach (
$res as $row ) {
908 $arr[$row->cl_to] = $row->cl_sortkey_prefix;
921 $res = $this->
getDB()->select(
'langlinks', [
'll_lang',
'll_title' ],
922 [
'll_from' => $this->mId ], __METHOD__ );
924 foreach (
$res as $row ) {
925 $arr[$row->ll_lang] = $row->ll_title;
936 $res = $this->
getDB()->select(
'iwlinks', [
'iwl_prefix',
'iwl_title' ],
937 [
'iwl_from' => $this->mId ], __METHOD__ );
939 foreach (
$res as $row ) {
940 if ( !isset( $arr[$row->iwl_prefix] ) ) {
941 $arr[$row->iwl_prefix] = [];
943 $arr[$row->iwl_prefix][$row->iwl_title] = 1;
955 $res = $this->
getDB()->select(
'page_props', [
'pp_propname',
'pp_value' ],
956 [
'pp_page' => $this->mId ], __METHOD__ );
958 foreach (
$res as $row ) {
959 $arr[$row->pp_propname] = $row->pp_value;
998 $this->mRevision = $revision;
1032 global $wgPagePropLinkInvalidations;
1035 if ( isset( $wgPagePropLinkInvalidations[
$name] ) ) {
1036 $inv = $wgPagePropLinkInvalidations[
$name];
1037 if ( !is_array( $inv ) ) {
1040 foreach ( $inv
as $table ) {
1053 if ( $this->linkInsertions ===
null ) {
1057 foreach ( $this->linkInsertions
as $insertion ) {
1070 if ( $this->linkDeletions ===
null ) {
1074 foreach ( $this->linkDeletions
as $ns =>
$titles ) {
1109 $timestamp = $this->mParserOutput->getCacheTime();
1110 $this->
getDB()->update(
'page',
1111 [
'page_links_updated' => $this->
getDB()->timestamp( $timestamp ) ],
1112 [
'page_id' => $this->mId ],
1130 if ( $this->
user ) {
1132 'userId' => $this->
user->getId(),
1133 'userName' => $this->
user->getName(),
1139 if ( $this->mRevision ) {
1140 $triggeringRevisionId = $this->mRevision->getId();
1142 $triggeringRevisionId =
false;
1146 'wiki' => $this->
getDB()->getWikiID(),
1148 'refreshLinksPrioritized',
1151 'rootJobTimestamp' => $this->mParserOutput->getCacheTime(),
1153 'triggeringUser' => $userInfo,
1154 'triggeringRevisionId' => $triggeringRevisionId,
1156 [
'removeDuplicates' =>
true ],
getInterlangInsertions( $existing=[])
Get an array of interlanguage link insertions.
getTemplateInsertions( $existing=[])
Get an array of template insertions.
getTemplateDeletions( $existing)
Given an array of existing templates, returns those templates which are not in $this and thus should ...
getCategoryDeletions( $existing)
Given an array of existing categories, returns those categories which are not in $this and thus shoul...
doUpdate()
Update link tables with outgoing links from an updated article.
static acquirePageLock(IDatabase $dbw, $pageId, $why='atomicity')
Acquire a lock for performing link table updates for a page on a DB.
if(!isset( $args[0])) $lang
getRemovedProperties()
Fetch page properties removed by this LinksUpdate.
array $mInterwikis
2-D map of (prefix => DBK => 1)
getInterwikiDeletions( $existing)
Given an array of existing interwiki links, returns those links which are not in $this and thus shoul...
setRevision(Revision $revision)
Set the revision corresponding to this LinksUpdate.
wfMakeUrlIndexes( $url)
Make URL indexes, appropriate for the el_index field of externallinks.
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. '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 '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. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) '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 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) '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! 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
static queueRecursiveJobsForTable(Title $title, $table)
Queue a RefreshLinks job for any table.
int $mId
Page ID of the article linked from.
array $mCategories
Map of category names to sort keys.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static addUpdate(DeferrableUpdate $update, $stage=self::POSTSEND)
Add an update to the deferred list to be run later by execute()
Class the manages updates of *_link tables as well as similar extension-managed tables.
static invalidatePages(IDatabase $dbw, $namespace, array $dbkeys)
Invalidate the cache of a list of pages from a single namespace.
static newPrioritized(Title $title, array $params)
array $mImages
DB keys of the images used, in the array key only.
Allows to change the fields on the form that will be generated $name
getImageDeletions( $existing)
Given an array of existing images, returns those images which are not in $this and thus should be del...
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 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
invalidateImageDescriptions( $images)
updateLinksTimestamp()
Update links table freshness.
null array $propertyInsertions
Added properties if calculated.
Abstract base class for update jobs that do something with some secondary data extracted from article...
getExternalDeletions( $existing)
Given an array of existing external links, returns those links which are not in $this and thus should...
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
queueRecursiveJobs()
Queue recursive jobs for this page.
getExistingImages()
Get an array of existing images, image names in the keys.
incrTableUpdate( $table, $prefix, $deletions, $insertions)
Update a table by doing a delete query then an insert query.
Interface that marks a DataUpdate as enqueuable via the JobQueue.
getLinkInsertions( $existing=[])
Get an array of pagelinks insertions for passing to the DB Skips the titles specified by the 2-D arra...
getExistingTemplates()
Get an array of existing templates, as a 2-D array.
getCategoryInsertions( $existing=[])
Get an array of category insertions.
namespace and then decline to actually register it file or subcat img or subcat $title
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
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.
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
array $mProperties
Map of arbitrary name to value.
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
getInterlangDeletions( $existing)
Given an array of existing interlanguage links, returns those links which are not in $this and thus s...
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
invalidateProperties( $changed)
Invalidate any necessary link lists related to page property changes.
Revision $mRevision
Revision for which this update has been triggered.
null array $linkInsertions
Added links if calculated.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
when a variable name is used in a it is silently declared as a new masking the global
getExistingProperties()
Get an array of existing categories, with the name in the key and sort key in the value.
Title $mTitle
Title object of the article linked from.
getTitle()
Return the title object of the page being updated.
static newRootJobParams( $key)
Get "root job" parameters for a task.
getImageInsertions( $existing=[])
Get an array of image insertions Skips the names specified in $existing.
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
__construct(Title $title, ParserOutput $parserOutput, $recursive=true)
Constructor.
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title 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
getExistingInterlangs()
Get an array of existing interlanguage links, with the language code in the key and the title in the ...
ParserOutput $mParserOutput
getParserOutput()
Returns parser output.
Class to invalidate the HTML cache of all the pages linking to a given title.
getAddedLinks()
Fetch page links added by this LinksUpdate.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Job to update link tables for pages.
getInterwikiInsertions( $existing=[])
Get an array of interwiki insertions for passing to the DB Skips the titles specified by the 2-D arra...
getAddedProperties()
Fetch page properties added by this LinksUpdate.
const GAID_FOR_UPDATE
Used to be GAID_FOR_UPDATE define.
getExistingCategories()
Get an array of existing categories, with the name in the key and sort key in the value.
null array $linkDeletions
Deleted links if calculated.
getPagePropRowData( $prop)
Returns an associative array to be used for inserting a row into the page_props table.
getExistingExternals()
Get an array of existing external links, URLs in the keys.
getPropertyDeletions( $existing)
Get array of properties which should be deleted.
either a unescaped string or a HtmlArmor object after in associative array form externallinks $linksUpdate
getImages()
Return the list of images used as generated by the parser.
array $mInterlangs
Map of language codes to titles.
Represents a title within MediaWiki.
setTriggeringUser(User $user)
Set the User who triggered this LinksUpdate.
getRemovedLinks()
Fetch page links removed by this LinksUpdate.
array $mExternals
URLs of external links, array key only.
if(count( $args)< 1) $job
Job queue task description base code.
getPropertyInsertions( $existing=[])
Get an array of page property insertions.
static singleton( $wiki=false)
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
getExternalInsertions( $existing=[])
Get an array of externallinks insertions.
bool $mRecursive
Whether to queue jobs for recursive updates.
null array $propertyDeletions
Deleted properties if calculated.
invalidateCategories( $cats)
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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
getExistingLinks()
Get an array of existing links, as a 2-D array.
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 MediaWikiServices
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
array $mLinks
Map of title strings to IDs for the links in the document.
getPropertySortKeyValue( $value)
Determines the sort key for the given property value.
getLinkDeletions( $existing)
Given an array of existing links, returns those links which are not in $this and thus should be delet...
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context $parserOutput
the array() calling protocol came about after MediaWiki 1.4rc1.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
getExistingInterwikis()
Get an array of existing inline interwiki links, as a 2-D array.