本文整理汇总了PHP中RecentChange::save方法的典型用法代码示例。如果您正苦于以下问题:PHP RecentChange::save方法的具体用法?PHP RecentChange::save怎么用?PHP RecentChange::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecentChange
的用法示例。
在下文中一共展示了RecentChange::save方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notifyMove
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();
}
示例2: notifyNew
/**
* 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;
}
示例3: notifyNew
/**
* 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;
}
示例4: notifyLog
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();
}
示例5: notifyLog
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();
}
示例6: notifyLog
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();
}