Exemplo n.º 1
0
 public static function notifyMove($timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip = '', $overRedir = false)
 {
     global $wgRequest;
     if (!$ip) {
         $ip = wfGetIP();
         if (!$ip) {
             $ip = '';
         }
     }
     $rc = new RecentChange();
     $rc->mAttribs = array('rc_timestamp' => $timestamp, 'rc_cur_time' => $timestamp, 'rc_namespace' => $oldTitle->getNamespace(), 'rc_title' => $oldTitle->getDBkey(), 'rc_type' => $overRedir ? RC_MOVE_OVER_REDIRECT : RC_MOVE, 'rc_minor' => 0, 'rc_cur_id' => $oldTitle->getArticleID(), 'rc_user' => $user->getId(), 'rc_user_text' => $user->getName(), 'rc_comment' => $comment, 'rc_this_oldid' => 0, 'rc_last_oldid' => 0, 'rc_bot' => $user->isAllowed('bot') ? $wgRequest->getBool('bot', true) : 0, 'rc_moved_to_ns' => $newTitle->getNamespace(), 'rc_moved_to_title' => $newTitle->getDBkey(), 'rc_ip' => $ip, 'rc_new' => 0, 'rc_patrolled' => 1, 'rc_old_len' => null, 'rc_new_len' => null, 'rc_deleted' => 0, 'rc_logid' => 0, 'rc_log_type' => null, 'rc_log_action' => '', 'rc_params' => '');
     $rc->mExtra = array('prefixedDBkey' => $oldTitle->getPrefixedDBkey(), 'lastTimestamp' => 0, 'prefixedMoveTo' => $newTitle->getPrefixedDBkey());
     $rc->save();
 }
Exemplo n.º 2
0
 /**
  * Makes an entry in the database corresponding to page creation
  * Note: the title object must be loaded with the new id using resetArticleID()
  *
  * @param string $timestamp
  * @param Title $title
  * @param bool $minor
  * @param User $user
  * @param string $comment
  * @param bool $bot
  * @param string $ip
  * @param int $size
  * @param int $newId
  * @param int $patrol
  * @return RecentChange
  */
 public static function notifyNew($timestamp, &$title, $minor, &$user, $comment, $bot, $ip = '', $size = 0, $newId = 0, $patrol = 0)
 {
     $rc = new RecentChange();
     $rc->mTitle = $title;
     $rc->mPerformer = $user;
     $rc->mAttribs = array('rc_timestamp' => $timestamp, 'rc_namespace' => $title->getNamespace(), 'rc_title' => $title->getDBkey(), 'rc_type' => RC_NEW, 'rc_source' => self::SRC_NEW, 'rc_minor' => $minor ? 1 : 0, 'rc_cur_id' => $title->getArticleID(), 'rc_user' => $user->getId(), 'rc_user_text' => $user->getName(), 'rc_comment' => $comment, 'rc_this_oldid' => $newId, 'rc_last_oldid' => 0, 'rc_bot' => $bot ? 1 : 0, 'rc_ip' => self::checkIPAddress($ip), 'rc_patrolled' => intval($patrol), 'rc_new' => 1, 'rc_old_len' => 0, 'rc_new_len' => $size, 'rc_deleted' => 0, 'rc_logid' => 0, 'rc_log_type' => null, 'rc_log_action' => '', 'rc_params' => '');
     $rc->mExtra = array('prefixedDBkey' => $title->getPrefixedDBkey(), 'lastTimestamp' => 0, 'oldSize' => 0, 'newSize' => $size, 'pageStatus' => 'created');
     DeferredUpdates::addCallableUpdate(function () use($rc) {
         $rc->save();
         if ($rc->mAttribs['rc_patrolled']) {
             PatrolLog::record($rc, true, $rc->getPerformer());
         }
     });
     return $rc;
 }
Exemplo n.º 3
0
 /**
  * Makes an entry in the database corresponding to page creation
  * Note: the title object must be loaded with the new id using resetArticleID()
  * @todo Document parameters and return
  *
  * @param $timestamp
  * @param $title Title
  * @param $minor
  * @param $user User
  * @param $comment
  * @param $bot
  * @param $ip string
  * @param $size int
  * @param $newId int
  * @param $patrol int
  * @return RecentChange
  */
 public static function notifyNew($timestamp, &$title, $minor, &$user, $comment, $bot, $ip = '', $size = 0, $newId = 0, $patrol = 0)
 {
     global $wgRequest;
     if (!$ip) {
         $ip = $wgRequest->getIP();
         if (!$ip) {
             $ip = '';
         }
     }
     $rc = new RecentChange();
     $rc->mAttribs = array('rc_timestamp' => $timestamp, 'rc_cur_time' => $timestamp, 'rc_namespace' => $title->getNamespace(), 'rc_title' => $title->getDBkey(), 'rc_type' => RC_NEW, 'rc_minor' => $minor ? 1 : 0, 'rc_cur_id' => $title->getArticleID(), 'rc_user' => $user->getId(), 'rc_user_text' => $user->getName(), 'rc_comment' => $comment, 'rc_this_oldid' => $newId, 'rc_last_oldid' => 0, 'rc_bot' => $bot ? 1 : 0, 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_ip' => $ip, 'rc_patrolled' => intval($patrol), 'rc_new' => 1, 'rc_old_len' => 0, 'rc_new_len' => $size, 'rc_deleted' => 0, 'rc_logid' => 0, 'rc_log_type' => null, 'rc_log_action' => '', 'rc_params' => '');
     $rc->mExtra = array('prefixedDBkey' => $title->getPrefixedDBkey(), 'lastTimestamp' => 0, 'oldSize' => 0, 'newSize' => $size);
     $rc->save();
     return $rc;
 }
Exemplo n.º 4
0
 public static function notifyLog($timestamp, &$title, &$user, $actionComment, $ip = '', $type, $action, $target, $logComment, $params, $newId = 0)
 {
     global $wgRequest;
     if (!$ip) {
         $ip = wfGetIP();
         if (!$ip) {
             $ip = '';
         }
     }
     $rc = new RecentChange();
     $rc->mAttribs = array('rc_timestamp' => $timestamp, 'rc_cur_time' => $timestamp, 'rc_namespace' => $target->getNamespace(), 'rc_title' => $target->getDBkey(), 'rc_type' => RC_LOG, 'rc_minor' => 0, 'rc_cur_id' => $target->getArticleID(), 'rc_user' => $user->getId(), 'rc_user_text' => $user->getName(), 'rc_comment' => $logComment, 'rc_this_oldid' => 0, 'rc_last_oldid' => 0, 'rc_bot' => $user->isAllowed('bot') ? $wgRequest->getBool('bot', true) : 0, 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_ip' => $ip, 'rc_patrolled' => 1, 'rc_new' => 0, 'rc_old_len' => NULL, 'rc_new_len' => NULL, 'rc_deleted' => 0, 'rc_logid' => $newId, 'rc_log_type' => $type, 'rc_log_action' => $action, 'rc_params' => $params);
     $rc->mExtra = array('prefixedDBkey' => $title->getPrefixedDBkey(), 'lastTimestamp' => 0, 'actionComment' => $actionComment);
     $rc->save();
 }
 function notifyLog($timestamp, &$title, &$user, $comment, $ip = '')
 {
     if (!$ip) {
         global $wgIP;
         $ip = empty($wgIP) ? '' : $wgIP;
     }
     $rc = new RecentChange();
     $rc->mAttribs = array('rc_timestamp' => $timestamp, 'rc_cur_time' => $timestamp, 'rc_namespace' => $title->getNamespace(), 'rc_title' => $title->getDBkey(), 'rc_type' => RC_LOG, 'rc_minor' => 0, 'rc_cur_id' => $title->getArticleID(), 'rc_user' => $user->getID(), 'rc_user_text' => $user->getName(), 'rc_comment' => $comment, 'rc_this_oldid' => 0, 'rc_last_oldid' => 0, 'rc_bot' => 0, 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_ip' => $ip, 'rc_patrolled' => 1, 'rc_new' => 0);
     $rc->mExtra = array('prefixedDBkey' => $title->getPrefixedDBkey(), 'lastTimestamp' => 0);
     $rc->save();
 }
Exemplo n.º 6
0
 function notifyLog($timestamp, &$title, &$user, $comment, $ip = '', $type, $action, $target, $logComment, $params, $minor = 0, $patrolled = 1)
 {
     if (!$ip) {
         $ip = wfGetIP();
         if (!$ip) {
             $ip = '';
         }
     }
     $rc = new RecentChange();
     $rc->mAttribs = array('rc_timestamp' => $timestamp, 'rc_cur_time' => $timestamp, 'rc_namespace' => $title->getNamespace(), 'rc_title' => $title->getDBkey(), 'rc_type' => RC_LOG, 'rc_minor' => $minor ? 1 : 0, 'rc_cur_id' => $title->getArticleID(), 'rc_user' => $user->getID(), 'rc_user_text' => $user->getName(), 'rc_comment' => $comment, 'rc_this_oldid' => 0, 'rc_last_oldid' => 0, 'rc_bot' => $user->isBot() ? 1 : 0, 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_ip' => $ip, 'rc_patrolled' => $patrolled ? 1 : 0, 'rc_new' => 0);
     $rc->mExtra = array('prefixedDBkey' => $title->getPrefixedDBkey(), 'lastTimestamp' => 0, 'logType' => $type, 'logAction' => $action, 'logComment' => $logComment, 'logTarget' => $target, 'logParams' => $params);
     $rc->save();
 }