MediaWiki REL1_32
DeletePageJob.php
Go to the documentation of this file.
1<?php
2
6class DeletePageJob extends Job {
7 public function __construct( $title, $params ) {
8 parent::__construct( 'deletePage', $title, $params );
9 }
10
16 public function run() {
17 // Failure to load the page is not job failure.
18 // A parallel deletion operation may have already completed the page deletion.
19 $wikiPage = WikiPage::newFromID( $this->params['wikiPageId'] );
20 if ( $wikiPage ) {
21 $wikiPage->doDeleteArticleBatched(
22 $this->params['reason'],
23 $this->params['suppress'],
24 User::newFromId( $this->params['userId'] ),
25 json_decode( $this->params['tags'] ),
26 $this->params['logsubtype'],
27 false,
28 $this->getRequestId() );
29 }
30 return true;
31 }
32}
Class DeletePageJob.
__construct( $title, $params)
run()
Execute the job.
Class to both describe a background job and handle jobs.
Definition Job.php:30
array $params
Array of job parameters.
Definition Job.php:35
getRequestId()
Definition Job.php:172
static newFromId( $id)
Static factory method for creation from a given user ID.
Definition User.php:615