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


PHP KTUtil::getServerName方法代码示例

本文整理汇总了PHP中KTUtil::getServerName方法的典型用法代码示例。如果您正苦于以下问题:PHP KTUtil::getServerName方法的具体用法?PHP KTUtil::getServerName怎么用?PHP KTUtil::getServerName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KTUtil的用法示例。


在下文中一共展示了KTUtil::getServerName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: KTDownloadManager

 /**
  * Constructor for the download manager.
  *
  * @param KTAPI_Session $session
  * @return KTDownloadManager
  */
 function KTDownloadManager()
 {
     $config =& KTConfig::getSingleton();
     $this->age = $config->get('webservice/downloadExpiry', 5);
     $protocol = $config->get('KnowledgeTree/sslEnabled') ? 'https' : 'http';
     $server = KTUtil::getServerName(TRUE);
     $url = $config->get('webservice/downloadUrl');
     $this->download_url = $protocol . '://' . $server . $url;
     $this->random = $config->get('webservice/randomKeyText', 'jhsdf8q1jkjpoiudfs7sd3ds1');
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:16,代码来源:KTDownloadManager.inc.php

示例2: getDynamicConfigSettings

 function getDynamicConfigSettings()
 {
     $oKTConfig =& KTConfig::getSingleton();
     // Override the config setting - KT_DIR is resolved on page load
     $oKTConfig->setdefaultns('KnowledgeTree', 'fileSystemRoot', KT_DIR);
     // Set ssl to enabled if using https - if the server variable is not set, allow the config setting to take precedence
     if (array_key_exists('HTTPS', $_SERVER)) {
         if (strtolower($_SERVER['HTTPS']) === 'on') {
             $oKTConfig->setdefaultns('KnowledgeTree', 'sslEnabled', 'true');
         }
     }
     $oKTConfig->setdefaultns('KnowledgeTree', 'serverName', $_SERVER['HTTP_HOST']);
     // Check for the config setting before overriding with the resolved setting
     $serverName = $oKTConfig->get('KnowledgeTree/serverName');
     $rootUrl = $oKTConfig->get('KnowledgeTree/rootUrl');
     $execSearchPath = $oKTConfig->get('KnowledgeTree/execSearchPath');
     $magicDatabase = $oKTConfig->get('KnowledgeTree/magicDatabase');
     // base server name
     if (empty($serverName) || $serverName == 'default') {
         $oKTConfig->setdefaultns('KnowledgeTree', 'serverName', KTUtil::getServerName());
     }
     // the sub directory or root url
     if (empty($rootUrl) || $rootUrl == 'default') {
         $oKTConfig->setdefaultns('KnowledgeTree', 'rootUrl', $this->guessRootUrl());
     }
     // path to find the executable binaries
     if (empty($execSearchPath) || $execSearchPath == 'default') {
         $oKTConfig->setdefaultns('KnowledgeTree', 'execSearchPath', $_SERVER['PATH']);
     }
     // path to magic database
     if (empty($magicDatabase) || $magicDatabase == 'default') {
         $oKTConfig->setdefaultns('KnowledgeTree', 'magicDatabase', KTInit::detectMagicFile());
     }
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:34,代码来源:dmsDefaults.php


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