/** * 获得主机信息,包含协议信息,主机名,访问端口信息 * * <pre>Example: * 请求: http://www.tintsoft.com/example/index.php?a=test * 返回: http://www.tintsoft.com/ * </pre> * * @throws Base_Exception 获取主机信息失败的时候抛出异常 */ private static function _init_host_info() { if (($http_host = self::get_server('HTTP_HOST')) != null) { self::$_host_info = self::get_scheme() . '://' . $http_host; } elseif (($http_host = self::get_server('SERVER_NAME')) != null) { self::$_host_info = self::get_scheme() . '://' . $http_host; if (($port = self::get_server_port()) != null) { self::$_host_info .= ':' . $port; } } else { throw new Base_Exception('[Base.Base_Request._init_host_info] determine the entry script URL failed!!'); } }