當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。