10000 Merge branch '2.3' into 2.4 · symfony/symfony-docs@7e40a29 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e40a29

Browse files
committed
Merge branch '2.3' into 2.4
Conflicts: book/security.rst book/service_container.rst
2 parents 70a3893 + 1a6f730 commit 7e40a29

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

+278
-353
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 8 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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
@@ -505,7 +505,7 @@ token link (a string made of 13 random characters) to access the Web Profiler.
505505
If the token is not clickable, it means that the profiler routes are not
506506
registered (see below for configuration information).
507507

508-
Analyzing Profiling data with the Web Profiler
508+
Analyzing Profiling Data with the Web Profiler
509509
..............................................
510510

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

book/propel.rst

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ routing system can be:
868868
869869
$collection = new RouteCollection();
870870
$collection->add(
871-
'homepage',
871+
'article_show',
872872
new Route('/articles/{culture}/{year}/{title}.{_format}', array(
873873
'_controller' => 'AcmeDemoBundle:Article:show',
874874
'_format' => 'html',
@@ -1161,7 +1161,7 @@ from the new routing resource.
11611161
:doc:`FrameworkExtraBundle documentation </bundles/SensioFrameworkExtraBundle/annotations/routing>`
11621162
to see how.
11631163

1164-
Adding a Host requirement to Imported Routes
1164+
Adding a Host Requirement to Imported Routes
11651165
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11661166

11671167
.. versionadded:: 2.2
@@ -1343,8 +1343,8 @@ method::
13431343
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
13441344
// http://www.example.com/blog/my-blog-post
13451345

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

13501350
.. configuration-block::

book/security.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ see :doc:`/cookbook/security/form_login`.
571571

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

574-
.. sidebar:: Avoid Common Pitfalls
574+
.. sidebar:: Avoid common Pitfalls
575575

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

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

717-
Securing Specific URL Patterns
717+
Securing specific URL Patterns
718718
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
719719

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

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

767-
Understanding how ``access_control`` works
767+
Understanding how ``access_control`` Works
768768
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
769769

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

1150-
Where do Users come from? (*User Providers*)
1150+
Where do Users Come from? (*User Providers*)
11511151
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11521152

11531153
During authentication, the user submits a set of credentials (usually a username
@@ -1512,7 +1512,7 @@ method:
15121512

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

1515-
Using Multiple User Providers
1515+
Using multiple User Providers
15161516
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15171517

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

18901890
For more details on expressions and security, see :ref:`book-security-expressions`.
18911891

1892-
Access Control Lists (ACLs): Securing Individual Database Objects
1892+
Access Control Lists (ACLs): Securing individual Database Objects
18931893
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18941894

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

2086-
Generating a secure Random Number
2086+
Generating a secure random Number
20872087
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20882088

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

book/service_container.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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
@@ -1126,7 +1126,7 @@ automatically:
11261126
.. index::
11271127
single: Templating; The templating service
11281128

1129-
Configuring and using the ``templating`` Service
1129+
Configuring and Using the ``templating`` Service
11301130
------------------------------------------------
11311131

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

book/testing.rst

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ When building a console application it may be useful to display tabular data:
1414
To display a table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
1515
set headers, rows and render::
1616

17-
$table = $app->getHelperSet()->get('table');
17+
$table = $this->getHelperSet()->get('table');
1818
$table
1919
->setHeaders(array('ISBN', 'Title', 'Author'))
2020
->setRows(array(

0 commit comments

Comments
 (0)
0