当前位置: 首页>>代码示例>>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;未经允许,请勿转载。