本文整理汇总了PHP中RecentChange::cleanupForIRC方法的典型用法代码示例。如果您正苦于以下问题:PHP RecentChange::cleanupForIRC方法的具体用法?PHP RecentChange::cleanupForIRC怎么用?PHP RecentChange::cleanupForIRC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecentChange
的用法示例。
在下文中一共展示了RecentChange::cleanupForIRC方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIRCLine
/**
* Generate an IRC line corresponding to user unification/creation
* @param Title $userpage
* @param string $wikiID
* @return string
*/
protected static function getIRCLine($userpage, $wikiID)
{
$title = RecentChange::cleanupForIRC($userpage->getPrefixedText());
$wikiID = RecentChange::cleanupForIRC($wikiID);
$url = $userpage->getCanonicalURL();
$user = RecentChange::cleanupForIRC($userpage->getText());
# see http://www.irssi.org/documentation/formats for some colour codes. prefix is \003,
# no colour (\003) switches back to the term default
$fullString = "14[[07{$title}14]]4@{$wikiID}10 " . "02{$url} 5* 03{$user} 5*\n";
return $fullString;
}
示例2: assertIRCComment
/**
* @param $expected String Expected IRC text without colors codes
* @param $type String Log type (move, delete, suppress, patrol ...)
* @param $action String A log type action
* @param $comment String (optional) A comment for the log action
* @param $msg String (optional) A message for PHPUnit :-)
*/
function assertIRCComment($expected, $type, $action, $params, $comment = null, $msg = '')
{
$logEntry = new ManualLogEntry($type, $action);
$logEntry->setPerformer($this->user);
$logEntry->setTarget($this->title);
if ($comment !== null) {
$logEntry->setComment($comment);
}
$logEntry->setParameters($params);
$formatter = LogFormatter::newFromEntry($logEntry);
$formatter->setContext($this->context);
// Apply the same transformation as done in RecentChange::getIRCLine for rc_comment
$ircRcComment = RecentChange::cleanupForIRC($formatter->getIRCActionComment());
$this->assertEquals($expected, $ircRcComment, $msg);
}
示例3: sendStatusToUDP
/**
* @param $status string
* @param $oldStatus string
*/
protected function sendStatusToUDP($status, $oldStatus)
{
global $wgCodeReviewUDPAddress, $wgCodeReviewUDPPort, $wgCodeReviewUDPPrefix, $wgUser;
if ($wgCodeReviewUDPAddress) {
$url = $this->getCanonicalUrl();
$line = wfMsg('code-rev-status') . " 14(" . $this->repo->getName() . ")03 " . RecentChange::cleanupForIRC($wgUser->getName()) . " " . str_replace("'''", '', wfMsg('code-change-status', "7" . $this->getIdString() . "")) . ": 15" . wfMsg('code-status-' . $oldStatus) . " -> 10" . wfMsg('code-status-' . $status) . " " . $url;
RecentChange::sendToUDP($line, $wgCodeReviewUDPAddress, $wgCodeReviewUDPPrefix, $wgCodeReviewUDPPort);
}
}