From a3ce77573b8697df32950c4f36a33075afc741d7 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 17:16:22 -0400 Subject: [PATCH 01/12] fix typo - missing word --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index a75777f7798..e71617c8c66 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -27,7 +27,7 @@ You can install the component in many different ways: Request ------- -The most common way to create request is to base it on the current PHP global +The most common way to create a request is to base it on the current PHP global variables with :method:`Symfony\\Component\\HttpFoundation\\Request::createFromGlobals`:: From 2d25c5e5ffbb5a6d4ed36f703003c7c379ab8d13 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 18:08:31 -0400 Subject: [PATCH 02/12] typo - change to --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index e71617c8c66..4a91e22a0bb 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -61,7 +61,7 @@ can be accessed via several public properties: * ``attributes``: no equivalent - used by your app to store other data (see :ref:`below`) -* ``files``: equivalent of ``$_FILE``; +* ``files``: equivalent of ``$_FILES``; * ``server``: equivalent of ``$_SERVER``; From 59f8e5b1feabee5006d9f7c2d6894c82e02a4293 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 18:11:48 -0400 Subject: [PATCH 03/12] change headers example to use a request header (not a response header) --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 4a91e22a0bb..8a90a6562f5 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -66,7 +66,7 @@ can be accessed via several public properties: * ``server``: equivalent of ``$_SERVER``; * ``headers``: mostly equivalent to a sub-set of ``$_SERVER`` - (``$request->headers->get('Content-Type')``). + (``$request->headers->get('user-agent')``). Each property is a :class:`Symfony\\Component\\HttpFoundation\\ParameterBag` instance (or a sub-class of), which is a data holder class: From adc045be3efd19d87dfd386b21a2a3ce219020c2 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:13:33 -0400 Subject: [PATCH 04/12] decorate php function with link to manual --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 8a90a6562f5..b6d5a6c7291 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -128,7 +128,7 @@ has some methods to filter the input values: parameter value converted to integer; * :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::filter`: Filters the - parameter by using the PHP ``filter_var()`` function. + parameter by using the PHP :phpfunction:`filter_var` function. All getters takes up to three arguments: the first one is the parameter name and the second one is the default value to return if the parameter does not From 8290eb972012dcf189b7709c8063313eabc156c4 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:27:45 -0400 Subject: [PATCH 05/12] add more descriptive text for book link --- components/http_foundation/introduction.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index b6d5a6c7291..c0e450e2da4 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -150,7 +150,7 @@ When PHP imports the request query, it handles request parameters like ``foo[bar]=bar`` in a special way as it creates an array. So you can get the ``foo`` parameter and you will get back an array with a ``bar`` element. But sometimes, you might want to get the value for the "original" parameter name: -``foo[bar]``. This is possible with all the `ParameterBag` getters like +``foo[bar]``. This is possible with all the ``ParameterBag`` getters like :method:`Symfony\\Component\\HttpFoundation\\Request::get` via the third argument:: @@ -172,7 +172,7 @@ thanks to the public ``attributes`` property, which is also an instance of :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`. This is mostly used to attach information that belongs to the Request and that needs to be accessed from many different points in your application. For information -on how this is used in the Symfony2 framework, see :ref:`read more`. +on how this is used in the Symfony2 framework, see :ref:`the Symfony2 book`. Identifying a Request ~~~~~~~~~~~~~~~~~~~~~ From 78ece84a1bdb83bdc218c6d23197c8d103fc4afa Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:28:23 -0400 Subject: [PATCH 06/12] Shorten line under 80 chars --- components/http_foundation/introduction.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index c0e450e2da4..fe9f51654ce 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -172,7 +172,8 @@ thanks to the public ``attributes`` property, which is also an instance of :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`. This is mostly used to attach information that belongs to the Request and that needs to be accessed from many different points in your application. For information -on how this is used in the Symfony2 framework, see :ref:`the Symfony2 book`. +on how this is used in the Symfony2 framework, see +:ref:`the Symfony2 book`. Identifying a Request ~~~~~~~~~~~~~~~~~~~~~ From 0338f9645ea5ec2fb0c7f3a0d351f7bb6b692308 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:34:15 -0400 Subject: [PATCH 07/12] lower case request since it's not talking about the class --- components/http_foundation/introduction.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index fe9f51654ce..d0833287ec0 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -189,8 +189,8 @@ this is done via the "path info" of the request, which can be accessed via the Simulating a Request ~~~~~~~~~~~~~~~~~~~~ -Instead of creating a Request based on the PHP globals, you can also simulate -a Request:: +Instead of creating a request based on the PHP globals, you can also simulate +a request:: $request = Request::create( '/hello-world', From 6f9c74eee49a8a273304e1b3954d19833fcf7a9b Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:37:48 -0400 Subject: [PATCH 08/12] change to URI to be more consistent. fix typo. lower case Session --- components/http_foundation/introduction.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index d0833287ec0..09397933bf3 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -199,9 +199,9 @@ a request:: ); The :method:`Symfony\\Component\\HttpFoundation\\Request::create` method -creates a request based on a path info, a method and some parameters (the +creates a request based on a URI, a method and some parameters (the query parameters or the request ones depending on the HTTP method); and of -course, you an also override all other variables as well (by default, Symfony +course, you can also override all other variables as well (by default, Symfony creates sensible defaults for all the PHP global variables). Based on such a request, you can override the PHP global variables via @@ -223,7 +223,7 @@ If you have a session attached to the Request, you can access it via the :method:`Symfony\\Component\\HttpFoundation\\Request::getSession` method; the :method:`Symfony\\Component\\HttpFoundation\\Request::hasPreviousSession` -method tells you if the request contains a Session which was started in one of +method tells you if the request contains a session which was started in one of the previous requests. Accessing `Accept-*` Headers Data From 66aad4af879cd04c11df3aadfe134cd544340615 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:39:57 -0400 Subject: [PATCH 09/12] change query to request to be more accurate --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 09397933bf3..4e11fd40af3 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -211,7 +211,7 @@ Based on such a request, you can override the PHP global variables via .. tip:: - You can also duplicate an existing query via + You can also duplicate an existing request via :method:`Symfony\\Component\\HttpFoundation\\Request::duplicate` or change a bunch of parameters with a single call to :method:`Symfony\\Component\\HttpFoundation\\Request::initialize`. From 868815c54384e74be638c7970c2795ed62220c92 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:55:03 -0400 Subject: [PATCH 10/12] lower case request --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 4e11fd40af3..0e5b10a081c 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -219,7 +219,7 @@ Based on such a request, you can override the PHP global variables via Accessing the Session ~~~~~~~~~~~~~~~~~~~~~ -If you have a session attached to the Request, you can access it via the +If you have a session attached to the request, you can access it via the :method:`Symfony\\Component\\HttpFoundation\\Request::getSession` method; the :method:`Symfony\\Component\\HttpFoundation\\Request::hasPreviousSession` From 6a5e3d9ca7c6133e17a38bcaf048718649bcc7f6 Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 19:58:00 -0400 Subject: [PATCH 11/12] change final bullet to end with period --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 0e5b10a081c..2b6b4940fd7 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -239,7 +239,7 @@ by using the following methods: returns the list of accepted languages ordered by descending quality; * :method:`Symfony\\Component\\HttpFoundation\\Request::getCharsets`: - returns the list of accepted charsets ordered by descending quality; + returns the list of accepted charsets ordered by descending quality. Accessing other Data ~~~~~~~~~~~~~~~~~~~~ From 20a75cb8259b19083467e4cfe82af86a07e46abd Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Sat, 30 Mar 2013 20:00:35 -0400 Subject: [PATCH 12/12] backtick Request. link to Request API --- components/http_foundation/introduction.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 2b6b4940fd7..2cb753730bd 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -244,8 +244,10 @@ by using the following methods: Accessing other Data ~~~~~~~~~~~~~~~~~~~~ -The Request class has many other methods that you can use to access the -request information. Have a look at the API for more information about them. +The ``Request`` class has many other methods that you can use to access the +request information. Have a look at +:class:`the Request API` +for more information about them. Response --------