本文整理汇总了PHP中DifferenceEngine::markPatrolledLink方法的典型用法代码示例。如果您正苦于以下问题:PHP DifferenceEngine::markPatrolledLink方法的具体用法?PHP DifferenceEngine::markPatrolledLink怎么用?PHP DifferenceEngine::markPatrolledLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DifferenceEngine
的用法示例。
在下文中一共展示了DifferenceEngine::markPatrolledLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMarkPatrolledLink
static function getMarkPatrolledLink()
{
global $wgRequest, $wgUser;
// Append a [Mark as Patrolled] link in certain cases
$markPatrolledLink = '';
$rcid = $wgRequest->getInt('rcid');
$fromRC = $wgRequest->getInt('fromrc');
if ($wgUser && $rcid > 0 && $fromRC && $wgUser->isAllowed('patrol')) {
$rc = RecentChange::newFromId($rcid);
if ($rc) {
$oldRevId = $rc->getAttribute('rc_last_oldid');
$newRevId = $rc->getAttribute('rc_this_oldid');
$diff = new DifferenceEngine(null, $oldRevId, $newRevId);
if ($diff->loadRevisionData()) {
$markPatrolledLink = $diff->markPatrolledLink();
} else {
throw new MWException("wikiHow internal error: we know there is an rcid ({$rcid}) and newrevid ({$newRevId}), but couldn't find the revision");
}
}
}
return $markPatrolledLink;
}