MediaWiki master
EnotifNotifyJob.php
Go to the documentation of this file.
1<?php
23
30class EnotifNotifyJob extends Job {
31 public function __construct( Title $title, array $params ) {
32 parent::__construct( 'enotifNotify', $title, $params );
33 }
34
35 public function run() {
36 $enotif = new EmailNotification();
37 // Get the user from ID (rename safe). Anons are 0, so defer to name.
38 if ( isset( $this->params['editorID'] ) && $this->params['editorID'] ) {
39 $editor = User::newFromId( $this->params['editorID'] );
40 // B/C, only the name might be given.
41 } else {
42 # @todo FIXME: newFromName could return false on a badly configured wiki.
43 $editor = User::newFromName( $this->params['editor'], false );
44 }
45 $enotif->actuallyNotifyOnPageChange(
46 $editor,
47 $this->title,
48 $this->params['timestamp'],
49 $this->params['summary'],
50 $this->params['minorEdit'],
51 $this->params['oldid'],
52 $this->params['watchers'],
53 $this->params['pageStatus']
54 );
55
56 return true;
57 }
58}
array $params
The job parameters.
Find watchers and create email notifications after a page is changed.
Send an email notification.
__construct(Title $title, array $params)
run()
Run the job.
Describe and execute a background job.
Definition Job.php:41
Represents a title within MediaWiki.
Definition Title.php:78
internal since 1.36
Definition User.php:93