27 use InvalidArgumentException;
58 throw new InvalidArgumentException(
"Page ID not known. Page doesn't exist?" );
67 parent::__construct( $immutablePageIdentity, $fakePO,
false );
72 $config = $services->getMainConfig();
73 $lbFactory = $services->getDBLoadBalancerFactory();
79 $dbw = $this->
getDB();
81 parent::doIncrementalUpdate();
89 $cat->refreshCountsIfSmall();
94 $dbw->newDeleteQueryBuilder()
95 ->deleteFrom(
'page_restrictions' )
96 ->where( [
'pr_page' => $id ] )
97 ->caller( __METHOD__ )->execute();
100 $dbw->newDeleteQueryBuilder()
101 ->deleteFrom(
'redirect' )
102 ->where( [
'rd_from' => $id ] )
103 ->caller( __METHOD__ )->execute();
107 $rcIdsForPage = $dbw->newSelectQueryBuilder()
109 ->from(
'recentchanges' )
110 ->where( [
'rc_type != ' .
RC_LOG,
'rc_cur_id' => $id ] )
111 ->caller( __METHOD__ )->fetchFieldValues();
114 $rcIdBatches = array_chunk( $rcIdsForPage, $batchSize );
115 foreach ( $rcIdBatches as $rcIdBatch ) {
116 $dbw->newDeleteQueryBuilder()
117 ->deleteFrom(
'recentchanges' )
118 ->where( [
'rc_id' => $rcIdBatch ] )
119 ->caller( __METHOD__ )->execute();
120 if ( count( $rcIdBatches ) > 1 ) {
121 $lbFactory->commitAndWaitForReplication(
122 __METHOD__, $this->ticket, [
'domain' => $dbw->getDomainID() ]
130 'domain' => $this->
getDB()->getDomainID(),
133 [
'pageId' => $this->mId,
'timestamp' => $this->timestamp ],
134 [
'removeDuplicates' =>
true ],
142 class_alias( LinksDeletionUpdate::class,
'LinksDeletionUpdate' );
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Defer callable updates to run later in the PHP process.
static addCallableUpdate( $callable, $stage=self::POSTSEND, $dbw=null)
Add an update to the pending update queue that invokes the specified callback when run.
Job queue task description base code.
A class containing constants representing the names of configuration variables.
const UpdateRowsPerQuery
Name constant for the UpdateRowsPerQuery setting, for use with Config::get()
Base representation for an editable wiki page.
getId( $wikiId=self::LOCAL)
getTitle()
Get the title object of the article.
Interface that marks a DataUpdate as enqueuable via the JobQueue.