[HttpFoundation] made small optimizations
This commit is contained in:
parent
56483dc14f
commit
8dd0c5641a
@ -31,7 +31,10 @@ class HeaderBag
|
|||||||
{
|
{
|
||||||
$this->cacheControl = array();
|
$this->cacheControl = array();
|
||||||
$this->cookies = array();
|
$this->cookies = array();
|
||||||
$this->replace($headers);
|
$this->headers = array();
|
||||||
|
foreach ($headers as $key => $values) {
|
||||||
|
$this->set($key, $values);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,7 @@ class ParameterBag
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $parameters = array())
|
public function __construct(array $parameters = array())
|
||||||
{
|
{
|
||||||
$this->replace($parameters);
|
$this->parameters = $parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -511,7 +511,11 @@ class Request
|
|||||||
|
|
||||||
$host = trim($elements[count($elements) - 1]);
|
$host = trim($elements[count($elements) - 1]);
|
||||||
} else {
|
} else {
|
||||||
$host = $this->headers->get('HOST', $this->server->get('SERVER_NAME', $this->server->get('SERVER_ADDR', '')));
|
if (!$host = $this->headers->get('HOST')) {
|
||||||
|
if (!$host = $this->server->get('SERVER_NAME')) {
|
||||||
|
$host = $this->server->get('SERVER_ADDR', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove port number from host
|
// Remove port number from host
|
||||||
|
Reference in New Issue
Block a user