From 01439d5f1467389461abd09d0d0886c9099d6704 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Jan 2011 10:11:09 +0100 Subject: [PATCH] updated bootstrap file --- .../Component/HttpKernel/bootstrap.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/bootstrap.php b/src/Symfony/Component/HttpKernel/bootstrap.php index 49e60276f5..a92431d6a7 100644 --- a/src/Symfony/Component/HttpKernel/bootstrap.php +++ b/src/Symfony/Component/HttpKernel/bootstrap.php @@ -1208,18 +1208,18 @@ class Request protected $format; protected $session; static protected $formats; - public function __construct(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) + public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array()) { $this->initialize($query, $request, $attributes, $cookies, $files, $server); } - public function initialize(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) + public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array()) { - $this->request = new ParameterBag(null !== $request ? $request : $_POST); - $this->query = new ParameterBag(null !== $query ? $query : $_GET); - $this->attributes = new ParameterBag(null !== $attributes ? $attributes : array()); - $this->cookies = new ParameterBag(null !== $cookies ? $cookies : $_COOKIE); - $this->files = new FileBag(null !== $files ? $files : $_FILES); - $this->server = new ServerBag(null !== $server ? $server : $_SERVER); + $this->request = new ParameterBag($request); + $this->query = new ParameterBag($query); + $this->attributes = new ParameterBag($attributes); + $this->cookies = new ParameterBag($cookies); + $this->files = new FileBag($files); + $this->server = new ServerBag($server); $this->headers = new HeaderBag($this->server->getHeaders()); $this->content = null; $this->languages = null; @@ -1232,6 +1232,10 @@ class Request $this->method = null; $this->format = null; } + static public function createfromGlobals() + { + return new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); + } static public function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array()) { $defaults = array(