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


PHP StatusNet::currentSite方法代碼示例

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


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

示例1: initialize

 function initialize()
 {
     // For various reasons this gets squished
     global $tldTree;
     if (empty($tldTree)) {
         if (!empty(self::$_thetree)) {
             $tldTree = self::$_thetree;
         }
     }
     $nickname = StatusNet::currentSite();
     if (empty($nickname)) {
         $this->log(LOG_WARNING, "No current site");
         return;
     }
     try {
         $sn = Status_network::staticGet('nickname', $nickname);
     } catch (Exception $e) {
         $this->log(LOG_ERR, $e->getMessage());
         return;
     }
     $tags = $sn->getTags();
     foreach ($tags as $tag) {
         if (strncmp($tag, 'domain=', 7) == 0) {
             $domain = substr($tag, 7);
             $this->log(LOG_INFO, "Setting email domain to {$domain}");
             common_config_append('email', 'whitelist', $domain);
         }
     }
 }
開發者ID:Grasia,項目名稱:bolotweet,代碼行數:29,代碼來源:DomainStatusNetworkPlugin.php

示例2: getFilename

 function getFilename()
 {
     $localDef = null;
     $local = null;
     $site = StatusNet::currentSite();
     if (!empty($site) && file_exists(INSTALLDIR . '/local/doc-src/' . $site . '/' . $this->title)) {
         $localDef = INSTALLDIR . '/local/doc-src/' . $site . '/' . $this->title;
         $local = glob(INSTALLDIR . '/local/doc-src/' . $site . '/' . $this->title . '.*');
         if ($local === false) {
             // Some systems return false, others array(), if dir didn't exist.
             $local = array();
         }
     } else {
         if (file_exists(INSTALLDIR . '/local/doc-src/' . $this->title)) {
             $localDef = INSTALLDIR . '/local/doc-src/' . $this->title;
         }
         $local = glob(INSTALLDIR . '/local/doc-src/' . $this->title . '.*');
         if ($local === false) {
             $local = array();
         }
     }
     if (count($local) || isset($localDef)) {
         return $this->negotiateLanguage($local, $localDef);
     }
     if (file_exists(INSTALLDIR . '/doc-src/' . $this->title)) {
         $distDef = INSTALLDIR . '/doc-src/' . $this->title;
     }
     $dist = glob(INSTALLDIR . '/doc-src/' . $this->title . '.*');
     if ($dist === false) {
         $dist = array();
     }
     if (count($dist) || isset($distDef)) {
         return $this->negotiateLanguage($dist, $distDef);
     }
     return null;
 }
開發者ID:himmelex,項目名稱:NTW,代碼行數:36,代碼來源:doc.php

示例3: switchSite

 /**
  * Make sure we're on the right site configuration
  */
 protected function switchSite()
 {
     if ($this->site != StatusNet::currentSite()) {
         common_log(LOG_DEBUG, __METHOD__ . ": switching to site {$this->site}");
         $this->stats('switch');
         StatusNet::switchSite($this->site);
     }
 }
開發者ID:himmelex,項目名稱:NTW,代碼行數:11,代碼來源:xmppmanager.php

示例4: switchSite

 /**
  * Change site configuration to site specified by nickname,
  * if set up via Status_network. If not, sites other than
  * the current will fail horribly.
  *
  * May throw exception or trigger a fatal error if the given
  * site is missing or configured incorrectly.
  *
  * @param string $nickname
  */
 public static function switchSite($nickname)
 {
     if ($nickname == StatusNet::currentSite()) {
         return true;
     }
     $sn = Status_network::staticGet('nickname', $nickname);
     if (empty($sn)) {
         return false;
         throw new Exception("No such site nickname '{$nickname}'");
     }
     $server = $sn->getServerName();
     StatusNet::init($server);
 }
開發者ID:stevertiqo,項目名稱:StatusNet,代碼行數:23,代碼來源:statusnet.php

示例5: queueName

 /**
  * Combines the queue_basename from configuration with the
  * group name for this queue to give eg:
  *
  * /queue/statusnet/main
  * /queue/statusnet/main/distrib
  * /queue/statusnet/xmpp/xmppout/site01
  *
  * @param string $queue
  * @return string
  */
 protected function queueName($queue)
 {
     $group = $this->queueGroup($queue);
     $site = StatusNet::currentSite();
     $specs = array("{$group}/{$queue}/{$site}", "{$group}/{$queue}");
     foreach ($specs as $spec) {
         if (in_array($spec, $this->breakout)) {
             return $this->base . $spec;
         }
     }
     return $this->base . $group;
 }
開發者ID:microcosmx,項目名稱:experiments,代碼行數:23,代碼來源:stompqueuemanager.php

示例6: mailPaths

 static function mailPaths()
 {
     $paths = array(INSTALLDIR . '/local/mail-src/', INSTALLDIR . '/mail-src/');
     $site = StatusNet::currentSite();
     if (!empty($site)) {
         array_unshift($paths, INSTALLDIR . '/local/mail-src/' . $site . '/');
     }
     return $paths;
 }
開發者ID:Grasia,項目名稱:bolotweet,代碼行數:9,代碼來源:docfile.php


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