38 parent::__construct(
'htmlCacheUpdate', $title, $params );
40 $this->removeDuplicates = ( !isset( $params[
'range'] ) && !isset( $params[
'pages'] ) );
55 "htmlCacheUpdate:{$table}:{$title->getPrefixedText()}"
61 global $wgUpdateRowsPerJob, $wgUpdateRowsPerQuery;
63 if ( isset( $this->params[
'table'] ) && !isset( $this->params[
'pages'] ) ) {
64 $this->params[
'recursive'] =
true;
68 if ( !empty( $this->params[
'recursive'] ) ) {
74 $wgUpdateRowsPerQuery,
80 } elseif ( isset( $this->params[
'pages'] ) ) {
86 $t->getArticleID() => [
$t->getNamespace(),
$t->getDBkey() ]
100 $pageIds = array_keys( $pages );
112 if ( isset( $this->params[
'rootJobTimestamp'] ) ) {
113 $touchTimestamp = $this->params[
'rootJobTimestamp'];
121 foreach ( array_chunk( $pageIds, $wgUpdateRowsPerQuery )
as $batch ) {
122 $dbw->commit( __METHOD__,
'flush' );
125 $dbw->update(
'page',
126 [
'page_touched' => $dbw->timestamp( $touchTimestamp ) ],
129 "page_touched < " . $dbw->addQuotes( $dbw->timestamp( $touchTimestamp ) )
137 [
'page_namespace',
'page_title' ],
138 [
'page_id' => $pageIds,
'page_touched' => $dbw->timestamp( $touchTimestamp ) ],
147 if ( $wgUseFileCache ) {
155 return isset( $this->params[
'pages'] ) ? count( $this->params[
'pages'] ) : 1;
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
the array() calling protocol came about after MediaWiki 1.4rc1.
Class to both describe a background job and handle jobs.
static newRootJobParams($key)
Get "root job" parameters for a task.
Represents a title within MediaWiki.
when a variable name is used in a it is silently declared as a new local masking the global
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
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites...
static clearFileCache(Title $title)
Clear the file caches for a page for all actions.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Job to purge the cache for all pages that link to or use another page or file.
static newFromResult($res)
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
static singleton($wiki=false)
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
wfGetLBFactory()
Get the load balancer factory object.
invalidateTitles(array $pages)
__construct(Title $title, array $params)
array $params
Array of job parameters.
static partitionBacklinkJob(Job $job, $bSize, $cSize, $opts=[])
Break down $job into approximately ($bSize/$cSize) leaf jobs and a single partition job that covers t...
static newForBacklinks(Title $title, $table)
static newFromTitles($titles, $urlArr=[])
Create an update object from an array of Title objects, or a TitleArray object.