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