本文整理汇总了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);
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}