MediaWiki
REL1_37
DeletePageJob.php
Go to the documentation of this file.
1
<?php
2
3
use
MediaWiki\MediaWikiServices
;
4
8
class
DeletePageJob
extends
Job
implements
GenericParameterJob
{
9
public
function
__construct
( array $params ) {
10
parent::__construct(
'deletePage'
, $params );
11
12
$this->title = Title::makeTitle( $params[
'namespace'
], $params[
'title'
] );
13
}
14
15
public
function
run
() {
16
// Failure to load the page is not job failure.
17
// A parallel deletion operation may have already completed the page deletion.
18
$wikiPage = MediaWikiServices::getInstance()->getWikiPageFactory()->newFromID( $this->params[
'wikiPageId'
] );
19
if
( $wikiPage ) {
20
$wikiPage->doDeleteArticleBatched(
21
$this->params[
'reason'
],
22
$this->params[
'suppress'
],
23
User::newFromId
( $this->params[
'userId'
] ),
24
json_decode( $this->params[
'tags'
] ),
25
$this->params[
'logsubtype'
],
26
false
,
27
$this->
getRequestId
() );
28
}
29
return
true
;
30
}
31
}
DeletePageJob
Class DeletePageJob.
Definition
DeletePageJob.php:8
DeletePageJob\__construct
__construct(array $params)
Definition
DeletePageJob.php:9
DeletePageJob\run
run()
Run the job.
Definition
DeletePageJob.php:15
Job
Class to both describe a background job and handle jobs.
Definition
Job.php:37
Job\getRequestId
getRequestId()
string|null Id of the request that created this job. Follows jobs recursively, allowing to track the ...
Definition
Job.php:251
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition
MediaWikiServices.php:190
User\newFromId
static newFromId( $id)
Static factory method for creation from a given user ID.
Definition
User.php:648
GenericParameterJob
Interface for generic jobs only uses the parameters field and are JSON serializable.
Definition
GenericParameterJob.php:31
includes
jobqueue
jobs
DeletePageJob.php
Generated on Fri Apr 5 2024 23:40:23 for MediaWiki by
1.9.8