当前位置: 首页>>代码示例>>PHP>>正文


PHP RecentChange::cleanupForIRC方法代码示例

本文整理汇总了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;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:17,代码来源:CentralAuthUser.php

示例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);
 }
开发者ID:Jobava,项目名称:diacritice-meta-repo,代码行数:22,代码来源:RecentChangeTest.php

示例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);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:13,代码来源:CodeRevision.php


注:本文中的RecentChange::cleanupForIRC方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。