*/
private $linkDeletions = null;
+ /**
+ * @var User|null
+ */
+ private $user;
+
/**
* Constructor
*
// Which ever runs first generally no-ops the other one.
$jobs = array();
foreach ( $bc->getCascadeProtectedLinks() as $title ) {
- $jobs[] = new RefreshLinksJob( $title, array( 'prioritize' => true ) );
+ $jobs[] = RefreshLinksJob::newPrioritized( $title, array() );
}
JobQueueGroup::singleton()->push( $jobs );
}
$this->mRevision = $revision;
}
+ /**
+ * Set the User who triggered this LinksUpdate
+ *
+ * @since 1.27
+ * @param User $user
+ */
+ public function setTriggeringUser( User $user ) {
+ $this->user = $user;
+ }
+
+ /**
+ * @since 1.27
+ * @return null|User
+ */
+ public function getTriggeringUser() {
+ return $this->user;
+ }
+
/**
* Invalidate any necessary link lists related to page property changes
* @param array $changed
}
public function getAsJobSpecification() {
+ if ( $this->user ) {
+ $userInfo = array(
+ 'userId' => $this->user->getId(),
+ 'userName' => $this->user->getName(),
+ );
+ } else {
+ $userInfo = false;
+ }
+
+ if ( $this->mRevision ) {
+ $triggeringRevisionId = $this->mRevision->getId();
+ } else {
+ $triggeringRevisionId = false;
+ }
+
return array(
'wiki' => $this->mDb->getWikiID(),
'job' => new JobSpecification(
'refreshLinksPrioritized',
array(
- 'prioritize' => true,
// Reuse the parser cache if it was saved
'rootJobTimestamp' => $this->mParserOutput->getCacheTime(),
- 'useRecursiveLinksUpdate' => $this->mRecursive
+ 'useRecursiveLinksUpdate' => $this->mRecursive,
+ 'triggeringUser' => $userInfo,
+ 'triggeringRevisionId' => $triggeringRevisionId,
),
array( 'removeDuplicates' => true ),
$this->getTitle()