Go to the documentation of this file.
44 $this->removeDuplicates = (
50 $this->params += [
'causeAction' =>
'unknown',
'causeAgent' =>
'unknown' ];
66 "htmlCacheUpdate:{$table}:{$title->getPrefixedText()}"
74 if ( isset( $this->params[
'table'] ) && !isset( $this->params[
'pages'] ) ) {
75 $this->params[
'recursive'] =
true;
79 if ( !empty( $this->params[
'recursive'] ) ) {
83 $extraParams[
'causeAction'] = $this->params[
'causeAction'];
84 $extraParams[
'causeAgent'] = $this->params[
'causeAgent'];
92 [
'params' => $extraParams ]
96 } elseif ( isset( $this->params[
'pages'] ) ) {
102 $t->getArticleID() => [
$t->getNamespace(),
$t->getDBkey() ]
116 $pageIds = array_keys( $pages );
131 $condTimestamp = $this->params[
'rootJobTimestamp'] ?? $touchTimestamp;
134 $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
135 $ticket = $factory->getEmptyTransactionTicket( __METHOD__ );
139 foreach ( $batches as $batch ) {
140 $dbw->update(
'page',
141 [
'page_touched' => $dbw->timestamp( $touchTimestamp ) ],
142 [
'page_id' => $batch,
144 "page_touched < " . $dbw->addQuotes( $dbw->timestamp( $condTimestamp ) )
148 if ( count( $batches ) > 1 ) {
149 $factory->commitAndWaitForReplication( __METHOD__, $ticket );
156 [
'page_namespace',
'page_title' ],
159 [
'page_id' => $pageIds,
'page_touched' => $dbw->timestamp( $touchTimestamp ) ],
165 foreach ( $titleArray as
$title ) {
173 foreach ( $titleArray as
$title ) {
180 $info = parent::getDeduplicationInfo();
181 if ( is_array( $info[
'params'] ) ) {
184 if ( isset( $info[
'params'][
'pages'] ) ) {
185 unset( $info[
'namespace'] );
186 unset( $info[
'title'] );
194 if ( !empty( $this->params[
'recursive'] ) ) {
196 } elseif ( isset( $this->params[
'pages'] ) ) {
197 return count( $this->params[
'pages'] );
static purge(array $urlArr)
Purges a list of CDN nodes defined in $wgCdnServers.
static newFromResult( $res)
static clearFileCache(Title $title)
Clear the file caches for a page for all actions.
array $params
Array of job parameters.
static newForBacklinks(Title $title, $table, $params=[])
static partitionBacklinkJob(Job $job, $bSize, $cSize, $opts=[])
Break down $job into approximately ($bSize/$cSize) leaf jobs and a single partition job that covers t...
Class to both describe a background job and handle jobs.
getCdnUrls()
Get a list of URLs to purge from the CDN cache when this page changes.
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Job to purge the cache for all pages that link to or use another page or file.
$wgUpdateRowsPerQuery
Number of rows to update per query.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
$wgUpdateRowsPerJob
Number of rows to update per job.
static newRootJobParams( $key)
Get "root job" parameters for a task.
invalidateTitles(array $pages)
bool $wgPageLanguageUseDB
Enable page language feature Allows setting page language in database.
getDeduplicationInfo()
Subclasses may need to override this to make duplication detection work.
__construct(Title $title, array $params)
Represents a title within MediaWiki.
static singleton( $domain=false)