改进Request类的domain方法 包含端口

This commit is contained in:
thinkphp
2016-12-21 11:22:36 +08:00
parent c1107d3a85
commit 8f2ed014cc

View File

@@ -25,7 +25,7 @@ class Request
protected $method;
/**
* @var string 域名
* @var string 域名(含协议和端口)
*/
protected $domain;
@@ -270,6 +270,9 @@ class Request
} elseif (!$this->domain) {
$this->domain = $this->scheme() . '://' . $this->host();
}
if (80 != $this->port()) {
$this->domain .= ':' . $this->port();
}
return $this->domain;
}