[HttpKernel] added a bootstrap file for HTTP cache front controllers

This commit is contained in:
Fabien Potencier 2011-01-31 08:28:25 +01:00
parent b52e28243d
commit 839cb027a6
3 changed files with 2495 additions and 4 deletions

View File

@ -44,9 +44,33 @@ ClassCollectionLoader::load(array(
'Symfony\\Component\\HttpFoundation\\ServerBag',
'Symfony\\Component\\HttpFoundation\\HeaderBag',
'Symfony\\Component\\HttpFoundation\\Request',
'Symfony\\Component\\HttpFoundation\\ApacheRequest',
'Symfony\\Component\\ClassLoader\\ClassCollectionLoader',
'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
'Symfony\\Component\\ClassLoader\\MapFileClassLoader',
), __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);

View File

@ -909,7 +909,7 @@ class ParameterBag
protected $parameters;
public function __construct(array $parameters = array())
{
$this->replace($parameters);
$this->parameters = $parameters;
}
public function all()
{
@ -1062,7 +1062,10 @@ class HeaderBag
{
$this->cacheControl = array();
$this->cookies = array();
$this->replace($headers);
$this->headers = array();
foreach ($headers as $key => $values) {
$this->set($key, $values);
}
}
public function all()
{
@ -1481,7 +1484,11 @@ class Request
$elements = explode(',', $host);
$host = trim($elements[count($elements) - 1]);
} 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);
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
{
class ClassCollectionLoader

File diff suppressed because it is too large Load Diff