46 parent::__construct();
51 } elseif ( $page->
exists() ) {
52 $this->pageId = $page->
getId();
61 $services = MediaWikiServices::getInstance();
64 $batchSize = $config->get(
'UpdateRowsPerQuery' );
69 if ( $this->ticket ) {
76 $dbw = $this->
getDB();
79 $dbw->delete(
'page_restrictions', [
'pr_page' => $id ], __METHOD__ );
82 $cats = $dbw->selectFieldValues(
88 $catBatches = array_chunk( $cats, $batchSize );
89 foreach ( $catBatches
as $catBatch ) {
90 $this->
page->updateCategoryCounts( [], $catBatch, $id );
91 if ( count( $catBatches ) > 1 ) {
93 __METHOD__, $this->ticket, [
'wiki' => $dbw->getWikiID() ]
101 $row = $dbw->selectRow(
103 [
'cat_id',
'cat_title',
'cat_pages',
'cat_subcats',
'cat_files' ],
104 [
'cat_title' =>
$title->getDBkey(),
'cat_pages <= 0' ],
114 [
'pl_from' => $id ],
115 [
'pl_from',
'pl_namespace',
'pl_title' ],
120 [
'il_from' => $id ],
121 [
'il_from',
'il_to' ],
126 [
'cl_from' => $id ],
127 [
'cl_from',
'cl_to' ],
132 [
'tl_from' => $id ],
133 [
'tl_from',
'tl_namespace',
'tl_title' ],
138 [
'el_from' => $id ],
144 [
'll_from' => $id ],
145 [
'll_from',
'll_lang' ],
150 [
'iwl_from' => $id ],
151 [
'iwl_from',
'iwl_prefix',
'iwl_title' ],
156 $dbw->delete(
'redirect', [
'rd_from' => $id ], __METHOD__ );
157 $dbw->delete(
'page_props', [
'pp_page' => $id ], __METHOD__ );
160 $rcIdsForTitle = $dbw->selectFieldValues(
165 'rc_namespace' =>
$title->getNamespace(),
166 'rc_title' =>
$title->getDBkey(),
168 $dbw->addQuotes( $dbw->timestamp( $this->timestamp ) )
172 $rcIdsForPage = $dbw->selectFieldValues(
175 [
'rc_type != ' .
RC_LOG,
'rc_cur_id' => $id ],
180 $rcIdBatches = array_chunk( array_merge( $rcIdsForTitle, $rcIdsForPage ), $batchSize );
181 foreach ( $rcIdBatches
as $rcIdBatch ) {
182 $dbw->delete(
'recentchanges', [
'rc_id' => $rcIdBatch ], __METHOD__ );
183 if ( count( $rcIdBatches ) > 1 ) {
185 __METHOD__, $this->ticket, [
'wiki' => $dbw->getWikiID() ]
191 ScopedCallback::consume( $scopedLock );
195 $services = MediaWikiServices::getInstance();
197 $dbw = $this->
getDB();
199 $res = $dbw->select( $table, $pk, $conds, __METHOD__ );
202 foreach (
$res as $row ) {
204 if ( count( $pkDeleteConds ) >= $bSize ) {
205 $dbw->delete( $table, $dbw->makeList( $pkDeleteConds,
LIST_OR ), __METHOD__ );
207 __METHOD__, $this->ticket, [
'wiki' => $dbw->getWikiID() ]
213 if ( $pkDeleteConds ) {
214 $dbw->delete( $table, $dbw->makeList( $pkDeleteConds,
LIST_OR ), __METHOD__ );
228 'wiki' => $this->
getDB()->getWikiID(),
231 [
'pageId' => $this->pageId,
'timestamp' => $this->timestamp ],
232 [
'removeDuplicates' =>
true ],
233 $this->
page->getTitle()
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
__construct(WikiPage $page, $pageId=null, $timestamp=null)
the array() calling protocol came about after MediaWiki 1.4rc1.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Interface that marks a DataUpdate as enqueuable via the JobQueue.
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
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
batchDeleteByPK($table, array $conds, array $pk, $bSize)
namespace and then decline to actually register it file or subcat img or subcat $title
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
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
Class representing a MediaWiki article and history.
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
Abstract base class for update jobs that do something with some secondary data extracted from article...
static newFromRow($row, $title=null)
Factory function, for constructing a Category object from a result set.
static acquirePageLock(IDatabase $dbw, $pageId, $why= 'atomicity')
Acquire a lock for performing link table updates for a page on a DB.
Job queue task description base code.
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 one of or reset my talk page
doUpdate()
Perform the actual work.
Update object handling the cleanup of links tables after a page was deleted.