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


PHP VirtualHost::getDefaultVirtualHost方法代碼示例

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


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

示例1: getDefaultNetwork

 /**
  * Get the default network
  *
  * @return object A Network object, NEVER returns null.
  *
  * @static
  * @access public
  */
 public static function getDefaultNetwork()
 {
     $retval = null;
     $vhost = VirtualHost::getCurrentVirtualHost();
     if ($vhost == null) {
         $vhost = VirtualHost::getDefaultVirtualHost();
     }
     return $vhost->getDefaultNetwork();
 }
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:17,代碼來源:Network.php

示例2: define

 */
/* This section deals with PATHs used in URLs and local content
 * BASE_SSL_PATH should be used to enter SSL mode (if available)
 * BASE_NON_SSL_PATH should be used to break out of SSL mode of when we
 * explicitely do not want someting to be referenced over http
 * BASE_URL_PATH should be used in all other cases to avoid needless SSL warning
 * 
 *   */
require_once 'classes/VirtualHost.php';
/**
 * Check for SSL support
 */
try {
    $vhost = VirtualHost::getCurrentVirtualHost();
    if ($vhost == null) {
        $vhost = VirtualHost::getDefaultVirtualHost();
    }
    if ($vhost->isSSLAvailable()) {
        /**
         * @ignore
         */
        define("SSL_AVAILABLE", true);
    } else {
        /**
         * @ignore
         */
        define("SSL_AVAILABLE", false);
    }
} catch (Exception $e) {
    //Leave this catch here, in case the schema update hasn't yet been done.
    define("SSL_AVAILABLE", false);
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:31,代碼來源:path_defines_url_content.php

示例3: setDefaultVirtualHost

 /**
  * Set as the default server
  *
  * @param VirtualHost $vhost
  *
  * @return bool True on success, false on failure
  */
 public function setDefaultVirtualHost(VirtualHost $vhost)
 {
     $db = AbstractDb::getObject();
     $vhostIdStr = $db->escapeString($vhost->getId());
     // Init values
     $_retVal = false;
     if ($vhostIdStr != VirtualHost::getDefaultVirtualHost()->getId()) {
         $sql = "UPDATE server SET default_virtual_host = '{$vhostIdStr}';\n";
         $_retVal = $db->execSqlUpdate($sql, false);
         $this->refresh();
     }
     return $_retVal;
 }
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:20,代碼來源:Server.php

示例4: isDefaultVirtualHost

 /**
  * Is this vhost the server's default?
  *
  * @return bool True or false
  */
 public function isDefaultVirtualHost()
 {
     // Init values
     $retVal = false;
     if (VirtualHost::getDefaultVirtualHost()->getId() == $this->getId()) {
         $retVal = true;
     }
     return $retVal;
 }
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:14,代碼來源:VirtualHost.php


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