Пример #1
0
 /**
  * @param  $comment
  * @param  $pageText
  * @param  $watch
  * @param  $user User
  * @return
  */
 protected function insertJob($comment, $pageText, $watch, $user)
 {
     $sessionKey = $this->stashSession();
     $job = new UploadFromUrlJob($this->getTitle(), array('url' => $this->mUrl, 'comment' => $comment, 'pageText' => $pageText, 'watch' => $watch, 'userName' => $user->getName(), 'leaveMessage' => $this->mAsync == 'async-leavemessage', 'ignoreWarnings' => $this->mIgnoreWarnings, 'sessionId' => session_id(), 'sessionKey' => $sessionKey));
     $job->initializeSessionData();
     $job->insert();
     return $sessionKey;
 }
Пример #2
0
 /**
  * @param string $comment
  * @param string $pageText
  * @param bool $watch
  * @param User $user
  * @return string
  */
 protected function insertJob($comment, $pageText, $watch, $user)
 {
     $sessionKey = $this->stashSession();
     $job = new UploadFromUrlJob($this->getTitle(), array('url' => $this->mUrl, 'comment' => $comment, 'pageText' => $pageText, 'watch' => $watch, 'userName' => $user->getName(), 'leaveMessage' => $this->mAsync == 'async-leavemessage', 'ignoreWarnings' => $this->mIgnoreWarnings, 'sessionId' => MediaWiki\Session\SessionManager::getGlobalSession()->getId(), 'sessionKey' => $sessionKey));
     $job->initializeSessionData();
     JobQueueGroup::singleton()->push($job);
     return $sessionKey;
 }