MediaWiki  master
LinksUpdate.php
Go to the documentation of this file.
1 <?php
24 
26 use BacklinkCache;
27 use DataUpdate;
28 use DeferredUpdates;
30 use Job;
31 use JobQueueGroup;
32 use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
40 use MWException;
41 use ParserOutput;
42 use RefreshLinksJob;
43 use RuntimeException;
44 use Title;
46 use Wikimedia\ScopedCallback;
47 
55 class LinksUpdate extends DataUpdate {
56  use ProtectedHookAccessorTrait;
58 
59  // @todo make members protected, but make sure extensions don't break
60 
62  protected $mId;
63 
65  protected $mTitle;
66 
68  protected $mParserOutput;
69 
71  protected $mRecursive;
72 
75 
79  private $user;
80 
82  private $db;
83 
85  private $tableFactory;
86 
94  public function __construct( PageIdentity $page, ParserOutput $parserOutput, $recursive = true ) {
95  parent::__construct();
96 
97  $this->mTitle = Title::castFromPageIdentity( $page );
98  $this->mParserOutput = $parserOutput;
99 
100  $this->deprecatePublicProperty( 'mId', '1.38', __CLASS__ );
101  $this->deprecatePublicProperty( 'mTitle', '1.38', __CLASS__ );
102  $this->deprecatePublicProperty( 'mParserOutput', '1.38', __CLASS__ );
103 
104  $this->deprecatePublicPropertyFallback( 'mLinks', '1.38',
105  function () {
106  return $this->getParserOutput()->getLinks();
107  },
108  null, __CLASS__
109  );
110  $this->deprecatePublicPropertyFallback( 'mImages', '1.38',
111  function () {
112  return $this->getParserOutput()->getImages();
113  },
114  null, __CLASS__
115  );
116  $this->deprecatePublicPropertyFallback( 'mTemplates', '1.38',
117  function () {
118  return $this->getParserOutput()->getTemplates();
119  },
120  null, __CLASS__
121  );
122  $this->deprecatePublicPropertyFallback( 'mExternals', '1.38',
123  function () {
124  return $this->getParserOutput()->getExternalLinks();
125  },
126  null, __CLASS__
127  );
128  $this->deprecatePublicPropertyFallback( 'mCategories', '1.38',
129  function () {
130  return $this->getParserOutput()->getCategories();
131  },
132  null, __CLASS__
133  );
134  $this->deprecatePublicPropertyFallback( 'mProperties', '1.38',
135  function () {
136  return $this->getParserOutput()->getPageProperties();
137  },
138  null, __CLASS__
139  );
140  $this->deprecatePublicPropertyFallback( 'mInterwikis', '1.38',
141  function () {
142  return $this->getParserOutput()->getInterwikiLinks();
143  },
144  null, __CLASS__
145  );
146  $this->deprecatePublicPropertyFallback( 'mInterlangs', '1.38',
147  function () {
148  $ill = $this->getParserOutput()->getLanguageLinks();
149  $res = [];
150  foreach ( $ill as $link ) {
151  list( $key, $title ) = explode( ':', $link, 2 );
152  $res[$key] = $title;
153  }
154  return $res;
155  },
156  null, __CLASS__
157  );
158  $this->deprecatePublicPropertyFallback( 'mCategories', '1.38',
159  function () {
160  $cats = $this->getParserOutput()->getCategories();
161  foreach ( $cats as &$sortkey ) {
162  # If the sortkey is longer then 255 bytes, it is truncated by DB, and then doesn't match
163  # when comparing existing vs current categories, causing T27254.
164  $sortkey = mb_strcut( $sortkey, 0, 255 );
165  }
166  },
167  null, __CLASS__
168  );
169 
170  $this->mRecursive = $recursive;
171  $this->deprecatePublicProperty( 'mRecursive', '1.38', __CLASS__ );
172 
173  $services = MediaWikiServices::getInstance();
174  $config = $services->getMainConfig();
175  $this->tableFactory = new LinksTableGroup(
176  $services->getObjectFactory(),
177  $services->getDBLoadBalancerFactory(),
178  $services->getCollationFactory(),
179  $page,
180  $config->get( 'UpdateRowsPerQuery' ),
181  function ( $table, $rows ) {
182  $this->getHookRunner()->onLinksUpdateAfterInsert( $this, $table, $rows );
183  },
184  $config->get( 'TempCategoryCollations' )
185  );
186  // TODO: this does not have to be called in LinksDeletionUpdate
187  $this->tableFactory->setParserOutput( $parserOutput );
188 
189  $this->getHookRunner()->onLinksUpdateConstructed( $this );
190  }
191 
192  public function setTransactionTicket( $ticket ) {
193  parent::setTransactionTicket( $ticket );
194  $this->tableFactory->setTransactionTicket( $ticket );
195  }
196 
203  public function setMoveDetails( PageReference $oldPage ) {
204  $this->tableFactory->setMoveDetails( $oldPage );
205  }
206 
212  public function doUpdate() {
213  if ( !$this->mId ) {
214  // NOTE: subclasses may initialize mId directly!
215  $this->mId = $this->mTitle->getArticleID( Title::READ_LATEST );
216  }
217 
218  if ( !$this->mId ) {
219  // Probably due to concurrent deletion or renaming of the page
220  $logger = LoggerFactory::getInstance( 'SecondaryDataUpdate' );
221  $logger->notice(
222  'LinksUpdate: The Title object yields no ID. Perhaps the page was deleted?',
223  [
224  'page_title' => $this->mTitle->getPrefixedDBkey(),
225  'cause_action' => $this->getCauseAction(),
226  'cause_agent' => $this->getCauseAgent()
227  ]
228  );
229 
230  // nothing to do
231  return;
232  }
233 
234  // Do any setup that needs to be done prior to acquiring the lock
235  // Calling getAll() here has the side-effect of calling
236  // LinksUpdateBatch::setParserOutput() on all subclasses, allowing
237  // those methods to also do pre-lock operations.
238  foreach ( $this->tableFactory->getAll() as $table ) {
239  $table->beforeLock();
240  }
241 
242  if ( $this->ticket ) {
243  // Make sure all links update threads see the changes of each other.
244  // This handles the case when updates have to batched into several COMMITs.
245  $scopedLock = self::acquirePageLock( $this->getDB(), $this->mId );
246  if ( !$scopedLock ) {
247  throw new RuntimeException( "Could not acquire lock for page ID '{$this->mId}'." );
248  }
249  }
250 
251  $this->getHookRunner()->onLinksUpdate( $this );
252  $this->doIncrementalUpdate();
253 
254  // Commit and release the lock (if set)
255  ScopedCallback::consume( $scopedLock );
256  // Run post-commit hook handlers without DBO_TRX
258  $this->getDB(),
259  __METHOD__,
260  function () {
261  $this->getHookRunner()->onLinksUpdateComplete( $this, $this->ticket );
262  }
263  ) );
264  }
265 
275  public static function acquirePageLock( IDatabase $dbw, $pageId, $why = 'atomicity' ) {
276  $key = "{$dbw->getDomainID()}:LinksUpdate:$why:pageid:$pageId"; // per-wiki
277  $scopedLock = $dbw->getScopedLockAndFlush( $key, __METHOD__, 15 );
278  if ( !$scopedLock ) {
279  $logger = LoggerFactory::getInstance( 'SecondaryDataUpdate' );
280  $logger->info( "Could not acquire lock '{key}' for page ID '{page_id}'.", [
281  'key' => $key,
282  'page_id' => $pageId,
283  ] );
284  return null;
285  }
286 
287  return $scopedLock;
288  }
289 
290  protected function doIncrementalUpdate() {
291  foreach ( $this->tableFactory->getAll() as $table ) {
292  $table->update();
293  }
294 
295  # Refresh links of all pages including this page
296  # This will be in a separate transaction
297  if ( $this->mRecursive ) {
298  $this->queueRecursiveJobs();
299  }
300 
301  # Update the links table freshness for this title
302  $this->updateLinksTimestamp();
303  }
304 
311  protected function queueRecursiveJobs() {
312  $backlinkCache = MediaWikiServices::getInstance()->getBacklinkCacheFactory()
313  ->getBacklinkCache( $this->mTitle );
314  $action = $this->getCauseAction();
315  $agent = $this->getCauseAgent();
316 
318  $this->mTitle, 'templatelinks', $action, $agent, $backlinkCache
319  );
320  if ( $this->mTitle->getNamespace() === NS_FILE ) {
321  // Process imagelinks in case the title is or was a redirect
323  $this->mTitle, 'imagelinks', $action, $agent, $backlinkCache
324  );
325  }
326 
327  // Get jobs for cascade-protected backlinks for a high priority queue.
328  // If meta-templates change to using a new template, the new template
329  // should be implicitly protected as soon as possible, if applicable.
330  // These jobs duplicate a subset of the above ones, but can run sooner.
331  // Which ever runs first generally no-ops the other one.
332  $jobs = [];
333  foreach ( $backlinkCache->getCascadeProtectedLinkPages() as $page ) {
335  $page,
336  [
337  'causeAction' => $action,
338  'causeAgent' => $agent
339  ]
340  );
341  }
342  JobQueueGroup::singleton()->push( $jobs );
343  }
344 
354  public static function queueRecursiveJobsForTable(
355  PageIdentity $page, $table, $action = 'unknown', $userName = 'unknown', ?BacklinkCache $backlinkCache = null
356  ) {
358  if ( !$backlinkCache ) {
359  wfDeprecatedMsg( __METHOD__ . " needs a BacklinkCache object, null passed", '1.37' );
360  $backlinkCache = MediaWikiServices::getInstance()->getBacklinkCacheFactory()
361  ->getBacklinkCache( $title );
362  }
363  if ( $backlinkCache->hasLinks( $table ) ) {
364  $job = new RefreshLinksJob(
365  $title,
366  [
367  'table' => $table,
368  'recursive' => true,
369  ] + Job::newRootJobParams( // "overall" refresh links job info
370  "refreshlinks:{$table}:{$title->getPrefixedText()}"
371  ) + [ 'causeAction' => $action, 'causeAgent' => $userName ]
372  );
373 
374  JobQueueGroup::singleton()->push( $job );
375  }
376  }
377 
384  public function setStrictTestMode( $mode = true ) {
385  $this->tableFactory->setStrictTestMode( $mode );
386  }
387 
392  public function getTitle() {
393  return $this->mTitle;
394  }
395 
402  public function getPageId() {
403  if ( $this->mId ) {
404  return $this->mId;
405  } else {
406  return $this->mTitle->getArticleID();
407  }
408  }
409 
415  public function getParserOutput() {
416  return $this->mParserOutput;
417  }
418 
423  public function getImages() {
424  return $this->getParserOutput()->getImages();
425  }
426 
433  public function setRevisionRecord( RevisionRecord $revisionRecord ) {
434  $this->mRevisionRecord = $revisionRecord;
435  $this->tableFactory->setRevision( $revisionRecord );
436  }
437 
442  public function getRevisionRecord() {
443  return $this->mRevisionRecord;
444  }
445 
452  public function setTriggeringUser( UserIdentity $user ) {
453  $this->user = $user;
454  }
455 
462  public function getTriggeringUser(): ?UserIdentity {
463  return $this->user;
464  }
465 
469  protected function getPageLinksTable(): PageLinksTable {
470  // @phan-suppress-next-line PhanTypeMismatchReturnSuperType
471  return $this->tableFactory->get( 'pagelinks' );
472  }
473 
478  // @phan-suppress-next-line PhanTypeMismatchReturnSuperType
479  return $this->tableFactory->get( 'externallinks' );
480  }
481 
485  protected function getPagePropsTable(): PagePropsTable {
486  // @phan-suppress-next-line PhanTypeMismatchReturnSuperType
487  return $this->tableFactory->get( 'page_props' );
488  }
489 
497  public function getAddedLinks() {
498  return $this->getPageLinksTable()->getTitleArray( LinksTable::INSERTED );
499  }
500 
508  public function getRemovedLinks() {
509  return $this->getPageLinksTable()->getTitleArray( LinksTable::DELETED );
510  }
511 
518  public function getAddedExternalLinks() {
519  return $this->getExternalLinksTable()->getStringArray( LinksTable::INSERTED );
520  }
521 
528  public function getRemovedExternalLinks() {
529  return $this->getExternalLinksTable()->getStringArray( LinksTable::DELETED );
530  }
531 
538  public function getAddedProperties() {
539  return $this->getPagePropsTable()->getAssocArray( LinksTable::INSERTED );
540  }
541 
548  public function getRemovedProperties() {
549  return $this->getPagePropsTable()->getAssocArray( LinksTable::DELETED );
550  }
551 
567  public function getPageReferenceIterator( $tableName, $setType ) {
568  $table = $this->tableFactory->get( $tableName );
569  if ( $table instanceof TitleLinksTable ) {
570  return $table->getPageReferenceIterator( $setType );
571  } else {
572  throw new \InvalidArgumentException(
573  __METHOD__ . ": $tableName does not have a list of titles" );
574  }
575  }
576 
586  public function getPageReferenceArray( $tableName, $setType ) {
587  return iterator_to_array( $this->getPageReferenceIterator( $tableName, $setType ) );
588  }
589 
593  private function updateLinksTimestamp() {
594  if ( $this->mId ) {
595  // The link updates made here only reflect the freshness of the parser output
596  $timestamp = $this->mParserOutput->getCacheTime();
597  $this->getDB()->update( 'page',
598  [ 'page_links_updated' => $this->getDB()->timestamp( $timestamp ) ],
599  [ 'page_id' => $this->mId ],
600  __METHOD__
601  );
602  }
603  }
604 
608  protected function getDB() {
609  if ( !$this->db ) {
610  $this->db = wfGetDB( DB_PRIMARY );
611  }
612 
613  return $this->db;
614  }
615 
622  public function isRecursive() {
623  return $this->mRecursive;
624  }
625 }
626 
628 class_alias( LinksUpdate::class, 'LinksUpdate' );
DataUpdate\getCauseAgent
getCauseAgent()
Definition: DataUpdate.php:72
MediaWiki\Deferred\LinksUpdate\LinksTableGroup
Definition: LinksTableGroup.php:18
MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobsForTable
static queueRecursiveJobsForTable(PageIdentity $page, $table, $action='unknown', $userName='unknown', ?BacklinkCache $backlinkCache=null)
Queue a RefreshLinks job for any table.
Definition: LinksUpdate.php:354
Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition: PageIdentity.php:64
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mRecursive
bool $mRecursive
Whether to queue jobs for recursive updates.
Definition: LinksUpdate.php:71
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getRemovedLinks
getRemovedLinks()
Fetch page links removed by this LinksUpdate.
Definition: LinksUpdate.php:508
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:47
ParserOutput
Definition: ParserOutput.php:35
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mParserOutput
ParserOutput $mParserOutput
Definition: LinksUpdate.php:68
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getAddedExternalLinks
getAddedExternalLinks()
Fetch external links added by this LinksUpdate.
Definition: LinksUpdate.php:518
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:203
MediaWiki\Deferred\LinksUpdate\LinksUpdate\updateLinksTimestamp
updateLinksTimestamp()
Update links table freshness.
Definition: LinksUpdate.php:593
MediaWiki\Deferred\LinksUpdate\LinksUpdate\isRecursive
isRecursive()
Whether or not this LinksUpdate will also update pages which transclude the current page or otherwise...
Definition: LinksUpdate.php:622
AutoCommitUpdate
Deferrable Update for closure/callback updates that should use auto-commit mode.
Definition: AutoCommitUpdate.php:9
MediaWiki\Logger\LoggerFactory\getInstance
static getInstance( $channel)
Get a named logger instance from the currently configured logger factory.
Definition: LoggerFactory.php:92
MediaWiki\Deferred\LinksUpdate\LinksUpdate\acquirePageLock
static acquirePageLock(IDatabase $dbw, $pageId, $why='atomicity')
Acquire a session-level lock for performing link table updates for a page on a DB.
Definition: LinksUpdate.php:275
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getPageReferenceIterator
getPageReferenceIterator( $tableName, $setType)
Get an iterator over PageReferenceValue objects corresponding to a given set type in a given table.
Definition: LinksUpdate.php:567
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getRemovedExternalLinks
getRemovedExternalLinks()
Fetch external links removed by this LinksUpdate.
Definition: LinksUpdate.php:528
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getAddedLinks
getAddedLinks()
Fetch page links added by this LinksUpdate.
Definition: LinksUpdate.php:497
DeferredUpdates\addUpdate
static addUpdate(DeferrableUpdate $update, $stage=self::POSTSEND)
Add an update to the pending update queue for execution at the appropriate time.
Definition: DeferredUpdates.php:125
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mId
int $mId
Page ID of the article linked from.
Definition: LinksUpdate.php:62
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getImages
getImages()
Return the list of images used as generated by the parser.
Definition: LinksUpdate.php:423
BacklinkCache
Class for fetching backlink lists, approximate backlink counts and partitions.
Definition: BacklinkCache.php:50
$res
$res
Definition: testCompression.php:57
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getParserOutput
getParserOutput()
Returns parser output.
Definition: LinksUpdate.php:415
MediaWiki\Deferred\LinksUpdate
Definition: CategoryLinksTable.php:3
MediaWiki\Deferred\LinksUpdate\LinksUpdate\setRevisionRecord
setRevisionRecord(RevisionRecord $revisionRecord)
Set the RevisionRecord corresponding to this LinksUpdate.
Definition: LinksUpdate.php:433
RefreshLinksJob\newPrioritized
static newPrioritized(PageIdentity $page, array $params)
Definition: RefreshLinksJob.php:71
Page\PageReference
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
Definition: PageReference.php:49
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition: UserIdentity.php:39
DataUpdate
Abstract base class for update jobs that do something with some secondary data extracted from article...
Definition: DataUpdate.php:30
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
Title\castFromPageIdentity
static castFromPageIdentity(?PageIdentity $pageIdentity)
Return a Title for a given PageIdentity.
Definition: Title.php:326
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition: MediaWikiServices.php:264
Job
Class to both describe a background job and handle jobs.
Definition: Job.php:38
MediaWiki\Deferred\LinksUpdate\LinksTable\INSERTED
const INSERTED
Link type: Inserted (added) links.
Definition: LinksTable.php:42
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getAddedProperties
getAddedProperties()
Fetch page properties added by this LinksUpdate.
Definition: LinksUpdate.php:538
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getPageLinksTable
getPageLinksTable()
Definition: LinksUpdate.php:469
deprecatePublicPropertyFallback
deprecatePublicPropertyFallback(string $property, string $version, $getter, $setter=null, $class=null, $component=null)
Mark a removed public property as deprecated and provide fallback getter and setter callables.
Definition: DeprecationHelper.php:125
wfDeprecatedMsg
wfDeprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
Definition: GlobalFunctions.php:1028
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mTitle
Title $mTitle
Title object of the article linked from.
Definition: LinksUpdate.php:65
MWException
MediaWiki exception.
Definition: MWException.php:29
MediaWiki\Logger\LoggerFactory
PSR-3 logger instance factory.
Definition: LoggerFactory.php:45
Config\get
get( $name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2186
DeferredUpdates
Class for managing the deferral of updates within the scope of a PHP script invocation.
Definition: DeferredUpdates.php:83
MediaWiki\Deferred\LinksUpdate\LinksUpdate\setMoveDetails
setMoveDetails(PageReference $oldPage)
Notify LinksUpdate that a move has just been completed and set the original title.
Definition: LinksUpdate.php:203
MediaWiki\Deferred\LinksUpdate\TitleLinksTable
An abstract base class for tables that link to local titles.
Definition: TitleLinksTable.php:14
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$db
IDatabase $db
Definition: LinksUpdate.php:82
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getExternalLinksTable
getExternalLinksTable()
Definition: LinksUpdate.php:477
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getRevisionRecord
getRevisionRecord()
Definition: LinksUpdate.php:442
$title
$title
Definition: testCompression.php:38
MediaWiki\Deferred\LinksUpdate\LinksUpdate\queueRecursiveJobs
queueRecursiveJobs()
Queue recursive jobs for this page.
Definition: LinksUpdate.php:311
Job\newRootJobParams
static newRootJobParams( $key)
Get "root job" parameters for a task.
Definition: Job.php:346
MediaWiki\Deferred\LinksUpdate\PageLinksTable
pagelinks
Definition: PageLinksTable.php:10
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getRemovedProperties
getRemovedProperties()
Fetch page properties removed by this LinksUpdate.
Definition: LinksUpdate.php:548
deprecatePublicProperty
deprecatePublicProperty( $property, $version, $class=null, $component=null)
Mark a property as deprecated.
Definition: DeprecationHelper.php:94
DataUpdate\$ticket
mixed $ticket
Result from LBFactory::getEmptyTransactionTicket()
Definition: DataUpdate.php:32
RefreshLinksJob
Job to update link tables for pages.
Definition: RefreshLinksJob.php:44
DB_PRIMARY
const DB_PRIMARY
Definition: defines.php:27
Wikimedia\Rdbms\IDatabase\getScopedLockAndFlush
getScopedLockAndFlush( $lockKey, $fname, $timeout)
Acquire a named lock, flush any transaction, and return an RAII style unlocker object.
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getDB
getDB()
Definition: LinksUpdate.php:608
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$user
UserIdentity null $user
Definition: LinksUpdate.php:79
MediaWiki\Deferred\LinksUpdate\LinksUpdate\__construct
__construct(PageIdentity $page, ParserOutput $parserOutput, $recursive=true)
Definition: LinksUpdate.php:94
MediaWiki\Deferred\LinksUpdate\LinksUpdate
Class the manages updates of *_link tables as well as similar extension-managed tables.
Definition: LinksUpdate.php:55
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getTitle
getTitle()
Return the title object of the page being updated.
Definition: LinksUpdate.php:392
MediaWiki\$action
string $action
Cache what action this request is.
Definition: MediaWiki.php:45
Title
Represents a title within MediaWiki.
Definition: Title.php:47
JobQueueGroup\singleton
static singleton( $domain=false)
Definition: JobQueueGroup.php:114
Page\PageReferenceValue
Immutable value object representing a page reference.
Definition: PageReferenceValue.php:42
MediaWiki\Deferred\LinksUpdate\LinksUpdate\doIncrementalUpdate
doIncrementalUpdate()
Definition: LinksUpdate.php:290
$job
if(count( $args)< 1) $job
Definition: recompressTracked.php:49
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getPagePropsTable
getPagePropsTable()
Definition: LinksUpdate.php:485
MediaWiki\$config
Config $config
Definition: MediaWiki.php:42
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$tableFactory
LinksTableGroup $tableFactory
Definition: LinksUpdate.php:85
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getPageId
getPageId()
Get the page_id of the page being updated.
Definition: LinksUpdate.php:402
MediaWiki\Deferred\LinksUpdate\PagePropsTable
page_props
Definition: PagePropsTable.php:19
MediaWiki\Deferred\LinksUpdate\LinksTableGroup\setParserOutput
setParserOutput(ParserOutput $parserOutput)
Set the ParserOutput object to be used in new and existing objects.
Definition: LinksTableGroup.php:137
DataUpdate\getCauseAction
getCauseAction()
Definition: DataUpdate.php:65
NS_FILE
const NS_FILE
Definition: Defines.php:70
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getPageReferenceArray
getPageReferenceArray( $tableName, $setType)
Same as getPageReferenceIterator() but converted to an array for convenience (at the expense of addit...
Definition: LinksUpdate.php:586
DeprecationHelper
trait DeprecationHelper
Use this trait in classes which have properties for which public access is deprecated or implementati...
Definition: DeprecationHelper.php:60
MediaWiki\Deferred\LinksUpdate\LinksUpdate\$mRevisionRecord
RevisionRecord $mRevisionRecord
Revision for which this update has been triggered.
Definition: LinksUpdate.php:74
MediaWiki\Deferred\LinksUpdate\LinksUpdate\doUpdate
doUpdate()
Update link tables with outgoing links from an updated article.
Definition: LinksUpdate.php:212
MediaWiki\Deferred\LinksUpdate\LinksUpdate\setTransactionTicket
setTransactionTicket( $ticket)
Definition: LinksUpdate.php:192
MediaWiki\Deferred\LinksUpdate\ExternalLinksTable
externallinks
Definition: ExternalLinksTable.php:15
MediaWiki\Deferred\LinksUpdate\LinksTable\DELETED
const DELETED
Link type: Deleted (removed) links.
Definition: LinksTable.php:45
MediaWiki\Deferred\LinksUpdate\LinksUpdate\setStrictTestMode
setStrictTestMode( $mode=true)
Omit conflict resolution options from the insert query so that testing can confirm that the increment...
Definition: LinksUpdate.php:384
MediaWiki\Deferred\LinksUpdate\LinksUpdate\setTriggeringUser
setTriggeringUser(UserIdentity $user)
Set the user who triggered this LinksUpdate.
Definition: LinksUpdate.php:452
MediaWiki\Deferred\LinksUpdate\LinksUpdate\getTriggeringUser
getTriggeringUser()
Get the user who triggered this LinksUpdate.
Definition: LinksUpdate.php:462
JobQueueGroup
Class to handle enqueueing of background jobs.
Definition: JobQueueGroup.php:32