Title::moveToInternal doesn't return anything, but it does throw an exception
[lhc/web/wiklou.git] / includes / job / EnotifNotifyJob.php
1 <?php
2 /**
3 * Job for notification emails.
4 *
5 * @file
6 * @ingroup JobQueue
7 */
8
9 /**
10 * Job for email notification mails
11 *
12 * @ingroup JobQueue
13 */
14 class EnotifNotifyJob extends Job {
15
16 function __construct( $title, $params, $id = 0 ) {
17 parent::__construct( 'enotifNotify', $title, $params, $id );
18 }
19
20 function run() {
21 $enotif = new EmailNotification();
22 // Get the user from ID (rename safe). Anons are 0, so defer to name.
23 if( isset( $this->params['editorID'] ) && $this->params['editorID'] ) {
24 $editor = User::newFromId( $this->params['editorID'] );
25 // B/C, only the name might be given.
26 } else {
27 # FIXME: newFromName could return false on a badly configured wiki.
28 $editor = User::newFromName( $this->params['editor'], false );
29 }
30 $enotif->actuallyNotifyOnPageChange(
31 $editor,
32 $this->title,
33 $this->params['timestamp'],
34 $this->params['summary'],
35 $this->params['minorEdit'],
36 $this->params['oldid'],
37 $this->params['watchers']
38 );
39 return true;
40 }
41
42 }