MediaWiki  1.23.8
HTMLCacheUpdate.php
Go to the documentation of this file.
1 <?php
31  public $mTitle;
32 
34  public $mTable;
35 
40  function __construct( Title $titleTo, $table ) {
41  $this->mTitle = $titleTo;
42  $this->mTable = $table;
43  }
44 
45  public function doUpdate() {
46  wfProfileIn( __METHOD__ );
47 
49  $this->mTitle,
50  array(
51  'table' => $this->mTable,
52  ) + Job::newRootJobParams( // "overall" refresh links job info
53  "htmlCacheUpdate:{$this->mTable}:{$this->mTitle->getPrefixedText()}"
54  )
55  );
56 
57  $count = $this->mTitle->getBacklinkCache()->getNumLinks( $this->mTable, 200 );
58  if ( $count >= 200 ) { // many backlinks
59  JobQueueGroup::singleton()->push( $job );
60  JobQueueGroup::singleton()->deduplicateRootJob( $job );
61  } else { // few backlinks ($count might be off even if 0)
62  $dbw = wfGetDB( DB_MASTER );
63  $dbw->onTransactionIdle( function () use ( $job ) {
64  $job->run(); // just do the purge query now
65  } );
66  }
67 
68  wfProfileOut( __METHOD__ );
69  }
70 }
DB_MASTER
const DB_MASTER
Definition: Defines.php:56
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3659
wfProfileIn
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
HTMLCacheUpdateJob
Job to purge the cache for all pages that link to or use another page or file.
Definition: HTMLCacheUpdateJob.php:35
wfProfileOut
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Job\newRootJobParams
static newRootJobParams( $key)
Definition: Job.php:239
HTMLCacheUpdate
Class to invalidate the HTML cache of all the pages linking to a given title.
Definition: HTMLCacheUpdate.php:29
HTMLCacheUpdate\doUpdate
doUpdate()
Perform the actual work.
Definition: HTMLCacheUpdate.php:43
HTMLCacheUpdate\$mTitle
Title $mTitle
Definition: HTMLCacheUpdate.php:30
$count
$count
Definition: UtfNormalTest2.php:96
HTMLCacheUpdate\$mTable
string $mTable
Definition: HTMLCacheUpdate.php:32
Title
Represents a title within MediaWiki.
Definition: Title.php:35
$job
if(count( $args)< 1) $job
Definition: recompressTracked.php:42
JobQueueGroup\singleton
static singleton( $wiki=false)
Definition: JobQueueGroup.php:61
DeferrableUpdate
Interface that deferrable updates should implement.
Definition: DeferredUpdates.php:29
HTMLCacheUpdate\__construct
__construct(Title $titleTo, $table)
Definition: HTMLCacheUpdate.php:38