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