Skip to content

Commit b4a0fb0

Browse files
committed
Merge branch '2.4'
Conflicts: reference/forms/types/collection.rst reference/forms/types/file.rst
2 parents 9e129bc + 7e40a29 commit b4a0fb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+291
-353
lines changed

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
_exts
1+
/_build
2+
/bundles/DoctrineFixturesBundle
3+
/bundles/DoctrineMigrationsBundle
4+
/bundles/DoctrineMongoDBBundle
5+
/bundles/SensioFrameworkExtraBundle
6+
/bundles/SensioGeneratorBundle
7+
/cmf
8+
/_exts

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ qthelp:
7777
@echo
7878
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
7979
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
80-
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/SymfonyCMF.qhcp"
80+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Symfony.qhcp"
8181
@echo "To view the help file:"
82-
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/SymfonyCMF.qhc"
82+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Symfony.qhc"
8383

8484
devhelp:
8585
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
8686
@echo
8787
@echo "Build finished."
8888
@echo "To view the help file:"
89-
@echo "# mkdir -p $$HOME/.local/share/devhelp/SymfonyCMF"
90-
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/SymfonyCMF"
89+
@echo "# mkdir -p $$HOME/.local/share/devhelp/Symfony"
90+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Symfony"
9191
@echo "# devhelp"
9292

9393
epub:

book/doctrine.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The easiest way to understand how Doctrine works is to see it in action.
3030
In this section, you'll configure your database, create a ``Product`` object,
3131
persist it to the database and fetch it back out.
3232

33-
.. sidebar:: Code along with the example
33+
.. sidebar:: Code along with the Example
3434

3535
If you want to follow along with the example in this chapter, create
3636
an ``AcmeStoreBundle`` via:
@@ -125,7 +125,7 @@ for you:
125125
126126
$ php app/console doctrine:database:create
127127
128-
.. sidebar:: Setting Up The Database to be UTF8
128+
.. sidebar:: Setting up the Database to be UTF8
129129

130130
One mistake even seasoned developers make when starting a Symfony2 project
131131
is forgetting to setup default charset and collation on their database,
@@ -1392,7 +1392,7 @@ powerful, allowing you to create complex queries and subscribe to events
13921392
that allow you to take different actions as objects go through their persistence
13931393
lifecycle.
13941394

1395-
Learn More
1395+
Learn more
13961396
~~~~~~~~~~
13971397

13981398
For more information about Doctrine, see the *Doctrine* section of the

book/forms.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ Each field type has a number of different options that can be passed to it.
618618
Many of these are specific to the field type and details can be found in
619619
the documentation for each type.
620620

621-
.. sidebar:: The ``required`` option
621+
.. sidebar:: The ``required`` Option
622622

623623
The most common option is the ``required`` option, which can be applied to
624624
any field. By default, the ``required`` option is set to ``true``, meaning
@@ -636,7 +636,7 @@ the documentation for each type.
636636
In other words, the ``required`` option is "nice", but true server-side
637637
validation should *always* be used.
638638

639-
.. sidebar:: The ``label`` option
639+
.. sidebar:: The ``label`` Option
640640

641641
The label for the form field can be set using the ``label`` option,
642642
which can be applied to any field::
@@ -1101,6 +1101,12 @@ Defining your Forms as Services
11011101
Defining your form type as a service is a good practice and makes it really
11021102
easy to use in your application.
11031103

1104+
.. note::
1105+
1106+
Services and the service container will be handled
1107+
:doc:`later on in this book </book/service_container>`. Things will be
1108+
more clear after reading that chapter.
1109+
11041110
.. configuration-block::
11051111

11061112
.. code-block:: yaml

book/from_flat_php_to_symfony2.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ to where it is now.
1616
By the end, you'll see how Symfony2 can rescue you from mundane tasks and
1717
let you take back control of your code.
1818

19-
A simple Blog in flat PHP
19+
A Simple Blog in Flat PHP
2020
-------------------------
2121

2222
In this chapter, you'll build the token blog application using only flat PHP.
@@ -701,7 +701,7 @@ And perhaps best of all, by using Symfony2, you now have access to a whole
701701
set of **high-quality open source tools developed by the Symfony2 community**!
702702
A good selection of Symfony2 community tools can be found on `KnpBundles.com`_.
703703

704-
Better templates
704+
Better Templates
705705
----------------
706706

707707
If you choose to use it, Symfony2 comes standard with a templating engine

book/http_cache.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ If ``debug`` is ``true``, Symfony2 automatically adds a ``X-Symfony-Cache``
234234
header to the response containing useful information about cache hits and
235235
misses.
236236

237-
.. sidebar:: Changing from one Reverse Proxy to Another
237+
.. sidebar:: Changing from one Reverse Proxy to another
238238

239239
The Symfony2 reverse proxy is a great tool to use when developing your
240240
website or when you deploy your website to a shared host where you cannot
@@ -327,7 +327,7 @@ its creation more manageable::
327327
// set a custom Cache-Control directive
328328
$response->headers->addCacheControlDirective('must-revalidate', true);
329329

330-
Public vs Private Responses
330+
Public vs private Responses
331331
~~~~~~~~~~~~~~~~~~~~~~~~~~~
332332

333333
Both gateway and proxy caches are considered "shared" caches as the cached

book/http_fundamentals.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ how to master it.
4242
.. index::
4343
single: HTTP; Request-response paradigm
4444

45-
Step1: The Client sends a Request
45+
Step1: The Client Sends a Request
4646
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4747

4848
Every conversation on the web starts with a *request*. The request is a text
@@ -105,7 +105,7 @@ the client accepts (``Accept``) and the application the client is using to
105105
make the request (``User-Agent``). Many other headers exist and can be found
106106
on Wikipedia's `List of HTTP header fields`_ article.
107107

108-
Step 2: The Server returns a Response
108+
Step 2: The Server Returns a Response
109109
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110110

111111
Once a server has received the request, it knows exactly which resource the
@@ -248,7 +248,7 @@ you'll never need to worry about. For example, the ``isSecure()`` method
248248
checks the *three* different values in PHP that can indicate whether or not
249249
the user is connecting via a secured connection (i.e. HTTPS).
250250

251-
.. sidebar:: ParameterBags and Request attributes
251+
.. sidebar:: ParameterBags and Request Attributes
252252

253253
As seen above, the ``$_GET`` and ``$_POST`` variables are accessible via
254254
the public ``query`` and ``request`` properties respectively. Each of

book/internals.rst

+15-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ method returns an array of arguments to pass to the Controller callable. The
127127
default implementation automatically resolves the method arguments, based on
128128
the Request attributes.
129129

130-
.. sidebar:: Matching Controller method arguments from Request attributes
130+
.. sidebar:: Matching Controller Method Arguments from Request Attributes
131131

132132
For each method argument, Symfony2 tries to get the value of a Request
133133
attribute with the same name. If it is not defined, the argument default
@@ -364,6 +364,19 @@ The FrameworkBundle registers several listeners:
364364

365365
Read more on the :ref:`kernel.response event <component-http-kernel-kernel-response>`.
366366

367+
.. index::
368+
single: Event; kernel.finish_request
369+
370+
``kernel.finish_request`` Event
371+
...............................
372+
373+
*Event Class*: :class:`Symfony\\Component\\HttpKernel\\Event\\FinishRequestEvent`
374+
375+
The purpose of this event is to to handle tasks that should be performed after
376+
the request has been handled but that do not need to modify the response.
377+
Event listeners for the ``kernel.finish_request`` event are called in both
378+
successful and exception cases.
379+
367380
.. index::
368381
single: Event; kernel.terminate
369382

@@ -492,7 +505,7 @@ token link (a string made of 13 random characters) to access the Web Profiler.
492505
If the token is not clickable, it means that the profiler routes are not
493506
registered (see below for configuration information).
494507

495-
Analyzing Profiling data with the Web Profiler
508+
Analyzing Profiling Data with the Web Profiler
496509
..............................................
497510

498511
The Web Profiler is a visualization tool for profiling data that you can use

book/propel.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A Simple Example: A Product
1515
In this section, you'll configure your database, create a ``Product`` object,
1616
persist it to the database and fetch it back out.
1717

18-
.. sidebar:: Code along with the example
18+
.. sidebar:: Code along with the Example
1919

2020
If you want to follow along with the example in this chapter, create an
2121
``AcmeStoreBundle`` via:
@@ -425,7 +425,7 @@ before. First, fetch a ``$product`` object and then access its related
425425

426426
Note, in the above example, only one query was made.
427427

428-
More information on Associations
428+
More Information on Associations
429429
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
430430

431431
You will find more information on relations by reading the dedicated chapter on

book/routing.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ routing system can be:
857857
858858
$collection = new RouteCollection();
859859
$collection->add(
860-
'homepage',
860+
'article_show',
861861
new Route('/articles/{culture}/{year}/{title}.{_format}', array(
862862
'_controller' => 'AcmeDemoBundle:Article:show',
863863
'_format' => 'html',
@@ -1150,7 +1150,7 @@ from the new routing resource.
11501150
:doc:`FrameworkExtraBundle documentation </bundles/SensioFrameworkExtraBundle/annotations/routing>`
11511151
to see how.
11521152

1153-
Adding a Host requirement to Imported Routes
1153+
Adding a Host Requirement to Imported Routes
11541154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11551155

11561156
You can set the host regex on imported routes. For more information, see
@@ -1329,8 +1329,8 @@ method::
13291329
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
13301330
// http://www.example.com/blog/my-blog-post
13311331

1332-
From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL)
1333-
rather than the ``path()`` function (which generates a relative URL). In PHP, pass ``true``
1332+
From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL)
1333+
rather than the ``path()`` function (which generates a relative URL). In PHP, pass ``true``
13341334
to ``generateUrl()``:
13351335

13361336
.. configuration-block::

book/security.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ see :doc:`/cookbook/security/form_login`.
572572

573573
.. _book-security-common-pitfalls:
574574

575-
.. sidebar:: Avoid Common Pitfalls
575+
.. sidebar:: Avoid common Pitfalls
576576

577577
When setting up your login form, watch out for a few common pitfalls.
578578

@@ -715,7 +715,7 @@ In this section, you'll focus on how to secure different resources (e.g. URLs,
715715
method calls, etc) with different roles. Later, you'll learn more about how
716716
roles are created and assigned to users.
717717

718-
Securing Specific URL Patterns
718+
Securing specific URL Patterns
719719
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
720720

721721
The most basic way to secure part of your application is to secure an entire
@@ -765,7 +765,7 @@ You can define as many URL patterns as you need - each is a regular expression.
765765

766766
.. _security-book-access-control-explanation:
767767

768-
Understanding how ``access_control`` works
768+
Understanding how ``access_control`` Works
769769
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
770770

771771
For each incoming request, Symfony2 checks each ``access_control`` entry
@@ -1154,7 +1154,7 @@ In the previous sections, you learned how you can protect different resources
11541154
by requiring a set of *roles* for a resource. This section explores
11551155
the other side of authorization: users.
11561156

1157-
Where do Users come from? (*User Providers*)
1157+
Where do Users Come from? (*User Providers*)
11581158
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11591159

11601160
During authentication, the user submits a set of credentials (usually a username
@@ -1520,7 +1520,7 @@ method:
15201520

15211521
<p>Username: <?php echo $app->getUser()->getUsername() ?></p>
15221522

1523-
Using Multiple User Providers
1523+
Using multiple User Providers
15241524
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15251525

15261526
Each authentication mechanism (e.g. HTTP Authentication, form login, etc)
@@ -1897,7 +1897,7 @@ You can also use expressions inside your templates:
18971897

18981898
For more details on expressions and security, see :ref:`book-security-expressions`.
18991899

1900-
Access Control Lists (ACLs): Securing Individual Database Objects
1900+
Access Control Lists (ACLs): Securing individual Database Objects
19011901
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19021902

19031903
Imagine you are designing a blog system where your users can comment on your
@@ -2088,7 +2088,7 @@ algorithm; you can use the same strategy in your own code thanks to the
20882088
// is password1 equals to password2?
20892089
$bool = StringUtils::equals($password1, $password2);
20902090

2091-
Generating a secure Random Number
2091+
Generating a secure random Number
20922092
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20932093

20942094
Whenever you need to generate a secure random number, you are highly

book/service_container.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ Now, just inject the ``request_stack``, which behaves like any normal service:
928928
argument of your action method. See
929929
:ref:`book-controller-request-argument` for details.
930930

931-
Making References Optional
931+
Making References optional
932932
--------------------------
933933

934934
Sometimes, one of your services may have an optional dependency, meaning

book/stable_api.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ in the stable API is in order to fix a security issue.
1818
The stable API is based on a whitelist, tagged with `@api`. Therefore,
1919
everything not tagged explicitly is not part of the stable API.
2020

21+
.. tip::
22+
23+
Read more about the stable API in :doc:`/contributing/code/bc`.
24+
2125
.. tip::
2226

2327
Any third party bundle should also publish its own stable API.
@@ -36,7 +40,6 @@ a public tagged API:
3640
* Finder
3741
* HttpFoundation
3842
* HttpKernel
39-
* Locale
4043
* Process
4144
* Routing
4245
* Templating

book/templating.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. index::
22
single: Templating
33

4-
Creating and using Templates
4+
Creating and Using Templates
55
============================
66

77
As you know, the :doc:`controller </book/controller>` is responsible for
@@ -1130,7 +1130,7 @@ automatically:
11301130
.. index::
11311131
single: Templating; The templating service
11321132

1133-
Configuring and using the ``templating`` Service
1133+
Configuring and Using the ``templating`` Service
11341134
------------------------------------------------
11351135

11361136
The heart of the template system in Symfony2 is the templating ``Engine``.

book/testing.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ document::
229229

230230
.. _book-testing-request-method-sidebar:
231231

232-
.. sidebar:: More about the ``request()`` method:
232+
.. sidebar:: More about the ``request()`` Method:
233233

234234
The full signature of the ``request()`` method is::
235235

@@ -411,7 +411,7 @@ The Client supports many operations that can be done in a real browser::
411411
// Clears all cookies and the history
412412
$client->restart();
413413

414-
Accessing Internal Objects
414+
Accessing internal Objects
415415
~~~~~~~~~~~~~~~~~~~~~~~~~~
416416

417417
.. versionadded:: 2.3

book/translation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ as the locale for the current request.
496496
You can now use the locale to create routes to other translated pages
497497
in your application.
498498

499-
Setting a Default Locale
499+
Setting a default Locale
500500
~~~~~~~~~~~~~~~~~~~~~~~~
501501

502502
What if the user's locale hasn't been determined? You can guarantee that a

components/console/helpers/tablehelper.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ When building a console application it may be useful to display tabular data:
2121
To display a table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
2222
set headers, rows and render::
2323

24-
$table = $app->getHelperSet()->get('table');
24+
$table = $this->getHelperSet()->get('table');
2525
$table
2626
->setHeaders(array('ISBN', 'Title', 'Author'))
2727
->setRows(array(

0 commit comments

Comments
 (0)