[HttpKernel] added a bootstrap file for HTTP cache front controllers
This commit is contained in:
parent
b52e28243d
commit
839cb027a6
@ -44,9 +44,33 @@ ClassCollectionLoader::load(array(
|
|||||||
'Symfony\\Component\\HttpFoundation\\ServerBag',
|
'Symfony\\Component\\HttpFoundation\\ServerBag',
|
||||||
'Symfony\\Component\\HttpFoundation\\HeaderBag',
|
'Symfony\\Component\\HttpFoundation\\HeaderBag',
|
||||||
'Symfony\\Component\\HttpFoundation\\Request',
|
'Symfony\\Component\\HttpFoundation\\Request',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\ApacheRequest',
|
||||||
|
|
||||||
'Symfony\\Component\\ClassLoader\\ClassCollectionLoader',
|
'Symfony\\Component\\ClassLoader\\ClassCollectionLoader',
|
||||||
'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
|
'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
|
||||||
'Symfony\\Component\\ClassLoader\\MapFileClassLoader',
|
'Symfony\\Component\\ClassLoader\\MapFileClassLoader',
|
||||||
|
|
||||||
), __DIR__.'/../..', 'bootstrap', false);
|
), __DIR__.'/../..', 'bootstrap', false);
|
||||||
|
|
||||||
|
if (file_exists(__DIR__.'/../../bootstrap_cache.php')) {
|
||||||
|
unlink(__DIR__.'/../../bootstrap_cache.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
ClassCollectionLoader::load(array(
|
||||||
|
'Symfony\\Component\\HttpKernel\\KernelInterface',
|
||||||
|
'Symfony\\Component\\HttpKernel\\Kernel',
|
||||||
|
'Symfony\\Component\\HttpKernel\\HttpKernelInterface',
|
||||||
|
'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache',
|
||||||
|
'Symfony\\Component\\HttpKernel\\HttpCache\\Store',
|
||||||
|
'Symfony\\Component\\HttpKernel\\HttpCache\\Esi',
|
||||||
|
|
||||||
|
'Symfony\\Component\\HttpFoundation\\ParameterBag',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\FileBag',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\ServerBag',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\HeaderBag',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\Request',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\ApacheRequest',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag',
|
||||||
|
'Symfony\\Component\\HttpFoundation\\Response',
|
||||||
|
|
||||||
|
'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
|
||||||
|
), __DIR__.'/../..', 'bootstrap_cache', false);
|
||||||
|
@ -909,7 +909,7 @@ class ParameterBag
|
|||||||
protected $parameters;
|
protected $parameters;
|
||||||
public function __construct(array $parameters = array())
|
public function __construct(array $parameters = array())
|
||||||
{
|
{
|
||||||
$this->replace($parameters);
|
$this->parameters = $parameters;
|
||||||
}
|
}
|
||||||
public function all()
|
public function all()
|
||||||
{
|
{
|
||||||
@ -1062,7 +1062,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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public function all()
|
public function all()
|
||||||
{
|
{
|
||||||
@ -1481,7 +1484,11 @@ class Request
|
|||||||
$elements = explode(',', $host);
|
$elements = explode(',', $host);
|
||||||
$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', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$elements = explode(':', $host);
|
$elements = explode(':', $host);
|
||||||
return trim($elements[0]);
|
return trim($elements[0]);
|
||||||
@ -1752,6 +1759,24 @@ class Request
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
namespace Symfony\Component\HttpFoundation
|
||||||
|
{
|
||||||
|
class ApacheRequest extends Request
|
||||||
|
{
|
||||||
|
protected function prepareRequestUri()
|
||||||
|
{
|
||||||
|
return $this->server->get('REQUEST_URI');
|
||||||
|
}
|
||||||
|
protected function prepareBaseUrl()
|
||||||
|
{
|
||||||
|
return $this->server->get('SCRIPT_NAME');
|
||||||
|
}
|
||||||
|
protected function preparePathInfo()
|
||||||
|
{
|
||||||
|
return $this->server->get('PATH_INFO');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
namespace Symfony\Component\ClassLoader
|
namespace Symfony\Component\ClassLoader
|
||||||
{
|
{
|
||||||
class ClassCollectionLoader
|
class ClassCollectionLoader
|
||||||
|
2442
src/Symfony/Component/HttpKernel/bootstrap_cache.php
Normal file
2442
src/Symfony/Component/HttpKernel/bootstrap_cache.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user