當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LogPage::isRestricted方法代碼示例

本文整理匯總了PHP中LogPage::isRestricted方法的典型用法代碼示例。如果您正苦於以下問題:PHP LogPage::isRestricted方法的具體用法?PHP LogPage::isRestricted怎麽用?PHP LogPage::isRestricted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在LogPage的用法示例。


在下文中一共展示了LogPage::isRestricted方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: publish

 /**
  * Publishes the log entry.
  * @param int $newId Id of the log entry.
  * @param string $to One of: rcandudp (default), rc, udp
  */
 public function publish($newId, $to = 'rcandudp')
 {
     $log = new LogPage($this->getType());
     if ($log->isRestricted()) {
         return;
     }
     $rc = $this->getRecentChange($newId);
     if ($to === 'rc' || $to === 'rcandudp') {
         $rc->save('pleasedontudp');
     }
     if ($to === 'udp' || $to === 'rcandudp') {
         $rc->notifyRCFeeds();
     }
 }
開發者ID:jpena88,項目名稱:mediawiki-dokku-deploy,代碼行數:19,代碼來源:LogEntry.php

示例2: publish

 /**
  * Publishes the log entry.
  * @param int $newId id of the log entry.
  * @param string $to rcandudp (default), rc, udp
  */
 public function publish($newId, $to = 'rcandudp')
 {
     $log = new LogPage($this->getType());
     if ($log->isRestricted()) {
         return;
     }
     $formatter = LogFormatter::newFromEntry($this);
     $context = RequestContext::newExtraneousContext($this->getTarget());
     $formatter->setContext($context);
     $logpage = SpecialPage::getTitleFor('Log', $this->getType());
     $user = $this->getPerformer();
     $ip = "";
     if ($user->isAnon()) {
         /*
          * "MediaWiki default" and friends may have
          * no IP address in their name
          */
         if (IP::isIPAddress($user->getName())) {
             $ip = $user->getName();
         }
     }
     $rc = RecentChange::newLogEntry($this->getTimestamp(), $logpage, $user, $formatter->getPlainActionText(), $ip, $this->getType(), $this->getSubtype(), $this->getTarget(), $this->getComment(), serialize((array) $this->getParameters()), $newId, $formatter->getIRCActionComment());
     if ($to === 'rc' || $to === 'rcandudp') {
         $rc->save('pleasedontudp');
     }
     if ($to === 'udp' || $to === 'rcandudp') {
         $rc->notifyRC2UDP();
     }
 }
開發者ID:Grprashanthkumar,項目名稱:ColfusionWeb,代碼行數:34,代碼來源:LogEntry.php

示例3: publish

 /**
  * Publish the log entry.
  *
  * @param int $newId Id of the log entry.
  * @param string $to One of: rcandudp (default), rc, udp
  * @return RecentChange|null
  */
 public function publish($newId, $to = 'rcandudp')
 {
     $log = new LogPage($this->getType());
     if ($log->isRestricted()) {
         return null;
     }
     $rc = $this->getRecentChange($newId);
     if ($to === 'rc' || $to === 'rcandudp') {
         $rc->save('pleasedontudp');
     }
     if ($to === 'udp' || $to === 'rcandudp') {
         $rc->notifyRCFeeds();
     }
     // Log the autopatrol if the log entry is patrollable
     if ($this->getIsPatrollable() && $rc->getAttribute('rc_patrolled') === 1) {
         PatrolLog::record($rc, true, $this->getPerformer());
     }
     // Add change tags to the log entry and (if applicable) the associated revision
     $tags = $this->getTags();
     if (!is_null($tags)) {
         $rcId = $rc->getAttribute('rc_id');
         $revId = $this->getAssociatedRevId();
         // Use null if $revId is 0
         ChangeTags::addTags($tags, $rcId, $revId > 0 ? $revId : null, $newId);
     }
     return $rc;
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:34,代碼來源:LogEntry.php

示例4: publish

 /**
  * Publishes the log entry.
  * @param $newId int id of the log entry.
  * @param $to string: rcandudp (default), rc, udp
  */
 public function publish($newId, $to = 'rcandudp')
 {
     $log = new LogPage($this->getType());
     if ($log->isRestricted()) {
         return;
     }
     $formatter = LogFormatter::newFromEntry($this);
     $context = RequestContext::newExtraneousContext($this->getTarget());
     $formatter->setContext($context);
     $logpage = SpecialPage::getTitleFor('Log', $this->getType());
     $user = $this->getPerformer();
     $rc = RecentChange::newLogEntry($this->getTimestamp(), $logpage, $user, $formatter->getPlainActionText(), $user->isAnon() ? $user->getName() : '', $this->getType(), $this->getSubtype(), $this->getTarget(), $this->getComment(), serialize((array) $this->getParameters()), $newId, $formatter->getIRCActionComment());
     if ($to === 'rc' || $to === 'rcandudp') {
         $rc->save('pleasedontudp');
     }
     if ($to === 'udp' || $to === 'rcandudp') {
         $rc->notifyRC2UDP();
     }
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:24,代碼來源:LogEntry.php

示例5: publish

 /**
  * Publish the log entry.
  *
  * @param int $newId Id of the log entry.
  * @param string $to One of: rcandudp (default), rc, udp
  */
 public function publish($newId, $to = 'rcandudp')
 {
     DeferredUpdates::addCallableUpdate(function () use($newId, $to) {
         $log = new LogPage($this->getType());
         if (!$log->isRestricted()) {
             $rc = $this->getRecentChange($newId);
             if ($to === 'rc' || $to === 'rcandudp') {
                 // save RC, passing tags so they are applied there
                 $tags = $this->getTags();
                 if (is_null($tags)) {
                     $tags = [];
                 }
                 $rc->addTags($tags);
                 $rc->save('pleasedontudp');
             }
             if ($to === 'udp' || $to === 'rcandudp') {
                 $rc->notifyRCFeeds();
             }
             // Log the autopatrol if the log entry is patrollable
             if ($this->getIsPatrollable() && $rc->getAttribute('rc_patrolled') === 1) {
                 PatrolLog::record($rc, true, $this->getPerformer());
             }
         }
     }, DeferredUpdates::POSTSEND, wfGetDB(DB_MASTER));
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:31,代碼來源:LogEntry.php

示例6: publish

 /**
  * Publish the log entry.
  *
  * @param int $newId Id of the log entry.
  * @param string $to One of: rcandudp (default), rc, udp
  */
 public function publish($newId, $to = 'rcandudp')
 {
     $log = new LogPage($this->getType());
     if ($log->isRestricted()) {
         return;
     }
     $rc = $this->getRecentChange($newId);
     if ($to === 'rc' || $to === 'rcandudp') {
         $rc->save('pleasedontudp');
     }
     if ($to === 'udp' || $to === 'rcandudp') {
         $rc->notifyRCFeeds();
     }
     // Log the autopatrol if an associated rev id was passed
     if ($this->getAssociatedRevId() > 0 && $rc->getAttribute('rc_patrolled') === 1) {
         PatrolLog::record($rc, true, $this->getPerformer());
     }
 }
開發者ID:guochangjiang,項目名稱:mediawiki,代碼行數:24,代碼來源:LogEntry.php


注:本文中的LogPage::isRestricted方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。